md-editor-v3 4.16.9 → 4.17.0
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/lib/cjs/MdEditor.cjs +3 -5
- package/lib/cjs/chunks/dom.cjs +1 -2
- package/lib/cjs/chunks/index.cjs +11 -8
- package/lib/es/MdEditor.mjs +3 -5
- package/lib/es/chunks/dom.mjs +1 -2
- package/lib/es/chunks/index.mjs +11 -8
- package/lib/umd/index.js +5 -5
- package/package.json +1 -1
package/lib/cjs/MdEditor.cjs
CHANGED
|
@@ -1312,7 +1312,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
};
|
|
1314
1314
|
const getLineNumber = (pMaxScrollLength, cMaxScrollLength) => {
|
|
1315
|
-
let lineNumer =
|
|
1315
|
+
let lineNumer = 1;
|
|
1316
1316
|
for (let i = elesHasLineNumber.length - 1; i - 1 >= 0; i--) {
|
|
1317
1317
|
const curr = elesHasLineNumber[i];
|
|
1318
1318
|
const sibling = elesHasLineNumber[i - 1];
|
|
@@ -1371,7 +1371,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1371
1371
|
const lineNumer = getLineNumber(pMaxScrollLength, cMaxScrollLength);
|
|
1372
1372
|
startTop = getTopByLine(lineNumer);
|
|
1373
1373
|
scale = (scrollDOM.scrollTop - startTop) / (pMaxScrollLength - startTop);
|
|
1374
|
-
startEleOffetTop = (_c = document.querySelector(`[data-line="${lineNumer}"]`)) == null ? void 0 : _c.offsetTop;
|
|
1374
|
+
startEleOffetTop = ((_c = document.querySelector(`[data-line="${lineNumer}"]`)) == null ? void 0 : _c.offsetTop) || startEleOffetTop;
|
|
1375
1375
|
blockHeight = cMaxScrollLength - startEleOffetTop + getComputedStyleNum(cEle, "padding-top");
|
|
1376
1376
|
}
|
|
1377
1377
|
const scrollToTop = startEleOffetTop - cElePaddingTop + blockHeight * scale;
|
|
@@ -1447,9 +1447,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1447
1447
|
let blockHeight = 0;
|
|
1448
1448
|
if (endLineScrollTop > pMaxScrollLength || realEleEnd.offsetTop + realEleEnd.offsetHeight > cMaxScrollLength) {
|
|
1449
1449
|
const lineNumer = getLineNumber(pMaxScrollLength, cMaxScrollLength);
|
|
1450
|
-
eleStartOffsetTop = (_f = document.querySelector(
|
|
1451
|
-
`[data-line="${lineNumer}"]`
|
|
1452
|
-
)) == null ? void 0 : _f.offsetTop;
|
|
1450
|
+
eleStartOffsetTop = ((_f = document.querySelector(`[data-line="${lineNumer}"]`)) == null ? void 0 : _f.offsetTop) || eleStartOffsetTop;
|
|
1453
1451
|
firstLineScrollTop = getTopByLine(lineNumer);
|
|
1454
1452
|
scale = (cScrollTop - eleStartOffsetTop) / (cMaxScrollLength - eleStartOffsetTop);
|
|
1455
1453
|
blockHeight = pMaxScrollLength - firstLineScrollTop;
|
package/lib/cjs/chunks/dom.cjs
CHANGED
|
@@ -4,8 +4,7 @@ const keyMove = (trigger, moveHandler) => {
|
|
|
4
4
|
const parent = trigger.parentElement || document.body;
|
|
5
5
|
const width = parent.offsetWidth;
|
|
6
6
|
const height = parent.offsetHeight;
|
|
7
|
-
const { clientWidth } = document.documentElement;
|
|
8
|
-
const { clientHeight } = document.documentElement;
|
|
7
|
+
const { clientWidth, clientHeight } = document.documentElement;
|
|
9
8
|
const x = mdown.offsetX;
|
|
10
9
|
const y = mdown.offsetY;
|
|
11
10
|
const mouseMoveHandler = (e) => {
|
package/lib/cjs/chunks/index.cjs
CHANGED
|
@@ -125,6 +125,9 @@ const useHighlight = (props) => {
|
|
|
125
125
|
vue.watch(
|
|
126
126
|
() => highlight.value.css,
|
|
127
127
|
() => {
|
|
128
|
+
if (props.noHighlight) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
128
131
|
dom.updateHandler("link", {
|
|
129
132
|
...highlight.value.css,
|
|
130
133
|
rel: "stylesheet",
|
|
@@ -164,14 +167,14 @@ const useMermaid = (props) => {
|
|
|
164
167
|
}
|
|
165
168
|
);
|
|
166
169
|
vue.onMounted(() => {
|
|
167
|
-
var _a, _b
|
|
168
|
-
if (props.noMermaid ||
|
|
170
|
+
var _a, _b;
|
|
171
|
+
if (props.noMermaid || mermaidRef.value) {
|
|
169
172
|
return;
|
|
170
173
|
}
|
|
171
174
|
const jsSrc = editorExtensions.mermaid.js;
|
|
172
175
|
if (/\.mjs/.test(jsSrc)) {
|
|
173
176
|
dom.appendHandler("link", {
|
|
174
|
-
...(
|
|
177
|
+
...(_a = editorExtensionsAttrs.mermaid) == null ? void 0 : _a.js,
|
|
175
178
|
rel: "modulepreload",
|
|
176
179
|
href: jsSrc,
|
|
177
180
|
id: `${config.prefix}-mermaid-m`
|
|
@@ -188,7 +191,7 @@ const useMermaid = (props) => {
|
|
|
188
191
|
dom.appendHandler(
|
|
189
192
|
"script",
|
|
190
193
|
{
|
|
191
|
-
...(
|
|
194
|
+
...(_b = editorExtensionsAttrs.mermaid) == null ? void 0 : _b.js,
|
|
192
195
|
src: jsSrc,
|
|
193
196
|
id: `${config.prefix}-mermaid`,
|
|
194
197
|
onload() {
|
|
@@ -615,7 +618,7 @@ const StrIcon = (name, customIcon) => {
|
|
|
615
618
|
};
|
|
616
619
|
const StrIcon$1 = StrIcon;
|
|
617
620
|
const codetabs = (md, _opts) => {
|
|
618
|
-
const defaultRender = md.renderer.rules.fence, unescapeAll = md.utils.unescapeAll, re = /\[(\w*)(?::([\w ]*))?\]/, mandatoryRe = /::close/;
|
|
621
|
+
const defaultRender = md.renderer.rules.fence, unescapeAll = md.utils.unescapeAll, re = /\[(\w*)(?::([\w ]*))?\]/, mandatoryRe = /::(open|close)/;
|
|
619
622
|
const getInfo = (token) => {
|
|
620
623
|
return token.info ? unescapeAll(token.info).trim() : "";
|
|
621
624
|
};
|
|
@@ -628,9 +631,9 @@ const codetabs = (md, _opts) => {
|
|
|
628
631
|
return info ? info.split(/(\s+)/g)[0] : "";
|
|
629
632
|
};
|
|
630
633
|
const getTagType = (token) => {
|
|
631
|
-
const mandatory =
|
|
632
|
-
const open =
|
|
633
|
-
const tagContainer = mandatory || _opts.codeFoldable ? "details" : "div", tagHeader = mandatory || _opts.codeFoldable ? "summary" : "div";
|
|
634
|
+
const mandatory = token.info.match(mandatoryRe) || [];
|
|
635
|
+
const open = mandatory[1] === "open" || mandatory[1] !== "close" && _opts.codeFoldable && token.content.trim().split("\n").length < _opts.autoFoldThreshold;
|
|
636
|
+
const tagContainer = mandatory[1] || _opts.codeFoldable ? "details" : "div", tagHeader = mandatory[1] || _opts.codeFoldable ? "summary" : "div";
|
|
634
637
|
return { open, tagContainer, tagHeader };
|
|
635
638
|
};
|
|
636
639
|
const fenceGroup = (tokens, idx, options, env, slf) => {
|
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1311,7 +1311,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1311
1311
|
}
|
|
1312
1312
|
};
|
|
1313
1313
|
const getLineNumber = (pMaxScrollLength, cMaxScrollLength) => {
|
|
1314
|
-
let lineNumer =
|
|
1314
|
+
let lineNumer = 1;
|
|
1315
1315
|
for (let i = elesHasLineNumber.length - 1; i - 1 >= 0; i--) {
|
|
1316
1316
|
const curr = elesHasLineNumber[i];
|
|
1317
1317
|
const sibling = elesHasLineNumber[i - 1];
|
|
@@ -1370,7 +1370,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1370
1370
|
const lineNumer = getLineNumber(pMaxScrollLength, cMaxScrollLength);
|
|
1371
1371
|
startTop = getTopByLine(lineNumer);
|
|
1372
1372
|
scale = (scrollDOM.scrollTop - startTop) / (pMaxScrollLength - startTop);
|
|
1373
|
-
startEleOffetTop = (_c = document.querySelector(`[data-line="${lineNumer}"]`)) == null ? void 0 : _c.offsetTop;
|
|
1373
|
+
startEleOffetTop = ((_c = document.querySelector(`[data-line="${lineNumer}"]`)) == null ? void 0 : _c.offsetTop) || startEleOffetTop;
|
|
1374
1374
|
blockHeight = cMaxScrollLength - startEleOffetTop + getComputedStyleNum(cEle, "padding-top");
|
|
1375
1375
|
}
|
|
1376
1376
|
const scrollToTop = startEleOffetTop - cElePaddingTop + blockHeight * scale;
|
|
@@ -1446,9 +1446,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1446
1446
|
let blockHeight = 0;
|
|
1447
1447
|
if (endLineScrollTop > pMaxScrollLength || realEleEnd.offsetTop + realEleEnd.offsetHeight > cMaxScrollLength) {
|
|
1448
1448
|
const lineNumer = getLineNumber(pMaxScrollLength, cMaxScrollLength);
|
|
1449
|
-
eleStartOffsetTop = (_f = document.querySelector(
|
|
1450
|
-
`[data-line="${lineNumer}"]`
|
|
1451
|
-
)) == null ? void 0 : _f.offsetTop;
|
|
1449
|
+
eleStartOffsetTop = ((_f = document.querySelector(`[data-line="${lineNumer}"]`)) == null ? void 0 : _f.offsetTop) || eleStartOffsetTop;
|
|
1452
1450
|
firstLineScrollTop = getTopByLine(lineNumer);
|
|
1453
1451
|
scale = (cScrollTop - eleStartOffsetTop) / (cMaxScrollLength - eleStartOffsetTop);
|
|
1454
1452
|
blockHeight = pMaxScrollLength - firstLineScrollTop;
|
package/lib/es/chunks/dom.mjs
CHANGED
|
@@ -3,8 +3,7 @@ const keyMove = (trigger, moveHandler) => {
|
|
|
3
3
|
const parent = trigger.parentElement || document.body;
|
|
4
4
|
const width = parent.offsetWidth;
|
|
5
5
|
const height = parent.offsetHeight;
|
|
6
|
-
const { clientWidth } = document.documentElement;
|
|
7
|
-
const { clientHeight } = document.documentElement;
|
|
6
|
+
const { clientWidth, clientHeight } = document.documentElement;
|
|
8
7
|
const x = mdown.offsetX;
|
|
9
8
|
const y = mdown.offsetY;
|
|
10
9
|
const mouseMoveHandler = (e) => {
|
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -124,6 +124,9 @@ const useHighlight = (props) => {
|
|
|
124
124
|
watch(
|
|
125
125
|
() => highlight.value.css,
|
|
126
126
|
() => {
|
|
127
|
+
if (props.noHighlight) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
127
130
|
updateHandler("link", {
|
|
128
131
|
...highlight.value.css,
|
|
129
132
|
rel: "stylesheet",
|
|
@@ -163,14 +166,14 @@ const useMermaid = (props) => {
|
|
|
163
166
|
}
|
|
164
167
|
);
|
|
165
168
|
onMounted(() => {
|
|
166
|
-
var _a, _b
|
|
167
|
-
if (props.noMermaid ||
|
|
169
|
+
var _a, _b;
|
|
170
|
+
if (props.noMermaid || mermaidRef.value) {
|
|
168
171
|
return;
|
|
169
172
|
}
|
|
170
173
|
const jsSrc = editorExtensions.mermaid.js;
|
|
171
174
|
if (/\.mjs/.test(jsSrc)) {
|
|
172
175
|
appendHandler("link", {
|
|
173
|
-
...(
|
|
176
|
+
...(_a = editorExtensionsAttrs.mermaid) == null ? void 0 : _a.js,
|
|
174
177
|
rel: "modulepreload",
|
|
175
178
|
href: jsSrc,
|
|
176
179
|
id: `${prefix}-mermaid-m`
|
|
@@ -187,7 +190,7 @@ const useMermaid = (props) => {
|
|
|
187
190
|
appendHandler(
|
|
188
191
|
"script",
|
|
189
192
|
{
|
|
190
|
-
...(
|
|
193
|
+
...(_b = editorExtensionsAttrs.mermaid) == null ? void 0 : _b.js,
|
|
191
194
|
src: jsSrc,
|
|
192
195
|
id: `${prefix}-mermaid`,
|
|
193
196
|
onload() {
|
|
@@ -614,7 +617,7 @@ const StrIcon = (name, customIcon) => {
|
|
|
614
617
|
};
|
|
615
618
|
const StrIcon$1 = StrIcon;
|
|
616
619
|
const codetabs = (md, _opts) => {
|
|
617
|
-
const defaultRender = md.renderer.rules.fence, unescapeAll = md.utils.unescapeAll, re = /\[(\w*)(?::([\w ]*))?\]/, mandatoryRe = /::close/;
|
|
620
|
+
const defaultRender = md.renderer.rules.fence, unescapeAll = md.utils.unescapeAll, re = /\[(\w*)(?::([\w ]*))?\]/, mandatoryRe = /::(open|close)/;
|
|
618
621
|
const getInfo = (token) => {
|
|
619
622
|
return token.info ? unescapeAll(token.info).trim() : "";
|
|
620
623
|
};
|
|
@@ -627,9 +630,9 @@ const codetabs = (md, _opts) => {
|
|
|
627
630
|
return info ? info.split(/(\s+)/g)[0] : "";
|
|
628
631
|
};
|
|
629
632
|
const getTagType = (token) => {
|
|
630
|
-
const mandatory =
|
|
631
|
-
const open =
|
|
632
|
-
const tagContainer = mandatory || _opts.codeFoldable ? "details" : "div", tagHeader = mandatory || _opts.codeFoldable ? "summary" : "div";
|
|
633
|
+
const mandatory = token.info.match(mandatoryRe) || [];
|
|
634
|
+
const open = mandatory[1] === "open" || mandatory[1] !== "close" && _opts.codeFoldable && token.content.trim().split("\n").length < _opts.autoFoldThreshold;
|
|
635
|
+
const tagContainer = mandatory[1] || _opts.codeFoldable ? "details" : "div", tagHeader = mandatory[1] || _opts.codeFoldable ? "summary" : "div";
|
|
633
636
|
return { open, tagContainer, tagHeader };
|
|
634
637
|
};
|
|
635
638
|
const fenceGroup = (tokens, idx, options, env, slf) => {
|
package/lib/umd/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(pe,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],g):(pe=typeof globalThis<"u"?globalThis:pe||self,g(pe.MdEditorV3={},pe.Vue))})(this,function(pe,g){"use strict";var IOe=Object.defineProperty;var DOe=(pe,g,at)=>g in pe?IOe(pe,g,{enumerable:!0,configurable:!0,writable:!0,value:at}):pe[g]=at;var Xe=(pe,g,at)=>(DOe(pe,typeof g!="symbol"?g+"":g,at),at),LQ=(pe,g,at)=>{if(!g.has(pe))throw TypeError("Cannot "+at)};var T=(pe,g,at)=>(LQ(pe,g,"read from private field"),at?at.call(pe):g.get(pe)),Qe=(pe,g,at)=>{if(g.has(pe))throw TypeError("Cannot add the same private member more than once");g instanceof WeakSet?g.add(pe):g.set(pe,at)},fe=(pe,g,at,ka)=>(LQ(pe,g,"write to private field"),ka?ka.call(pe,at):g.set(pe,at),at);var Nd=(pe,g,at,ka)=>({set _(Md){fe(pe,g,Md,at)},get _(){return T(pe,g,ka)}}),le=(pe,g,at)=>(LQ(pe,g,"access private method"),at);var Iz,_O,Ti,En,_i,Ri,RO,_t,zi,Pt,Ke,ge,ln,Yn,Jt,Ut,Wi,Et,qi,Zi,Vn,Ui,yo,sn,Gs,MQ,pa,qr,Is,Cn,_d,Jz,ma,zO,Ds,Or,ko,lr,xo,Ns,BQ,ZOe,WO,Ld,qO,Fd,Le,et,Ls,HQ,ga,Js,ZO;function at(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const ka=e=>{const t=typeof e;return t!=="function"&&t!=="object"||e===null},Md=e=>{const t=e.flags===""?void 0:e.flags;return new RegExp(e.source,t)},GO=(e,t=new WeakMap)=>{if(e===null||ka(e))return e;if(t.has(e))return t.get(e);if(e instanceof RegExp)return Md(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof Function)return e;if(e instanceof Map){const i=new Map;return t.set(e,i),e.forEach((r,o)=>{i.set(o,GO(r,t))}),i}if(e instanceof Set){const i=new Set;t.set(e,i);for(const r of e)i.add(GO(r,t));return i}if(Array.isArray(e)){const i=[];return t.set(e,i),e.forEach(r=>{i.push(GO(r,t))}),i}const n={};t.set(e,n);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=GO(e[i],t));return n},Bd=(e,t=200)=>{let n=0;return(...i)=>new Promise(r=>{n&&(clearTimeout(n),r("cancel")),n=window.setTimeout(()=>{e.apply(void 0,i),n=0,r("done")},t)})},tW=(e,t={_blank:!0,nofollow:!0})=>{const n=document.createElement("a");n.href=e,t._blank&&(n.target="_blank"),t.nofollow&&(n.rel="noopener noreferrer"),n.click()},nW=()=>{let e=-1;return(t,n,i,r=100)=>{const o=()=>{i&&(typeof r=="number"?setTimeout(i,r):i())};e!==-1&&(cancelAnimationFrame(e),o());let a=t.scrollTop;const O=()=>{e=-1;const l=n-a;a=a+l/5,Math.abs(l)<1?(t.scrollTo(0,n),o()):(t.scrollTo(0,a),e=requestAnimationFrame(O))};e=requestAnimationFrame(O)}},KQ=(e,t=200)=>{let n=0,i=null;const r=o=>{n===0&&(n=o),o-n>=t?(e.apply(void 0,i),i=null,n=0):window.requestAnimationFrame(r)};return(...o)=>{i===null&&window.requestAnimationFrame(r),i=o}},iW=e=>{const t=n=>{const{scrollHeight:i,scrollWidth:r,offsetHeight:o,offsetWidth:a,scrollLeft:O,scrollTop:l}=e,s=n.x,u=n.y,c=h=>{const p=l+u-h.y,m=O+s-h.x,b=i-o,$=r-a,Q={};m>=0&&m<=$&&(Q.left=m),p>=0&&p<=b&&(Q.top=p),e.scroll(Q)};document.addEventListener("mousemove",c);const f=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},Hd=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,JQ=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Kd=(e,t)=>{for(const n in t)JQ(t[n])&&JQ(e[n])?e[n]=Kd(e[n],t[n]):e[n]=t[n];return e},z="md-editor",eb="https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.js",tb="https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.css",Me="https://cdnjs.cloudflare.com/ajax/libs",rW=`${Me}/highlight.js/11.8.0/highlight.min.js`,nb={main:`${Me}/prettier/2.8.0/standalone.js`,markdown:`${Me}/prettier/2.8.0/parser-markdown.js`},oW={css:`${Me}/cropperjs/1.5.13/cropper.min.css`,js:`${Me}/cropperjs/1.5.13/cropper.min.js`},aW=`${Me}/screenfull.js/5.2.0/screenfull.min.js`,Jd=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","mermaid","katex","-","revoke","next","save","=","prettier","pageFullscreen","fullscreen","preview","previewOnly","htmlPreview","catalog","github"],eh=["markdownTotal","=","scrollSwitch"],eu={"zh-CN":{toolbarTips:{bold:"加粗",underline:"下划线",italic:"斜体",strikeThrough:"删除线",title:"标题",sub:"下标",sup:"上标",quote:"引用",unorderedList:"无序列表",orderedList:"有序列表",task:"任务列表",codeRow:"行内代码",code:"块级代码",link:"链接",image:"图片",table:"表格",mermaid:"mermaid图",katex:"katex公式",revoke:"后退",next:"前进",save:"保存",prettier:"美化",pageFullscreen:"浏览器全屏",fullscreen:"屏幕全屏",preview:"预览",previewOnly:"仅预览",htmlPreview:"html代码预览",catalog:"目录",github:"源码地址"},titleItem:{h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题"},imgTitleItem:{link:"添加链接",upload:"上传图片",clip2upload:"裁剪上传"},linkModalTips:{linkTitle:"添加链接",imageTitle:"添加图片",descLabel:"链接描述:",descLabelPlaceHolder:"请输入描述...",urlLabel:"链接地址:",urlLabelPlaceHolder:"请输入链接...",buttonOK:"确定"},clipModalTips:{title:"裁剪图片上传",buttonUpload:"上传"},copyCode:{text:"复制代码",successTips:"已复制!",failTips:"复制失败!"},mermaid:{flow:"流程图",sequence:"时序图",gantt:"甘特图",class:"类图",state:"状态图",pie:"饼图",relationship:"关系图",journey:"旅程图"},katex:{inline:"行内公式",block:"块级公式"},footer:{markdownTotal:"字数",scrollAuto:"同步滚动"}},"en-US":{toolbarTips:{bold:"bold",underline:"underline",italic:"italic",strikeThrough:"strikeThrough",title:"title",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"unordered list",orderedList:"ordered list",task:"task list",codeRow:"inline code",code:"block-level code",link:"link",image:"image",table:"table",mermaid:"mermaid",katex:"formula",revoke:"revoke",next:"undo revoke",save:"save",prettier:"prettier",pageFullscreen:"fullscreen in page",fullscreen:"fullscreen",preview:"preview",previewOnly:"preview only",htmlPreview:"html preview",catalog:"catalog",github:"source code"},titleItem:{h1:"Lv1 Heading",h2:"Lv2 Heading",h3:"Lv3 Heading",h4:"Lv4 Heading",h5:"Lv5 Heading",h6:"Lv6 Heading"},imgTitleItem:{link:"Add Img Link",upload:"Upload Img",clip2upload:"Clip Upload"},linkModalTips:{linkTitle:"Add Link",imageTitle:"Add Image",descLabel:"Desc:",descLabelPlaceHolder:"Enter a description...",urlLabel:"Link:",urlLabelPlaceHolder:"Enter a link...",buttonOK:"OK"},clipModalTips:{title:"Crop Image",buttonUpload:"Upload"},copyCode:{text:"Copy",successTips:"Copied!",failTips:"Copy failed!"},mermaid:{flow:"flow",sequence:"sequence",gantt:"gantt",class:"class",state:"state",pie:"pie",relationship:"relationship",journey:"journey"},katex:{inline:"inline",block:"block"},footer:{markdownTotal:"Character Count",scrollAuto:"Scroll Auto"}}},OW=`${Me}/mermaid/10.6.1/mermaid.esm.min.mjs`,lW={js:`${Me}/KaTeX/0.16.9/katex.min.js`,css:`${Me}/KaTeX/0.16.9/katex.min.css`},th={a11y:{light:`${Me}/highlight.js/11.8.0/styles/a11y-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/a11y-dark.min.css`},atom:{light:`${Me}/highlight.js/11.8.0/styles/atom-one-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/atom-one-dark.min.css`},github:{light:`${Me}/highlight.js/11.8.0/styles/github.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/github-dark.min.css`},gradient:{light:`${Me}/highlight.js/11.8.0/styles/gradient-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/gradient-dark.min.css`},kimbie:{light:`${Me}/highlight.js/11.8.0/styles/kimbie-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/kimbie-dark.min.css`},paraiso:{light:`${Me}/highlight.js/11.8.0/styles/paraiso-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/paraiso-dark.min.css`},qtcreator:{light:`${Me}/highlight.js/11.8.0/styles/qtcreator-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${Me}/highlight.js/11.8.0/styles/stackoverflow-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/stackoverflow-dark.min.css`}},sW={highlight:{js:{integrity:"sha384-g4mRvs7AO0/Ol5LxcGyz4Doe21pVhGNnC3EQw5shw+z+aXDN86HqUdwXWO+Gz2zI",crossOrigin:"anonymous"},css:{a11y:{light:{integrity:"sha384-qdZDAN3jffvh670RHw1wxLekabidEFaNRninYgIzBvMbL6WlHdXeHS/Bt+vx33lN",crossOrigin:"anonymous"},dark:{integrity:"sha384-2QAAjX8pqaM5azX68KWI2wExF6Q13kY4kEiQFY4b/1zPe6rpgmTByNpDEllH3sb+",crossOrigin:"anonymous"}},atom:{light:{integrity:"sha384-w6Ujm1VWa9HYFqGc89oAPn/DWDi2gUamjNrq9DRvEYm2X3ClItg9Y9xs1ViVo5b5",crossOrigin:"anonymous"},dark:{integrity:"sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07",crossOrigin:"anonymous"}},github:{light:{integrity:"sha384-eFTL69TLRZTkNfYZOLM+G04821K1qZao/4QLJbet1pP4tcF+fdXq/9CdqAbWRl/L",crossOrigin:"anonymous"},dark:{integrity:"sha384-wH75j6z1lH97ZOpMOInqhgKzFkAInZPPSPlZpYKYTOqsaizPvhQZmAtLcPKXpLyH",crossOrigin:"anonymous"}},gradient:{light:{integrity:"sha384-yErHBR8aEZPxRl3XmR8dGSRAclMlnSRRw8sXQLcmPWzWUvb56BzQmBw3EWHl7QGI",crossOrigin:"anonymous"},dark:{integrity:"sha384-lUCvtSOdvDbp5hLWKgwz/taFu1HxlpqES2OVP5UG2JMTfnU481gXcBhGF9lAGoSr",crossOrigin:"anonymous"}},kimbie:{light:{integrity:"sha384-tloeSLUPczAvoZ48TUz+OxRie0oYLCRwlkadUXovGzzJEIbNQB2TkfUuvJ6SW5Mi",crossOrigin:"anonymous"},dark:{integrity:"sha384-o5F1vUaMNOmou1sQrsWiFo4/QUGSV0svqNZW+EesmKxWC8MpFJcveBhAyfvTHbGb",crossOrigin:"anonymous"}},paraiso:{light:{integrity:"sha384-5j6QHU2Hwg1ehtlIQNDebhETDB8bga3/88hzBFsMRaGmgQHCftqIN7GZNDNw0vTL",crossOrigin:"anonymous"},dark:{integrity:"sha384-I5vnnMQu0LWDQnHpT61xyoMwKarAB8jpZkB2ioFOlmzUFnIFaV4QbUwlBBOMKhTH",crossOrigin:"anonymous"}},qtcreator:{light:{integrity:"sha384-iEBgHrwi8Hv4dSZBz+MOGvS05rF7I7fGKM2fASQyE9jn2Istg9Qd5dSoK18WyRTB",crossOrigin:"anonymous"},dark:{integrity:"sha384-D6LXJGWNR4QV7gnpuP3ccbvOYoR02td3cU0y7lESABPg/tzCSC4m+y+M2TtrmpHc",crossOrigin:"anonymous"}},stackoverflow:{light:{integrity:"sha384-FMwt7cTGo4aLxZnno5k0xTj0W4gmi48Kwept+y/oQmE6cFk36Kr+QJZOKNOQwORe",crossOrigin:"anonymous"},dark:{integrity:"sha384-iL+x+BroCyHm/p2c6sMA9umXhdCWp2cKe4QUjPeMzHgwXAk+ZxHyIGP3NZTZensU",crossOrigin:"anonymous"}}}},prettier:{standaloneJs:{integrity:"sha384-cBKW1A8TbwohtSsrm+VWpXevI1PWdPmUrozwqTw7aS51JIhz9IvgHHa/bV6icWeL",crossOrigin:"anonymous"},parserMarkdownJs:{integrity:"sha384-kXeeC2HiA6n3rpvz0MOjB7yZo9QjvYNAMihonwR5fdTOFs/rm/Bm3Xg8cOSE4900",crossOrigin:"anonymous"}},cropper:{js:{integrity:"sha384-r+ljwOAhwY4/kdyzMnuBg7MEVoWpTMp5EYUDntB/E9qzNwL9dAEcNrb2XaV+mJc2",crossOrigin:"anonymous"},css:{integrity:"sha384-oMy41mb/qJnpJlpXOF57hSu2KGi47l/UV9+tPNrBOs7/ap5Vubj/3phrCtjutHMQ",crossOrigin:"anonymous"}},iconfont:{integrity:"sha384-HRrf1e8/EiqrIZQftejl7pMTeuLeYczOz7rolAGxgw86N7UjiXkex67Uf2XTZz5z",crossOrigin:"anonymous"},iconfontClass:{integrity:"sha384-81pjilF/gLoQvAfd8madmeylVdv8IagPQaq1C/OZbysLav7k9g+Ir3XD5qK00Q5r",crossOrigin:"anonymous"},screenfull:{js:{integrity:"sha384-ELVAm9p9T4LGCG4lz8hbYalUYAppIpI1zV8IXYDCBUJFiVnV+EeG8vGSYQi+Wi4S",crossOrigin:"anonymous"}},mermaid:{js:{integrity:"sha384-zmipzuFBFDAekHS2uY4mN5cvpcSvgUi3aMjMJ2xnVRsU2kDHBtqLOJRnianHJeP1",crossOrigin:"anonymous"}},katex:{js:{integrity:"sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8",crossOrigin:"anonymous"},css:{integrity:"sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV",crossOrigin:"anonymous"}}},dt={editorExtensions:{highlight:{js:rW,css:th},prettier:{standaloneJs:nb.main,parserMarkdownJs:nb.markdown},cropper:{...oW},iconfont:eb,iconfontClass:tb,screenfull:{js:aW},mermaid:{js:OW},katex:{...lW}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:(e,t)=>t,markdownItConfig:()=>{},markdownItPlugins:e=>e,iconfontType:"svg",mermaidConfig:e=>e},uW=e=>Kd(dt,e),tu=170,cW=g.defineComponent({setup(){return()=>g.createVNode("div",{class:`${z}-divider`},null)}}),Gn=({instance:e,ctx:t,props:n={}},i="default")=>{const r=(e==null?void 0:e.$slots[i])||(t==null?void 0:t.slots[i]);return(r?r(e):"")||n[i]},fW={overlay:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},relative:{type:String,default:"html"}},xa=g.defineComponent({props:fW,setup(e,t){const n=`${z}-dropdown-hidden`,i=g.reactive({overlayClass:[n],overlayStyle:{},triggerHover:!1,overlayHover:!1}),r=g.ref(),o=g.ref(),a=()=>{var k,S;i.triggerHover=!0;const u=r.value,c=o.value;if(!u||!c)return;const f=u.getBoundingClientRect(),h=u.offsetTop,p=u.offsetLeft,m=f.height,b=f.width,$=((k=document.querySelector(e.relative))==null?void 0:k.scrollLeft)||0,Q=((S=document.querySelector(e.relative))==null?void 0:S.clientWidth)||0;let P=p-c.offsetWidth/2+b/2-$;P+c.offsetWidth>$+Q&&(P=$+Q-c.offsetWidth),P<0&&(P=0),i.overlayStyle={...i.overlayStyle,top:h+m+"px",left:P+"px"},e.onChange(!0)},O=()=>{i.overlayHover=!0};g.watch(()=>e.visible,u=>{u?i.overlayClass=i.overlayClass.filter(c=>c!==n):i.overlayClass.push(n)});let l=-1;const s=u=>{r.value===u.target?i.triggerHover=!1:i.overlayHover=!1,clearTimeout(l),l=window.setTimeout(()=>{!i.overlayHover&&!i.triggerHover&&e.onChange(!1)},10)};return g.onMounted(()=>{r.value.addEventListener("mouseenter",a),r.value.addEventListener("mouseleave",s),o.value.addEventListener("mouseenter",O),o.value.addEventListener("mouseleave",s)}),g.onBeforeUnmount(()=>{r.value.removeEventListener("mouseenter",a),r.value.removeEventListener("mouseleave",s),o.value.removeEventListener("mouseenter",O),o.value.removeEventListener("mouseleave",s)}),()=>{const u=Gn({ctx:t}),c=Gn({props:e,ctx:t},"overlay"),f=g.cloneVNode(u instanceof Array?u[0]:u,{ref:r,key:"cloned-dropdown-trigger"}),h=g.createVNode("div",{class:[`${z}-dropdown`,i.overlayClass],style:i.overlayStyle,ref:o},[g.createVNode("div",{class:`${z}-dropdown-overlay`},[c instanceof Array?c[0]:c])]);return[f,h]}}});class dW{constructor(){Xe(this,"pools",{})}remove(t,n,i){const o=this.pools[t]&&this.pools[t][n];o&&(this.pools[t][n]=o.filter(a=>a!==i))}clear(t){this.pools[t]={}}on(t,n){return this.pools[t]||(this.pools[t]={}),this.pools[t][n.name]||(this.pools[t][n.name]=[]),this.pools[t][n.name].push(n.callback),this.pools[t][n.name].includes(n.callback)}emit(t,n,...i){this.pools[t]||(this.pools[t]={});const o=this.pools[t][n];o&&o.forEach(a=>{try{a(...i)}catch(O){console.error(`${n} monitor event exception!`,O)}})}}const B=new dW,hW={noPrettier:{type:Boolean},toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]},setting:{type:Object,default:()=>({})},screenfull:{type:Object,default:null},screenfullJs:{type:String,default:""},updateSetting:{type:Function,default:()=>{}},tableShape:{type:Array,default:()=>[6,4]},defToolbars:{type:Object},noUploadImg:{type:Boolean},showToolbarName:{type:Boolean}},nu="onSave",nh="changeCatalogVisible",ib="changeFullscreen",rb="pageFullscreenChanged",ob="fullscreenChanged",ab="previewChanged",Ob="previewOnlyChanged",lb="htmlPreviewChanged",sb="catalogVisibleChanged",iu="buildFinished",vo="errorCatcher",je="replace",ru="uploadImage",ih="openModals",ub="ctrlZ",cb="ctrlShiftZ",ou="catalogChanged",fb="pushCatalog",rh="rerender",db="eventListener",hb=(e,t)=>{const n=i=>{const r=e.parentElement||document.body,o=r.offsetWidth,a=r.offsetHeight,{clientWidth:O}=document.documentElement,{clientHeight:l}=document.documentElement,s=i.offsetX,u=i.offsetY,c=h=>{let p=h.x+document.body.scrollLeft-document.body.clientLeft-s,m=h.y+document.body.scrollTop-document.body.clientTop-u;p=p<1?1:p<O-o-1?p:O-o-1,m=m<1?1:m<l-a-1?m:l-a-1,t?t(p,m):(r.style.left=`${p}px`,r.style.top=`${m}px`)};document.addEventListener("mousemove",c);const f=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}},un=(e,t,n="")=>{var r;const i=document.getElementById(t.id);if(i)n!==""&&(Reflect.get(window,n)?(r=t.onload)==null||r.call(i,new Event("load")):t.onload&&i.addEventListener("load",t.onload));else{const o={...t};o.onload=null;const a=mW(e,o);t.onload&&a.addEventListener("load",t.onload),document.head.appendChild(a)}},pW=(e,t)=>{const n=document.getElementById(t.id);n==null||n.remove(),un(e,t)},mW=(e,t)=>{const n=document.createElement(e);return Object.keys(t).forEach(i=>{t[i]!==void 0&&(n[i]=t[i])}),n},gW=e=>{const t=g.inject("editorId"),{editorExtensions:n,editorExtensionsAttrs:i}=dt;let r=n.screenfull.instance;const o=g.ref(!1),a=s=>{if(!r){B.emit(t,vo,{name:"fullscreen",message:"fullscreen is undefined"});return}r.isEnabled?(o.value=!0,(s===void 0?!r.isFullscreen:s)?r.request():r.exit()):console.error("browser does not support screenfull!")},O=()=>{r&&r.isEnabled&&r.on("change",()=>{(o.value||e.setting.fullscreen)&&(o.value=!1,e.updateSetting("fullscreen"))})},l=()=>{r=window.screenfull,O()};return g.onMounted(()=>{var s;O(),r||un("script",{...(s=i.screenfull)==null?void 0:s.js,src:n.screenfull.js,id:`${z}-screenfull`,onload:l},"screenfull")}),g.onMounted(()=>{B.on(t,{name:ib,callback:a})}),{fullscreenHandler:a}},$W={tableShape:{type:Array,default:()=>[6,4]},onSelected:{type:Function,default:()=>{}}},QW=g.defineComponent({name:"TableShape",props:$W,setup(e){const t=g.reactive({x:-1,y:-1}),n=()=>{const r=[...e.tableShape];return(!r[2]||r[2]<r[0])&&(r[2]=r[0]),(!r[3]||r[3]<r[3])&&(r[3]=r[1]),r},i=g.ref(n());return g.watch(()=>e.tableShape,()=>{i.value=n()}),()=>g.createVNode("div",{class:`${z}-table-shape`,onMouseleave:()=>{i.value=n(),t.x=-1,t.y=-1}},[new Array(i.value[1]).fill("").map((r,o)=>g.createVNode("div",{class:`${z}-table-shape-row`,key:`table-shape-row-${o}`},[new Array(i.value[0]).fill("").map((a,O)=>g.createVNode("div",{class:`${z}-table-shape-col`,key:`table-shape-col-${O}`,onMouseenter:()=>{t.x=o,t.y=O,O+1===i.value[0]&&O+1<i.value[2]?i.value[0]++:O+2<i.value[0]&&i.value[0]>e.tableShape[0]&&i.value[0]--,o+1===i.value[1]&&o+1<i.value[3]?i.value[1]++:o+2<i.value[1]&&i.value[1]>e.tableShape[1]&&i.value[1]--},onClick:()=>{e.onSelected(t)}},[g.createVNode("div",{class:[`${z}-table-shape-col-default`,o<=t.x&&O<=t.y&&`${z}-table-shape-col-include`]},null)]))]))])}}),bW=g.defineComponent({props:{name:{type:String,default:""}},setup(e){return()=>dt.iconfontType==="svg"?g.createVNode("svg",{class:`${z}-icon`,"aria-hidden":"true"},[g.createVNode("use",{"xlink:href":`#${z}-icon-${e.name}`},null)]):g.createVNode("i",{class:`${z}-iconfont ${z}-icon-${e.name}`},null)}}),ve=g.defineComponent({props:{name:{type:String,default:""}},setup(e){const t=g.inject("customIcon");return()=>{const n=t.value[e.name];return typeof n=="object"?typeof n.component=="object"?g.h(n.component,n.props):g.createVNode("span",{innerHTML:n.component},null):g.createVNode(bW,{name:e.name},null)}}}),yW=(e,t="image.png")=>{const n=e.split(","),i=n[0].match(/:(.*?);/);if(i){const r=i[1],o=atob(n[1]);let a=o.length;const O=new Uint8Array(a);for(;a--;)O[a]=o.charCodeAt(a);return new File([O],t,{type:r})}return null},SW=e=>{if(!e)return e;const t=e.split(`
|
|
2
|
-
`),n=['<span rn-wrapper aria-hidden="true">'];return t.forEach(()=>{n.push("<span></span>")}),n.push("</span>"),`<span class="${z}-code-block">${e}</span>${n.join("")}`},PW=(e,t)=>{if(!e||!t)return 0;const n=e==null?void 0:e.getBoundingClientRect();if(t===document.documentElement)return n.top-t.clientTop;const i=t==null?void 0:t.getBoundingClientRect();return n.top-i.top},kW=(()=>{let e=0;return t=>t+ ++e})(),pb=(()=>{let e=0;return()=>++e})(),xW={title:{type:String,default:""},visible:{type:Boolean,default:!1},width:{type:String,default:"auto"},height:{type:String,default:"auto"},onClose:{type:Function},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:()=>{}},class:{type:String},style:{type:[Object,String],default:()=>({})},showMask:{type:Boolean,default:!0}},wo=g.defineComponent({name:"MdModal",props:xW,emits:["onClose"],setup(e,t){const n=g.inject("theme"),i=g.ref(e.visible),r=g.ref([`${z}-modal`]),o=g.ref(),a=g.ref(),O=g.ref(),l=g.shallowRef();let s=()=>{};const u=g.reactive({maskStyle:{zIndex:-1},modalStyle:{zIndex:-1},initPos:{left:"0px",top:"0px"},historyPos:{left:"0px",top:"0px"}}),c=g.computed(()=>e.isFullscreen?{width:"100%",height:"100%"}:{width:e.width,height:e.height});g.watch(()=>e.isFullscreen,p=>{p?s():g.nextTick(()=>{s=hb(a.value,(m,b)=>{u.initPos.left=m+"px",u.initPos.top=b+"px"})})}),g.watch(()=>e.visible,p=>{p?(u.maskStyle.zIndex=dt.editorConfig.zIndex+pb(),u.modalStyle.zIndex=dt.editorConfig.zIndex+pb(),r.value.push("zoom-in"),i.value=p,g.nextTick(()=>{const m=o.value.offsetWidth/2,b=o.value.offsetHeight/2,$=document.documentElement.clientWidth/2,Q=document.documentElement.clientHeight/2;u.initPos.left=$-m+"px",u.initPos.top=Q-b+"px",e.isFullscreen||(s=hb(a.value,(P,k)=>{u.initPos.left=P+"px",u.initPos.top=k+"px"}))}),setTimeout(()=>{r.value=r.value.filter(m=>m!=="zoom-in")},140)):(r.value.push("zoom-out"),s(),setTimeout(()=>{r.value=r.value.filter(m=>m!=="zoom-out"),i.value=p},130))});const f=g.computed(()=>({display:i.value?"block":"none"})),h=g.computed(()=>typeof e.style=="string"?[e.style,f.value].join("; "):e.style instanceof Object?{...f.value,...e.style}:f.value);return g.onMounted(()=>{O.value=document.body}),()=>{const p=Gn({ctx:t}),m=Gn({props:e,ctx:t},"title");return O.value?g.createVNode(g.Teleport,{to:O.value},{default:()=>[g.createVNode("div",{ref:l,class:`${z}-modal-container`,"data-theme":n.value},[g.createVNode("div",{class:e.class,style:h.value},[e.showMask&&g.createVNode("div",{class:`${z}-modal-mask`,style:u.maskStyle,onClick:()=>{e.onClose?e.onClose():t.emit("onClose")}},null),g.createVNode("div",{class:r.value,style:{...u.modalStyle,...u.initPos,...c.value},ref:o},[g.createVNode("div",{class:`${z}-modal-header`,ref:a},[m||""]),g.createVNode("div",{class:`${z}-modal-body`},[p]),g.createVNode("div",{class:`${z}-modal-func`},[e.showAdjust&&g.createVNode("div",{class:`${z}-modal-adjust`,onClick:b=>{b.stopPropagation(),e.isFullscreen?u.initPos=u.historyPos:(u.historyPos=u.initPos,u.initPos={left:"0",top:"0"}),e.onAdjust(!e.isFullscreen)}},[g.createVNode(ve,{name:e.isFullscreen?"suoxiao":"fangda"},null)]),g.createVNode("div",{class:`${z}-modal-close`,onClick:b=>{b.stopPropagation(),e.onClose?e.onClose():t.emit("onClose")}},[g.createVNode(ve,{name:"close"},null)])])])])])]}):""}}});wo.install=e=>(e.component(wo.name,wo),e);const vW={type:{type:String,default:"link"},visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},wW=g.defineComponent({props:vW,setup(e){const t=g.inject("usedLanguageText"),n=g.inject("editorId"),i=g.computed(()=>{var o,a;switch(e.type){case"link":return(o=t.value.linkModalTips)==null?void 0:o.linkTitle;case"image":return(a=t.value.linkModalTips)==null?void 0:a.imageTitle;default:return""}}),r=g.reactive({desc:"",url:""});return g.watch(()=>e.visible,o=>{o||setTimeout(()=>{r.desc="",r.url=""},200)}),()=>g.createVNode(wo,{title:i.value,visible:e.visible,onClose:e.onCancel},{default:()=>{var o,a,O,l,s;return[g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("label",{class:`${z}-label`,for:`link-desc-${n}`},[(o=t.value.linkModalTips)==null?void 0:o.descLabel]),g.createVNode("input",{placeholder:(a=t.value.linkModalTips)==null?void 0:a.descLabelPlaceHolder,class:`${z}-input`,id:`link-desc-${n}`,type:"text",value:r.desc,onChange:u=>{r.desc=u.target.value},autocomplete:"off"},null)]),g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("label",{class:`${z}-label`,for:`link-url-${n}`},[(O=t.value.linkModalTips)==null?void 0:O.urlLabel]),g.createVNode("input",{placeholder:(l=t.value.linkModalTips)==null?void 0:l.urlLabelPlaceHolder,class:`${z}-input`,id:`link-url-${n}`,type:"text",value:r.url,onChange:u=>{r.url=u.target.value},autocomplete:"off"},null)]),g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("button",{class:[`${z}-btn`,`${z}-btn-row`],type:"button",onClick:()=>{e.onOk(r),r.desc="",r.url=""}},[(s=t.value.linkModalTips)==null?void 0:s.buttonOK])])]}})}}),XW={visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},TW=g.defineComponent({props:XW,setup(e){const t=g.inject("usedLanguageText"),n=g.inject("editorId");let i=dt.editorExtensions.cropper.instance;const r=g.ref(),o=g.ref(),a=g.ref(),O=g.reactive({cropperInited:!1,imgSelected:!1,imgSrc:"",isFullscreen:!1});let l=null;g.watch(()=>e.visible,()=>{e.visible&&!O.cropperInited&&(i=i||window.Cropper,r.value.onchange=()=>{if(!i){B.emit(n,vo,{name:"Cropper",message:"Cropper is undefined"});return}const u=r.value.files||[];if(O.imgSelected=!0,(u==null?void 0:u.length)>0){const c=new FileReader;c.onload=f=>{O.imgSrc=f.target.result,g.nextTick(()=>{l=new i(o.value,{viewMode:2,preview:`.${z}-clip-preview-target`})})},c.readAsDataURL(u[0])}})}),g.watch(()=>[O.imgSelected],()=>{a.value.style=""}),g.watch(()=>O.isFullscreen,()=>{g.nextTick(()=>{l==null||l.destroy(),a.value.style="",o.value&&(l=new i(o.value,{viewMode:2,preview:`.${z}-clip-preview-target`}))})});const s=()=>{l.clear(),l.destroy(),l=null,r.value.value="",O.imgSelected=!1};return()=>{var u;return g.createVNode(wo,{class:`${z}-modal-clip`,title:(u=t.value.clipModalTips)==null?void 0:u.title,visible:e.visible,onClose:e.onCancel,showAdjust:!0,isFullscreen:O.isFullscreen,onAdjust:c=>{O.isFullscreen=c},width:"668px",height:"421px"},{default:()=>{var c,f;return[g.createVNode("div",{class:`${z}-form-item ${z}-clip`},[g.createVNode("div",{class:`${z}-clip-main`},[O.imgSelected?g.createVNode("div",{class:`${z}-clip-cropper`},[g.createVNode("img",{src:O.imgSrc,ref:o,style:{display:"none"},alt:""},null),g.createVNode("div",{class:`${z}-clip-delete`,onClick:s},[g.createVNode(ve,{name:"delete"},null)])]):g.createVNode("div",{class:`${z}-clip-upload`,onClick:()=>{r.value.click()}},[g.createVNode(ve,{name:"upload"},null)])]),g.createVNode("div",{class:`${z}-clip-preview`},[g.createVNode("div",{class:`${z}-clip-preview-target`,ref:a},null)])]),g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("button",{class:`${z}-btn`,type:"button",onClick:()=>{if(l){const h=l.getCroppedCanvas();B.emit(n,ru,[yW(h.toDataURL("image/png"))],e.onOk),s()}}},[((c=t.value.clipModalTips)==null?void 0:c.buttonUpload)||((f=t.value.linkModalTips)==null?void 0:f.buttonOK)])]),g.createVNode("input",{ref:r,accept:"image/*",type:"file",multiple:!1,style:{display:"none"}},null)]}})}}}),_W={type:{type:String,default:"link"},linkVisible:{type:Boolean,default:!1},clipVisible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},RW=g.defineComponent({props:_W,setup(e){return()=>g.createVNode(g.Fragment,null,[g.createVNode(wW,{type:e.type,visible:e.linkVisible,onOk:e.onOk,onCancel:e.onCancel},null),g.createVNode(TW,{visible:e.clipVisible,onOk:e.onOk,onCancel:e.onCancel},null)])}}),zW=g.defineComponent({name:"MDEditorToolbar",props:hW,setup(e){const t=g.inject("editorId"),n=g.inject("usedLanguageText"),i=g.inject("theme"),r=g.inject("previewTheme"),o=g.inject("language"),{fullscreenHandler:a}=gW(e),O=`${t}-toolbar-wrapper`,l=g.ref(),s=g.reactive({title:!1,catalog:!1,image:!1,table:!1,mermaid:!1,katex:!1}),u=($,Q)=>{B.emit(t,je,$,Q)},c=g.reactive({type:"link",linkVisible:!1,clipVisible:!1}),f=g.ref();g.onMounted(()=>{B.on(t,{name:ih,callback($){c.type=$,c.linkVisible=!0}})});const h=g.computed(()=>{const $=e.toolbars.filter(S=>!e.toolbarsExclude.includes(S)),Q=$.indexOf("="),P=Q===-1?$:$.slice(0,Q+1),k=Q===-1?[]:$.slice(Q,Number.MAX_SAFE_INTEGER);return[P,k]}),p=g.ref(),m=()=>{B.emit(t,ru,Array.from(p.value.files||[])),p.value.value=""};g.onMounted(()=>{p.value.addEventListener("change",m)});const b=$=>{var Q,P,k,S,R,w,x,v,E,Z,V,U,X,q,W,Y,N,F,I,L,ie,he,Re,G,Oe,ze,Ge,kt,ui,jn,Ei,UO,$a,Zr,EO,YO,Qa,Rd,zd,ba,Wd,sr,xt,So,ya,Ur,qd,Fs,Zd,Ye,Ud,VO,Po,CO,Ed,jO,ci,Yd,Sa,Vd,AO,yn,Ms,Cd,Yi,jd,Bs,Hs,Ad;if(Jd.includes($))switch($){case"-":return g.createVNode(cW,null,null);case"bold":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Q=n.value.toolbarTips)==null?void 0:Q.bold,onClick:()=>{u("bold")}},[g.createVNode(ve,{name:"bold"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(P=n.value.toolbarTips)==null?void 0:P.bold])]);case"underline":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(k=n.value.toolbarTips)==null?void 0:k.underline,onClick:()=>{u("underline")}},[g.createVNode(ve,{name:"underline"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(S=n.value.toolbarTips)==null?void 0:S.underline])]);case"italic":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(R=n.value.toolbarTips)==null?void 0:R.italic,onClick:()=>{u("italic")}},[g.createVNode(ve,{name:"italic"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(w=n.value.toolbarTips)==null?void 0:w.italic])]);case"strikeThrough":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(x=n.value.toolbarTips)==null?void 0:x.strikeThrough,onClick:()=>{u("strikeThrough")}},[g.createVNode(ve,{name:"strike-through"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(v=n.value.toolbarTips)==null?void 0:v.strikeThrough])]);case"title":return g.createVNode(xa,{relative:`#${O}`,visible:s.title,onChange:ye=>{s.title=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.title=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h1")}},[(E=n.value.titleItem)==null?void 0:E.h1]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h2")}},[(Z=n.value.titleItem)==null?void 0:Z.h2]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h3")}},[(V=n.value.titleItem)==null?void 0:V.h3]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h4")}},[(U=n.value.titleItem)==null?void 0:U.h4]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h5")}},[(X=n.value.titleItem)==null?void 0:X.h5]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h6")}},[(q=n.value.titleItem)==null?void 0:q.h6])])},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.title},[g.createVNode(ve,{name:"title"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.title])])]}});case"sub":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(W=n.value.toolbarTips)==null?void 0:W.sub,onClick:()=>{u("sub")}},[g.createVNode(ve,{name:"sub"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Y=n.value.toolbarTips)==null?void 0:Y.sub])]);case"sup":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(N=n.value.toolbarTips)==null?void 0:N.sup,onClick:()=>{u("sup")}},[g.createVNode(ve,{name:"sup"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(F=n.value.toolbarTips)==null?void 0:F.sup])]);case"quote":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(I=n.value.toolbarTips)==null?void 0:I.quote,onClick:()=>{u("quote")}},[g.createVNode(ve,{name:"quote"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(L=n.value.toolbarTips)==null?void 0:L.quote])]);case"unorderedList":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(ie=n.value.toolbarTips)==null?void 0:ie.unorderedList,onClick:()=>{u("unorderedList")}},[g.createVNode(ve,{name:"unordered-list"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(he=n.value.toolbarTips)==null?void 0:he.unorderedList])]);case"orderedList":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Re=n.value.toolbarTips)==null?void 0:Re.orderedList,onClick:()=>{u("orderedList")}},[g.createVNode(ve,{name:"ordered-list"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(G=n.value.toolbarTips)==null?void 0:G.orderedList])]);case"task":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Oe=n.value.toolbarTips)==null?void 0:Oe.task,onClick:()=>{u("task")}},[g.createVNode(ve,{name:"task"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(ze=n.value.toolbarTips)==null?void 0:ze.task])]);case"codeRow":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ge=n.value.toolbarTips)==null?void 0:Ge.codeRow,onClick:()=>{u("codeRow")}},[g.createVNode(ve,{name:"code-row"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(kt=n.value.toolbarTips)==null?void 0:kt.codeRow])]);case"code":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(ui=n.value.toolbarTips)==null?void 0:ui.code,onClick:()=>{u("code")}},[g.createVNode(ve,{name:"code"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(jn=n.value.toolbarTips)==null?void 0:jn.code])]);case"link":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ei=n.value.toolbarTips)==null?void 0:Ei.link,onClick:()=>{c.type="link",c.linkVisible=!0}},[g.createVNode(ve,{name:"link"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(UO=n.value.toolbarTips)==null?void 0:UO.link])]);case"image":return e.noUploadImg?g.createVNode("div",{class:`${z}-toolbar-item`,title:($a=n.value.toolbarTips)==null?void 0:$a.image,onClick:()=>{c.type="image",c.linkVisible=!0}},[g.createVNode(ve,{name:"image"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Zr=n.value.toolbarTips)==null?void 0:Zr.image])]):g.createVNode(xa,{relative:`#${O}`,visible:s.image,onChange:ye=>{s.image=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.title=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-image`,onClick:()=>{c.type="image",c.linkVisible=!0}},[(EO=n.value.imgTitleItem)==null?void 0:EO.link]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-image`,onClick:()=>{p.value.click()}},[(YO=n.value.imgTitleItem)==null?void 0:YO.upload]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-image`,onClick:()=>{c.clipVisible=!0}},[(Qa=n.value.imgTitleItem)==null?void 0:Qa.clip2upload])])},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.image},[g.createVNode(ve,{name:"image"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.image])])]}});case"table":return g.createVNode(xa,{relative:`#${O}`,visible:s.table,onChange:ye=>{s.table=ye},key:"bar-table",overlay:g.createVNode(QW,{tableShape:e.tableShape,onSelected:ye=>{u("table",{selectedShape:ye})}},null)},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.table},[g.createVNode(ve,{name:"table"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.table])])]}});case"revoke":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Rd=n.value.toolbarTips)==null?void 0:Rd.revoke,onClick:()=>{B.emit(t,ub)}},[g.createVNode(ve,{name:"revoke"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(zd=n.value.toolbarTips)==null?void 0:zd.revoke])]);case"next":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(ba=n.value.toolbarTips)==null?void 0:ba.next,onClick:()=>{B.emit(t,cb)}},[g.createVNode(ve,{name:"next"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Wd=n.value.toolbarTips)==null?void 0:Wd.next])]);case"save":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(sr=n.value.toolbarTips)==null?void 0:sr.save,onClick:()=>{B.emit(t,nu)}},[g.createVNode(ve,{name:"baocun"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(xt=n.value.toolbarTips)==null?void 0:xt.save])]);case"prettier":return e.noPrettier?"":g.createVNode("div",{class:`${z}-toolbar-item`,title:(So=n.value.toolbarTips)==null?void 0:So.prettier,onClick:()=>{u("prettier")}},[g.createVNode(ve,{name:"prettier"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(ya=n.value.toolbarTips)==null?void 0:ya.prettier])]);case"pageFullscreen":return!e.setting.fullscreen&&g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ur=n.value.toolbarTips)==null?void 0:Ur.pageFullscreen,onClick:()=>{e.updateSetting("pageFullscreen")}},[g.createVNode(ve,{name:e.setting.pageFullscreen?"suoxiao":"fangda"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(qd=n.value.toolbarTips)==null?void 0:qd.pageFullscreen])]);case"fullscreen":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Fs=n.value.toolbarTips)==null?void 0:Fs.fullscreen,onClick:()=>{a()}},[g.createVNode(ve,{name:e.setting.fullscreen?"fullscreen-exit":"fullscreen"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Zd=n.value.toolbarTips)==null?void 0:Zd.fullscreen])]);case"preview":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ye=n.value.toolbarTips)==null?void 0:Ye.preview,onClick:()=>{e.updateSetting("preview")}},[g.createVNode(ve,{name:"preview"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Ud=n.value.toolbarTips)==null?void 0:Ud.preview])]);case"previewOnly":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(VO=n.value.toolbarTips)==null?void 0:VO.previewOnly,onClick:()=>{e.updateSetting("previewOnly")}},[g.createVNode(ve,{name:"preview-only"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Po=n.value.toolbarTips)==null?void 0:Po.previewOnly])]);case"htmlPreview":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(CO=n.value.toolbarTips)==null?void 0:CO.htmlPreview,onClick:()=>{e.updateSetting("htmlPreview")}},[g.createVNode(ve,{name:"coding"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Ed=n.value.toolbarTips)==null?void 0:Ed.htmlPreview])]);case"catalog":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(jO=n.value.toolbarTips)==null?void 0:jO.catalog,onClick:()=>{B.emit(t,nh)},key:"bar-catalog"},[g.createVNode(ve,{name:"catalog"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(ci=n.value.toolbarTips)==null?void 0:ci.catalog])]);case"github":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Yd=n.value.toolbarTips)==null?void 0:Yd.github,onClick:()=>tW("https://github.com/imzbf/md-editor-v3")},[g.createVNode(ve,{name:"github"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Sa=n.value.toolbarTips)==null?void 0:Sa.github])]);case"mermaid":return g.createVNode(xa,{relative:`#${O}`,visible:s.mermaid,onChange:ye=>{s.mermaid=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.mermaid=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("flow")}},[(Vd=n.value.mermaid)==null?void 0:Vd.flow]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("sequence")}},[(AO=n.value.mermaid)==null?void 0:AO.sequence]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("gantt")}},[(yn=n.value.mermaid)==null?void 0:yn.gantt]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("class")}},[(Ms=n.value.mermaid)==null?void 0:Ms.class]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("state")}},[(Cd=n.value.mermaid)==null?void 0:Cd.state]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("pie")}},[(Yi=n.value.mermaid)==null?void 0:Yi.pie]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("relationship")}},[(jd=n.value.mermaid)==null?void 0:jd.relationship]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("journey")}},[(Bs=n.value.mermaid)==null?void 0:Bs.journey])]),key:"bar-mermaid"},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.mermaid},[g.createVNode(ve,{name:"mermaid"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.mermaid])])]}});case"katex":return g.createVNode(xa,{relative:`#${O}`,visible:s.katex,onChange:ye=>{s.katex=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.katex=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-katex`,onClick:()=>{u("katexInline")}},[(Hs=n.value.katex)==null?void 0:Hs.inline]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-katex`,onClick:()=>{u("katexBlock")}},[(Ad=n.value.katex)==null?void 0:Ad.block])]),key:"bar-katex"},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.katex},[g.createVNode(ve,{name:"formula"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.katex])])]}})}else if(e.defToolbars instanceof Array){const ye=e.defToolbars[$];return ye?g.cloneVNode(ye,{theme:i.value,previewTheme:r.value,language:o.value,insert(ur){B.emit(t,je,"universal",{generate:ur})}}):""}else if(e.defToolbars&&e.defToolbars.children instanceof Array){const ye=e.defToolbars.children[$];return ye?g.cloneVNode(ye,{theme:i.value,previewTheme:r.value,language:o.value,insert(ur){B.emit(t,je,"universal",{generate:ur})}}):""}else return""};return g.watch(()=>e.toolbars,()=>{g.nextTick(()=>{l.value&&iW(l.value)})},{immediate:!0}),()=>{const $=h.value[0].map(P=>b(P)),Q=h.value[1].map(P=>b(P));return g.createVNode(g.Fragment,null,[e.toolbars.length>0&&g.createVNode("div",{class:`${z}-toolbar-wrapper`,ref:l,id:O},[g.createVNode("div",{class:[`${z}-toolbar`,e.showToolbarName&&`${z}-stn`]},[g.createVNode("div",{class:`${z}-toolbar-left`,ref:f},[$]),g.createVNode("div",{class:`${z}-toolbar-right`},[Q])])]),g.createVNode("input",{ref:p,accept:"image/*",type:"file",multiple:!0,style:{display:"none"}},null),g.createVNode(RW,{linkVisible:c.linkVisible,clipVisible:c.clipVisible,type:c.type,onCancel:()=>{c.linkVisible=!1,c.clipVisible=!1},onOk:P=>{P&&u(c.type,{desc:P.desc,url:P.url,transform:c.type==="image"}),c.linkVisible=!1,c.clipVisible=!1}},null)])}}}),WW=`.${z}-preview > [data-line]`,oh=(e,t)=>+getComputedStyle(e).getPropertyValue(t).replace("px",""),qW=(e,t)=>{const n=Bd(()=>{e.removeEventListener("scroll",i),e.addEventListener("scroll",i),t.removeEventListener("scroll",i),t.addEventListener("scroll",i)},50),i=r=>{const o=e.clientHeight,a=t.clientHeight,O=e.scrollHeight,l=t.scrollHeight,s=(O-o)/(l-a);r.target===e?(t.removeEventListener("scroll",i),t.scrollTo({top:e.scrollTop/s}),n()):(e.removeEventListener("scroll",i),e.scrollTo({top:t.scrollTop*s}),n())};return[()=>{n().finally(()=>{e.dispatchEvent(new Event("scroll"))})},()=>{e.removeEventListener("scroll",i),t.removeEventListener("scroll",i)}]},ZW=(e,t,n)=>{const{view:i}=n,r=nW(),o=$=>i.lineBlockAt(i.state.doc.line($+1).from).top,a=$=>i.lineBlockAt(i.state.doc.line($+1).from).bottom;let O=[],l=[],s=[];const u=()=>{O=[],l=Array.from(t.querySelectorAll(WW)),s=l.map(S=>Number(S.dataset.line));const $=[...s],{lines:Q}=i.state.doc;let P=$.shift()||0,k=$.shift()||Q;for(let S=0;S<Q;S++)S===k&&(P=S,k=$.shift()||Q),O.push({start:P,end:k-1})},c=($,Q)=>{let P=0;for(let k=l.length-1;k-1>=0;k--){const S=l[k],R=l[k-1];if(S.offsetTop+S.offsetHeight>Q&&R.offsetTop<Q){P=Number(R.dataset.line);break}}for(let k=O.length-1;k>=0;k--){const S=a(O[k].end),R=o(O[k].start);if(S>$&&R<=$){P=P<O[k].start?P:O[k].start;break}}return P};let f=0,h=0;const p=()=>{var Y,N,F;if(h!==0)return!1;f++;const{scrollDOM:$,contentHeight:Q}=i;let P=oh(t,"padding-top");const k=i.lineBlockAtHeight($.scrollTop),{number:S}=i.state.doc.lineAt(k.from),R=O[S-1];if(!R)return!1;let w=1;const x=t.querySelector(`[data-line="${R.start}"]`)||((Y=t.firstElementChild)==null?void 0:Y.firstElementChild),v=t.querySelector(`[data-line="${R.end+1}"]`)||((N=t.lastElementChild)==null?void 0:N.lastElementChild),E=$.scrollHeight-$.clientHeight,Z=t.scrollHeight-t.clientHeight;let V=o(R.start),U=a(R.end),X=x.offsetTop,q=v.offsetTop-X;if(V===0&&(X=0,x===v?(P=0,U=Q-$.offsetHeight,q=Z):q=v.offsetTop),w=($.scrollTop-V+oh(i.contentDOM,"padding-bottom"))/(U-V),V>0&&(U>=E||v.offsetTop+v.clientHeight>Z)){const I=c(E,Z);V=o(I),w=($.scrollTop-V)/(E-V),X=(F=document.querySelector(`[data-line="${I}"]`))==null?void 0:F.offsetTop,q=Z-X+oh(t,"padding-top")}const W=X-P+q*w;r(t,W,()=>{f--})},m=()=>{var W,Y,N,F,I,L,ie;if(f!==0)return;h++;const{scrollDOM:$}=i,Q=t.scrollTop,P=t.scrollHeight,k=$.scrollHeight-$.clientHeight,S=t.scrollHeight-t.clientHeight;let R=(W=t.firstElementChild)==null?void 0:W.firstElementChild,w=(Y=t.firstElementChild)==null?void 0:Y.lastElementChild;if(s.length>0){let he=Math.ceil(s[s.length-1]*(Q/P)),Re=s.findLastIndex(G=>G<=he);Re=Re===-1?0:Re,he=s[Re];for(let G=Re;G>=0&&G<s.length;)if(l[G].offsetTop>Q){if(G-1>=0){G--;continue}he=-1,Re=G;break}else{if(G+1<s.length&&l[G+1].offsetTop<Q){G++;continue}he=s[G],Re=G;break}switch(Re){case-1:{R=(N=t.firstElementChild)==null?void 0:N.firstElementChild,w=l[Re];break}case s.length-1:{R=l[Re],w=(F=t.firstElementChild)==null?void 0:F.lastElementChild;break}default:R=l[Re],w=l[Re+1===l.length?Re:Re+1]}}let x=R===((I=t.firstElementChild)==null?void 0:I.firstElementChild)?0:R.offsetTop,v=w.offsetTop,E=0;const{start:Z,end:V}=O[Number(R.dataset.line||0)];let U=o(Z);const X=o(V+1===i.state.doc.lines?V:V+1);let q=0;if(X>k||w.offsetTop+w.offsetHeight>S){const he=c(k,S);x=(L=document.querySelector(`[data-line="${he}"]`))==null?void 0:L.offsetTop,U=o(he),E=(Q-x)/(S-x),q=k-U}else R===((ie=t.firstElementChild)==null?void 0:ie.firstElementChild)?(R===w&&(v=w.offsetTop+w.offsetHeight+ +getComputedStyle(w).marginBottom.replace("px","")),q=X,E=Math.max(Q/v,0)):(E=Math.max((Q-x)/(v-x),0),q=X-U);r(e,U+q*E,()=>{h--})},b=KQ($=>{var S;const{scrollDOM:Q,contentHeight:P}=i,k=Q.clientHeight;if(P<=k||t.firstElementChild.clientHeight<=t.clientHeight)return!1;if(i.state.doc.lines<((S=O[O.length-1])==null?void 0:S.end))return u(),!1;$.target===e?p():m()},1);return[()=>{u(),e.addEventListener("scroll",b),t.addEventListener("scroll",b),e.dispatchEvent(new Event("scroll"))},()=>{e.removeEventListener("scroll",b),t.removeEventListener("scroll",b)}]},UW=(e,t,n)=>{const i=g.inject("editorId");let r=()=>{},o=()=>{};const a=()=>{r();const O=document.querySelector(`#${i} .cm-scroller`),l=document.querySelector(`[id="${i}-preview-wrapper"]`),s=document.querySelector(`[id="${i}-html-wrapper"]`);(l||s)&&([o,r]=(l?ZW:qW)(O,l||s,n.value),e.scrollAuto&&o())};g.watch([t,g.toRef(e.setting,"preview"),g.toRef(e.setting,"htmlPreview"),g.toRef(e.setting,"fullscreen"),g.toRef(e.setting,"pageFullscreen")],()=>{g.nextTick(a)}),g.watch(()=>e.scrollAuto,O=>{O?o():r()}),g.watch(()=>e.setting.previewOnly,O=>{O?r():o()}),g.onMounted(a)};let Ve=class Bz{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=va(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Vi.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=va(this,t,n);let i=[];return this.decompose(t,n,i,0),Vi.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new IO(this),o=new IO(t);for(let a=n,O=n;;){if(r.next(a),o.next(a),a=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(O+=r.value.length,r.done||O>=i)return!0}}iter(t=1){return new IO(this,t)}iterRange(t,n=this.length){return new gb(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new $b(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Bz.empty:t.length<=32?new ht(t):Vi.from(ht.split(t,[]))}};class ht extends Ve{constructor(t,n=EW(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let o=0;;o++){let a=this.text[o],O=r+a.length;if((n?i:O)>=t)return new YW(r,O,i,a);r=O+1,i++}}decompose(t,n,i,r){let o=t<=0&&n>=this.length?this:new ht(mb(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),O=au(o.text,a.text.slice(),0,o.length);if(O.length<=32)i.push(new ht(O,a.length+o.length));else{let l=O.length>>1;i.push(new ht(O.slice(0,l)),new ht(O.slice(l)))}}else i.push(o)}replace(t,n,i){if(!(i instanceof ht))return super.replace(t,n,i);[t,n]=va(this,t,n);let r=au(this.text,au(i.text,mb(this.text,0,t)),n),o=this.length+i.length-(n-t);return r.length<=32?new ht(r,o):Vi.from(ht.split(r,[]),o)}sliceString(t,n=this.length,i=`
|
|
1
|
+
(function(pe,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],g):(pe=typeof globalThis<"u"?globalThis:pe||self,g(pe.MdEditorV3={},pe.Vue))})(this,function(pe,g){"use strict";var IOe=Object.defineProperty;var DOe=(pe,g,at)=>g in pe?IOe(pe,g,{enumerable:!0,configurable:!0,writable:!0,value:at}):pe[g]=at;var Xe=(pe,g,at)=>(DOe(pe,typeof g!="symbol"?g+"":g,at),at),LQ=(pe,g,at)=>{if(!g.has(pe))throw TypeError("Cannot "+at)};var T=(pe,g,at)=>(LQ(pe,g,"read from private field"),at?at.call(pe):g.get(pe)),Qe=(pe,g,at)=>{if(g.has(pe))throw TypeError("Cannot add the same private member more than once");g instanceof WeakSet?g.add(pe):g.set(pe,at)},fe=(pe,g,at,ka)=>(LQ(pe,g,"write to private field"),ka?ka.call(pe,at):g.set(pe,at),at);var Nd=(pe,g,at,ka)=>({set _(Md){fe(pe,g,Md,at)},get _(){return T(pe,g,ka)}}),le=(pe,g,at)=>(LQ(pe,g,"access private method"),at);var Iz,_O,Ti,En,_i,Ri,RO,_t,zi,Pt,Ke,ge,ln,Yn,Jt,Ut,Wi,Et,qi,Zi,Vn,Ui,yo,sn,Gs,MQ,pa,qr,Is,Cn,_d,Jz,ma,zO,Ds,Or,ko,lr,xo,Ns,BQ,ZOe,WO,Ld,qO,Fd,Le,et,Ls,HQ,ga,Js,ZO;function at(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const ka=e=>{const t=typeof e;return t!=="function"&&t!=="object"||e===null},Md=e=>{const t=e.flags===""?void 0:e.flags;return new RegExp(e.source,t)},GO=(e,t=new WeakMap)=>{if(e===null||ka(e))return e;if(t.has(e))return t.get(e);if(e instanceof RegExp)return Md(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof Function)return e;if(e instanceof Map){const i=new Map;return t.set(e,i),e.forEach((r,o)=>{i.set(o,GO(r,t))}),i}if(e instanceof Set){const i=new Set;t.set(e,i);for(const r of e)i.add(GO(r,t));return i}if(Array.isArray(e)){const i=[];return t.set(e,i),e.forEach(r=>{i.push(GO(r,t))}),i}const n={};t.set(e,n);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=GO(e[i],t));return n},Bd=(e,t=200)=>{let n=0;return(...i)=>new Promise(r=>{n&&(clearTimeout(n),r("cancel")),n=window.setTimeout(()=>{e.apply(void 0,i),n=0,r("done")},t)})},tW=(e,t={_blank:!0,nofollow:!0})=>{const n=document.createElement("a");n.href=e,t._blank&&(n.target="_blank"),t.nofollow&&(n.rel="noopener noreferrer"),n.click()},nW=()=>{let e=-1;return(t,n,i,r=100)=>{const o=()=>{i&&(typeof r=="number"?setTimeout(i,r):i())};e!==-1&&(cancelAnimationFrame(e),o());let a=t.scrollTop;const O=()=>{e=-1;const l=n-a;a=a+l/5,Math.abs(l)<1?(t.scrollTo(0,n),o()):(t.scrollTo(0,a),e=requestAnimationFrame(O))};e=requestAnimationFrame(O)}},KQ=(e,t=200)=>{let n=0,i=null;const r=o=>{n===0&&(n=o),o-n>=t?(e.apply(void 0,i),i=null,n=0):window.requestAnimationFrame(r)};return(...o)=>{i===null&&window.requestAnimationFrame(r),i=o}},iW=e=>{const t=n=>{const{scrollHeight:i,scrollWidth:r,offsetHeight:o,offsetWidth:a,scrollLeft:O,scrollTop:l}=e,s=n.x,u=n.y,c=h=>{const p=l+u-h.y,m=O+s-h.x,b=i-o,$=r-a,Q={};m>=0&&m<=$&&(Q.left=m),p>=0&&p<=b&&(Q.top=p),e.scroll(Q)};document.addEventListener("mousemove",c);const f=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},Hd=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,JQ=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Kd=(e,t)=>{for(const n in t)JQ(t[n])&&JQ(e[n])?e[n]=Kd(e[n],t[n]):e[n]=t[n];return e},z="md-editor",eb="https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.js",tb="https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.css",Me="https://cdnjs.cloudflare.com/ajax/libs",rW=`${Me}/highlight.js/11.8.0/highlight.min.js`,nb={main:`${Me}/prettier/2.8.0/standalone.js`,markdown:`${Me}/prettier/2.8.0/parser-markdown.js`},oW={css:`${Me}/cropperjs/1.5.13/cropper.min.css`,js:`${Me}/cropperjs/1.5.13/cropper.min.js`},aW=`${Me}/screenfull.js/5.2.0/screenfull.min.js`,Jd=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","mermaid","katex","-","revoke","next","save","=","prettier","pageFullscreen","fullscreen","preview","previewOnly","htmlPreview","catalog","github"],eh=["markdownTotal","=","scrollSwitch"],eu={"zh-CN":{toolbarTips:{bold:"加粗",underline:"下划线",italic:"斜体",strikeThrough:"删除线",title:"标题",sub:"下标",sup:"上标",quote:"引用",unorderedList:"无序列表",orderedList:"有序列表",task:"任务列表",codeRow:"行内代码",code:"块级代码",link:"链接",image:"图片",table:"表格",mermaid:"mermaid图",katex:"katex公式",revoke:"后退",next:"前进",save:"保存",prettier:"美化",pageFullscreen:"浏览器全屏",fullscreen:"屏幕全屏",preview:"预览",previewOnly:"仅预览",htmlPreview:"html代码预览",catalog:"目录",github:"源码地址"},titleItem:{h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题"},imgTitleItem:{link:"添加链接",upload:"上传图片",clip2upload:"裁剪上传"},linkModalTips:{linkTitle:"添加链接",imageTitle:"添加图片",descLabel:"链接描述:",descLabelPlaceHolder:"请输入描述...",urlLabel:"链接地址:",urlLabelPlaceHolder:"请输入链接...",buttonOK:"确定"},clipModalTips:{title:"裁剪图片上传",buttonUpload:"上传"},copyCode:{text:"复制代码",successTips:"已复制!",failTips:"复制失败!"},mermaid:{flow:"流程图",sequence:"时序图",gantt:"甘特图",class:"类图",state:"状态图",pie:"饼图",relationship:"关系图",journey:"旅程图"},katex:{inline:"行内公式",block:"块级公式"},footer:{markdownTotal:"字数",scrollAuto:"同步滚动"}},"en-US":{toolbarTips:{bold:"bold",underline:"underline",italic:"italic",strikeThrough:"strikeThrough",title:"title",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"unordered list",orderedList:"ordered list",task:"task list",codeRow:"inline code",code:"block-level code",link:"link",image:"image",table:"table",mermaid:"mermaid",katex:"formula",revoke:"revoke",next:"undo revoke",save:"save",prettier:"prettier",pageFullscreen:"fullscreen in page",fullscreen:"fullscreen",preview:"preview",previewOnly:"preview only",htmlPreview:"html preview",catalog:"catalog",github:"source code"},titleItem:{h1:"Lv1 Heading",h2:"Lv2 Heading",h3:"Lv3 Heading",h4:"Lv4 Heading",h5:"Lv5 Heading",h6:"Lv6 Heading"},imgTitleItem:{link:"Add Img Link",upload:"Upload Img",clip2upload:"Clip Upload"},linkModalTips:{linkTitle:"Add Link",imageTitle:"Add Image",descLabel:"Desc:",descLabelPlaceHolder:"Enter a description...",urlLabel:"Link:",urlLabelPlaceHolder:"Enter a link...",buttonOK:"OK"},clipModalTips:{title:"Crop Image",buttonUpload:"Upload"},copyCode:{text:"Copy",successTips:"Copied!",failTips:"Copy failed!"},mermaid:{flow:"flow",sequence:"sequence",gantt:"gantt",class:"class",state:"state",pie:"pie",relationship:"relationship",journey:"journey"},katex:{inline:"inline",block:"block"},footer:{markdownTotal:"Character Count",scrollAuto:"Scroll Auto"}}},OW=`${Me}/mermaid/10.6.1/mermaid.esm.min.mjs`,lW={js:`${Me}/KaTeX/0.16.9/katex.min.js`,css:`${Me}/KaTeX/0.16.9/katex.min.css`},th={a11y:{light:`${Me}/highlight.js/11.8.0/styles/a11y-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/a11y-dark.min.css`},atom:{light:`${Me}/highlight.js/11.8.0/styles/atom-one-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/atom-one-dark.min.css`},github:{light:`${Me}/highlight.js/11.8.0/styles/github.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/github-dark.min.css`},gradient:{light:`${Me}/highlight.js/11.8.0/styles/gradient-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/gradient-dark.min.css`},kimbie:{light:`${Me}/highlight.js/11.8.0/styles/kimbie-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/kimbie-dark.min.css`},paraiso:{light:`${Me}/highlight.js/11.8.0/styles/paraiso-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/paraiso-dark.min.css`},qtcreator:{light:`${Me}/highlight.js/11.8.0/styles/qtcreator-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${Me}/highlight.js/11.8.0/styles/stackoverflow-light.min.css`,dark:`${Me}/highlight.js/11.8.0/styles/stackoverflow-dark.min.css`}},sW={highlight:{js:{integrity:"sha384-g4mRvs7AO0/Ol5LxcGyz4Doe21pVhGNnC3EQw5shw+z+aXDN86HqUdwXWO+Gz2zI",crossOrigin:"anonymous"},css:{a11y:{light:{integrity:"sha384-qdZDAN3jffvh670RHw1wxLekabidEFaNRninYgIzBvMbL6WlHdXeHS/Bt+vx33lN",crossOrigin:"anonymous"},dark:{integrity:"sha384-2QAAjX8pqaM5azX68KWI2wExF6Q13kY4kEiQFY4b/1zPe6rpgmTByNpDEllH3sb+",crossOrigin:"anonymous"}},atom:{light:{integrity:"sha384-w6Ujm1VWa9HYFqGc89oAPn/DWDi2gUamjNrq9DRvEYm2X3ClItg9Y9xs1ViVo5b5",crossOrigin:"anonymous"},dark:{integrity:"sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07",crossOrigin:"anonymous"}},github:{light:{integrity:"sha384-eFTL69TLRZTkNfYZOLM+G04821K1qZao/4QLJbet1pP4tcF+fdXq/9CdqAbWRl/L",crossOrigin:"anonymous"},dark:{integrity:"sha384-wH75j6z1lH97ZOpMOInqhgKzFkAInZPPSPlZpYKYTOqsaizPvhQZmAtLcPKXpLyH",crossOrigin:"anonymous"}},gradient:{light:{integrity:"sha384-yErHBR8aEZPxRl3XmR8dGSRAclMlnSRRw8sXQLcmPWzWUvb56BzQmBw3EWHl7QGI",crossOrigin:"anonymous"},dark:{integrity:"sha384-lUCvtSOdvDbp5hLWKgwz/taFu1HxlpqES2OVP5UG2JMTfnU481gXcBhGF9lAGoSr",crossOrigin:"anonymous"}},kimbie:{light:{integrity:"sha384-tloeSLUPczAvoZ48TUz+OxRie0oYLCRwlkadUXovGzzJEIbNQB2TkfUuvJ6SW5Mi",crossOrigin:"anonymous"},dark:{integrity:"sha384-o5F1vUaMNOmou1sQrsWiFo4/QUGSV0svqNZW+EesmKxWC8MpFJcveBhAyfvTHbGb",crossOrigin:"anonymous"}},paraiso:{light:{integrity:"sha384-5j6QHU2Hwg1ehtlIQNDebhETDB8bga3/88hzBFsMRaGmgQHCftqIN7GZNDNw0vTL",crossOrigin:"anonymous"},dark:{integrity:"sha384-I5vnnMQu0LWDQnHpT61xyoMwKarAB8jpZkB2ioFOlmzUFnIFaV4QbUwlBBOMKhTH",crossOrigin:"anonymous"}},qtcreator:{light:{integrity:"sha384-iEBgHrwi8Hv4dSZBz+MOGvS05rF7I7fGKM2fASQyE9jn2Istg9Qd5dSoK18WyRTB",crossOrigin:"anonymous"},dark:{integrity:"sha384-D6LXJGWNR4QV7gnpuP3ccbvOYoR02td3cU0y7lESABPg/tzCSC4m+y+M2TtrmpHc",crossOrigin:"anonymous"}},stackoverflow:{light:{integrity:"sha384-FMwt7cTGo4aLxZnno5k0xTj0W4gmi48Kwept+y/oQmE6cFk36Kr+QJZOKNOQwORe",crossOrigin:"anonymous"},dark:{integrity:"sha384-iL+x+BroCyHm/p2c6sMA9umXhdCWp2cKe4QUjPeMzHgwXAk+ZxHyIGP3NZTZensU",crossOrigin:"anonymous"}}}},prettier:{standaloneJs:{integrity:"sha384-cBKW1A8TbwohtSsrm+VWpXevI1PWdPmUrozwqTw7aS51JIhz9IvgHHa/bV6icWeL",crossOrigin:"anonymous"},parserMarkdownJs:{integrity:"sha384-kXeeC2HiA6n3rpvz0MOjB7yZo9QjvYNAMihonwR5fdTOFs/rm/Bm3Xg8cOSE4900",crossOrigin:"anonymous"}},cropper:{js:{integrity:"sha384-r+ljwOAhwY4/kdyzMnuBg7MEVoWpTMp5EYUDntB/E9qzNwL9dAEcNrb2XaV+mJc2",crossOrigin:"anonymous"},css:{integrity:"sha384-oMy41mb/qJnpJlpXOF57hSu2KGi47l/UV9+tPNrBOs7/ap5Vubj/3phrCtjutHMQ",crossOrigin:"anonymous"}},iconfont:{integrity:"sha384-HRrf1e8/EiqrIZQftejl7pMTeuLeYczOz7rolAGxgw86N7UjiXkex67Uf2XTZz5z",crossOrigin:"anonymous"},iconfontClass:{integrity:"sha384-81pjilF/gLoQvAfd8madmeylVdv8IagPQaq1C/OZbysLav7k9g+Ir3XD5qK00Q5r",crossOrigin:"anonymous"},screenfull:{js:{integrity:"sha384-ELVAm9p9T4LGCG4lz8hbYalUYAppIpI1zV8IXYDCBUJFiVnV+EeG8vGSYQi+Wi4S",crossOrigin:"anonymous"}},mermaid:{js:{integrity:"sha384-zmipzuFBFDAekHS2uY4mN5cvpcSvgUi3aMjMJ2xnVRsU2kDHBtqLOJRnianHJeP1",crossOrigin:"anonymous"}},katex:{js:{integrity:"sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8",crossOrigin:"anonymous"},css:{integrity:"sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV",crossOrigin:"anonymous"}}},dt={editorExtensions:{highlight:{js:rW,css:th},prettier:{standaloneJs:nb.main,parserMarkdownJs:nb.markdown},cropper:{...oW},iconfont:eb,iconfontClass:tb,screenfull:{js:aW},mermaid:{js:OW},katex:{...lW}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:(e,t)=>t,markdownItConfig:()=>{},markdownItPlugins:e=>e,iconfontType:"svg",mermaidConfig:e=>e},uW=e=>Kd(dt,e),tu=170,cW=g.defineComponent({setup(){return()=>g.createVNode("div",{class:`${z}-divider`},null)}}),Gn=({instance:e,ctx:t,props:n={}},i="default")=>{const r=(e==null?void 0:e.$slots[i])||(t==null?void 0:t.slots[i]);return(r?r(e):"")||n[i]},fW={overlay:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},relative:{type:String,default:"html"}},xa=g.defineComponent({props:fW,setup(e,t){const n=`${z}-dropdown-hidden`,i=g.reactive({overlayClass:[n],overlayStyle:{},triggerHover:!1,overlayHover:!1}),r=g.ref(),o=g.ref(),a=()=>{var k,S;i.triggerHover=!0;const u=r.value,c=o.value;if(!u||!c)return;const f=u.getBoundingClientRect(),h=u.offsetTop,p=u.offsetLeft,m=f.height,b=f.width,$=((k=document.querySelector(e.relative))==null?void 0:k.scrollLeft)||0,Q=((S=document.querySelector(e.relative))==null?void 0:S.clientWidth)||0;let P=p-c.offsetWidth/2+b/2-$;P+c.offsetWidth>$+Q&&(P=$+Q-c.offsetWidth),P<0&&(P=0),i.overlayStyle={...i.overlayStyle,top:h+m+"px",left:P+"px"},e.onChange(!0)},O=()=>{i.overlayHover=!0};g.watch(()=>e.visible,u=>{u?i.overlayClass=i.overlayClass.filter(c=>c!==n):i.overlayClass.push(n)});let l=-1;const s=u=>{r.value===u.target?i.triggerHover=!1:i.overlayHover=!1,clearTimeout(l),l=window.setTimeout(()=>{!i.overlayHover&&!i.triggerHover&&e.onChange(!1)},10)};return g.onMounted(()=>{r.value.addEventListener("mouseenter",a),r.value.addEventListener("mouseleave",s),o.value.addEventListener("mouseenter",O),o.value.addEventListener("mouseleave",s)}),g.onBeforeUnmount(()=>{r.value.removeEventListener("mouseenter",a),r.value.removeEventListener("mouseleave",s),o.value.removeEventListener("mouseenter",O),o.value.removeEventListener("mouseleave",s)}),()=>{const u=Gn({ctx:t}),c=Gn({props:e,ctx:t},"overlay"),f=g.cloneVNode(u instanceof Array?u[0]:u,{ref:r,key:"cloned-dropdown-trigger"}),h=g.createVNode("div",{class:[`${z}-dropdown`,i.overlayClass],style:i.overlayStyle,ref:o},[g.createVNode("div",{class:`${z}-dropdown-overlay`},[c instanceof Array?c[0]:c])]);return[f,h]}}});class dW{constructor(){Xe(this,"pools",{})}remove(t,n,i){const o=this.pools[t]&&this.pools[t][n];o&&(this.pools[t][n]=o.filter(a=>a!==i))}clear(t){this.pools[t]={}}on(t,n){return this.pools[t]||(this.pools[t]={}),this.pools[t][n.name]||(this.pools[t][n.name]=[]),this.pools[t][n.name].push(n.callback),this.pools[t][n.name].includes(n.callback)}emit(t,n,...i){this.pools[t]||(this.pools[t]={});const o=this.pools[t][n];o&&o.forEach(a=>{try{a(...i)}catch(O){console.error(`${n} monitor event exception!`,O)}})}}const B=new dW,hW={noPrettier:{type:Boolean},toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]},setting:{type:Object,default:()=>({})},screenfull:{type:Object,default:null},screenfullJs:{type:String,default:""},updateSetting:{type:Function,default:()=>{}},tableShape:{type:Array,default:()=>[6,4]},defToolbars:{type:Object},noUploadImg:{type:Boolean},showToolbarName:{type:Boolean}},nu="onSave",nh="changeCatalogVisible",ib="changeFullscreen",rb="pageFullscreenChanged",ob="fullscreenChanged",ab="previewChanged",Ob="previewOnlyChanged",lb="htmlPreviewChanged",sb="catalogVisibleChanged",iu="buildFinished",vo="errorCatcher",je="replace",ru="uploadImage",ih="openModals",ub="ctrlZ",cb="ctrlShiftZ",ou="catalogChanged",fb="pushCatalog",rh="rerender",db="eventListener",hb=(e,t)=>{const n=i=>{const r=e.parentElement||document.body,o=r.offsetWidth,a=r.offsetHeight,{clientWidth:O,clientHeight:l}=document.documentElement,s=i.offsetX,u=i.offsetY,c=h=>{let p=h.x+document.body.scrollLeft-document.body.clientLeft-s,m=h.y+document.body.scrollTop-document.body.clientTop-u;p=p<1?1:p<O-o-1?p:O-o-1,m=m<1?1:m<l-a-1?m:l-a-1,t?t(p,m):(r.style.left=`${p}px`,r.style.top=`${m}px`)};document.addEventListener("mousemove",c);const f=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}},un=(e,t,n="")=>{var r;const i=document.getElementById(t.id);if(i)n!==""&&(Reflect.get(window,n)?(r=t.onload)==null||r.call(i,new Event("load")):t.onload&&i.addEventListener("load",t.onload));else{const o={...t};o.onload=null;const a=mW(e,o);t.onload&&a.addEventListener("load",t.onload),document.head.appendChild(a)}},pW=(e,t)=>{const n=document.getElementById(t.id);n==null||n.remove(),un(e,t)},mW=(e,t)=>{const n=document.createElement(e);return Object.keys(t).forEach(i=>{t[i]!==void 0&&(n[i]=t[i])}),n},gW=e=>{const t=g.inject("editorId"),{editorExtensions:n,editorExtensionsAttrs:i}=dt;let r=n.screenfull.instance;const o=g.ref(!1),a=s=>{if(!r){B.emit(t,vo,{name:"fullscreen",message:"fullscreen is undefined"});return}r.isEnabled?(o.value=!0,(s===void 0?!r.isFullscreen:s)?r.request():r.exit()):console.error("browser does not support screenfull!")},O=()=>{r&&r.isEnabled&&r.on("change",()=>{(o.value||e.setting.fullscreen)&&(o.value=!1,e.updateSetting("fullscreen"))})},l=()=>{r=window.screenfull,O()};return g.onMounted(()=>{var s;O(),r||un("script",{...(s=i.screenfull)==null?void 0:s.js,src:n.screenfull.js,id:`${z}-screenfull`,onload:l},"screenfull")}),g.onMounted(()=>{B.on(t,{name:ib,callback:a})}),{fullscreenHandler:a}},$W={tableShape:{type:Array,default:()=>[6,4]},onSelected:{type:Function,default:()=>{}}},QW=g.defineComponent({name:"TableShape",props:$W,setup(e){const t=g.reactive({x:-1,y:-1}),n=()=>{const r=[...e.tableShape];return(!r[2]||r[2]<r[0])&&(r[2]=r[0]),(!r[3]||r[3]<r[3])&&(r[3]=r[1]),r},i=g.ref(n());return g.watch(()=>e.tableShape,()=>{i.value=n()}),()=>g.createVNode("div",{class:`${z}-table-shape`,onMouseleave:()=>{i.value=n(),t.x=-1,t.y=-1}},[new Array(i.value[1]).fill("").map((r,o)=>g.createVNode("div",{class:`${z}-table-shape-row`,key:`table-shape-row-${o}`},[new Array(i.value[0]).fill("").map((a,O)=>g.createVNode("div",{class:`${z}-table-shape-col`,key:`table-shape-col-${O}`,onMouseenter:()=>{t.x=o,t.y=O,O+1===i.value[0]&&O+1<i.value[2]?i.value[0]++:O+2<i.value[0]&&i.value[0]>e.tableShape[0]&&i.value[0]--,o+1===i.value[1]&&o+1<i.value[3]?i.value[1]++:o+2<i.value[1]&&i.value[1]>e.tableShape[1]&&i.value[1]--},onClick:()=>{e.onSelected(t)}},[g.createVNode("div",{class:[`${z}-table-shape-col-default`,o<=t.x&&O<=t.y&&`${z}-table-shape-col-include`]},null)]))]))])}}),bW=g.defineComponent({props:{name:{type:String,default:""}},setup(e){return()=>dt.iconfontType==="svg"?g.createVNode("svg",{class:`${z}-icon`,"aria-hidden":"true"},[g.createVNode("use",{"xlink:href":`#${z}-icon-${e.name}`},null)]):g.createVNode("i",{class:`${z}-iconfont ${z}-icon-${e.name}`},null)}}),ve=g.defineComponent({props:{name:{type:String,default:""}},setup(e){const t=g.inject("customIcon");return()=>{const n=t.value[e.name];return typeof n=="object"?typeof n.component=="object"?g.h(n.component,n.props):g.createVNode("span",{innerHTML:n.component},null):g.createVNode(bW,{name:e.name},null)}}}),yW=(e,t="image.png")=>{const n=e.split(","),i=n[0].match(/:(.*?);/);if(i){const r=i[1],o=atob(n[1]);let a=o.length;const O=new Uint8Array(a);for(;a--;)O[a]=o.charCodeAt(a);return new File([O],t,{type:r})}return null},SW=e=>{if(!e)return e;const t=e.split(`
|
|
2
|
+
`),n=['<span rn-wrapper aria-hidden="true">'];return t.forEach(()=>{n.push("<span></span>")}),n.push("</span>"),`<span class="${z}-code-block">${e}</span>${n.join("")}`},PW=(e,t)=>{if(!e||!t)return 0;const n=e==null?void 0:e.getBoundingClientRect();if(t===document.documentElement)return n.top-t.clientTop;const i=t==null?void 0:t.getBoundingClientRect();return n.top-i.top},kW=(()=>{let e=0;return t=>t+ ++e})(),pb=(()=>{let e=0;return()=>++e})(),xW={title:{type:String,default:""},visible:{type:Boolean,default:!1},width:{type:String,default:"auto"},height:{type:String,default:"auto"},onClose:{type:Function},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:()=>{}},class:{type:String},style:{type:[Object,String],default:()=>({})},showMask:{type:Boolean,default:!0}},wo=g.defineComponent({name:"MdModal",props:xW,emits:["onClose"],setup(e,t){const n=g.inject("theme"),i=g.ref(e.visible),r=g.ref([`${z}-modal`]),o=g.ref(),a=g.ref(),O=g.ref(),l=g.shallowRef();let s=()=>{};const u=g.reactive({maskStyle:{zIndex:-1},modalStyle:{zIndex:-1},initPos:{left:"0px",top:"0px"},historyPos:{left:"0px",top:"0px"}}),c=g.computed(()=>e.isFullscreen?{width:"100%",height:"100%"}:{width:e.width,height:e.height});g.watch(()=>e.isFullscreen,p=>{p?s():g.nextTick(()=>{s=hb(a.value,(m,b)=>{u.initPos.left=m+"px",u.initPos.top=b+"px"})})}),g.watch(()=>e.visible,p=>{p?(u.maskStyle.zIndex=dt.editorConfig.zIndex+pb(),u.modalStyle.zIndex=dt.editorConfig.zIndex+pb(),r.value.push("zoom-in"),i.value=p,g.nextTick(()=>{const m=o.value.offsetWidth/2,b=o.value.offsetHeight/2,$=document.documentElement.clientWidth/2,Q=document.documentElement.clientHeight/2;u.initPos.left=$-m+"px",u.initPos.top=Q-b+"px",e.isFullscreen||(s=hb(a.value,(P,k)=>{u.initPos.left=P+"px",u.initPos.top=k+"px"}))}),setTimeout(()=>{r.value=r.value.filter(m=>m!=="zoom-in")},140)):(r.value.push("zoom-out"),s(),setTimeout(()=>{r.value=r.value.filter(m=>m!=="zoom-out"),i.value=p},130))});const f=g.computed(()=>({display:i.value?"block":"none"})),h=g.computed(()=>typeof e.style=="string"?[e.style,f.value].join("; "):e.style instanceof Object?{...f.value,...e.style}:f.value);return g.onMounted(()=>{O.value=document.body}),()=>{const p=Gn({ctx:t}),m=Gn({props:e,ctx:t},"title");return O.value?g.createVNode(g.Teleport,{to:O.value},{default:()=>[g.createVNode("div",{ref:l,class:`${z}-modal-container`,"data-theme":n.value},[g.createVNode("div",{class:e.class,style:h.value},[e.showMask&&g.createVNode("div",{class:`${z}-modal-mask`,style:u.maskStyle,onClick:()=>{e.onClose?e.onClose():t.emit("onClose")}},null),g.createVNode("div",{class:r.value,style:{...u.modalStyle,...u.initPos,...c.value},ref:o},[g.createVNode("div",{class:`${z}-modal-header`,ref:a},[m||""]),g.createVNode("div",{class:`${z}-modal-body`},[p]),g.createVNode("div",{class:`${z}-modal-func`},[e.showAdjust&&g.createVNode("div",{class:`${z}-modal-adjust`,onClick:b=>{b.stopPropagation(),e.isFullscreen?u.initPos=u.historyPos:(u.historyPos=u.initPos,u.initPos={left:"0",top:"0"}),e.onAdjust(!e.isFullscreen)}},[g.createVNode(ve,{name:e.isFullscreen?"suoxiao":"fangda"},null)]),g.createVNode("div",{class:`${z}-modal-close`,onClick:b=>{b.stopPropagation(),e.onClose?e.onClose():t.emit("onClose")}},[g.createVNode(ve,{name:"close"},null)])])])])])]}):""}}});wo.install=e=>(e.component(wo.name,wo),e);const vW={type:{type:String,default:"link"},visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},wW=g.defineComponent({props:vW,setup(e){const t=g.inject("usedLanguageText"),n=g.inject("editorId"),i=g.computed(()=>{var o,a;switch(e.type){case"link":return(o=t.value.linkModalTips)==null?void 0:o.linkTitle;case"image":return(a=t.value.linkModalTips)==null?void 0:a.imageTitle;default:return""}}),r=g.reactive({desc:"",url:""});return g.watch(()=>e.visible,o=>{o||setTimeout(()=>{r.desc="",r.url=""},200)}),()=>g.createVNode(wo,{title:i.value,visible:e.visible,onClose:e.onCancel},{default:()=>{var o,a,O,l,s;return[g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("label",{class:`${z}-label`,for:`link-desc-${n}`},[(o=t.value.linkModalTips)==null?void 0:o.descLabel]),g.createVNode("input",{placeholder:(a=t.value.linkModalTips)==null?void 0:a.descLabelPlaceHolder,class:`${z}-input`,id:`link-desc-${n}`,type:"text",value:r.desc,onChange:u=>{r.desc=u.target.value},autocomplete:"off"},null)]),g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("label",{class:`${z}-label`,for:`link-url-${n}`},[(O=t.value.linkModalTips)==null?void 0:O.urlLabel]),g.createVNode("input",{placeholder:(l=t.value.linkModalTips)==null?void 0:l.urlLabelPlaceHolder,class:`${z}-input`,id:`link-url-${n}`,type:"text",value:r.url,onChange:u=>{r.url=u.target.value},autocomplete:"off"},null)]),g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("button",{class:[`${z}-btn`,`${z}-btn-row`],type:"button",onClick:()=>{e.onOk(r),r.desc="",r.url=""}},[(s=t.value.linkModalTips)==null?void 0:s.buttonOK])])]}})}}),XW={visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},TW=g.defineComponent({props:XW,setup(e){const t=g.inject("usedLanguageText"),n=g.inject("editorId");let i=dt.editorExtensions.cropper.instance;const r=g.ref(),o=g.ref(),a=g.ref(),O=g.reactive({cropperInited:!1,imgSelected:!1,imgSrc:"",isFullscreen:!1});let l=null;g.watch(()=>e.visible,()=>{e.visible&&!O.cropperInited&&(i=i||window.Cropper,r.value.onchange=()=>{if(!i){B.emit(n,vo,{name:"Cropper",message:"Cropper is undefined"});return}const u=r.value.files||[];if(O.imgSelected=!0,(u==null?void 0:u.length)>0){const c=new FileReader;c.onload=f=>{O.imgSrc=f.target.result,g.nextTick(()=>{l=new i(o.value,{viewMode:2,preview:`.${z}-clip-preview-target`})})},c.readAsDataURL(u[0])}})}),g.watch(()=>[O.imgSelected],()=>{a.value.style=""}),g.watch(()=>O.isFullscreen,()=>{g.nextTick(()=>{l==null||l.destroy(),a.value.style="",o.value&&(l=new i(o.value,{viewMode:2,preview:`.${z}-clip-preview-target`}))})});const s=()=>{l.clear(),l.destroy(),l=null,r.value.value="",O.imgSelected=!1};return()=>{var u;return g.createVNode(wo,{class:`${z}-modal-clip`,title:(u=t.value.clipModalTips)==null?void 0:u.title,visible:e.visible,onClose:e.onCancel,showAdjust:!0,isFullscreen:O.isFullscreen,onAdjust:c=>{O.isFullscreen=c},width:"668px",height:"421px"},{default:()=>{var c,f;return[g.createVNode("div",{class:`${z}-form-item ${z}-clip`},[g.createVNode("div",{class:`${z}-clip-main`},[O.imgSelected?g.createVNode("div",{class:`${z}-clip-cropper`},[g.createVNode("img",{src:O.imgSrc,ref:o,style:{display:"none"},alt:""},null),g.createVNode("div",{class:`${z}-clip-delete`,onClick:s},[g.createVNode(ve,{name:"delete"},null)])]):g.createVNode("div",{class:`${z}-clip-upload`,onClick:()=>{r.value.click()}},[g.createVNode(ve,{name:"upload"},null)])]),g.createVNode("div",{class:`${z}-clip-preview`},[g.createVNode("div",{class:`${z}-clip-preview-target`,ref:a},null)])]),g.createVNode("div",{class:`${z}-form-item`},[g.createVNode("button",{class:`${z}-btn`,type:"button",onClick:()=>{if(l){const h=l.getCroppedCanvas();B.emit(n,ru,[yW(h.toDataURL("image/png"))],e.onOk),s()}}},[((c=t.value.clipModalTips)==null?void 0:c.buttonUpload)||((f=t.value.linkModalTips)==null?void 0:f.buttonOK)])]),g.createVNode("input",{ref:r,accept:"image/*",type:"file",multiple:!1,style:{display:"none"}},null)]}})}}}),_W={type:{type:String,default:"link"},linkVisible:{type:Boolean,default:!1},clipVisible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},RW=g.defineComponent({props:_W,setup(e){return()=>g.createVNode(g.Fragment,null,[g.createVNode(wW,{type:e.type,visible:e.linkVisible,onOk:e.onOk,onCancel:e.onCancel},null),g.createVNode(TW,{visible:e.clipVisible,onOk:e.onOk,onCancel:e.onCancel},null)])}}),zW=g.defineComponent({name:"MDEditorToolbar",props:hW,setup(e){const t=g.inject("editorId"),n=g.inject("usedLanguageText"),i=g.inject("theme"),r=g.inject("previewTheme"),o=g.inject("language"),{fullscreenHandler:a}=gW(e),O=`${t}-toolbar-wrapper`,l=g.ref(),s=g.reactive({title:!1,catalog:!1,image:!1,table:!1,mermaid:!1,katex:!1}),u=($,Q)=>{B.emit(t,je,$,Q)},c=g.reactive({type:"link",linkVisible:!1,clipVisible:!1}),f=g.ref();g.onMounted(()=>{B.on(t,{name:ih,callback($){c.type=$,c.linkVisible=!0}})});const h=g.computed(()=>{const $=e.toolbars.filter(S=>!e.toolbarsExclude.includes(S)),Q=$.indexOf("="),P=Q===-1?$:$.slice(0,Q+1),k=Q===-1?[]:$.slice(Q,Number.MAX_SAFE_INTEGER);return[P,k]}),p=g.ref(),m=()=>{B.emit(t,ru,Array.from(p.value.files||[])),p.value.value=""};g.onMounted(()=>{p.value.addEventListener("change",m)});const b=$=>{var Q,P,k,S,R,w,x,v,E,Z,V,U,X,q,W,Y,N,F,I,L,ie,he,Re,G,Oe,ze,Ge,kt,ui,jn,Ei,UO,$a,Zr,EO,YO,Qa,Rd,zd,ba,Wd,sr,xt,So,ya,Ur,qd,Fs,Zd,Ye,Ud,VO,Po,CO,Ed,jO,ci,Yd,Sa,Vd,AO,yn,Ms,Cd,Yi,jd,Bs,Hs,Ad;if(Jd.includes($))switch($){case"-":return g.createVNode(cW,null,null);case"bold":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Q=n.value.toolbarTips)==null?void 0:Q.bold,onClick:()=>{u("bold")}},[g.createVNode(ve,{name:"bold"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(P=n.value.toolbarTips)==null?void 0:P.bold])]);case"underline":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(k=n.value.toolbarTips)==null?void 0:k.underline,onClick:()=>{u("underline")}},[g.createVNode(ve,{name:"underline"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(S=n.value.toolbarTips)==null?void 0:S.underline])]);case"italic":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(R=n.value.toolbarTips)==null?void 0:R.italic,onClick:()=>{u("italic")}},[g.createVNode(ve,{name:"italic"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(w=n.value.toolbarTips)==null?void 0:w.italic])]);case"strikeThrough":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(x=n.value.toolbarTips)==null?void 0:x.strikeThrough,onClick:()=>{u("strikeThrough")}},[g.createVNode(ve,{name:"strike-through"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(v=n.value.toolbarTips)==null?void 0:v.strikeThrough])]);case"title":return g.createVNode(xa,{relative:`#${O}`,visible:s.title,onChange:ye=>{s.title=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.title=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h1")}},[(E=n.value.titleItem)==null?void 0:E.h1]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h2")}},[(Z=n.value.titleItem)==null?void 0:Z.h2]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h3")}},[(V=n.value.titleItem)==null?void 0:V.h3]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h4")}},[(U=n.value.titleItem)==null?void 0:U.h4]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h5")}},[(X=n.value.titleItem)==null?void 0:X.h5]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-title`,onClick:()=>{u("h6")}},[(q=n.value.titleItem)==null?void 0:q.h6])])},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.title},[g.createVNode(ve,{name:"title"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.title])])]}});case"sub":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(W=n.value.toolbarTips)==null?void 0:W.sub,onClick:()=>{u("sub")}},[g.createVNode(ve,{name:"sub"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Y=n.value.toolbarTips)==null?void 0:Y.sub])]);case"sup":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(N=n.value.toolbarTips)==null?void 0:N.sup,onClick:()=>{u("sup")}},[g.createVNode(ve,{name:"sup"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(F=n.value.toolbarTips)==null?void 0:F.sup])]);case"quote":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(I=n.value.toolbarTips)==null?void 0:I.quote,onClick:()=>{u("quote")}},[g.createVNode(ve,{name:"quote"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(L=n.value.toolbarTips)==null?void 0:L.quote])]);case"unorderedList":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(ie=n.value.toolbarTips)==null?void 0:ie.unorderedList,onClick:()=>{u("unorderedList")}},[g.createVNode(ve,{name:"unordered-list"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(he=n.value.toolbarTips)==null?void 0:he.unorderedList])]);case"orderedList":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Re=n.value.toolbarTips)==null?void 0:Re.orderedList,onClick:()=>{u("orderedList")}},[g.createVNode(ve,{name:"ordered-list"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(G=n.value.toolbarTips)==null?void 0:G.orderedList])]);case"task":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Oe=n.value.toolbarTips)==null?void 0:Oe.task,onClick:()=>{u("task")}},[g.createVNode(ve,{name:"task"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(ze=n.value.toolbarTips)==null?void 0:ze.task])]);case"codeRow":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ge=n.value.toolbarTips)==null?void 0:Ge.codeRow,onClick:()=>{u("codeRow")}},[g.createVNode(ve,{name:"code-row"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(kt=n.value.toolbarTips)==null?void 0:kt.codeRow])]);case"code":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(ui=n.value.toolbarTips)==null?void 0:ui.code,onClick:()=>{u("code")}},[g.createVNode(ve,{name:"code"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(jn=n.value.toolbarTips)==null?void 0:jn.code])]);case"link":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ei=n.value.toolbarTips)==null?void 0:Ei.link,onClick:()=>{c.type="link",c.linkVisible=!0}},[g.createVNode(ve,{name:"link"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(UO=n.value.toolbarTips)==null?void 0:UO.link])]);case"image":return e.noUploadImg?g.createVNode("div",{class:`${z}-toolbar-item`,title:($a=n.value.toolbarTips)==null?void 0:$a.image,onClick:()=>{c.type="image",c.linkVisible=!0}},[g.createVNode(ve,{name:"image"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Zr=n.value.toolbarTips)==null?void 0:Zr.image])]):g.createVNode(xa,{relative:`#${O}`,visible:s.image,onChange:ye=>{s.image=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.title=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-image`,onClick:()=>{c.type="image",c.linkVisible=!0}},[(EO=n.value.imgTitleItem)==null?void 0:EO.link]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-image`,onClick:()=>{p.value.click()}},[(YO=n.value.imgTitleItem)==null?void 0:YO.upload]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-image`,onClick:()=>{c.clipVisible=!0}},[(Qa=n.value.imgTitleItem)==null?void 0:Qa.clip2upload])])},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.image},[g.createVNode(ve,{name:"image"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.image])])]}});case"table":return g.createVNode(xa,{relative:`#${O}`,visible:s.table,onChange:ye=>{s.table=ye},key:"bar-table",overlay:g.createVNode(QW,{tableShape:e.tableShape,onSelected:ye=>{u("table",{selectedShape:ye})}},null)},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.table},[g.createVNode(ve,{name:"table"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.table])])]}});case"revoke":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Rd=n.value.toolbarTips)==null?void 0:Rd.revoke,onClick:()=>{B.emit(t,ub)}},[g.createVNode(ve,{name:"revoke"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(zd=n.value.toolbarTips)==null?void 0:zd.revoke])]);case"next":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(ba=n.value.toolbarTips)==null?void 0:ba.next,onClick:()=>{B.emit(t,cb)}},[g.createVNode(ve,{name:"next"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Wd=n.value.toolbarTips)==null?void 0:Wd.next])]);case"save":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(sr=n.value.toolbarTips)==null?void 0:sr.save,onClick:()=>{B.emit(t,nu)}},[g.createVNode(ve,{name:"baocun"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(xt=n.value.toolbarTips)==null?void 0:xt.save])]);case"prettier":return e.noPrettier?"":g.createVNode("div",{class:`${z}-toolbar-item`,title:(So=n.value.toolbarTips)==null?void 0:So.prettier,onClick:()=>{u("prettier")}},[g.createVNode(ve,{name:"prettier"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(ya=n.value.toolbarTips)==null?void 0:ya.prettier])]);case"pageFullscreen":return!e.setting.fullscreen&&g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ur=n.value.toolbarTips)==null?void 0:Ur.pageFullscreen,onClick:()=>{e.updateSetting("pageFullscreen")}},[g.createVNode(ve,{name:e.setting.pageFullscreen?"suoxiao":"fangda"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(qd=n.value.toolbarTips)==null?void 0:qd.pageFullscreen])]);case"fullscreen":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Fs=n.value.toolbarTips)==null?void 0:Fs.fullscreen,onClick:()=>{a()}},[g.createVNode(ve,{name:e.setting.fullscreen?"fullscreen-exit":"fullscreen"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Zd=n.value.toolbarTips)==null?void 0:Zd.fullscreen])]);case"preview":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Ye=n.value.toolbarTips)==null?void 0:Ye.preview,onClick:()=>{e.updateSetting("preview")}},[g.createVNode(ve,{name:"preview"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Ud=n.value.toolbarTips)==null?void 0:Ud.preview])]);case"previewOnly":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(VO=n.value.toolbarTips)==null?void 0:VO.previewOnly,onClick:()=>{e.updateSetting("previewOnly")}},[g.createVNode(ve,{name:"preview-only"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Po=n.value.toolbarTips)==null?void 0:Po.previewOnly])]);case"htmlPreview":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(CO=n.value.toolbarTips)==null?void 0:CO.htmlPreview,onClick:()=>{e.updateSetting("htmlPreview")}},[g.createVNode(ve,{name:"coding"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Ed=n.value.toolbarTips)==null?void 0:Ed.htmlPreview])]);case"catalog":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(jO=n.value.toolbarTips)==null?void 0:jO.catalog,onClick:()=>{B.emit(t,nh)},key:"bar-catalog"},[g.createVNode(ve,{name:"catalog"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(ci=n.value.toolbarTips)==null?void 0:ci.catalog])]);case"github":return g.createVNode("div",{class:`${z}-toolbar-item`,title:(Yd=n.value.toolbarTips)==null?void 0:Yd.github,onClick:()=>tW("https://github.com/imzbf/md-editor-v3")},[g.createVNode(ve,{name:"github"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Sa=n.value.toolbarTips)==null?void 0:Sa.github])]);case"mermaid":return g.createVNode(xa,{relative:`#${O}`,visible:s.mermaid,onChange:ye=>{s.mermaid=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.mermaid=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("flow")}},[(Vd=n.value.mermaid)==null?void 0:Vd.flow]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("sequence")}},[(AO=n.value.mermaid)==null?void 0:AO.sequence]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("gantt")}},[(yn=n.value.mermaid)==null?void 0:yn.gantt]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("class")}},[(Ms=n.value.mermaid)==null?void 0:Ms.class]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("state")}},[(Cd=n.value.mermaid)==null?void 0:Cd.state]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("pie")}},[(Yi=n.value.mermaid)==null?void 0:Yi.pie]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("relationship")}},[(jd=n.value.mermaid)==null?void 0:jd.relationship]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-mermaid`,onClick:()=>{u("journey")}},[(Bs=n.value.mermaid)==null?void 0:Bs.journey])]),key:"bar-mermaid"},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.mermaid},[g.createVNode(ve,{name:"mermaid"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.mermaid])])]}});case"katex":return g.createVNode(xa,{relative:`#${O}`,visible:s.katex,onChange:ye=>{s.katex=ye},overlay:g.createVNode("ul",{class:`${z}-menu`,onClick:()=>{s.katex=!1}},[g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-katex`,onClick:()=>{u("katexInline")}},[(Hs=n.value.katex)==null?void 0:Hs.inline]),g.createVNode("li",{class:`${z}-menu-item ${z}-menu-item-katex`,onClick:()=>{u("katexBlock")}},[(Ad=n.value.katex)==null?void 0:Ad.block])]),key:"bar-katex"},{default:()=>{var ye,Je;return[g.createVNode("div",{class:`${z}-toolbar-item`,title:(ye=n.value.toolbarTips)==null?void 0:ye.katex},[g.createVNode(ve,{name:"formula"},null),e.showToolbarName&&g.createVNode("div",{class:`${z}-toolbar-item-name`},[(Je=n.value.toolbarTips)==null?void 0:Je.katex])])]}})}else if(e.defToolbars instanceof Array){const ye=e.defToolbars[$];return ye?g.cloneVNode(ye,{theme:i.value,previewTheme:r.value,language:o.value,insert(ur){B.emit(t,je,"universal",{generate:ur})}}):""}else if(e.defToolbars&&e.defToolbars.children instanceof Array){const ye=e.defToolbars.children[$];return ye?g.cloneVNode(ye,{theme:i.value,previewTheme:r.value,language:o.value,insert(ur){B.emit(t,je,"universal",{generate:ur})}}):""}else return""};return g.watch(()=>e.toolbars,()=>{g.nextTick(()=>{l.value&&iW(l.value)})},{immediate:!0}),()=>{const $=h.value[0].map(P=>b(P)),Q=h.value[1].map(P=>b(P));return g.createVNode(g.Fragment,null,[e.toolbars.length>0&&g.createVNode("div",{class:`${z}-toolbar-wrapper`,ref:l,id:O},[g.createVNode("div",{class:[`${z}-toolbar`,e.showToolbarName&&`${z}-stn`]},[g.createVNode("div",{class:`${z}-toolbar-left`,ref:f},[$]),g.createVNode("div",{class:`${z}-toolbar-right`},[Q])])]),g.createVNode("input",{ref:p,accept:"image/*",type:"file",multiple:!0,style:{display:"none"}},null),g.createVNode(RW,{linkVisible:c.linkVisible,clipVisible:c.clipVisible,type:c.type,onCancel:()=>{c.linkVisible=!1,c.clipVisible=!1},onOk:P=>{P&&u(c.type,{desc:P.desc,url:P.url,transform:c.type==="image"}),c.linkVisible=!1,c.clipVisible=!1}},null)])}}}),WW=`.${z}-preview > [data-line]`,oh=(e,t)=>+getComputedStyle(e).getPropertyValue(t).replace("px",""),qW=(e,t)=>{const n=Bd(()=>{e.removeEventListener("scroll",i),e.addEventListener("scroll",i),t.removeEventListener("scroll",i),t.addEventListener("scroll",i)},50),i=r=>{const o=e.clientHeight,a=t.clientHeight,O=e.scrollHeight,l=t.scrollHeight,s=(O-o)/(l-a);r.target===e?(t.removeEventListener("scroll",i),t.scrollTo({top:e.scrollTop/s}),n()):(e.removeEventListener("scroll",i),e.scrollTo({top:t.scrollTop*s}),n())};return[()=>{n().finally(()=>{e.dispatchEvent(new Event("scroll"))})},()=>{e.removeEventListener("scroll",i),t.removeEventListener("scroll",i)}]},ZW=(e,t,n)=>{const{view:i}=n,r=nW(),o=$=>i.lineBlockAt(i.state.doc.line($+1).from).top,a=$=>i.lineBlockAt(i.state.doc.line($+1).from).bottom;let O=[],l=[],s=[];const u=()=>{O=[],l=Array.from(t.querySelectorAll(WW)),s=l.map(S=>Number(S.dataset.line));const $=[...s],{lines:Q}=i.state.doc;let P=$.shift()||0,k=$.shift()||Q;for(let S=0;S<Q;S++)S===k&&(P=S,k=$.shift()||Q),O.push({start:P,end:k-1})},c=($,Q)=>{let P=1;for(let k=l.length-1;k-1>=0;k--){const S=l[k],R=l[k-1];if(S.offsetTop+S.offsetHeight>Q&&R.offsetTop<Q){P=Number(R.dataset.line);break}}for(let k=O.length-1;k>=0;k--){const S=a(O[k].end),R=o(O[k].start);if(S>$&&R<=$){P=P<O[k].start?P:O[k].start;break}}return P};let f=0,h=0;const p=()=>{var Y,N,F;if(h!==0)return!1;f++;const{scrollDOM:$,contentHeight:Q}=i;let P=oh(t,"padding-top");const k=i.lineBlockAtHeight($.scrollTop),{number:S}=i.state.doc.lineAt(k.from),R=O[S-1];if(!R)return!1;let w=1;const x=t.querySelector(`[data-line="${R.start}"]`)||((Y=t.firstElementChild)==null?void 0:Y.firstElementChild),v=t.querySelector(`[data-line="${R.end+1}"]`)||((N=t.lastElementChild)==null?void 0:N.lastElementChild),E=$.scrollHeight-$.clientHeight,Z=t.scrollHeight-t.clientHeight;let V=o(R.start),U=a(R.end),X=x.offsetTop,q=v.offsetTop-X;if(V===0&&(X=0,x===v?(P=0,U=Q-$.offsetHeight,q=Z):q=v.offsetTop),w=($.scrollTop-V+oh(i.contentDOM,"padding-bottom"))/(U-V),V>0&&(U>=E||v.offsetTop+v.clientHeight>Z)){const I=c(E,Z);V=o(I),w=($.scrollTop-V)/(E-V),X=((F=document.querySelector(`[data-line="${I}"]`))==null?void 0:F.offsetTop)||X,q=Z-X+oh(t,"padding-top")}const W=X-P+q*w;r(t,W,()=>{f--})},m=()=>{var W,Y,N,F,I,L,ie;if(f!==0)return;h++;const{scrollDOM:$}=i,Q=t.scrollTop,P=t.scrollHeight,k=$.scrollHeight-$.clientHeight,S=t.scrollHeight-t.clientHeight;let R=(W=t.firstElementChild)==null?void 0:W.firstElementChild,w=(Y=t.firstElementChild)==null?void 0:Y.lastElementChild;if(s.length>0){let he=Math.ceil(s[s.length-1]*(Q/P)),Re=s.findLastIndex(G=>G<=he);Re=Re===-1?0:Re,he=s[Re];for(let G=Re;G>=0&&G<s.length;)if(l[G].offsetTop>Q){if(G-1>=0){G--;continue}he=-1,Re=G;break}else{if(G+1<s.length&&l[G+1].offsetTop<Q){G++;continue}he=s[G],Re=G;break}switch(Re){case-1:{R=(N=t.firstElementChild)==null?void 0:N.firstElementChild,w=l[Re];break}case s.length-1:{R=l[Re],w=(F=t.firstElementChild)==null?void 0:F.lastElementChild;break}default:R=l[Re],w=l[Re+1===l.length?Re:Re+1]}}let x=R===((I=t.firstElementChild)==null?void 0:I.firstElementChild)?0:R.offsetTop,v=w.offsetTop,E=0;const{start:Z,end:V}=O[Number(R.dataset.line||0)];let U=o(Z);const X=o(V+1===i.state.doc.lines?V:V+1);let q=0;if(X>k||w.offsetTop+w.offsetHeight>S){const he=c(k,S);x=((L=document.querySelector(`[data-line="${he}"]`))==null?void 0:L.offsetTop)||x,U=o(he),E=(Q-x)/(S-x),q=k-U}else R===((ie=t.firstElementChild)==null?void 0:ie.firstElementChild)?(R===w&&(v=w.offsetTop+w.offsetHeight+ +getComputedStyle(w).marginBottom.replace("px","")),q=X,E=Math.max(Q/v,0)):(E=Math.max((Q-x)/(v-x),0),q=X-U);r(e,U+q*E,()=>{h--})},b=KQ($=>{var S;const{scrollDOM:Q,contentHeight:P}=i,k=Q.clientHeight;if(P<=k||t.firstElementChild.clientHeight<=t.clientHeight)return!1;if(i.state.doc.lines<((S=O[O.length-1])==null?void 0:S.end))return u(),!1;$.target===e?p():m()},1);return[()=>{u(),e.addEventListener("scroll",b),t.addEventListener("scroll",b),e.dispatchEvent(new Event("scroll"))},()=>{e.removeEventListener("scroll",b),t.removeEventListener("scroll",b)}]},UW=(e,t,n)=>{const i=g.inject("editorId");let r=()=>{},o=()=>{};const a=()=>{r();const O=document.querySelector(`#${i} .cm-scroller`),l=document.querySelector(`[id="${i}-preview-wrapper"]`),s=document.querySelector(`[id="${i}-html-wrapper"]`);(l||s)&&([o,r]=(l?ZW:qW)(O,l||s,n.value),e.scrollAuto&&o())};g.watch([t,g.toRef(e.setting,"preview"),g.toRef(e.setting,"htmlPreview"),g.toRef(e.setting,"fullscreen"),g.toRef(e.setting,"pageFullscreen")],()=>{g.nextTick(a)}),g.watch(()=>e.scrollAuto,O=>{O?o():r()}),g.watch(()=>e.setting.previewOnly,O=>{O?r():o()}),g.onMounted(a)};let Ve=class Bz{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=va(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Vi.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=va(this,t,n);let i=[];return this.decompose(t,n,i,0),Vi.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new IO(this),o=new IO(t);for(let a=n,O=n;;){if(r.next(a),o.next(a),a=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(O+=r.value.length,r.done||O>=i)return!0}}iter(t=1){return new IO(this,t)}iterRange(t,n=this.length){return new gb(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new $b(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Bz.empty:t.length<=32?new ht(t):Vi.from(ht.split(t,[]))}};class ht extends Ve{constructor(t,n=EW(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let o=0;;o++){let a=this.text[o],O=r+a.length;if((n?i:O)>=t)return new YW(r,O,i,a);r=O+1,i++}}decompose(t,n,i,r){let o=t<=0&&n>=this.length?this:new ht(mb(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),O=au(o.text,a.text.slice(),0,o.length);if(O.length<=32)i.push(new ht(O,a.length+o.length));else{let l=O.length>>1;i.push(new ht(O.slice(0,l)),new ht(O.slice(l)))}}else i.push(o)}replace(t,n,i){if(!(i instanceof ht))return super.replace(t,n,i);[t,n]=va(this,t,n);let r=au(this.text,au(i.text,mb(this.text,0,t)),n),o=this.length+i.length-(n-t);return r.length<=32?new ht(r,o):Vi.from(ht.split(r,[]),o)}sliceString(t,n=this.length,i=`
|
|
3
3
|
`){[t,n]=va(this,t,n);let r="";for(let o=0,a=0;o<=n&&a<this.text.length;a++){let O=this.text[a],l=o+O.length;o>t&&a&&(r+=i),t<l&&n>o&&(r+=O.slice(Math.max(0,t-o),n-o)),o=l+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let o of t)i.push(o),r+=o.length+1,i.length==32&&(n.push(new ht(i,r)),i=[],r=-1);return r>-1&&n.push(new ht(i,r)),n}}class Vi extends Ve{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let o=0;;o++){let a=this.children[o],O=r+a.length,l=i+a.lines-1;if((n?l:O)>=t)return a.lineInner(t,n,i,r);r=O+1,i=l+1}}decompose(t,n,i,r){for(let o=0,a=0;a<=n&&o<this.children.length;o++){let O=this.children[o],l=a+O.length;if(t<=l&&n>=a){let s=r&((a<=t?1:0)|(l>=n?2:0));a>=t&&l<=n&&!s?i.push(O):O.decompose(t-a,n-a,i,s)}a=l+1}}replace(t,n,i){if([t,n]=va(this,t,n),i.lines<this.lines)for(let r=0,o=0;r<this.children.length;r++){let a=this.children[r],O=o+a.length;if(t>=o&&n<=O){let l=a.replace(t-o,n-o,i),s=this.lines-a.lines+l.lines;if(l.lines<s>>4&&l.lines>s>>6){let u=this.children.slice();return u[r]=l,new Vi(u,this.length-(n-t)+i.length)}return super.replace(o,O,l)}o=O+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=`
|
|
4
4
|
`){[t,n]=va(this,t,n);let r="";for(let o=0,a=0;o<this.children.length&&a<=n;o++){let O=this.children[o],l=a+O.length;a>t&&o&&(r+=i),t<l&&n>a&&(r+=O.sliceString(t-a,n-a,i)),a=l+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Vi))return 0;let i=0,[r,o,a,O]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,o+=n){if(r==a||o==O)return i;let l=this.children[r],s=t.children[o];if(l!=s)return i+l.scanIdentical(s,n);i+=l.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let h of t)i+=h.lines;if(i<32){let h=[];for(let p of t)p.flatten(h);return new ht(h,n)}let r=Math.max(32,i>>5),o=r<<1,a=r>>1,O=[],l=0,s=-1,u=[];function c(h){let p;if(h.lines>o&&h instanceof Vi)for(let m of h.children)c(m);else h.lines>a&&(l>a||!l)?(f(),O.push(h)):h instanceof ht&&l&&(p=u[u.length-1])instanceof ht&&h.lines+p.lines<=32?(l+=h.lines,s+=h.length+1,u[u.length-1]=new ht(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>r&&f(),l+=h.lines,s+=h.length+1,u.push(h))}function f(){l!=0&&(O.push(u.length==1?u[0]:Vi.from(u,s)),s=-1,l=u.length=0)}for(let h of t)c(h);return f(),O.length==1?O[0]:new Vi(O,n)}}Ve.empty=new ht([""],0);function EW(e){let t=-1;for(let n of e)t+=n.length+1;return t}function au(e,t,n=0,i=1e9){for(let r=0,o=0,a=!0;o<e.length&&r<=i;o++){let O=e[o],l=r+O.length;l>=n&&(l>i&&(O=O.slice(0,i-r)),r<n&&(O=O.slice(n-r)),a?(t[t.length-1]+=O,a=!1):t.push(O)),r=l+1}return t}function mb(e,t,n){return au(e,[""],t,n)}class IO{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof ht?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],o=this.offsets[i],a=o>>1,O=r instanceof ht?r.text.length:r.children.length;if(a==(n>0?O:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=`
|
|
5
5
|
`,this;t--}else if(r instanceof ht){let l=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=r.children[a+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof ht?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class gb{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new IO(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class $b{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ve.prototype[Symbol.iterator]=function(){return this.iter()},IO.prototype[Symbol.iterator]=gb.prototype[Symbol.iterator]=$b.prototype[Symbol.iterator]=function(){return this});let YW=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function va(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}let wa="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=1;e<wa.length;e++)wa[e]+=wa[e-1];function VW(e){for(let t=1;t<wa.length;t+=2)if(wa[t]>e)return wa[t-1]<=e;return!1}function Qb(e){return e>=127462&&e<=127487}const bb=8205;function Yt(e,t,n=!0,i=!0){return(n?yb:CW)(e,t,i)}function yb(e,t,n){if(t==e.length)return t;t&&Sb(e.charCodeAt(t))&&Pb(e.charCodeAt(t-1))&&t--;let i=di(e,t);for(t+=cr(i);t<e.length;){let r=di(e,t);if(i==bb||r==bb||n&&VW(r))t+=cr(r),i=r;else if(Qb(r)){let o=0,a=t-2;for(;a>=0&&Qb(di(e,a));)o++,a-=2;if(o%2==0)break;t+=2}else break}return t}function CW(e,t,n){for(;t>0;){let i=yb(e,t-2,n);if(i<t)return i;t--}return 0}function Sb(e){return e>=56320&&e<57344}function Pb(e){return e>=55296&&e<56320}function di(e,t){let n=e.charCodeAt(t);if(!Pb(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Sb(i)?(n-55296<<10)+(i-56320)+65536:n}function kb(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function cr(e){return e<65536?1:2}const ah=/\r\n?|\n/;var en=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(en||(en={}));class Ci{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];t+=i<0?this.sections[n]:i}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,i=0,r=0;n<this.sections.length;){let o=this.sections[n++],a=this.sections[n++];a<0?(t(i,r,o),r+=o):r+=a,i+=o}}iterChangedRanges(t,n=!1){Oh(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?t.push(i,r):t.push(r,i)}return new Ci(t)}composeDesc(t){return this.empty?t:t.empty?this:xb(this,t)}mapDesc(t,n=!1){return t.empty?this:lh(this,t,n)}mapPos(t,n=-1,i=en.Simple){let r=0,o=0;for(let a=0;a<this.sections.length;){let O=this.sections[a++],l=this.sections[a++],s=r+O;if(l<0){if(s>t)return o+(t-r);o+=O}else{if(i!=en.Simple&&s>=t&&(i==en.TrackDel&&r<t&&s>t||i==en.TrackBefore&&r<t||i==en.TrackAfter&&s>t))return null;if(s>t||s==t&&n<0&&!O)return t==r||n<0?o:o+l;o+=l}r=s}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return o}touchesRange(t,n=t){for(let i=0,r=0;i<this.sections.length&&r<=n;){let o=this.sections[i++],a=this.sections[i++],O=r+o;if(a>=0&&r<=n&&O>=t)return r<t&&O>n?"cover":!0;r=O}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];t+=(t?" ":"")+i+(r>=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ci(t)}static create(t){return new Ci(t)}}class vt extends Ci{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Oh(this,(n,i,r,o,a)=>t=t.replace(r,r+(i-n),a),!1),t}mapDesc(t,n=!1){return lh(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,o=0;r<n.length;r+=2){let a=n[r],O=n[r+1];if(O>=0){n[r]=O,n[r+1]=a;let l=r>>1;for(;i.length<l;)i.push(Ve.empty);i.push(a?t.slice(o,o+a):Ve.empty)}o+=a}return new vt(n,i)}compose(t){return this.empty?t:t.empty?this:xb(this,t,!0)}map(t,n=!1){return t.empty?this:lh(this,t,n,!0)}iterChanges(t,n=!1){Oh(this,t,n)}get desc(){return Ci.create(this.sections)}filter(t){let n=[],i=[],r=[],o=new DO(this);e:for(let a=0,O=0;;){let l=a==t.length?1e9:t[a++];for(;O<l||O==l&&o.len==0;){if(o.done)break e;let u=Math.min(o.len,l-O);Gt(r,u,-1);let c=o.ins==-1?-1:o.off==0?o.ins:0;Gt(n,u,c),c>0&&Yr(i,n,o.text),o.forward(u),O+=u}let s=t[a++];for(;O<s;){if(o.done)break e;let u=Math.min(o.len,s-O);Gt(n,u,-1),Gt(r,u,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(u),O+=u}}return{changes:new vt(n,i),filtered:Ci.create(r)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?t.push(i):r==0?t.push([i]):t.push([i].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,i){let r=[],o=[],a=0,O=null;function l(u=!1){if(!u&&!r.length)return;a<n&&Gt(r,n-a,-1);let c=new vt(r,o);O=O?O.compose(c.map(O)):c,r=[],o=[],a=0}function s(u){if(Array.isArray(u))for(let c of u)s(c);else if(u instanceof vt){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),O=O?O.compose(u.map(O)):u}else{let{from:c,to:f=c,insert:h}=u;if(c>f||c<0||f>n)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${n})`);let p=h?typeof h=="string"?Ve.of(h.split(i||ah)):h:Ve.empty,m=p.length;if(c==f&&m==0)return;c<a&&l(),c>a&&Gt(r,c-a,-1),Gt(r,f-c,m),Yr(o,r,p),a=f}}return s(t),l(!O),O}static empty(t){return new vt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<t.length;r++){let o=t[r];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((a,O)=>O&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;i.length<r;)i.push(Ve.empty);i[r]=Ve.of(o.slice(1)),n.push(o[0],i[r].length)}}}return new vt(n,i)}static createSet(t,n){return new vt(t,n)}}function Gt(e,t,n,i=!1){if(t==0&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Yr(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(Ve.empty);e.push(n)}}function Oh(e,t,n){let i=e.inserted;for(let r=0,o=0,a=0;a<e.sections.length;){let O=e.sections[a++],l=e.sections[a++];if(l<0)r+=O,o+=O;else{let s=r,u=o,c=Ve.empty;for(;s+=O,u+=l,l&&i&&(c=c.append(i[a-2>>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)O=e.sections[a++],l=e.sections[a++];t(r,s,o,u,c),r=s,o=u}}}function lh(e,t,n,i=!1){let r=[],o=i?[]:null,a=new DO(e),O=new DO(t);for(let l=-1;;)if(a.ins==-1&&O.ins==-1){let s=Math.min(a.len,O.len);Gt(r,s,-1),a.forward(s),O.forward(s)}else if(O.ins>=0&&(a.ins<0||l==a.i||a.off==0&&(O.len<a.len||O.len==a.len&&!n))){let s=O.len;for(Gt(r,O.ins,-1);s;){let u=Math.min(a.len,s);a.ins>=0&&l<a.i&&a.len<=u&&(Gt(r,0,a.ins),o&&Yr(o,r,a.text),l=a.i),a.forward(u),s-=u}O.next()}else if(a.ins>=0){let s=0,u=a.len;for(;u;)if(O.ins==-1){let c=Math.min(u,O.len);s+=c,u-=c,O.forward(c)}else if(O.ins==0&&O.len<u)u-=O.len,O.next();else break;Gt(r,s,l<a.i?a.ins:0),o&&l<a.i&&Yr(o,r,a.text),l=a.i,a.forward(a.len-u)}else{if(a.done&&O.done)return o?vt.createSet(r,o):Ci.create(r);throw new Error("Mismatched change set lengths")}}function xb(e,t,n=!1){let i=[],r=n?[]:null,o=new DO(e),a=new DO(t);for(let O=!1;;){if(o.done&&a.done)return r?vt.createSet(i,r):Ci.create(i);if(o.ins==0)Gt(i,o.len,0,O),o.next();else if(a.len==0&&!a.done)Gt(i,0,a.ins,O),r&&Yr(r,i,a.text),a.next();else{if(o.done||a.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,a.len),s=i.length;if(o.ins==-1){let u=a.ins==-1?-1:a.off?0:a.ins;Gt(i,l,u,O),r&&u&&Yr(r,i,a.text)}else a.ins==-1?(Gt(i,o.off?0:o.len,l,O),r&&Yr(r,i,o.textBit(l))):(Gt(i,o.off?0:o.len,a.off?0:a.ins,O),r&&!a.off&&Yr(r,i,a.text));O=(o.ins>l||a.ins>=0&&a.len>l)&&(O||i.length>s),o.forward2(l),a.forward(l)}}}}class DO{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length?Ve.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Ve.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Xo{constructor(t,n,i){this.from=t,this.to=n,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new Xo(i,r,this.flags)}extend(t,n=t){if(t<=this.anchor&&n>=this.anchor)return A.range(t,n);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return A.range(this.anchor,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return A.range(t.anchor,t.head)}static create(t,n,i){return new Xo(t,n,i)}}class A{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:A.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new A([this.main],0)}addRange(t,n=!0){return A.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let i=this.ranges.slice();return i[n]=t,A.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new A(t.ranges.map(n=>Xo.fromJSON(n)),t.main)}static single(t,n=t){return new A([A.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<t.length;r++){let o=t[r];if(o.empty?o.from<=i:o.from<i)return A.normalized(t.slice(),n);i=o.to}return new A(t,n)}static cursor(t,n=0,i,r){return Xo.create(t,t,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(t,n,i,r){let o=(i??16777215)<<6|(r==null?7:Math.min(6,r));return n<t?Xo.create(n,t,48|o):Xo.create(t,n,(n>t?8:0)|o)}static normalized(t,n=0){let i=t[n];t.sort((r,o)=>r.from-o.from),n=t.indexOf(i);for(let r=1;r<t.length;r++){let o=t[r],a=t[r-1];if(o.empty?o.from<=a.to:o.from<a.to){let O=a.from,l=Math.max(o.to,a.to);r<=n&&n--,t.splice(--r,2,o.anchor>o.head?A.range(l,O):A.range(O,l))}}return new A(t,n)}}function vb(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let sh=0;class se{constructor(t,n,i,r,o){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=sh++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(t={}){return new se(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:uh),!!t.static,t.enables)}of(t){return new Ou([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ou(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ou(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function uh(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class Ou{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=sh++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,o=this.id,a=t[o]>>1,O=this.type==2,l=!1,s=!1,u=[];for(let c of this.dependencies)c=="doc"?l=!0:c=="selection"?s=!0:((n=t[c.id])!==null&&n!==void 0?n:1)&1||u.push(t[c.id]);return{create(c){return c.values[a]=i(c),1},update(c,f){if(l&&f.docChanged||s&&(f.docChanged||f.selection)||ch(c,u)){let h=i(c);if(O?!wb(h,c.values[a],r):!r(h,c.values[a]))return c.values[a]=h,1}return 0},reconfigure:(c,f)=>{let h,p=f.config.address[o];if(p!=null){let m=su(f,p);if(this.dependencies.every(b=>b instanceof se?f.facet(b)===c.facet(b):b instanceof In?f.field(b,!1)==c.field(b,!1):!0)||(O?wb(h=i(c),m,r):r(h=i(c),m)))return c.values[a]=m,0}else h=i(c);return c.values[a]=h,1}}}}function wb(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function ch(e,t){let n=!1;for(let i of t)LO(e,i)&1&&(n=!0);return n}function jW(e,t,n){let i=n.map(l=>e[l.id]),r=n.map(l=>l.type),o=i.filter(l=>!(l&1)),a=e[t.id]>>1;function O(l){let s=[];for(let u=0;u<i.length;u++){let c=su(l,i[u]);if(r[u]==2)for(let f of c)s.push(f);else s.push(c)}return t.combine(s)}return{create(l){for(let s of i)LO(l,s);return l.values[a]=O(l),1},update(l,s){if(!ch(l,o))return 0;let u=O(l);return t.compare(u,l.values[a])?0:(l.values[a]=u,1)},reconfigure(l,s){let u=ch(l,i),c=s.config.facets[t.id],f=s.facet(t);if(c&&!u&&uh(n,c))return l.values[a]=f,0;let h=O(l);return t.compare(h,f)?(l.values[a]=f,0):(l.values[a]=h,1)}}}const Xb=se.define({static:!0});class In{constructor(t,n,i,r,o){this.id=t,this.createF=n,this.updateF=i,this.compareF=r,this.spec=o,this.provides=void 0}static define(t){let n=new In(sh++,t.create,t.update,t.compare||((i,r)=>i===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(Xb).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let o=i.values[n],a=this.updateF(o,r);return this.compareF(o,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}init(t){return[this,Xb.of({field:this,create:t})]}get extension(){return this}}const To={lowest:4,low:3,default:2,high:1,highest:0};function NO(e){return t=>new Tb(t,e)}const fr={highest:NO(To.highest),high:NO(To.high),default:NO(To.default),low:NO(To.low),lowest:NO(To.lowest)};class Tb{constructor(t,n){this.inner=t,this.prec=n}}class ji{of(t){return new fh(this,t)}reconfigure(t){return ji.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class fh{constructor(t,n){this.compartment=t,this.inner=n}}class lu{constructor(t,n,i,r,o,a){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,i){let r=[],o=Object.create(null),a=new Map;for(let f of AW(t,n,a))f instanceof In?r.push(f):(o[f.facet.id]||(o[f.facet.id]=[])).push(f);let O=Object.create(null),l=[],s=[];for(let f of r)O[f.id]=s.length<<1,s.push(h=>f.slot(h));let u=i==null?void 0:i.config.facets;for(let f in o){let h=o[f],p=h[0].facet,m=u&&u[f]||[];if(h.every(b=>b.type==0))if(O[p.id]=l.length<<1|1,uh(m,h))l.push(i.facet(p));else{let b=p.combine(h.map($=>$.value));l.push(i&&p.compare(b,i.facet(p))?i.facet(p):b)}else{for(let b of h)b.type==0?(O[b.id]=l.length<<1|1,l.push(b.value)):(O[b.id]=s.length<<1,s.push($=>b.dynamicSlot($)));O[p.id]=s.length<<1,s.push(b=>jW(b,p,h))}}let c=s.map(f=>f(O));return new lu(t,a,c,O,l,o)}}function AW(e,t,n){let i=[[],[],[],[],[]],r=new Map;function o(a,O){let l=r.get(a);if(l!=null){if(l<=O)return;let s=i[l].indexOf(a);s>-1&&i[l].splice(s,1),a instanceof fh&&n.delete(a.compartment)}if(r.set(a,O),Array.isArray(a))for(let s of a)o(s,O);else if(a instanceof fh){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let s=t.get(a.compartment)||a.inner;n.set(a.compartment,s),o(s,O)}else if(a instanceof Tb)o(a.inner,a.prec);else if(a instanceof In)i[O].push(a),a.provides&&o(a.provides,O);else if(a instanceof Ou)i[O].push(a),a.facet.extensions&&o(a.facet.extensions,To.default);else{let s=a.extension;if(!s)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(s,O)}}return o(e,To.default),i.reduce((a,O)=>a.concat(O))}function LO(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function su(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const _b=se.define(),dh=se.define({combine:e=>e.some(t=>t),static:!0}),Rb=se.define({combine:e=>e.length?e[0]:void 0,static:!0}),zb=se.define(),Wb=se.define(),qb=se.define(),Zb=se.define({combine:e=>e.length?e[0]:!1});class dr{constructor(t,n){this.type=t,this.value=n}static define(){return new GW}}class GW{of(t){return new dr(this,t)}}class IW{constructor(t){this.map=t}of(t){return new qe(this,t)}}class qe{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new qe(this.type,n)}is(t){return this.type==t}static define(t={}){return new IW(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let o=r.map(n);o&&i.push(o)}return i}}qe.reconfigure=qe.define(),qe.appendConfig=qe.define();class gt{constructor(t,n,i,r,o,a){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,i&&vb(i,n.newLength),o.some(O=>O.type==gt.time)||(this.annotations=o.concat(gt.time.of(Date.now())))}static create(t,n,i,r,o,a){return new gt(t,n,i,r,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(gt.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}gt.time=dr.define(),gt.userEvent=dr.define(),gt.addToHistory=dr.define(),gt.remote=dr.define();function DW(e,t){let n=[];for(let i=0,r=0;;){let o,a;if(i<e.length&&(r==t.length||t[r]>=e[i]))o=e[i++],a=e[i++];else if(r<t.length)o=t[r++],a=t[r++];else return n;!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function Ub(e,t,n){var i;let r,o,a;return n?(r=t.changes,o=vt.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(o):(i=e.selection)===null||i===void 0?void 0:i.map(r),effects:qe.mapEffects(e.effects,r).concat(qe.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function hh(e,t,n){let i=t.selection,r=Xa(t.annotations);return t.userEvent&&(r=r.concat(gt.userEvent.of(t.userEvent))),{changes:t.changes instanceof vt?t.changes:vt.of(t.changes||[],n,e.facet(Rb)),selection:i&&(i instanceof A?i:A.single(i.anchor,i.head)),effects:Xa(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}function Eb(e,t,n){let i=hh(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let o=1;o<t.length;o++){t[o].filter===!1&&(n=!1);let a=!!t[o].sequential;i=Ub(i,hh(e,t[o],a?i.changes.newLength:e.doc.length),a)}let r=gt.create(e,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return LW(n?NW(r):r)}function NW(e){let t=e.startState,n=!0;for(let r of t.facet(zb)){let o=r(e);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:DW(n,o))}if(n!==!0){let r,o;if(n===!1)o=e.changes.invertedDesc,r=vt.empty(t.doc.length);else{let a=e.changes.filter(n);r=a.changes,o=a.filtered.mapDesc(a.changes).invertedDesc}e=gt.create(t,r,e.selection&&e.selection.map(o),qe.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let i=t.facet(Wb);for(let r=i.length-1;r>=0;r--){let o=i[r](e);o instanceof gt?e=o:Array.isArray(o)&&o.length==1&&o[0]instanceof gt?e=o[0]:e=Eb(t,Xa(o),!1)}return e}function LW(e){let t=e.startState,n=t.facet(qb),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=Ub(i,hh(t,o,e.changes.newLength),!0))}return i==e?e:gt.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const FW=[];function Xa(e){return e==null?FW:Array.isArray(e)?e:[e]}var Vt=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Vt||(Vt={}));const MW=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ph;try{ph=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function BW(e){if(ph)return ph.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||MW.test(n)))return!0}return!1}function HW(e){return t=>{if(!/\S/.test(t))return Vt.Space;if(BW(t))return Vt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return Vt.Word;return Vt.Other}}class xe{constructor(t,n,i,r,o,a){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let O=0;O<this.config.dynamicSlots.length;O++)LO(this,O<<1);this.computeSlot=null}field(t,n=!0){let i=this.config.address[t.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return LO(this,i),su(this,i)}update(...t){return Eb(this,t,!0)}applyTransaction(t){let n=this.config,{base:i,compartments:r}=n;for(let O of t.effects)O.is(ji.reconfigure)?(n&&(r=new Map,n.compartments.forEach((l,s)=>r.set(s,l)),n=null),r.set(O.value.compartment,O.value.extension)):O.is(qe.reconfigure)?(n=null,i=O.value):O.is(qe.appendConfig)&&(n=null,i=Xa(i).concat(O.value));let o;n?o=t.startState.values.slice():(n=lu.resolve(i,r,this),o=new xe(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,s)=>s.reconfigure(l,this),null).values);let a=t.startState.facet(dh)?t.newSelection:t.newSelection.asSingle();new xe(n,t.newDoc,a,o,(O,l)=>l.update(O,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:A.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),o=[i.range],a=Xa(i.effects);for(let O=1;O<n.ranges.length;O++){let l=t(n.ranges[O]),s=this.changes(l.changes),u=s.map(r);for(let f=0;f<O;f++)o[f]=o[f].map(u);let c=r.mapDesc(s,!0);o.push(l.range.map(c)),r=r.compose(u),a=qe.mapEffects(a,u).concat(qe.mapEffects(Xa(l.effects),c))}return{changes:r,selection:A.create(o,n.mainIndex),effects:a}}changes(t=[]){return t instanceof vt?t:vt.of(t,this.doc.length,this.facet(xe.lineSeparator))}toText(t){return Ve.of(t.split(this.facet(xe.lineSeparator)||ah))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(LO(this,n),su(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let r=t[i];r instanceof In&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(t[i]),this))}return n}static fromJSON(t,n={},i){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let o in i)if(Object.prototype.hasOwnProperty.call(t,o)){let a=i[o],O=t[o];r.push(a.init(l=>a.spec.fromJSON(O,l)))}}return xe.create({doc:t.doc,selection:A.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=lu.resolve(t.extensions||[],new Map),i=t.doc instanceof Ve?t.doc:Ve.of((t.doc||"").split(n.staticFacet(xe.lineSeparator)||ah)),r=t.selection?t.selection instanceof A?t.selection:A.single(t.selection.anchor,t.selection.head):A.single(0);return vb(r,i.length),n.staticFacet(dh)||(r=r.asSingle()),new xe(n,i,r,n.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(xe.tabSize)}get lineBreak(){return this.facet(xe.lineSeparator)||`
|
|
@@ -110,9 +110,9 @@ See: https://github.com/francoischalifour/medium-zoom`)}},e3=function(t){var n=d
|
|
|
110
110
|
`:">",o},rO.prototype.renderInline=function(e,t,n){let i="";const r=this.rules;for(let o=0,a=e.length;o<a;o++){const O=e[o].type;typeof r[O]<"u"?i+=r[O](e,o,t,n,this):i+=this.renderToken(e,o,t)}return i},rO.prototype.renderInlineAsText=function(e,t,n){let i="";for(let r=0,o=e.length;r<o;r++)switch(e[r].type){case"text":i+=e[r].content;break;case"image":i+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":i+=e[r].content;break;case"softbreak":case"hardbreak":i+=`
|
|
111
111
|
`;break}return i},rO.prototype.render=function(e,t,n){let i="";const r=this.rules;for(let o=0,a=e.length;o<a;o++){const O=e[o].type;O==="inline"?i+=this.renderInline(e[o].children,t,n):typeof r[O]<"u"?i+=r[O](e,o,t,n,this):i+=this.renderToken(e,o,t,n)}return i};function pn(){this.__rules__=[],this.__cache__=null}pn.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},pn.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(i){t.indexOf(i)<0&&t.push(i)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(i){i.enabled&&(n&&i.alt.indexOf(n)<0||e.__cache__[n].push(i.fn))})})},pn.prototype.at=function(e,t,n){const i=this.__find__(e),r=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__[i].fn=t,this.__rules__[i].alt=r.alt||[],this.__cache__=null},pn.prototype.before=function(e,t,n,i){const r=this.__find__(e),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},pn.prototype.after=function(e,t,n,i){const r=this.__find__(e),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},pn.prototype.push=function(e,t,n){const i=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null},pn.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,n.push(i)},this),this.__cache__=null,n},pn.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)},pn.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,n.push(i)},this),this.__cache__=null,n},pn.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Qi(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Qi.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let i=0,r=n.length;i<r;i++)if(n[i][0]===t)return i;return-1},Qi.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},Qi.prototype.attrSet=function(t,n){const i=this.attrIndex(t),r=[t,n];i<0?this.attrPush(r):this.attrs[i]=r},Qi.prototype.attrGet=function(t){const n=this.attrIndex(t);let i=null;return n>=0&&(i=this.attrs[n][1]),i},Qi.prototype.attrJoin=function(t,n){const i=this.attrIndex(t);i<0?this.attrPush([t,n]):this.attrs[i][1]=this.attrs[i][1]+" "+n};function Ox(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Ox.prototype.Token=Qi;const r6=/\r\n?|\n/g,o6=/\0/g;function a6(e){let t;t=e.src.replace(r6,`
|
|
112
112
|
`),t=t.replace(o6,"�"),e.src=t}function O6(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function l6(e){const t=e.tokens;for(let n=0,i=t.length;n<i;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function s6(e){return/^<a[>\s]/i.test(e)}function u6(e){return/^<\/a\s*>/i.test(e)}function c6(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,i=t.length;n<i;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,o=0;for(let a=r.length-1;a>=0;a--){const O=r[a];if(O.type==="link_close"){for(a--;r[a].level!==O.level&&r[a].type!=="link_open";)a--;continue}if(O.type==="html_inline"&&(s6(O.content)&&o>0&&o--,u6(O.content)&&o++),!(o>0)&&O.type==="text"&&e.md.linkify.test(O.content)){const l=O.content;let s=e.md.linkify.match(l);const u=[];let c=O.level,f=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type==="text_special"&&(s=s.slice(1));for(let h=0;h<s.length;h++){const p=s[h].url,m=e.md.normalizeLink(p);if(!e.md.validateLink(m))continue;let b=s[h].text;s[h].schema?s[h].schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");const $=s[h].index;if($>f){const S=new e.Token("text","",0);S.content=l.slice(f,$),S.level=c,u.push(S)}const Q=new e.Token("link_open","a",1);Q.attrs=[["href",m]],Q.level=c++,Q.markup="linkify",Q.info="auto",u.push(Q);const P=new e.Token("text","",0);P.content=b,P.level=c,u.push(P);const k=new e.Token("link_close","a",-1);k.level=--c,k.markup="linkify",k.info="auto",u.push(k),f=s[h].lastIndex}if(f<l.length){const h=new e.Token("text","",0);h.content=l.slice(f),h.level=c,u.push(h)}t[n].children=r=ox(r,a,u)}}}}const lx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,f6=/\((c|tm|r)\)/i,d6=/\((c|tm|r)\)/ig,h6={c:"©",r:"®",tm:"™"};function p6(e,t){return h6[t.toLowerCase()]}function m6(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(d6,p6)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function g6(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&lx.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function $6(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(f6.test(e.tokens[t].content)&&m6(e.tokens[t].children),lx.test(e.tokens[t].content)&&g6(e.tokens[t].children))}const Q6=/['"]/,sx=/['"]/g,ux="’";function zc(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function b6(e,t){let n;const i=[];for(let r=0;r<e.length;r++){const o=e[r],a=e[r].level;for(n=i.length-1;n>=0&&!(i[n].level<=a);n--);if(i.length=n+1,o.type!=="text")continue;let O=o.content,l=0,s=O.length;e:for(;l<s;){sx.lastIndex=l;const u=sx.exec(O);if(!u)break;let c=!0,f=!0;l=u.index+1;const h=u[0]==="'";let p=32;if(u.index-1>=0)p=O.charCodeAt(u.index-1);else for(n=r-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){p=e[n].content.charCodeAt(e[n].content.length-1);break}let m=32;if(l<s)m=O.charCodeAt(l);else for(n=r+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){m=e[n].content.charCodeAt(0);break}const b=Al(p)||jl(String.fromCharCode(p)),$=Al(m)||jl(String.fromCharCode(m)),Q=Cl(p),P=Cl(m);if(P?c=!1:$&&(Q||b||(c=!1)),Q?f=!1:b&&(P||$||(f=!1)),m===34&&u[0]==='"'&&p>=48&&p<=57&&(f=c=!1),c&&f&&(c=b,f=$),!c&&!f){h&&(o.content=zc(o.content,u.index,ux));continue}if(f)for(n=i.length-1;n>=0;n--){let k=i[n];if(i[n].level<a)break;if(k.single===h&&i[n].level===a){k=i[n];let S,R;h?(S=t.md.options.quotes[2],R=t.md.options.quotes[3]):(S=t.md.options.quotes[0],R=t.md.options.quotes[1]),o.content=zc(o.content,u.index,R),e[k.token].content=zc(e[k.token].content,k.pos,S),l+=R.length-1,k.token===r&&(l+=S.length-1),O=o.content,s=O.length,i.length=n;continue e}}c?i.push({token:r,pos:u.index,single:h,level:a}):f&&h&&(o.content=zc(o.content,u.index,ux))}}}function y6(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!Q6.test(e.tokens[t].content)||b6(e.tokens[t].children,e)}function S6(e){let t,n;const i=e.tokens,r=i.length;for(let o=0;o<r;o++){if(i[o].type!=="inline")continue;const a=i[o].children,O=a.length;for(t=0;t<O;t++)a[t].type==="text_special"&&(a[t].type="text");for(t=n=0;t<O;t++)a[t].type==="text"&&t+1<O&&a[t+1].type==="text"?a[t+1].content=a[t].content+a[t+1].content:(t!==n&&(a[n]=a[t]),n++);t!==n&&(a.length=n)}}const Vm=[["normalize",a6],["block",O6],["inline",l6],["linkify",c6],["replacements",$6],["smartquotes",y6],["text_join",S6]];function Cm(){this.ruler=new pn;for(let e=0;e<Vm.length;e++)this.ruler.push(Vm[e][0],Vm[e][1])}Cm.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,i=t.length;n<i;n++)t[n](e)},Cm.prototype.State=Ox;function Ki(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,a=0,O=0,l=0,s=r.length,u=!1;a<s;a++){const c=r.charCodeAt(a);if(!u)if(Fe(c)){O++,c===9?l+=4-l%4:l++;continue}else u=!0;(c===10||a===s-1)&&(c!==10&&a++,this.bMarks.push(o),this.eMarks.push(a),this.tShift.push(O),this.sCount.push(l),this.bsCount.push(0),u=!1,O=0,l=0,o=a+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ki.prototype.push=function(e,t,n){const i=new Qi(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},Ki.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},Ki.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},Ki.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const i=this.src.charCodeAt(t);if(!Fe(i))break}return t},Ki.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Fe(this.src.charCodeAt(--t)))return t+1;return t},Ki.prototype.skipChars=function(t,n){for(let i=this.src.length;t<i&&this.src.charCodeAt(t)===n;t++);return t},Ki.prototype.skipCharsBack=function(t,n,i){if(t<=i)return t;for(;t>i;)if(n!==this.src.charCodeAt(--t))return t+1;return t},Ki.prototype.getLines=function(t,n,i,r){if(t>=n)return"";const o=new Array(n-t);for(let a=0,O=t;O<n;O++,a++){let l=0;const s=this.bMarks[O];let u=s,c;for(O+1<n||r?c=this.eMarks[O]+1:c=this.eMarks[O];u<c&&l<i;){const f=this.src.charCodeAt(u);if(Fe(f))f===9?l+=4-(l+this.bsCount[O])%4:l++;else if(u-s<this.tShift[O])l++;else break;u++}l>i?o[a]=new Array(l-i+1).join(" ")+this.src.slice(u,c):o[a]=this.src.slice(u,c)}return o.join("")},Ki.prototype.Token=Qi;const P6=65536;function jm(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function cx(e){const t=[],n=e.length;let i=0,r=e.charCodeAt(i),o=!1,a=0,O="";for(;i<n;)r===124&&(o?(O+=e.substring(a,i-1),a=i):(t.push(O+e.substring(a,i)),O="",a=i+1)),o=r===92,i++,r=e.charCodeAt(i);return t.push(O+e.substring(a)),t}function k6(e,t,n,i){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let o=e.bMarks[r]+e.tShift[r];if(o>=e.eMarks[r])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58||o>=e.eMarks[r])return!1;const O=e.src.charCodeAt(o++);if(O!==124&&O!==45&&O!==58&&!Fe(O)||a===45&&Fe(O))return!1;for(;o<e.eMarks[r];){const k=e.src.charCodeAt(o);if(k!==124&&k!==45&&k!==58&&!Fe(k))return!1;o++}let l=jm(e,t+1),s=l.split("|");const u=[];for(let k=0;k<s.length;k++){const S=s[k].trim();if(!S){if(k===0||k===s.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?u.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?u.push("left"):u.push("")}if(l=jm(e,t).trim(),l.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;s=cx(l),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop();const c=s.length;if(c===0||c!==u.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const $=e.push("tr_open","tr",1);$.map=[t,t+1];for(let k=0;k<s.length;k++){const S=e.push("th_open","th",1);u[k]&&(S.attrs=[["style","text-align:"+u[k]]]);const R=e.push("inline","",0);R.content=s[k].trim(),R.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let Q,P=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let k=!1;for(let R=0,w=h.length;R<w;R++)if(h[R](e,r,n,!0)){k=!0;break}if(k||(l=jm(e,r).trim(),!l)||e.sCount[r]-e.blkIndent>=4||(s=cx(l),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop(),P+=c-s.length,P>P6))break;if(r===t+2){const R=e.push("tbody_open","tbody",1);R.map=Q=[t+2,0]}const S=e.push("tr_open","tr",1);S.map=[r,r+1];for(let R=0;R<c;R++){const w=e.push("td_open","td",1);u[R]&&(w.attrs=[["style","text-align:"+u[R]]]);const x=e.push("inline","",0);x.content=s[R]?s[R].trim():"",x.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return Q&&(e.push("tbody_close","tbody",-1),Q[1]=r),e.push("table_close","table",-1),m[1]=r,e.parentType=f,e.line=r,!0}function x6(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let i=t+1,r=i;for(;i<n;){if(e.isEmpty(i)){i++;continue}if(e.sCount[i]-e.blkIndent>=4){i++,r=i;continue}break}e.line=r;const o=e.push("code_block","code",0);return o.content=e.getLines(t,r,4+e.blkIndent,!1)+`
|
|
113
|
-
`,o.map=[t,e.line],!0}function v6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const a=e.src.charCodeAt(r);if(a!==126&&a!==96)return!1;let O=r;r=e.skipChars(r,a);let l=r-O;if(l<3)return!1;const s=e.src.slice(O,r),u=e.src.slice(r,o);if(a===96&&u.indexOf(String.fromCharCode(a))>=0)return!1;if(i)return!0;let c=t,f=!1;for(;c++,!(c>=n||(r=O=e.bMarks[c]+e.tShift[c],o=e.eMarks[c],r<o&&e.sCount[c]<e.blkIndent));)if(e.src.charCodeAt(r)===a&&!(e.sCount[c]-e.blkIndent>=4)&&(r=e.skipChars(r,a),!(r-O<l)&&(r=e.skipSpaces(r),!(r<o)))){f=!0;break}l=e.sCount[t],e.line=c+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,c,l,!0),h.markup=s,h.map=[t,e.line],!0}function w6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const O=[],l=[],s=[],u=[],c=e.md.block.ruler.getRules("blockquote"),f=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=t;p<n;p++){const P=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],r>=o)break;if(e.src.charCodeAt(r++)===62&&!P){let S=e.sCount[p]+1,R,w;e.src.charCodeAt(r)===32?(r++,S++,w=!1,R=!0):e.src.charCodeAt(r)===9?(R=!0,(e.bsCount[p]+S)%4===3?(r++,S++,w=!1):w=!0):R=!1;let x=S;for(O.push(e.bMarks[p]),e.bMarks[p]=r;r<o;){const v=e.src.charCodeAt(r);if(Fe(v))v===9?x+=4-(x+e.bsCount[p]+(w?1:0))%4:x++;else break;r++}h=r>=o,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(R?1:0),s.push(e.sCount[p]),e.sCount[p]=x-S,u.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(h)break;let k=!1;for(let S=0,R=c.length;S<R;S++)if(c[S](e,p,n,!0)){k=!0;break}if(k){e.lineMax=p,e.blkIndent!==0&&(O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]=-1}const m=e.blkIndent;e.blkIndent=0;const b=e.push("blockquote_open","blockquote",1);b.markup=">";const $=[t,0];b.map=$,e.md.block.tokenize(e,t,p);const Q=e.push("blockquote_close","blockquote",-1);Q.markup=">",e.lineMax=a,e.parentType=f,$[1]=e.line;for(let P=0;P<u.length;P++)e.bMarks[P+t]=O[P],e.tShift[P+t]=u[P],e.sCount[P+t]=s[P],e.bsCount[P+t]=l[P];return e.blkIndent=m,!0}function X6(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let O=1;for(;o<r;){const s=e.src.charCodeAt(o++);if(s!==a&&!Fe(s))return!1;s===a&&O++}if(O<3)return!1;if(i)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(O+1).join(String.fromCharCode(a)),!0}function fx(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const o=e.src.charCodeAt(i);if(!Fe(o))return-1}return i}function dx(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=i)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<i&&(o=e.src.charCodeAt(r),!Fe(o))?-1:r}function T6(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function _6(e,t,n,i){let r,o,a,O,l=t,s=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u=!1;i&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(u=!0);let c,f,h;if((h=dx(e,l))>=0){if(c=!0,a=e.bMarks[l]+e.tShift[l],f=Number(e.src.slice(a,h-1)),u&&f!==1)return!1}else if((h=fx(e,l))>=0)c=!1;else return!1;if(u&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(i)return!0;const p=e.src.charCodeAt(h-1),m=e.tokens.length;c?(O=e.push("ordered_list_open","ol",1),f!==1&&(O.attrs=[["start",f]])):O=e.push("bullet_list_open","ul",1);const b=[l,0];O.map=b,O.markup=String.fromCharCode(p);let $=!1;const Q=e.md.block.ruler.getRules("list"),P=e.parentType;for(e.parentType="list";l<n;){o=h,r=e.eMarks[l];const k=e.sCount[l]+h-(e.bMarks[l]+e.tShift[l]);let S=k;for(;o<r;){const q=e.src.charCodeAt(o);if(q===9)S+=4-(S+e.bsCount[l])%4;else if(q===32)S++;else break;o++}const R=o;let w;R>=r?w=1:w=S-k,w>4&&(w=1);const x=k+w;O=e.push("list_item_open","li",1),O.markup=String.fromCharCode(p);const v=[l,0];O.map=v,c&&(O.info=e.src.slice(a,h-1));const E=e.tight,Z=e.tShift[l],V=e.sCount[l],U=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=x,e.tight=!0,e.tShift[l]=R-e.bMarks[l],e.sCount[l]=S,R>=r&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||$)&&(s=!1),$=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=U,e.tShift[l]=Z,e.sCount[l]=V,e.tight=E,O=e.push("list_item_close","li",-1),O.markup=String.fromCharCode(p),l=e.line,v[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let X=!1;for(let q=0,W=Q.length;q<W;q++)if(Q[q](e,l,n,!0)){X=!0;break}if(X)break;if(c){if(h=dx(e,l),h<0)break;a=e.bMarks[l]+e.tShift[l]}else if(h=fx(e,l),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return c?O=e.push("ordered_list_close","ol",-1):O=e.push("bullet_list_close","ul",-1),O.markup=String.fromCharCode(p),b[1]=l,e.line=l,e.parentType=P,s&&T6(e,m),!0}function R6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function O(Q){const P=e.lineMax;if(Q>=P||e.isEmpty(Q))return null;let k=!1;if(e.sCount[Q]-e.blkIndent>3&&(k=!0),e.sCount[Q]<0&&(k=!0),!k){const w=e.md.block.ruler.getRules("reference"),x=e.parentType;e.parentType="reference";let v=!1;for(let E=0,Z=w.length;E<Z;E++)if(w[E](e,Q,P,!0)){v=!0;break}if(e.parentType=x,v)return null}const S=e.bMarks[Q]+e.tShift[Q],R=e.eMarks[Q];return e.src.slice(S,R+1)}let l=e.src.slice(r,o+1);o=l.length;let s=-1;for(r=1;r<o;r++){const Q=l.charCodeAt(r);if(Q===91)return!1;if(Q===93){s=r;break}else if(Q===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(Q===92&&(r++,r<o&&l.charCodeAt(r)===10)){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}}if(s<0||l.charCodeAt(s+1)!==58)return!1;for(r=s+2;r<o;r++){const Q=l.charCodeAt(r);if(Q===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(Q))break}const u=e.md.helpers.parseLinkDestination(l,r,o);if(!u.ok)return!1;const c=e.md.normalizeLink(u.str);if(!e.md.validateLink(c))return!1;r=u.pos;const f=r,h=a,p=r;for(;r<o;r++){const Q=l.charCodeAt(r);if(Q===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(Q))break}let m=e.md.helpers.parseLinkTitle(l,r,o);for(;m.can_continue;){const Q=O(a);if(Q===null)break;l+=Q,r=o,o=l.length,a++,m=e.md.helpers.parseLinkTitle(l,r,o,m)}let b;for(r<o&&p!==r&&m.ok?(b=m.str,r=m.pos):(b="",r=f,a=h);r<o;){const Q=l.charCodeAt(r);if(!Fe(Q))break;r++}if(r<o&&l.charCodeAt(r)!==10&&b)for(b="",r=f,a=h;r<o;){const Q=l.charCodeAt(r);if(!Fe(Q))break;r++}if(r<o&&l.charCodeAt(r)!==10)return!1;const $=Rc(l.slice(1,s));return $?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[$]>"u"&&(e.env.references[$]={title:b,href:c}),e.line=a),!0):!1}const z6=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],W6="[a-zA-Z_:][a-zA-Z0-9:._-]*",q6="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",hx="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+W6+"(?:\\s*=\\s*"+q6+")?)")+"*\\s*\\/?>",px="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Z6="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",U6="<[?][\\s\\S]*?[?]>",E6="<![A-Za-z][^>]*>",Y6="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",V6=new RegExp("^(?:"+hx+"|"+px+"|"+Z6+"|"+U6+"|"+E6+"|"+Y6+")"),C6=new RegExp("^(?:"+hx+"|"+px+")"),oO=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+z6.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(C6.source+"\\s*$"),/^$/,!1]];function j6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let a=e.src.slice(r,o),O=0;for(;O<oO.length&&!oO[O][0].test(a);O++);if(O===oO.length)return!1;if(i)return oO[O][2];let l=t+1;if(!oO[O][1].test(a)){for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(r=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],a=e.src.slice(r,o),oO[O][1].test(a)){a.length!==0&&l++;break}}e.line=l;const s=e.push("html_block","",0);return s.map=[t,l],s.content=e.getLines(t,l,e.blkIndent,!0),!0}function A6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.src.charCodeAt(r);if(a!==35||r>=o)return!1;let O=1;for(a=e.src.charCodeAt(++r);a===35&&r<o&&O<=6;)O++,a=e.src.charCodeAt(++r);if(O>6||r<o&&!Fe(a))return!1;if(i)return!0;o=e.skipSpacesBack(o,r);const l=e.skipCharsBack(o,35,r);l>r&&Fe(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const s=e.push("heading_open","h"+String(O),1);s.markup="########".slice(0,O),s.map=[t,e.line];const u=e.push("inline","",0);u.content=e.src.slice(r,o).trim(),u.map=[t,e.line],u.children=[];const c=e.push("heading_close","h"+String(O),-1);return c.markup="########".slice(0,O),!0}function G6(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,a,O=t+1;for(;O<n&&!e.isEmpty(O);O++){if(e.sCount[O]-e.blkIndent>3)continue;if(e.sCount[O]>=e.blkIndent){let h=e.bMarks[O]+e.tShift[O];const p=e.eMarks[O];if(h<p&&(a=e.src.charCodeAt(h),(a===45||a===61)&&(h=e.skipChars(h,a),h=e.skipSpaces(h),h>=p))){o=a===61?1:2;break}}if(e.sCount[O]<0)continue;let f=!1;for(let h=0,p=i.length;h<p;h++)if(i[h](e,O,n,!0)){f=!0;break}if(f)break}if(!o)return!1;const l=e.getLines(t,O,e.blkIndent,!1).trim();e.line=O+1;const s=e.push("heading_open","h"+String(o),1);s.markup=String.fromCharCode(a),s.map=[t,e.line];const u=e.push("inline","",0);u.content=l,u.map=[t,e.line-1],u.children=[];const c=e.push("heading_close","h"+String(o),-1);return c.markup=String.fromCharCode(a),e.parentType=r,!0}function I6(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let s=!1;for(let u=0,c=i.length;u<c;u++)if(i[u](e,o,n,!0)){s=!0;break}if(s)break}const a=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const O=e.push("paragraph_open","p",1);O.map=[t,e.line];const l=e.push("inline","",0);return l.content=a,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const Wc=[["table",k6,["paragraph","reference"]],["code",x6],["fence",v6,["paragraph","reference","blockquote","list"]],["blockquote",w6,["paragraph","reference","blockquote","list"]],["hr",X6,["paragraph","reference","blockquote","list"]],["list",_6,["paragraph","reference","blockquote"]],["reference",R6],["html_block",j6,["paragraph","reference","blockquote"]],["heading",A6,["paragraph","reference","blockquote"]],["lheading",G6],["paragraph",I6]];function qc(){this.ruler=new pn;for(let e=0;e<Wc.length;e++)this.ruler.push(Wc[e][0],Wc[e][1],{alt:(Wc[e][2]||[]).slice()})}qc.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,o=e.md.options.maxNesting;let a=t,O=!1;for(;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n||e.sCount[a]<e.blkIndent));){if(e.level>=o){e.line=n;break}const l=e.line;let s=!1;for(let u=0;u<r;u++)if(s=i[u](e,a,n,!1),s){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");e.tight=!O,e.isEmpty(e.line-1)&&(O=!0),a=e.line,a<n&&e.isEmpty(a)&&(O=!0,a++,e.line=a)}},qc.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)},qc.prototype.State=Ki;function Gl(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Gl.prototype.pushPending=function(){const e=new Qi("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Gl.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new Qi(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i},Gl.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<n&&this.src.charCodeAt(o)===i;)o++;const a=o-e,O=o<n?this.src.charCodeAt(o):32,l=Al(r)||jl(String.fromCharCode(r)),s=Al(O)||jl(String.fromCharCode(O)),u=Cl(r),c=Cl(O),f=!c&&(!s||u||l),h=!u&&(!l||c||s);return{can_open:f&&(t||!h||l),can_close:h&&(t||!f||s),length:a}},Gl.prototype.Token=Qi;function D6(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function N6(e,t){let n=e.pos;for(;n<e.posMax&&!D6(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const L6=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function F6(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(L6);if(!r)return!1;const o=r[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let O=a.url;if(O.length<=o.length)return!1;O=O.replace(/\*+$/,"");const l=e.md.normalizeLink(O);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const s=e.push("link_open","a",1);s.attrs=[["href",l]],s.markup="linkify",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(O);const c=e.push("link_close","a",-1);c.markup="linkify",c.info="auto"}return e.pos+=O.length-o.length,!0}function M6(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let o=i-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&Fe(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const Am=[];for(let e=0;e<256;e++)Am.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Am[e.charCodeAt(0)]=1});function B6(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Fe(r));)n++;return e.pos=n,!0}let o=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const O=e.src.charCodeAt(n+1);O>=56320&&O<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const O=e.push("text_special","",0);r<256&&Am[r]!==0?O.content=o:O.content=a,O.markup=a,O.info="escape"}return e.pos=n+1,!0}function H6(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const a=e.src.slice(r,n),O=a.length;if(e.backticksScanned&&(e.backticks[O]||0)<=r)return t||(e.pending+=a),e.pos+=O,!0;let l=n,s;for(;(s=e.src.indexOf("`",l))!==-1;){for(l=s+1;l<o&&e.src.charCodeAt(l)===96;)l++;const u=l-s;if(u===O){if(!t){const c=e.push("code_inline","code",0);c.markup=a,c.content=e.src.slice(n,s).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[u]=s}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=O,!0}function K6(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const a=String.fromCharCode(i);if(o<2)return!1;let O;o%2&&(O=e.push("text","",0),O.content=a,o--);for(let l=0;l<o;l+=2)O=e.push("text","",0),O.content=a+a,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function mx(e,t){let n;const i=[],r=t.length;for(let o=0;o<r;o++){const a=t[o];if(a.marker!==126||a.end===-1)continue;const O=t[a.end];n=e.tokens[a.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[O.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[O.token-1].type==="text"&&e.tokens[O.token-1].content==="~"&&i.push(O.token-1)}for(;i.length;){const o=i.pop();let a=o+1;for(;a<e.tokens.length&&e.tokens[a].type==="s_close";)a++;a--,o!==a&&(n=e.tokens[a],e.tokens[a]=e.tokens[o],e.tokens[o]=n)}}function J6(e){const t=e.tokens_meta,n=e.tokens_meta.length;mx(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&mx(e,t[i].delimiters)}const gx={tokenize:K6,postProcess:J6};function eC(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let o=0;o<r.length;o++){const a=e.push("text","",0);a.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function $x(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],a=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===o.token+1,O=String.fromCharCode(r.marker),l=e.tokens[r.token];l.type=a?"strong_open":"em_open",l.tag=a?"strong":"em",l.nesting=1,l.markup=a?O+O:O,l.content="";const s=e.tokens[o.token];s.type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?O+O:O,s.content="",a&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function tC(e){const t=e.tokens_meta,n=e.tokens_meta.length;$x(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&$x(e,t[i].delimiters)}const Qx={tokenize:eC,postProcess:tC};function nC(e,t){let n,i,r,o,a="",O="",l=e.pos,s=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,c=e.posMax,f=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<c&&e.src.charCodeAt(p)===40){for(s=!1,p++;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(p>=c)return!1;if(l=p,r=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),r.ok){for(a=e.md.normalizeLink(r.str),e.md.validateLink(a)?p=r.pos:a="",l=p;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(r=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<c&&l!==p&&r.ok)for(O=r.str,p=r.pos;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);}(p>=c||e.src.charCodeAt(p)!==41)&&(s=!0),p++}if(s){if(typeof e.env.references>"u")return!1;if(p<c&&e.src.charCodeAt(p)===91?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?i=e.src.slice(l,p++):p=h+1):p=h+1,i||(i=e.src.slice(f,h)),o=e.env.references[Rc(i)],!o)return e.pos=u,!1;a=o.href,O=o.title}if(!t){e.pos=f,e.posMax=h;const m=e.push("link_open","a",1),b=[["href",a]];m.attrs=b,O&&b.push(["title",O]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=c,!0}function iC(e,t){let n,i,r,o,a,O,l,s,u="";const c=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<f&&e.src.charCodeAt(o)===40){for(o++;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(o>=f)return!1;for(s=o,O=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),O.ok&&(u=e.md.normalizeLink(O.str),e.md.validateLink(u)?o=O.pos:u=""),s=o;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(O=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<f&&s!==o&&O.ok)for(l=O.str,o=O.pos;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);else l="";if(o>=f||e.src.charCodeAt(o)!==41)return e.pos=c,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<f&&e.src.charCodeAt(o)===91?(s=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(s,o++):o=p+1):o=p+1,r||(r=e.src.slice(h,p)),a=e.env.references[Rc(r)],!a)return e.pos=c,!1;u=a.href,l=a.title}if(!t){i=e.src.slice(h,p);const m=[];e.md.inline.parse(i,e.md,e.env,m);const b=e.push("image","img",0),$=[["src",u],["alt",""]];b.attrs=$,b.children=m,b.content=i,l&&$.push(["title",l])}return e.pos=o,e.posMax=f,!0}const rC=/^([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])?)*)$/,oC=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function aC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(i+1,n);if(oC.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}if(rC.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}return!1}function OC(e){return/^<a[>\s]/i.test(e)}function lC(e){return/^<\/a\s*>/i.test(e)}function sC(e){const t=e|32;return t>=97&&t<=122}function uC(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!sC(r))return!1;const o=e.src.slice(i).match(V6);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],OC(a.content)&&e.linkLevel++,lC(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const cC=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,fC=/^&([a-z][a-z0-9]{1,31});/i;function dC(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(cC);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),O=e.push("text_special","",0);O.content=Ym(a)?_c(a):_c(65533),O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(fC);if(o){const a=rx(o[0]);if(a!==o[0]){if(!t){const O=e.push("text_special","",0);O.content=a,O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function bx(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const o=[];for(let a=0;a<n;a++){const O=e[a];if(o.push(0),(e[i].marker!==O.marker||r!==O.token-1)&&(i=a),r=O.token,O.length=O.length||0,!O.close)continue;t.hasOwnProperty(O.marker)||(t[O.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[O.marker][(O.open?3:0)+O.length%3];let s=i-o[i]-1,u=s;for(;s>l;s-=o[s]+1){const c=e[s];if(c.marker===O.marker&&c.open&&c.end<0){let f=!1;if((c.close||O.open)&&(c.length+O.length)%3===0&&(c.length%3!==0||O.length%3!==0)&&(f=!0),!f){const h=s>0&&!e[s-1].open?o[s-1]+1:0;o[a]=a-s+h,o[s]=h,O.open=!1,c.end=a,c.close=!1,u=-1,r=-2;break}}}u!==-1&&(t[O.marker][(O.open?3:0)+(O.length||0)%3]=u)}}function hC(e){const t=e.tokens_meta,n=e.tokens_meta.length;bx(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&bx(t[i].delimiters)}function pC(e){let t,n,i=0;const r=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<o&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const Gm=[["text",N6],["linkify",F6],["newline",M6],["escape",B6],["backticks",H6],["strikethrough",gx.tokenize],["emphasis",Qx.tokenize],["link",nC],["image",iC],["autolink",aC],["html_inline",uC],["entity",dC]],Im=[["balance_pairs",hC],["strikethrough",gx.postProcess],["emphasis",Qx.postProcess],["fragments_join",pC]];function Il(){this.ruler=new pn;for(let e=0;e<Gm.length;e++)this.ruler.push(Gm[e][0],Gm[e][1]);this.ruler2=new pn;for(let e=0;e<Im.length;e++)this.ruler2.push(Im[e][0],Im[e][1])}Il.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let a=!1;if(e.level<r){for(let O=0;O<i;O++)if(e.level++,a=n[O](e,!0),e.level--,a){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos},Il.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const o=e.pos;let a=!1;if(e.level<r){for(let O=0;O<n;O++)if(a=t[O](e,!1),a){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Il.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const o=this.ruler2.getRules(""),a=o.length;for(let O=0;O<a;O++)o[O](r)},Il.prototype.State=Gl;function mC(e){const t={};e=e||{},t.src_Any=Jk.source,t.src_Cc=ex.source,t.src_Z=nx.source,t.src_P=qm.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Dm(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Zc(e){return Object.prototype.toString.call(e)}function gC(e){return Zc(e)==="[object String]"}function $C(e){return Zc(e)==="[object Object]"}function QC(e){return Zc(e)==="[object RegExp]"}function yx(e){return Zc(e)==="[object Function]"}function bC(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Sx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function yC(e){return Object.keys(e||{}).reduce(function(t,n){return t||Sx.hasOwnProperty(n)},!1)}const SC={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},PC="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",kC="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function xC(e){e.__index__=-1,e.__text_cache__=""}function vC(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function Px(){return function(e,t){t.normalize(e)}}function Uc(e){const t=e.re=mC(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(PC),n.push(t.src_xn),t.src_tlds=n.join("|");function i(O){return O.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function o(O,l){throw new Error('(LinkifyIt) Invalid schema "'+O+'": '+l)}Object.keys(e.__schemas__).forEach(function(O){const l=e.__schemas__[O];if(l===null)return;const s={validate:null,link:null};if(e.__compiled__[O]=s,$C(l)){QC(l.validate)?s.validate=vC(l.validate):yx(l.validate)?s.validate=l.validate:o(O,l),yx(l.normalize)?s.normalize=l.normalize:l.normalize?o(O,l):s.normalize=Px();return}if(gC(l)){r.push(O);return}o(O,l)}),r.forEach(function(O){e.__compiled__[e.__schemas__[O]]&&(e.__compiled__[O].validate=e.__compiled__[e.__schemas__[O]].validate,e.__compiled__[O].normalize=e.__compiled__[e.__schemas__[O]].normalize)}),e.__compiled__[""]={validate:null,normalize:Px()};const a=Object.keys(e.__compiled__).filter(function(O){return O.length>0&&e.__compiled__[O]}).map(bC).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),xC(e)}function wC(e,t){const n=e.__index__,i=e.__last_index__,r=e.__text_cache__.slice(n,i);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=i+t,this.raw=r,this.text=r,this.url=r}function Nm(e,t){const n=new wC(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Tn(e,t){if(!(this instanceof Tn))return new Tn(e,t);t||yC(e)&&(t=e,e={}),this.__opts__=Dm({},Sx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Dm({},SC,e),this.__compiled__={},this.__tlds__=kC,this.__tlds_replaced__=!1,this.re={},Uc(this)}Tn.prototype.add=function(t,n){return this.__schemas__[t]=n,Uc(this),this},Tn.prototype.set=function(t){return this.__opts__=Dm(this.__opts__,t),this},Tn.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,i,r,o,a,O,l,s,u;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=t.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s<this.__index__)&&(i=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=i.index+i[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__="",this.__index__=a,this.__last_index__=i.index+i[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,O=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&O>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=O))),this.__index__>=0},Tn.prototype.pretest=function(t){return this.re.pretest.test(t)},Tn.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0},Tn.prototype.match=function(t){const n=[];let i=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Nm(this,i)),i=this.__last_index__);let r=i?t.slice(i):t;for(;this.test(r);)n.push(Nm(this,i)),r=r.slice(this.__last_index__),i+=this.__last_index__;return n.length?n:null},Tn.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);return i?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i,Nm(this,0)):null},Tn.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,o){return i!==o[r-1]}).reverse(),Uc(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Uc(this),this)},Tn.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},Tn.prototype.onCompile=function(){};const aO=2147483647,Ji=36,Lm=1,Dl=26,XC=38,TC=700,kx=72,xx=128,vx="-",_C=/^xn--/,RC=/[^\0-\x7F]/,zC=/[\x2E\u3002\uFF0E\uFF61]/g,WC={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fm=Ji-Lm,er=Math.floor,Mm=String.fromCharCode;function io(e){throw new RangeError(WC[e])}function qC(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function wx(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(zC,".");const r=e.split("."),o=qC(r,t).join(".");return i+o}function Xx(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const o=e.charCodeAt(n++);(o&64512)==56320?t.push(((r&1023)<<10)+(o&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const ZC=e=>String.fromCodePoint(...e),UC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Ji},Tx=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},_x=function(e,t,n){let i=0;for(e=n?er(e/TC):e>>1,e+=er(e/t);e>Fm*Dl>>1;i+=Ji)e=er(e/Fm);return er(i+(Fm+1)*e/(e+XC))},Rx=function(e){const t=[],n=e.length;let i=0,r=xx,o=kx,a=e.lastIndexOf(vx);a<0&&(a=0);for(let O=0;O<a;++O)e.charCodeAt(O)>=128&&io("not-basic"),t.push(e.charCodeAt(O));for(let O=a>0?a+1:0;O<n;){const l=i;for(let u=1,c=Ji;;c+=Ji){O>=n&&io("invalid-input");const f=UC(e.charCodeAt(O++));f>=Ji&&io("invalid-input"),f>er((aO-i)/u)&&io("overflow"),i+=f*u;const h=c<=o?Lm:c>=o+Dl?Dl:c-o;if(f<h)break;const p=Ji-h;u>er(aO/p)&&io("overflow"),u*=p}const s=t.length+1;o=_x(i-l,s,l==0),er(i/s)>aO-r&&io("overflow"),r+=er(i/s),i%=s,t.splice(i++,0,r)}return String.fromCodePoint(...t)},zx=function(e){const t=[];e=Xx(e);const n=e.length;let i=xx,r=0,o=kx;for(const l of e)l<128&&t.push(Mm(l));const a=t.length;let O=a;for(a&&t.push(vx);O<n;){let l=aO;for(const u of e)u>=i&&u<l&&(l=u);const s=O+1;l-i>er((aO-r)/s)&&io("overflow"),r+=(l-i)*s,i=l;for(const u of e)if(u<i&&++r>aO&&io("overflow"),u===i){let c=r;for(let f=Ji;;f+=Ji){const h=f<=o?Lm:f>=o+Dl?Dl:f-o;if(c<h)break;const p=c-h,m=Ji-h;t.push(Mm(Tx(h+p%m,0))),c=er(p/m)}t.push(Mm(Tx(c,0))),o=_x(r,s,O===a),r=0,++O}++r,++i}return t.join("")},Wx={version:"2.3.1",ucs2:{decode:Xx,encode:ZC},decode:Rx,encode:zx,toASCII:function(e){return wx(e,function(t){return RC.test(t)?"xn--"+zx(t):t})},toUnicode:function(e){return wx(e,function(t){return _C.test(t)?Rx(t.slice(4).toLowerCase()):t})}},EC={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},YC=/^(vbscript|javascript|file|data):/,VC=/^data:image\/(gif|png|jpeg|webp);/;function CC(e){const t=e.trim().toLowerCase();return YC.test(t)?VC.test(t):!0}const qx=["http:","https:","mailto:"];function jC(e){const t=Wm(e,!0);if(t.hostname&&(!t.protocol||qx.indexOf(t.protocol)>=0))try{t.hostname=Wx.toASCII(t.hostname)}catch{}return Vl(zm(t))}function AC(e){const t=Wm(e,!0);if(t.hostname&&(!t.protocol||qx.indexOf(t.protocol)>=0))try{t.hostname=Wx.toUnicode(t.hostname)}catch{}return nO(zm(t),nO.defaultChars+"%")}function Jn(e,t){if(!(this instanceof Jn))return new Jn(e,t);t||Em(e)||(t=e||{},e="default"),this.inline=new Il,this.block=new qc,this.core=new Cm,this.renderer=new rO,this.linkify=new Tn,this.validateLink=CC,this.normalizeLink=jC,this.normalizeLinkText=AC,this.utils=J3,this.helpers=Tc({},i6),this.options={},this.configure(e),t&&this.set(t)}Jn.prototype.set=function(e){return Tc(this.options,e),this},Jn.prototype.configure=function(e){const t=this;if(Em(e)){const n=e;if(e=EC[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},Jn.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this},Jn.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this},Jn.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},Jn.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},Jn.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Jn.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Jn.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Zx=new Set([!0,!1,"alt","title"]);function Ux(e,t){return(Array.isArray(e)?e:[]).filter(([n])=>n!==t)}function Ex(e,t){e&&e.attrs&&(e.attrs=Ux(e.attrs,t))}function GC(e,t){if(!Zx.has(e))throw new TypeError(`figcaption must be one of: ${[...Zx]}.`);if(e==="alt")return t.content;const n=t.attrs.find(([i])=>i==="title");return Array.isArray(n)&&n[1]?(Ex(t,"title"),n[1]):void 0}function IC(e,t){t=t||{},e.core.ruler.before("linkify","image_figures",function(n){let i=1;for(let r=1,o=n.tokens.length;r<o-1;++r){const a=n.tokens[r];if(a.type!=="inline"||!a.children||a.children.length!==1&&a.children.length!==3||a.children.length===1&&a.children[0].type!=="image")continue;if(a.children.length===3){const[s,u,c]=a.children;if(s.type!=="link_open"||u.type!=="image"||c.type!=="link_close")continue}if(r!==0&&n.tokens[r-1].type!=="paragraph_open"||r!==o-1&&n.tokens[r+1].type!=="paragraph_close")continue;const O=n.tokens[r-1];let l;if(O.type="figure_open",O.tag="figure",n.tokens[r+1].type="figure_close",n.tokens[r+1].tag="figure",t.dataType&&n.tokens[r-1].attrPush(["data-type","image"]),t.link&&a.children.length===1){[l]=a.children;const s=new n.Token("link_open","a",1);s.attrPush(["href",l.attrGet("src")]),a.children.unshift(s),a.children.push(new n.Token("link_close","a",-1))}if(l=a.children.length===1?a.children[0]:a.children[1],t.figcaption){const s=GC(t.figcaption,l);if(s){const[u]=e.parseInline(s,n.env);a.children.push(new n.Token("figcaption_open","figcaption",1)),a.children.push(...u.children),a.children.push(new n.Token("figcaption_close","figcaption",-1)),l.attrs&&(l.attrs=Ux(l.attrs,"title"))}}if(t.copyAttrs&&l.attrs){const s=t.copyAttrs===!0?"":t.copyAttrs;O.attrs=l.attrs.filter(([u])=>u.match(s)).map(u=>Array.from(u))}if(t.tabindex&&(n.tokens[r-1].attrPush(["tabindex",i]),i++),t.lazy&&(l.attrs.some(([s])=>s==="loading")||l.attrs.push(["loading","lazy"])),t.async&&(l.attrs.some(([s])=>s==="decoding")||l.attrs.push(["decoding","async"])),t.classes&&typeof t.classes=="string"){let s=!1;for(let u=0,c=l.attrs.length;u<c&&!s;u++){const f=l.attrs[u];f[0]==="class"&&(f[1]=`${f[1]} ${t.classes}`,s=!0)}s||l.attrs.push(["class",t.classes])}if(t.removeSrc){const s=l.attrs.find(([u])=>u==="src");l.attrs.push(["data-src",s[1]]),Ex(l,"src")}}})}var Bm=!0,Yx=!1,Vx=!1,DC=function(e,t){t&&(Bm=!t.enabled,Yx=!!t.label,Vx=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)LC(i,r)&&(FC(i[r],n.Token),Cx(i[r-2],"class","task-list-item"+(Bm?"":" enabled")),Cx(i[NC(i,r-2)],"class","contains-task-list"))})};function Cx(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function NC(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function LC(e,t){return JC(e[t])&&e9(e[t-1])&&t9(e[t-2])&&n9(e[t])}function FC(e,t){if(e.children.unshift(MC(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),Yx)if(Vx){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(KC(e.content,n,t))}else e.children.unshift(BC(t)),e.children.push(HC(t))}function MC(e,t){var n=new t("html_inline","",0),i=Bm?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function BC(e){var t=new e("html_inline","",0);return t.content="<label>",t}function HC(e){var t=new e("html_inline","",0);return t.content="</label>",t}function KC(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function JC(e){return e.type==="inline"}function e9(e){return e.type==="paragraph_open"}function t9(e){return e.type==="list_item_open"}function n9(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}const i9=Rm(DC),r9=e=>{const t=g.inject("highlight"),n=g.shallowRef(dt.editorExtensions.highlight.instance);return g.onMounted(()=>{e.noHighlight||n.value||(un("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`}),un("script",{...t.value.js,id:`${z}-hljs`,onload(){n.value=window.hljs}},"hljs"))}),g.watch(()=>t.value.css,()=>{pW("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`})}),n},OO=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,jx=new Set,Hm=typeof process=="object"&&process?process:{},Ax=(e,t,n,i)=>{typeof Hm.emitWarning=="function"?Hm.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let Ec=globalThis.AbortController,Gx=globalThis.AbortSignal;if(typeof Ec>"u"){Gx=class{constructor(){Xe(this,"onabort");Xe(this,"_onabort",[]);Xe(this,"reason");Xe(this,"aborted",!1)}addEventListener(i,r){this._onabort.push(r)}},Ec=class{constructor(){Xe(this,"signal",new Gx);t()}abort(i){var r,o;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const a of this.signal._onabort)a(i);(o=(r=this.signal).onabort)==null||o.call(r,i)}}};let e=((Iz=Hm.env)==null?void 0:Iz.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const t=()=>{e&&(e=!1,Ax("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const o9=e=>!jx.has(e),ro=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Ix=e=>ro(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Yc:null:null;class Yc extends Array{constructor(t){super(t),this.fill(0)}}const ha=class ha{constructor(t,n){Xe(this,"heap");Xe(this,"length");if(!T(ha,_O))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(t),this.length=0}static create(t){const n=Ix(t);if(!n)return[];fe(ha,_O,!0);const i=new ha(t,n);return fe(ha,_O,!1),i}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};_O=new WeakMap,Qe(ha,_O,!1);let Km=ha;const DQ=class DQ{constructor(t){Qe(this,Gs);Qe(this,_d);Qe(this,Or);Qe(this,lr);Qe(this,Ns);Qe(this,WO);Qe(this,qO);Qe(this,Le);Qe(this,Ls);Qe(this,ga);Qe(this,Ti,void 0);Qe(this,En,void 0);Qe(this,_i,void 0);Qe(this,Ri,void 0);Qe(this,RO,void 0);Xe(this,"ttl");Xe(this,"ttlResolution");Xe(this,"ttlAutopurge");Xe(this,"updateAgeOnGet");Xe(this,"updateAgeOnHas");Xe(this,"allowStale");Xe(this,"noDisposeOnSet");Xe(this,"noUpdateTTL");Xe(this,"maxEntrySize");Xe(this,"sizeCalculation");Xe(this,"noDeleteOnFetchRejection");Xe(this,"noDeleteOnStaleGet");Xe(this,"allowStaleOnFetchAbort");Xe(this,"allowStaleOnFetchRejection");Xe(this,"ignoreFetchAbort");Qe(this,_t,void 0);Qe(this,zi,void 0);Qe(this,Pt,void 0);Qe(this,Ke,void 0);Qe(this,ge,void 0);Qe(this,ln,void 0);Qe(this,Yn,void 0);Qe(this,Jt,void 0);Qe(this,Ut,void 0);Qe(this,Wi,void 0);Qe(this,Et,void 0);Qe(this,qi,void 0);Qe(this,Zi,void 0);Qe(this,Vn,void 0);Qe(this,Ui,void 0);Qe(this,yo,void 0);Qe(this,sn,void 0);Qe(this,pa,()=>{});Qe(this,qr,()=>{});Qe(this,Is,()=>{});Qe(this,Cn,()=>!1);Qe(this,ma,t=>{});Qe(this,zO,(t,n,i)=>{});Qe(this,Ds,(t,n,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Xe(this,ZOe,"LRUCache");const{max:n=0,ttl:i,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:O,allowStale:l,dispose:s,disposeAfter:u,noDisposeOnSet:c,noUpdateTTL:f,maxSize:h=0,maxEntrySize:p=0,sizeCalculation:m,fetchMethod:b,noDeleteOnFetchRejection:$,noDeleteOnStaleGet:Q,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:k,ignoreFetchAbort:S}=t;if(n!==0&&!ro(n))throw new TypeError("max option must be a nonnegative integer");const R=n?Ix(n):Array;if(!R)throw new Error("invalid max value: "+n);if(fe(this,Ti,n),fe(this,En,h),this.maxEntrySize=p||T(this,En),this.sizeCalculation=m,this.sizeCalculation){if(!T(this,En)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,RO,b),fe(this,yo,!!b),fe(this,Pt,new Map),fe(this,Ke,new Array(n).fill(void 0)),fe(this,ge,new Array(n).fill(void 0)),fe(this,ln,new R(n)),fe(this,Yn,new R(n)),fe(this,Jt,0),fe(this,Ut,0),fe(this,Wi,Km.create(n)),fe(this,_t,0),fe(this,zi,0),typeof s=="function"&&fe(this,_i,s),typeof u=="function"?(fe(this,Ri,u),fe(this,Et,[])):(fe(this,Ri,void 0),fe(this,Et,void 0)),fe(this,Ui,!!T(this,_i)),fe(this,sn,!!T(this,Ri)),this.noDisposeOnSet=!!c,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!$,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(T(this,En)!==0&&!ro(T(this,En)))throw new TypeError("maxSize must be a positive integer if specified");if(!ro(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");le(this,_d,Jz).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!O,this.ttlResolution=ro(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!ro(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,Gs,MQ).call(this)}if(T(this,Ti)===0&&this.ttl===0&&T(this,En)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,Ti)&&!T(this,En)){const w="LRU_CACHE_UNBOUNDED";o9(w)&&(jx.add(w),Ax("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",w,DQ))}}static unsafeExposeInternals(t){return{starts:T(t,Zi),ttls:T(t,Vn),sizes:T(t,qi),keyMap:T(t,Pt),keyList:T(t,Ke),valList:T(t,ge),next:T(t,ln),prev:T(t,Yn),get head(){return T(t,Jt)},get tail(){return T(t,Ut)},free:T(t,Wi),isBackgroundFetch:n=>{var i;return le(i=t,Le,et).call(i,n)},backgroundFetch:(n,i,r,o)=>{var a;return le(a=t,qO,Fd).call(a,n,i,r,o)},moveToTail:n=>{var i;return le(i=t,ga,Js).call(i,n)},indexes:n=>{var i;return le(i=t,Or,ko).call(i,n)},rindexes:n=>{var i;return le(i=t,lr,xo).call(i,n)},isStale:n=>{var i;return T(i=t,Cn).call(i,n)}}}get max(){return T(this,Ti)}get maxSize(){return T(this,En)}get calculatedSize(){return T(this,zi)}get size(){return T(this,_t)}get fetchMethod(){return T(this,RO)}get dispose(){return T(this,_i)}get disposeAfter(){return T(this,Ri)}getRemainingTTL(t){return T(this,Pt).has(t)?1/0:0}*entries(){for(const t of le(this,Or,ko).call(this))T(this,ge)[t]!==void 0&&T(this,Ke)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield[T(this,Ke)[t],T(this,ge)[t]])}*rentries(){for(const t of le(this,lr,xo).call(this))T(this,ge)[t]!==void 0&&T(this,Ke)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield[T(this,Ke)[t],T(this,ge)[t]])}*keys(){for(const t of le(this,Or,ko).call(this)){const n=T(this,Ke)[t];n!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield n)}}*rkeys(){for(const t of le(this,lr,xo).call(this)){const n=T(this,Ke)[t];n!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield n)}}*values(){for(const t of le(this,Or,ko).call(this))T(this,ge)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield T(this,ge)[t])}*rvalues(){for(const t of le(this,lr,xo).call(this))T(this,ge)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield T(this,ge)[t])}[Symbol.iterator](){return this.entries()}find(t,n={}){for(const i of le(this,Or,ko).call(this)){const r=T(this,ge)[i],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&t(o,T(this,Ke)[i],this))return this.get(T(this,Ke)[i],n)}}forEach(t,n=this){for(const i of le(this,Or,ko).call(this)){const r=T(this,ge)[i],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,T(this,Ke)[i],this)}}rforEach(t,n=this){for(const i of le(this,lr,xo).call(this)){const r=T(this,ge)[i],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,T(this,Ke)[i],this)}}purgeStale(){let t=!1;for(const n of le(this,lr,xo).call(this,{allowStale:!0}))T(this,Cn).call(this,n)&&(this.delete(T(this,Ke)[n]),t=!0);return t}info(t){const n=T(this,Pt).get(t);if(n===void 0)return;const i=T(this,ge)[n],r=le(this,Le,et).call(this,i)?i.__staleWhileFetching:i;if(r===void 0)return;const o={value:r};if(T(this,Vn)&&T(this,Zi)){const a=T(this,Vn)[n],O=T(this,Zi)[n];if(a&&O){const l=a-(OO.now()-O);o.ttl=l,o.start=Date.now()}}return T(this,qi)&&(o.size=T(this,qi)[n]),o}dump(){const t=[];for(const n of le(this,Or,ko).call(this,{allowStale:!0})){const i=T(this,Ke)[n],r=T(this,ge)[n],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||i===void 0)continue;const a={value:o};if(T(this,Vn)&&T(this,Zi)){a.ttl=T(this,Vn)[n];const O=OO.now()-T(this,Zi)[n];a.start=Math.floor(Date.now()-O)}T(this,qi)&&(a.size=T(this,qi)[n]),t.unshift([i,a])}return t}load(t){this.clear();for(const[n,i]of t){if(i.start){const r=Date.now()-i.start;i.start=OO.now()-r}this.set(n,i.value,i)}}set(t,n,i={}){var f,h,p,m,b;if(n===void 0)return this.delete(t),this;const{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:O=this.sizeCalculation,status:l}=i;let{noUpdateTTL:s=this.noUpdateTTL}=i;const u=T(this,Ds).call(this,t,n,i.size||0,O);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(t),this;let c=T(this,_t)===0?void 0:T(this,Pt).get(t);if(c===void 0)c=T(this,_t)===0?T(this,Ut):T(this,Wi).length!==0?T(this,Wi).pop():T(this,_t)===T(this,Ti)?le(this,WO,Ld).call(this,!1):T(this,_t),T(this,Ke)[c]=t,T(this,ge)[c]=n,T(this,Pt).set(t,c),T(this,ln)[T(this,Ut)]=c,T(this,Yn)[c]=T(this,Ut),fe(this,Ut,c),Nd(this,_t)._++,T(this,zO).call(this,c,u,l),l&&(l.set="add"),s=!1;else{le(this,ga,Js).call(this,c);const $=T(this,ge)[c];if(n!==$){if(T(this,yo)&&le(this,Le,et).call(this,$)){$.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Q}=$;Q!==void 0&&!a&&(T(this,Ui)&&((f=T(this,_i))==null||f.call(this,Q,t,"set")),T(this,sn)&&((h=T(this,Et))==null||h.push([Q,t,"set"])))}else a||(T(this,Ui)&&((p=T(this,_i))==null||p.call(this,$,t,"set")),T(this,sn)&&((m=T(this,Et))==null||m.push([$,t,"set"])));if(T(this,ma).call(this,c),T(this,zO).call(this,c,u,l),T(this,ge)[c]=n,l){l.set="replace";const Q=$&&le(this,Le,et).call(this,$)?$.__staleWhileFetching:$;Q!==void 0&&(l.oldValue=Q)}}else l&&(l.set="update")}if(r!==0&&!T(this,Vn)&&le(this,Gs,MQ).call(this),T(this,Vn)&&(s||T(this,Is).call(this,c,r,o),l&&T(this,qr).call(this,l,c)),!a&&T(this,sn)&&T(this,Et)){const $=T(this,Et);let Q;for(;Q=$==null?void 0:$.shift();)(b=T(this,Ri))==null||b.call(this,...Q)}return this}pop(){var t;try{for(;T(this,_t);){const n=T(this,ge)[T(this,Jt)];if(le(this,WO,Ld).call(this,!0),le(this,Le,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(T(this,sn)&&T(this,Et)){const n=T(this,Et);let i;for(;i=n==null?void 0:n.shift();)(t=T(this,Ri))==null||t.call(this,...i)}}}has(t,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=n,o=T(this,Pt).get(t);if(o!==void 0){const a=T(this,ge)[o];if(le(this,Le,et).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(T(this,Cn).call(this,o))r&&(r.has="stale",T(this,qr).call(this,r,o));else return i&&T(this,pa).call(this,o),r&&(r.has="hit",T(this,qr).call(this,r,o)),!0}else r&&(r.has="miss");return!1}peek(t,n={}){const{allowStale:i=this.allowStale}=n,r=T(this,Pt).get(t);if(r===void 0||!i&&T(this,Cn).call(this,r))return;const o=T(this,ge)[r];return le(this,Le,et).call(this,o)?o.__staleWhileFetching:o}async fetch(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:O=this.noDisposeOnSet,size:l=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:$,signal:Q}=n;if(!T(this,yo))return $&&($.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:$});const P={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:O,size:l,sizeCalculation:s,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:$,signal:Q};let k=T(this,Pt).get(t);if(k===void 0){$&&($.fetch="miss");const S=le(this,qO,Fd).call(this,t,k,P,m);return S.__returned=S}else{const S=T(this,ge)[k];if(le(this,Le,et).call(this,S)){const E=i&&S.__staleWhileFetching!==void 0;return $&&($.fetch="inflight",E&&($.returnedStale=!0)),E?S.__staleWhileFetching:S.__returned=S}const R=T(this,Cn).call(this,k);if(!b&&!R)return $&&($.fetch="hit"),le(this,ga,Js).call(this,k),r&&T(this,pa).call(this,k),$&&T(this,qr).call(this,$,k),S;const w=le(this,qO,Fd).call(this,t,k,P,m),v=w.__staleWhileFetching!==void 0&&i;return $&&($.fetch=R?"stale":"refresh",v&&R&&($.returnedStale=!0)),v?w.__staleWhileFetching:w.__returned=w}}get(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=n,O=T(this,Pt).get(t);if(O!==void 0){const l=T(this,ge)[O],s=le(this,Le,et).call(this,l);return a&&T(this,qr).call(this,a,O),T(this,Cn).call(this,O)?(a&&(a.get="stale"),s?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(o||this.delete(t),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),s?l.__staleWhileFetching:(le(this,ga,Js).call(this,O),r&&T(this,pa).call(this,O),l))}else a&&(a.get="miss")}delete(t){var i,r,o,a;let n=!1;if(T(this,_t)!==0){const O=T(this,Pt).get(t);if(O!==void 0)if(n=!0,T(this,_t)===1)this.clear();else{T(this,ma).call(this,O);const l=T(this,ge)[O];if(le(this,Le,et).call(this,l)?l.__abortController.abort(new Error("deleted")):(T(this,Ui)||T(this,sn))&&(T(this,Ui)&&((i=T(this,_i))==null||i.call(this,l,t,"delete")),T(this,sn)&&((r=T(this,Et))==null||r.push([l,t,"delete"]))),T(this,Pt).delete(t),T(this,Ke)[O]=void 0,T(this,ge)[O]=void 0,O===T(this,Ut))fe(this,Ut,T(this,Yn)[O]);else if(O===T(this,Jt))fe(this,Jt,T(this,ln)[O]);else{const s=T(this,Yn)[O];T(this,ln)[s]=T(this,ln)[O];const u=T(this,ln)[O];T(this,Yn)[u]=T(this,Yn)[O]}Nd(this,_t)._--,T(this,Wi).push(O)}}if(T(this,sn)&&((o=T(this,Et))!=null&&o.length)){const O=T(this,Et);let l;for(;l=O==null?void 0:O.shift();)(a=T(this,Ri))==null||a.call(this,...l)}return n}clear(){var t,n,i;for(const r of le(this,lr,xo).call(this,{allowStale:!0})){const o=T(this,ge)[r];if(le(this,Le,et).call(this,o))o.__abortController.abort(new Error("deleted"));else{const a=T(this,Ke)[r];T(this,Ui)&&((t=T(this,_i))==null||t.call(this,o,a,"delete")),T(this,sn)&&((n=T(this,Et))==null||n.push([o,a,"delete"]))}}if(T(this,Pt).clear(),T(this,ge).fill(void 0),T(this,Ke).fill(void 0),T(this,Vn)&&T(this,Zi)&&(T(this,Vn).fill(0),T(this,Zi).fill(0)),T(this,qi)&&T(this,qi).fill(0),fe(this,Jt,0),fe(this,Ut,0),T(this,Wi).length=0,fe(this,zi,0),fe(this,_t,0),T(this,sn)&&T(this,Et)){const r=T(this,Et);let o;for(;o=r==null?void 0:r.shift();)(i=T(this,Ri))==null||i.call(this,...o)}}};ZOe=Symbol.toStringTag,Ti=new WeakMap,En=new WeakMap,_i=new WeakMap,Ri=new WeakMap,RO=new WeakMap,_t=new WeakMap,zi=new WeakMap,Pt=new WeakMap,Ke=new WeakMap,ge=new WeakMap,ln=new WeakMap,Yn=new WeakMap,Jt=new WeakMap,Ut=new WeakMap,Wi=new WeakMap,Et=new WeakMap,qi=new WeakMap,Zi=new WeakMap,Vn=new WeakMap,Ui=new WeakMap,yo=new WeakMap,sn=new WeakMap,Gs=new WeakSet,MQ=function(){const t=new Yc(T(this,Ti)),n=new Yc(T(this,Ti));fe(this,Vn,t),fe(this,Zi,n),fe(this,Is,(o,a,O=OO.now())=>{if(n[o]=a!==0?O:0,t[o]=a,a!==0&&this.ttlAutopurge){const l=setTimeout(()=>{T(this,Cn).call(this,o)&&this.delete(T(this,Ke)[o])},a+1);l.unref&&l.unref()}}),fe(this,pa,o=>{n[o]=t[o]!==0?OO.now():0}),fe(this,qr,(o,a)=>{if(t[a]){const O=t[a],l=n[a];if(!O||!l)return;o.ttl=O,o.start=l,o.now=i||r();const s=o.now-l;o.remainingTTL=O-s}});let i=0;const r=()=>{const o=OO.now();if(this.ttlResolution>0){i=o;const a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{const a=T(this,Pt).get(o);if(a===void 0)return 0;const O=t[a],l=n[a];if(!O||!l)return 1/0;const s=(i||r())-l;return O-s},fe(this,Cn,o=>{const a=n[o],O=t[o];return!!O&&!!a&&(i||r())-a>O})},pa=new WeakMap,qr=new WeakMap,Is=new WeakMap,Cn=new WeakMap,_d=new WeakSet,Jz=function(){const t=new Yc(T(this,Ti));fe(this,zi,0),fe(this,qi,t),fe(this,ma,n=>{fe(this,zi,T(this,zi)-t[n]),t[n]=0}),fe(this,Ds,(n,i,r,o)=>{if(le(this,Le,et).call(this,i))return 0;if(!ro(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(i,n),!ro(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),fe(this,zO,(n,i,r)=>{if(t[n]=i,T(this,En)){const o=T(this,En)-t[n];for(;T(this,zi)>o;)le(this,WO,Ld).call(this,!0)}fe(this,zi,T(this,zi)+t[n]),r&&(r.entrySize=i,r.totalCalculatedSize=T(this,zi))})},ma=new WeakMap,zO=new WeakMap,Ds=new WeakMap,Or=new WeakSet,ko=function*({allowStale:t=this.allowStale}={}){if(T(this,_t))for(let n=T(this,Ut);!(!le(this,Ns,BQ).call(this,n)||((t||!T(this,Cn).call(this,n))&&(yield n),n===T(this,Jt)));)n=T(this,Yn)[n]},lr=new WeakSet,xo=function*({allowStale:t=this.allowStale}={}){if(T(this,_t))for(let n=T(this,Jt);!(!le(this,Ns,BQ).call(this,n)||((t||!T(this,Cn).call(this,n))&&(yield n),n===T(this,Ut)));)n=T(this,ln)[n]},Ns=new WeakSet,BQ=function(t){return t!==void 0&&T(this,Pt).get(T(this,Ke)[t])===t},WO=new WeakSet,Ld=function(t){var o,a;const n=T(this,Jt),i=T(this,Ke)[n],r=T(this,ge)[n];return T(this,yo)&&le(this,Le,et).call(this,r)?r.__abortController.abort(new Error("evicted")):(T(this,Ui)||T(this,sn))&&(T(this,Ui)&&((o=T(this,_i))==null||o.call(this,r,i,"evict")),T(this,sn)&&((a=T(this,Et))==null||a.push([r,i,"evict"]))),T(this,ma).call(this,n),t&&(T(this,Ke)[n]=void 0,T(this,ge)[n]=void 0,T(this,Wi).push(n)),T(this,_t)===1?(fe(this,Jt,fe(this,Ut,0)),T(this,Wi).length=0):fe(this,Jt,T(this,ln)[n]),T(this,Pt).delete(i),Nd(this,_t)._--,n},qO=new WeakSet,Fd=function(t,n,i,r){const o=n===void 0?void 0:T(this,ge)[n];if(le(this,Le,et).call(this,o))return o;const a=new Ec,{signal:O}=i;O==null||O.addEventListener("abort",()=>a.abort(O.reason),{signal:a.signal});const l={signal:a.signal,options:i,context:r},s=(m,b=!1)=>{const{aborted:$}=a.signal,Q=i.ignoreFetchAbort&&m!==void 0;if(i.status&&($&&!b?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,Q&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),$&&!Q&&!b)return c(a.signal.reason);const P=h;return T(this,ge)[n]===h&&(m===void 0?P.__staleWhileFetching?T(this,ge)[n]=P.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,m,l.options))),m},u=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),c(m)),c=m=>{const{aborted:b}=a.signal,$=b&&i.allowStaleOnFetchAbort,Q=$||i.allowStaleOnFetchRejection,P=Q||i.noDeleteOnFetchRejection,k=h;if(T(this,ge)[n]===h&&(!P||k.__staleWhileFetching===void 0?this.delete(t):$||(T(this,ge)[n]=k.__staleWhileFetching)),Q)return i.status&&k.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw m},f=(m,b)=>{var Q;const $=(Q=T(this,RO))==null?void 0:Q.call(this,t,o,l);$&&$ instanceof Promise&&$.then(P=>m(P===void 0?void 0:P),b),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=P=>s(P,!0)))})};i.status&&(i.status.fetchDispatched=!0);const h=new Promise(f).then(s,u),p=Object.assign(h,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return n===void 0?(this.set(t,p,{...l.options,status:void 0}),n=T(this,Pt).get(t)):T(this,ge)[n]=p,p},Le=new WeakSet,et=function(t){if(!T(this,yo))return!1;const n=t;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ec},Ls=new WeakSet,HQ=function(t,n){T(this,Yn)[n]=t,T(this,ln)[t]=n},ga=new WeakSet,Js=function(t){t!==T(this,Ut)&&(t===T(this,Jt)?fe(this,Jt,T(this,ln)[t]):le(this,Ls,HQ).call(this,T(this,Yn)[t],T(this,ln)[t]),le(this,Ls,HQ).call(this,T(this,Ut),t),fe(this,Ut,t))};let Jm=DQ;const a9=e=>{const t=g.inject("theme"),{editorExtensions:n,editorExtensionsAttrs:i,mermaidConfig:r}=dt,o=g.shallowRef(n.mermaid.instance),a=g.shallowRef(-1),O=new Jm({max:1e3,ttl:6e5}),l=()=>{const u=o.value;!e.noMermaid&&u&&(u.initialize(r({startOnLoad:!1,theme:t.value==="dark"?"dark":"default"})),a.value=a.value+1)};return g.watch(()=>t.value,()=>{O.clear(),l()}),g.onMounted(()=>{var c,f,h;if(e.noMermaid||(c=o.value)!=null&&c.instance)return;const u=n.mermaid.js;/\.mjs/.test(u)?(un("link",{...(f=i.mermaid)==null?void 0:f.js,rel:"modulepreload",href:u,id:`${z}-mermaid-m`}),import(u).then(p=>{o.value=p.default,l()})):un("script",{...(h=i.mermaid)==null?void 0:h.js,src:u,id:`${z}-mermaid`,onload(){o.value=window.mermaid,l()}},"mermaid")}),{mermaidRef:o,reRenderRef:a,replaceMermaid:()=>{g.nextTick(()=>{if(!e.noMermaid&&o.value){const u=document.querySelectorAll(`div.${z}-mermaid`),c=document.createElement("div");c.style.width=document.body.offsetWidth+"px",c.style.height=document.body.offsetHeight+"px",c.style.position="fixed",c.style.zIndex="-10000",c.style.top="-10000";let f=u.length;f>0&&document.body.appendChild(c),u.forEach(async h=>{let p=O.get(h.innerText);if(!p){const b=Hd(),$=o.value.renderAsync||o.value.render;let Q="";try{Q=await $(b,h.innerText,c)}catch{}p=await e.sanitizeMermaid(typeof Q=="string"?Q:Q.svg),O.set(h.innerText,p)}const m=document.createElement("p");m.className=`${z}-mermaid`,m.setAttribute("data-processed",""),m.innerHTML=p,h.dataset.line!==void 0&&(m.dataset.line=h.dataset.line),h.replaceWith(m),--f===0&&c.remove()})}})}}},O9=e=>{const t=g.shallowRef(dt.editorExtensions.katex.instance);return g.onMounted(()=>{if(e.noKatex||t.value)return;const{editorExtensions:n}=dt;un("script",{src:n.katex.js,id:`${z}-katex`,onload(){t.value=window.katex}},"katex"),un("link",{rel:"stylesheet",href:n.katex.css,id:`${z}-katexCss`})}),t},l9=(e,t)=>{const n=e.renderer.rules.fence.bind(e.renderer.rules);e.renderer.rules.fence=(i,r,o,a,O)=>{const l=i[r],s=l.content.trim();if(l.info==="mermaid"){let u;return i[r].map&&i[r].level===0&&(u=i[r].map[0],i[r].attrSet("data-line",String(u))),`<div class="${z}-mermaid" ${u!==void 0?"data-line="+u:""} data-mermaid-theme=${t.themeRef.value}>${s}</div>`}return n(i,r,o,a,O)}},Vc=(e,t)=>{const n=e.attrs?e.attrs.slice():[];return t.forEach(i=>{const r=e.attrIndex(i[0]);r<0?n.push(i):(n[r]=n[r].slice(),n[r][1]+=` ${i[1]}`)}),n},Dx=(e,t)=>{let n=!0,i=!0;const r=e.posMax,o=t>0?e.src.charCodeAt(t-1):-1,a=t+1<=r?e.src.charCodeAt(t+1):-1;return(o===32||o===9||a>=48&&a<=57)&&(i=!1),(a===32||a===9)&&(n=!1),{can_open:n,can_close:i}},s9=(e,t)=>{let n,i,r,o;if(e.src[e.pos]!=="$")return!1;if(r=Dx(e,e.pos),!r.can_open)return t||(e.pending+="$"),e.pos+=1,!0;const a=e.pos+1;for(n=a;(n=e.src.indexOf("$",n))!==-1;){for(o=n-1;e.src[o]==="\\";)o-=1;if((n-o)%2==1)break;n+=1}return n===-1?(t||(e.pending+="$"),e.pos=a,!0):n-a===0?(t||(e.pending+="$$"),e.pos=a+1,!0):(r=Dx(e,n),r.can_close?(t||(i=e.push("math_inline","math",0),i.markup="$",i.content=e.src.slice(a,n)),e.pos=n+1,!0):(t||(e.pending+="$"),e.pos=a,!0))},u9=(e,t,n,i)=>{let r,o,a,O,l=!1,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s+2>u||e.src.slice(s,s+2)!=="$$")return!1;if(s+=2,r=e.src.slice(s,u),i)return!0;for(r.trim().slice(-2)==="$$"&&(r=r.trim().slice(0,-2),l=!0),a=t;!l&&(a++,!(a>=n||(s=e.bMarks[a]+e.tShift[a],u=e.eMarks[a],s<u&&e.tShift[a]<e.blkIndent)));)e.src.slice(s,u).trim().slice(-2)==="$$"&&(O=e.src.slice(0,u).lastIndexOf("$$"),o=e.src.slice(s,O),l=!0);e.line=a+1;const c=e.push("math_block","math",0);return c.block=!0,c.content=(r&&r.trim()?r+`
|
|
114
|
-
`:"")+e.getLines(t+1,a,e.tShift[t],!0)+(o&&o.trim()?o:""),c.map=[t,e.line],c.markup="$$",!0},c9=(e,{katexRef:t})=>{const n=(r,o,a,O,l)=>{const s=r[o],u={attrs:Vc(s,[["class",`${z}-katex-inline`]])};if(t.value){const c=t.value.renderToString(s.content,{throwOnError:!1});return`<span ${l.renderAttrs(u)} data-processed>${c}</span>`}else return`<span ${l.renderAttrs(u)}>${s.content}</span>`},i=(r,o,a,O,l)=>{const s=r[o],u={attrs:Vc(s,[["class",`${z}-katex-block`]])};if(t.value){const c=t.value.renderToString(s.content,{throwOnError:!1,displayMode:!0});return`<p ${l.renderAttrs(u)} data-processed>${c}</p>`}else return`<p ${l.renderAttrs(u)}>${s.content}</p>`};e.inline.ruler.after("escape","math_inline",s9),e.block.ruler.after("blockquote","math_block",u9,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=n,e.renderer.rules.math_block=i},f9=(e,t)=>{t=t||{};const n=3,i=t.marker||"!",r=i.charCodeAt(0),o=i.length;let a="",O="";const l=(u,c,f,h,p)=>{const m=u[c];return m.type==="admonition_open"?u[c].attrPush(["class",`${z}-admonition ${z}-admonition-${m.info}`]):m.type==="admonition_title_open"&&u[c].attrPush(["class",`${z}-admonition-title`]),p.renderToken(u,c,f)},s=u=>{const c=u.trim().split(" ",2);O="",a=c[0],c.length>1&&(O=u.substring(a.length+2))};e.block.ruler.before("code","admonition",(u,c,f,h)=>{let p,m,b,$=!1,Q=u.bMarks[c]+u.tShift[c],P=u.eMarks[c];if(r!==u.src.charCodeAt(Q))return!1;for(p=Q+1;p<=P&&i[(p-Q)%o]===u.src[p];p++);const k=Math.floor((p-Q)/o);if(k!==n)return!1;p-=(p-Q)%o;const S=u.src.slice(Q,p),R=u.src.slice(p,P);if(s(R),h)return!0;for(m=c;m++,!(m>=f||(Q=u.bMarks[m]+u.tShift[m],P=u.eMarks[m],Q<P&&u.sCount[m]<u.blkIndent));)if(r===u.src.charCodeAt(Q)&&!(u.sCount[m]-u.blkIndent>=4)){for(p=Q+1;p<=P&&i[(p-Q)%o]===u.src[p];p++);if(!(Math.floor((p-Q)/o)<k)&&(p-=(p-Q)%o,p=u.skipSpaces(p),!(p<P))){$=!0;break}}const w=u.parentType,x=u.lineMax;return u.parentType="root",u.lineMax=m,b=u.push("admonition_open","div",1),b.markup=S,b.block=!0,b.info=a,b.map=[c,m],O&&(b=u.push("admonition_title_open","p",1),b.markup=S+" "+a,b.map=[c,m],b=u.push("inline","",0),b.content=O,b.map=[c,u.line-1],b.children=[],b=u.push("admonition_title_close","p",-1),b.markup=S+" "+a),u.md.block.tokenize(u,c+1,m),b=u.push("admonition_close","div",-1),b.markup=u.src.slice(Q,p),b.block=!0,u.parentType=w,u.lineMax=x,u.line=m+($?1:0),!0},{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.admonition_open=l,e.renderer.rules.admonition_title_open=l,e.renderer.rules.admonition_title_close=l,e.renderer.rules.admonition_close=l},d9=(e,t)=>{e.renderer.rules.heading_open=(n,i)=>{var O;const r=n[i],o=((O=n[i+1].children)==null?void 0:O.reduce((l,s)=>l+(["text","code_inline"].includes(s.type)&&s.content||""),""))||"",a=r.markup.length;return t.headsRef.value.push({text:o,level:a}),r.map&&r.level===0&&r.attrSet("id",t.mdHeadingId(o,a,t.headsRef.value.length)),e.renderer.renderToken(n,i,t)},e.renderer.rules.heading_close=(n,i,r,o,a)=>a.renderToken(n,i,r)},Nx=(e,t)=>{if(typeof t[e]=="string")return t[e];const n=`<i class="${z}-iconfont ${z}-icon-${e}"></i>`;switch(dt.iconfontType){case"svg":return`<svg class="${z}-icon" aria-hidden="true"><use xlink:href="#${z}-icon-${e}"></use></svg>`;default:return n}},h9=(e,t)=>{const n=e.renderer.rules.fence,i=e.utils.unescapeAll,r=/\[(\w*)(?::([\w ]*))?\]/,o=/::close/,a=c=>c.info?i(c.info).trim():"",O=c=>{const f=a(c),[h=null,p=""]=(r.exec(f)||[]).slice(1);return[h,p]},l=c=>{const f=a(c);return f?f.split(/(\s+)/g)[0]:""},s=c=>{const f=
|
|
115
|
-
`).length<t.autoFoldThreshold,p=f||t.codeFoldable?"details":"div",m=f||t.codeFoldable?"summary":"div";return{open:h,tagContainer:p,tagHeader:m}},u=(c,f,h,p,m)=>{var Y;if(c[f].hidden)return"";const b=(Y=t.usedLanguageTextRef.value)==null?void 0:Y.copyCode.text,$=t.customIconRef.value.copy||b,Q=!!t.customIconRef.value.copy,P=`<span class="${z}-collapse-tips">${Nx("collapse-tips",t.customIconRef.value)}</span>`,[k]=O(c[f]);if(k===null){const{open:N,tagContainer:F,tagHeader:I}=s(c[f]),L=[["class",`${z}-code`]];N&&L.push(["open",""]);const ie={attrs:Vc(c[f],L)};c[f].info=c[f].info.replace(o,"");const he=n(c,f,h,p,m);return`<${F} ${m.renderAttrs(ie)}>
|
|
113
|
+
`,o.map=[t,e.line],!0}function v6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const a=e.src.charCodeAt(r);if(a!==126&&a!==96)return!1;let O=r;r=e.skipChars(r,a);let l=r-O;if(l<3)return!1;const s=e.src.slice(O,r),u=e.src.slice(r,o);if(a===96&&u.indexOf(String.fromCharCode(a))>=0)return!1;if(i)return!0;let c=t,f=!1;for(;c++,!(c>=n||(r=O=e.bMarks[c]+e.tShift[c],o=e.eMarks[c],r<o&&e.sCount[c]<e.blkIndent));)if(e.src.charCodeAt(r)===a&&!(e.sCount[c]-e.blkIndent>=4)&&(r=e.skipChars(r,a),!(r-O<l)&&(r=e.skipSpaces(r),!(r<o)))){f=!0;break}l=e.sCount[t],e.line=c+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,c,l,!0),h.markup=s,h.map=[t,e.line],!0}function w6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const O=[],l=[],s=[],u=[],c=e.md.block.ruler.getRules("blockquote"),f=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=t;p<n;p++){const P=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],r>=o)break;if(e.src.charCodeAt(r++)===62&&!P){let S=e.sCount[p]+1,R,w;e.src.charCodeAt(r)===32?(r++,S++,w=!1,R=!0):e.src.charCodeAt(r)===9?(R=!0,(e.bsCount[p]+S)%4===3?(r++,S++,w=!1):w=!0):R=!1;let x=S;for(O.push(e.bMarks[p]),e.bMarks[p]=r;r<o;){const v=e.src.charCodeAt(r);if(Fe(v))v===9?x+=4-(x+e.bsCount[p]+(w?1:0))%4:x++;else break;r++}h=r>=o,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(R?1:0),s.push(e.sCount[p]),e.sCount[p]=x-S,u.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(h)break;let k=!1;for(let S=0,R=c.length;S<R;S++)if(c[S](e,p,n,!0)){k=!0;break}if(k){e.lineMax=p,e.blkIndent!==0&&(O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]=-1}const m=e.blkIndent;e.blkIndent=0;const b=e.push("blockquote_open","blockquote",1);b.markup=">";const $=[t,0];b.map=$,e.md.block.tokenize(e,t,p);const Q=e.push("blockquote_close","blockquote",-1);Q.markup=">",e.lineMax=a,e.parentType=f,$[1]=e.line;for(let P=0;P<u.length;P++)e.bMarks[P+t]=O[P],e.tShift[P+t]=u[P],e.sCount[P+t]=s[P],e.bsCount[P+t]=l[P];return e.blkIndent=m,!0}function X6(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let O=1;for(;o<r;){const s=e.src.charCodeAt(o++);if(s!==a&&!Fe(s))return!1;s===a&&O++}if(O<3)return!1;if(i)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(O+1).join(String.fromCharCode(a)),!0}function fx(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const o=e.src.charCodeAt(i);if(!Fe(o))return-1}return i}function dx(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=i)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<i&&(o=e.src.charCodeAt(r),!Fe(o))?-1:r}function T6(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function _6(e,t,n,i){let r,o,a,O,l=t,s=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u=!1;i&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(u=!0);let c,f,h;if((h=dx(e,l))>=0){if(c=!0,a=e.bMarks[l]+e.tShift[l],f=Number(e.src.slice(a,h-1)),u&&f!==1)return!1}else if((h=fx(e,l))>=0)c=!1;else return!1;if(u&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(i)return!0;const p=e.src.charCodeAt(h-1),m=e.tokens.length;c?(O=e.push("ordered_list_open","ol",1),f!==1&&(O.attrs=[["start",f]])):O=e.push("bullet_list_open","ul",1);const b=[l,0];O.map=b,O.markup=String.fromCharCode(p);let $=!1;const Q=e.md.block.ruler.getRules("list"),P=e.parentType;for(e.parentType="list";l<n;){o=h,r=e.eMarks[l];const k=e.sCount[l]+h-(e.bMarks[l]+e.tShift[l]);let S=k;for(;o<r;){const q=e.src.charCodeAt(o);if(q===9)S+=4-(S+e.bsCount[l])%4;else if(q===32)S++;else break;o++}const R=o;let w;R>=r?w=1:w=S-k,w>4&&(w=1);const x=k+w;O=e.push("list_item_open","li",1),O.markup=String.fromCharCode(p);const v=[l,0];O.map=v,c&&(O.info=e.src.slice(a,h-1));const E=e.tight,Z=e.tShift[l],V=e.sCount[l],U=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=x,e.tight=!0,e.tShift[l]=R-e.bMarks[l],e.sCount[l]=S,R>=r&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||$)&&(s=!1),$=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=U,e.tShift[l]=Z,e.sCount[l]=V,e.tight=E,O=e.push("list_item_close","li",-1),O.markup=String.fromCharCode(p),l=e.line,v[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let X=!1;for(let q=0,W=Q.length;q<W;q++)if(Q[q](e,l,n,!0)){X=!0;break}if(X)break;if(c){if(h=dx(e,l),h<0)break;a=e.bMarks[l]+e.tShift[l]}else if(h=fx(e,l),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return c?O=e.push("ordered_list_close","ol",-1):O=e.push("bullet_list_close","ul",-1),O.markup=String.fromCharCode(p),b[1]=l,e.line=l,e.parentType=P,s&&T6(e,m),!0}function R6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function O(Q){const P=e.lineMax;if(Q>=P||e.isEmpty(Q))return null;let k=!1;if(e.sCount[Q]-e.blkIndent>3&&(k=!0),e.sCount[Q]<0&&(k=!0),!k){const w=e.md.block.ruler.getRules("reference"),x=e.parentType;e.parentType="reference";let v=!1;for(let E=0,Z=w.length;E<Z;E++)if(w[E](e,Q,P,!0)){v=!0;break}if(e.parentType=x,v)return null}const S=e.bMarks[Q]+e.tShift[Q],R=e.eMarks[Q];return e.src.slice(S,R+1)}let l=e.src.slice(r,o+1);o=l.length;let s=-1;for(r=1;r<o;r++){const Q=l.charCodeAt(r);if(Q===91)return!1;if(Q===93){s=r;break}else if(Q===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(Q===92&&(r++,r<o&&l.charCodeAt(r)===10)){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}}if(s<0||l.charCodeAt(s+1)!==58)return!1;for(r=s+2;r<o;r++){const Q=l.charCodeAt(r);if(Q===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(Q))break}const u=e.md.helpers.parseLinkDestination(l,r,o);if(!u.ok)return!1;const c=e.md.normalizeLink(u.str);if(!e.md.validateLink(c))return!1;r=u.pos;const f=r,h=a,p=r;for(;r<o;r++){const Q=l.charCodeAt(r);if(Q===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(Q))break}let m=e.md.helpers.parseLinkTitle(l,r,o);for(;m.can_continue;){const Q=O(a);if(Q===null)break;l+=Q,r=o,o=l.length,a++,m=e.md.helpers.parseLinkTitle(l,r,o,m)}let b;for(r<o&&p!==r&&m.ok?(b=m.str,r=m.pos):(b="",r=f,a=h);r<o;){const Q=l.charCodeAt(r);if(!Fe(Q))break;r++}if(r<o&&l.charCodeAt(r)!==10&&b)for(b="",r=f,a=h;r<o;){const Q=l.charCodeAt(r);if(!Fe(Q))break;r++}if(r<o&&l.charCodeAt(r)!==10)return!1;const $=Rc(l.slice(1,s));return $?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[$]>"u"&&(e.env.references[$]={title:b,href:c}),e.line=a),!0):!1}const z6=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],W6="[a-zA-Z_:][a-zA-Z0-9:._-]*",q6="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",hx="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+W6+"(?:\\s*=\\s*"+q6+")?)")+"*\\s*\\/?>",px="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Z6="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",U6="<[?][\\s\\S]*?[?]>",E6="<![A-Za-z][^>]*>",Y6="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",V6=new RegExp("^(?:"+hx+"|"+px+"|"+Z6+"|"+U6+"|"+E6+"|"+Y6+")"),C6=new RegExp("^(?:"+hx+"|"+px+")"),oO=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+z6.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(C6.source+"\\s*$"),/^$/,!1]];function j6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let a=e.src.slice(r,o),O=0;for(;O<oO.length&&!oO[O][0].test(a);O++);if(O===oO.length)return!1;if(i)return oO[O][2];let l=t+1;if(!oO[O][1].test(a)){for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(r=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],a=e.src.slice(r,o),oO[O][1].test(a)){a.length!==0&&l++;break}}e.line=l;const s=e.push("html_block","",0);return s.map=[t,l],s.content=e.getLines(t,l,e.blkIndent,!0),!0}function A6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.src.charCodeAt(r);if(a!==35||r>=o)return!1;let O=1;for(a=e.src.charCodeAt(++r);a===35&&r<o&&O<=6;)O++,a=e.src.charCodeAt(++r);if(O>6||r<o&&!Fe(a))return!1;if(i)return!0;o=e.skipSpacesBack(o,r);const l=e.skipCharsBack(o,35,r);l>r&&Fe(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const s=e.push("heading_open","h"+String(O),1);s.markup="########".slice(0,O),s.map=[t,e.line];const u=e.push("inline","",0);u.content=e.src.slice(r,o).trim(),u.map=[t,e.line],u.children=[];const c=e.push("heading_close","h"+String(O),-1);return c.markup="########".slice(0,O),!0}function G6(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,a,O=t+1;for(;O<n&&!e.isEmpty(O);O++){if(e.sCount[O]-e.blkIndent>3)continue;if(e.sCount[O]>=e.blkIndent){let h=e.bMarks[O]+e.tShift[O];const p=e.eMarks[O];if(h<p&&(a=e.src.charCodeAt(h),(a===45||a===61)&&(h=e.skipChars(h,a),h=e.skipSpaces(h),h>=p))){o=a===61?1:2;break}}if(e.sCount[O]<0)continue;let f=!1;for(let h=0,p=i.length;h<p;h++)if(i[h](e,O,n,!0)){f=!0;break}if(f)break}if(!o)return!1;const l=e.getLines(t,O,e.blkIndent,!1).trim();e.line=O+1;const s=e.push("heading_open","h"+String(o),1);s.markup=String.fromCharCode(a),s.map=[t,e.line];const u=e.push("inline","",0);u.content=l,u.map=[t,e.line-1],u.children=[];const c=e.push("heading_close","h"+String(o),-1);return c.markup=String.fromCharCode(a),e.parentType=r,!0}function I6(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let s=!1;for(let u=0,c=i.length;u<c;u++)if(i[u](e,o,n,!0)){s=!0;break}if(s)break}const a=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const O=e.push("paragraph_open","p",1);O.map=[t,e.line];const l=e.push("inline","",0);return l.content=a,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const Wc=[["table",k6,["paragraph","reference"]],["code",x6],["fence",v6,["paragraph","reference","blockquote","list"]],["blockquote",w6,["paragraph","reference","blockquote","list"]],["hr",X6,["paragraph","reference","blockquote","list"]],["list",_6,["paragraph","reference","blockquote"]],["reference",R6],["html_block",j6,["paragraph","reference","blockquote"]],["heading",A6,["paragraph","reference","blockquote"]],["lheading",G6],["paragraph",I6]];function qc(){this.ruler=new pn;for(let e=0;e<Wc.length;e++)this.ruler.push(Wc[e][0],Wc[e][1],{alt:(Wc[e][2]||[]).slice()})}qc.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,o=e.md.options.maxNesting;let a=t,O=!1;for(;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n||e.sCount[a]<e.blkIndent));){if(e.level>=o){e.line=n;break}const l=e.line;let s=!1;for(let u=0;u<r;u++)if(s=i[u](e,a,n,!1),s){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");e.tight=!O,e.isEmpty(e.line-1)&&(O=!0),a=e.line,a<n&&e.isEmpty(a)&&(O=!0,a++,e.line=a)}},qc.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)},qc.prototype.State=Ki;function Gl(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Gl.prototype.pushPending=function(){const e=new Qi("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Gl.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new Qi(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i},Gl.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<n&&this.src.charCodeAt(o)===i;)o++;const a=o-e,O=o<n?this.src.charCodeAt(o):32,l=Al(r)||jl(String.fromCharCode(r)),s=Al(O)||jl(String.fromCharCode(O)),u=Cl(r),c=Cl(O),f=!c&&(!s||u||l),h=!u&&(!l||c||s);return{can_open:f&&(t||!h||l),can_close:h&&(t||!f||s),length:a}},Gl.prototype.Token=Qi;function D6(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function N6(e,t){let n=e.pos;for(;n<e.posMax&&!D6(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const L6=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function F6(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(L6);if(!r)return!1;const o=r[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let O=a.url;if(O.length<=o.length)return!1;O=O.replace(/\*+$/,"");const l=e.md.normalizeLink(O);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const s=e.push("link_open","a",1);s.attrs=[["href",l]],s.markup="linkify",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(O);const c=e.push("link_close","a",-1);c.markup="linkify",c.info="auto"}return e.pos+=O.length-o.length,!0}function M6(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let o=i-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&Fe(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const Am=[];for(let e=0;e<256;e++)Am.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Am[e.charCodeAt(0)]=1});function B6(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Fe(r));)n++;return e.pos=n,!0}let o=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const O=e.src.charCodeAt(n+1);O>=56320&&O<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const O=e.push("text_special","",0);r<256&&Am[r]!==0?O.content=o:O.content=a,O.markup=a,O.info="escape"}return e.pos=n+1,!0}function H6(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const a=e.src.slice(r,n),O=a.length;if(e.backticksScanned&&(e.backticks[O]||0)<=r)return t||(e.pending+=a),e.pos+=O,!0;let l=n,s;for(;(s=e.src.indexOf("`",l))!==-1;){for(l=s+1;l<o&&e.src.charCodeAt(l)===96;)l++;const u=l-s;if(u===O){if(!t){const c=e.push("code_inline","code",0);c.markup=a,c.content=e.src.slice(n,s).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[u]=s}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=O,!0}function K6(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const a=String.fromCharCode(i);if(o<2)return!1;let O;o%2&&(O=e.push("text","",0),O.content=a,o--);for(let l=0;l<o;l+=2)O=e.push("text","",0),O.content=a+a,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function mx(e,t){let n;const i=[],r=t.length;for(let o=0;o<r;o++){const a=t[o];if(a.marker!==126||a.end===-1)continue;const O=t[a.end];n=e.tokens[a.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[O.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[O.token-1].type==="text"&&e.tokens[O.token-1].content==="~"&&i.push(O.token-1)}for(;i.length;){const o=i.pop();let a=o+1;for(;a<e.tokens.length&&e.tokens[a].type==="s_close";)a++;a--,o!==a&&(n=e.tokens[a],e.tokens[a]=e.tokens[o],e.tokens[o]=n)}}function J6(e){const t=e.tokens_meta,n=e.tokens_meta.length;mx(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&mx(e,t[i].delimiters)}const gx={tokenize:K6,postProcess:J6};function eC(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let o=0;o<r.length;o++){const a=e.push("text","",0);a.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function $x(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],a=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===o.token+1,O=String.fromCharCode(r.marker),l=e.tokens[r.token];l.type=a?"strong_open":"em_open",l.tag=a?"strong":"em",l.nesting=1,l.markup=a?O+O:O,l.content="";const s=e.tokens[o.token];s.type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?O+O:O,s.content="",a&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function tC(e){const t=e.tokens_meta,n=e.tokens_meta.length;$x(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&$x(e,t[i].delimiters)}const Qx={tokenize:eC,postProcess:tC};function nC(e,t){let n,i,r,o,a="",O="",l=e.pos,s=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,c=e.posMax,f=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<c&&e.src.charCodeAt(p)===40){for(s=!1,p++;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(p>=c)return!1;if(l=p,r=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),r.ok){for(a=e.md.normalizeLink(r.str),e.md.validateLink(a)?p=r.pos:a="",l=p;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(r=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<c&&l!==p&&r.ok)for(O=r.str,p=r.pos;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);}(p>=c||e.src.charCodeAt(p)!==41)&&(s=!0),p++}if(s){if(typeof e.env.references>"u")return!1;if(p<c&&e.src.charCodeAt(p)===91?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?i=e.src.slice(l,p++):p=h+1):p=h+1,i||(i=e.src.slice(f,h)),o=e.env.references[Rc(i)],!o)return e.pos=u,!1;a=o.href,O=o.title}if(!t){e.pos=f,e.posMax=h;const m=e.push("link_open","a",1),b=[["href",a]];m.attrs=b,O&&b.push(["title",O]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=c,!0}function iC(e,t){let n,i,r,o,a,O,l,s,u="";const c=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<f&&e.src.charCodeAt(o)===40){for(o++;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(o>=f)return!1;for(s=o,O=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),O.ok&&(u=e.md.normalizeLink(O.str),e.md.validateLink(u)?o=O.pos:u=""),s=o;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(O=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<f&&s!==o&&O.ok)for(l=O.str,o=O.pos;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);else l="";if(o>=f||e.src.charCodeAt(o)!==41)return e.pos=c,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<f&&e.src.charCodeAt(o)===91?(s=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(s,o++):o=p+1):o=p+1,r||(r=e.src.slice(h,p)),a=e.env.references[Rc(r)],!a)return e.pos=c,!1;u=a.href,l=a.title}if(!t){i=e.src.slice(h,p);const m=[];e.md.inline.parse(i,e.md,e.env,m);const b=e.push("image","img",0),$=[["src",u],["alt",""]];b.attrs=$,b.children=m,b.content=i,l&&$.push(["title",l])}return e.pos=o,e.posMax=f,!0}const rC=/^([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])?)*)$/,oC=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function aC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(i+1,n);if(oC.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}if(rC.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}return!1}function OC(e){return/^<a[>\s]/i.test(e)}function lC(e){return/^<\/a\s*>/i.test(e)}function sC(e){const t=e|32;return t>=97&&t<=122}function uC(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!sC(r))return!1;const o=e.src.slice(i).match(V6);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],OC(a.content)&&e.linkLevel++,lC(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const cC=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,fC=/^&([a-z][a-z0-9]{1,31});/i;function dC(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(cC);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),O=e.push("text_special","",0);O.content=Ym(a)?_c(a):_c(65533),O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(fC);if(o){const a=rx(o[0]);if(a!==o[0]){if(!t){const O=e.push("text_special","",0);O.content=a,O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function bx(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const o=[];for(let a=0;a<n;a++){const O=e[a];if(o.push(0),(e[i].marker!==O.marker||r!==O.token-1)&&(i=a),r=O.token,O.length=O.length||0,!O.close)continue;t.hasOwnProperty(O.marker)||(t[O.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[O.marker][(O.open?3:0)+O.length%3];let s=i-o[i]-1,u=s;for(;s>l;s-=o[s]+1){const c=e[s];if(c.marker===O.marker&&c.open&&c.end<0){let f=!1;if((c.close||O.open)&&(c.length+O.length)%3===0&&(c.length%3!==0||O.length%3!==0)&&(f=!0),!f){const h=s>0&&!e[s-1].open?o[s-1]+1:0;o[a]=a-s+h,o[s]=h,O.open=!1,c.end=a,c.close=!1,u=-1,r=-2;break}}}u!==-1&&(t[O.marker][(O.open?3:0)+(O.length||0)%3]=u)}}function hC(e){const t=e.tokens_meta,n=e.tokens_meta.length;bx(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&bx(t[i].delimiters)}function pC(e){let t,n,i=0;const r=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<o&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const Gm=[["text",N6],["linkify",F6],["newline",M6],["escape",B6],["backticks",H6],["strikethrough",gx.tokenize],["emphasis",Qx.tokenize],["link",nC],["image",iC],["autolink",aC],["html_inline",uC],["entity",dC]],Im=[["balance_pairs",hC],["strikethrough",gx.postProcess],["emphasis",Qx.postProcess],["fragments_join",pC]];function Il(){this.ruler=new pn;for(let e=0;e<Gm.length;e++)this.ruler.push(Gm[e][0],Gm[e][1]);this.ruler2=new pn;for(let e=0;e<Im.length;e++)this.ruler2.push(Im[e][0],Im[e][1])}Il.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let a=!1;if(e.level<r){for(let O=0;O<i;O++)if(e.level++,a=n[O](e,!0),e.level--,a){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos},Il.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const o=e.pos;let a=!1;if(e.level<r){for(let O=0;O<n;O++)if(a=t[O](e,!1),a){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Il.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const o=this.ruler2.getRules(""),a=o.length;for(let O=0;O<a;O++)o[O](r)},Il.prototype.State=Gl;function mC(e){const t={};e=e||{},t.src_Any=Jk.source,t.src_Cc=ex.source,t.src_Z=nx.source,t.src_P=qm.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Dm(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Zc(e){return Object.prototype.toString.call(e)}function gC(e){return Zc(e)==="[object String]"}function $C(e){return Zc(e)==="[object Object]"}function QC(e){return Zc(e)==="[object RegExp]"}function yx(e){return Zc(e)==="[object Function]"}function bC(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Sx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function yC(e){return Object.keys(e||{}).reduce(function(t,n){return t||Sx.hasOwnProperty(n)},!1)}const SC={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},PC="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",kC="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function xC(e){e.__index__=-1,e.__text_cache__=""}function vC(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function Px(){return function(e,t){t.normalize(e)}}function Uc(e){const t=e.re=mC(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(PC),n.push(t.src_xn),t.src_tlds=n.join("|");function i(O){return O.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function o(O,l){throw new Error('(LinkifyIt) Invalid schema "'+O+'": '+l)}Object.keys(e.__schemas__).forEach(function(O){const l=e.__schemas__[O];if(l===null)return;const s={validate:null,link:null};if(e.__compiled__[O]=s,$C(l)){QC(l.validate)?s.validate=vC(l.validate):yx(l.validate)?s.validate=l.validate:o(O,l),yx(l.normalize)?s.normalize=l.normalize:l.normalize?o(O,l):s.normalize=Px();return}if(gC(l)){r.push(O);return}o(O,l)}),r.forEach(function(O){e.__compiled__[e.__schemas__[O]]&&(e.__compiled__[O].validate=e.__compiled__[e.__schemas__[O]].validate,e.__compiled__[O].normalize=e.__compiled__[e.__schemas__[O]].normalize)}),e.__compiled__[""]={validate:null,normalize:Px()};const a=Object.keys(e.__compiled__).filter(function(O){return O.length>0&&e.__compiled__[O]}).map(bC).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),xC(e)}function wC(e,t){const n=e.__index__,i=e.__last_index__,r=e.__text_cache__.slice(n,i);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=i+t,this.raw=r,this.text=r,this.url=r}function Nm(e,t){const n=new wC(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Tn(e,t){if(!(this instanceof Tn))return new Tn(e,t);t||yC(e)&&(t=e,e={}),this.__opts__=Dm({},Sx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Dm({},SC,e),this.__compiled__={},this.__tlds__=kC,this.__tlds_replaced__=!1,this.re={},Uc(this)}Tn.prototype.add=function(t,n){return this.__schemas__[t]=n,Uc(this),this},Tn.prototype.set=function(t){return this.__opts__=Dm(this.__opts__,t),this},Tn.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,i,r,o,a,O,l,s,u;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=t.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s<this.__index__)&&(i=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=i.index+i[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__="",this.__index__=a,this.__last_index__=i.index+i[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,O=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&O>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=O))),this.__index__>=0},Tn.prototype.pretest=function(t){return this.re.pretest.test(t)},Tn.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0},Tn.prototype.match=function(t){const n=[];let i=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Nm(this,i)),i=this.__last_index__);let r=i?t.slice(i):t;for(;this.test(r);)n.push(Nm(this,i)),r=r.slice(this.__last_index__),i+=this.__last_index__;return n.length?n:null},Tn.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);return i?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i,Nm(this,0)):null},Tn.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,o){return i!==o[r-1]}).reverse(),Uc(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Uc(this),this)},Tn.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},Tn.prototype.onCompile=function(){};const aO=2147483647,Ji=36,Lm=1,Dl=26,XC=38,TC=700,kx=72,xx=128,vx="-",_C=/^xn--/,RC=/[^\0-\x7F]/,zC=/[\x2E\u3002\uFF0E\uFF61]/g,WC={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fm=Ji-Lm,er=Math.floor,Mm=String.fromCharCode;function io(e){throw new RangeError(WC[e])}function qC(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function wx(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(zC,".");const r=e.split("."),o=qC(r,t).join(".");return i+o}function Xx(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const o=e.charCodeAt(n++);(o&64512)==56320?t.push(((r&1023)<<10)+(o&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const ZC=e=>String.fromCodePoint(...e),UC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Ji},Tx=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},_x=function(e,t,n){let i=0;for(e=n?er(e/TC):e>>1,e+=er(e/t);e>Fm*Dl>>1;i+=Ji)e=er(e/Fm);return er(i+(Fm+1)*e/(e+XC))},Rx=function(e){const t=[],n=e.length;let i=0,r=xx,o=kx,a=e.lastIndexOf(vx);a<0&&(a=0);for(let O=0;O<a;++O)e.charCodeAt(O)>=128&&io("not-basic"),t.push(e.charCodeAt(O));for(let O=a>0?a+1:0;O<n;){const l=i;for(let u=1,c=Ji;;c+=Ji){O>=n&&io("invalid-input");const f=UC(e.charCodeAt(O++));f>=Ji&&io("invalid-input"),f>er((aO-i)/u)&&io("overflow"),i+=f*u;const h=c<=o?Lm:c>=o+Dl?Dl:c-o;if(f<h)break;const p=Ji-h;u>er(aO/p)&&io("overflow"),u*=p}const s=t.length+1;o=_x(i-l,s,l==0),er(i/s)>aO-r&&io("overflow"),r+=er(i/s),i%=s,t.splice(i++,0,r)}return String.fromCodePoint(...t)},zx=function(e){const t=[];e=Xx(e);const n=e.length;let i=xx,r=0,o=kx;for(const l of e)l<128&&t.push(Mm(l));const a=t.length;let O=a;for(a&&t.push(vx);O<n;){let l=aO;for(const u of e)u>=i&&u<l&&(l=u);const s=O+1;l-i>er((aO-r)/s)&&io("overflow"),r+=(l-i)*s,i=l;for(const u of e)if(u<i&&++r>aO&&io("overflow"),u===i){let c=r;for(let f=Ji;;f+=Ji){const h=f<=o?Lm:f>=o+Dl?Dl:f-o;if(c<h)break;const p=c-h,m=Ji-h;t.push(Mm(Tx(h+p%m,0))),c=er(p/m)}t.push(Mm(Tx(c,0))),o=_x(r,s,O===a),r=0,++O}++r,++i}return t.join("")},Wx={version:"2.3.1",ucs2:{decode:Xx,encode:ZC},decode:Rx,encode:zx,toASCII:function(e){return wx(e,function(t){return RC.test(t)?"xn--"+zx(t):t})},toUnicode:function(e){return wx(e,function(t){return _C.test(t)?Rx(t.slice(4).toLowerCase()):t})}},EC={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},YC=/^(vbscript|javascript|file|data):/,VC=/^data:image\/(gif|png|jpeg|webp);/;function CC(e){const t=e.trim().toLowerCase();return YC.test(t)?VC.test(t):!0}const qx=["http:","https:","mailto:"];function jC(e){const t=Wm(e,!0);if(t.hostname&&(!t.protocol||qx.indexOf(t.protocol)>=0))try{t.hostname=Wx.toASCII(t.hostname)}catch{}return Vl(zm(t))}function AC(e){const t=Wm(e,!0);if(t.hostname&&(!t.protocol||qx.indexOf(t.protocol)>=0))try{t.hostname=Wx.toUnicode(t.hostname)}catch{}return nO(zm(t),nO.defaultChars+"%")}function Jn(e,t){if(!(this instanceof Jn))return new Jn(e,t);t||Em(e)||(t=e||{},e="default"),this.inline=new Il,this.block=new qc,this.core=new Cm,this.renderer=new rO,this.linkify=new Tn,this.validateLink=CC,this.normalizeLink=jC,this.normalizeLinkText=AC,this.utils=J3,this.helpers=Tc({},i6),this.options={},this.configure(e),t&&this.set(t)}Jn.prototype.set=function(e){return Tc(this.options,e),this},Jn.prototype.configure=function(e){const t=this;if(Em(e)){const n=e;if(e=EC[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},Jn.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this},Jn.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this},Jn.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},Jn.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},Jn.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Jn.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Jn.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Zx=new Set([!0,!1,"alt","title"]);function Ux(e,t){return(Array.isArray(e)?e:[]).filter(([n])=>n!==t)}function Ex(e,t){e&&e.attrs&&(e.attrs=Ux(e.attrs,t))}function GC(e,t){if(!Zx.has(e))throw new TypeError(`figcaption must be one of: ${[...Zx]}.`);if(e==="alt")return t.content;const n=t.attrs.find(([i])=>i==="title");return Array.isArray(n)&&n[1]?(Ex(t,"title"),n[1]):void 0}function IC(e,t){t=t||{},e.core.ruler.before("linkify","image_figures",function(n){let i=1;for(let r=1,o=n.tokens.length;r<o-1;++r){const a=n.tokens[r];if(a.type!=="inline"||!a.children||a.children.length!==1&&a.children.length!==3||a.children.length===1&&a.children[0].type!=="image")continue;if(a.children.length===3){const[s,u,c]=a.children;if(s.type!=="link_open"||u.type!=="image"||c.type!=="link_close")continue}if(r!==0&&n.tokens[r-1].type!=="paragraph_open"||r!==o-1&&n.tokens[r+1].type!=="paragraph_close")continue;const O=n.tokens[r-1];let l;if(O.type="figure_open",O.tag="figure",n.tokens[r+1].type="figure_close",n.tokens[r+1].tag="figure",t.dataType&&n.tokens[r-1].attrPush(["data-type","image"]),t.link&&a.children.length===1){[l]=a.children;const s=new n.Token("link_open","a",1);s.attrPush(["href",l.attrGet("src")]),a.children.unshift(s),a.children.push(new n.Token("link_close","a",-1))}if(l=a.children.length===1?a.children[0]:a.children[1],t.figcaption){const s=GC(t.figcaption,l);if(s){const[u]=e.parseInline(s,n.env);a.children.push(new n.Token("figcaption_open","figcaption",1)),a.children.push(...u.children),a.children.push(new n.Token("figcaption_close","figcaption",-1)),l.attrs&&(l.attrs=Ux(l.attrs,"title"))}}if(t.copyAttrs&&l.attrs){const s=t.copyAttrs===!0?"":t.copyAttrs;O.attrs=l.attrs.filter(([u])=>u.match(s)).map(u=>Array.from(u))}if(t.tabindex&&(n.tokens[r-1].attrPush(["tabindex",i]),i++),t.lazy&&(l.attrs.some(([s])=>s==="loading")||l.attrs.push(["loading","lazy"])),t.async&&(l.attrs.some(([s])=>s==="decoding")||l.attrs.push(["decoding","async"])),t.classes&&typeof t.classes=="string"){let s=!1;for(let u=0,c=l.attrs.length;u<c&&!s;u++){const f=l.attrs[u];f[0]==="class"&&(f[1]=`${f[1]} ${t.classes}`,s=!0)}s||l.attrs.push(["class",t.classes])}if(t.removeSrc){const s=l.attrs.find(([u])=>u==="src");l.attrs.push(["data-src",s[1]]),Ex(l,"src")}}})}var Bm=!0,Yx=!1,Vx=!1,DC=function(e,t){t&&(Bm=!t.enabled,Yx=!!t.label,Vx=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)LC(i,r)&&(FC(i[r],n.Token),Cx(i[r-2],"class","task-list-item"+(Bm?"":" enabled")),Cx(i[NC(i,r-2)],"class","contains-task-list"))})};function Cx(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function NC(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function LC(e,t){return JC(e[t])&&e9(e[t-1])&&t9(e[t-2])&&n9(e[t])}function FC(e,t){if(e.children.unshift(MC(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),Yx)if(Vx){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(KC(e.content,n,t))}else e.children.unshift(BC(t)),e.children.push(HC(t))}function MC(e,t){var n=new t("html_inline","",0),i=Bm?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function BC(e){var t=new e("html_inline","",0);return t.content="<label>",t}function HC(e){var t=new e("html_inline","",0);return t.content="</label>",t}function KC(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function JC(e){return e.type==="inline"}function e9(e){return e.type==="paragraph_open"}function t9(e){return e.type==="list_item_open"}function n9(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}const i9=Rm(DC),r9=e=>{const t=g.inject("highlight"),n=g.shallowRef(dt.editorExtensions.highlight.instance);return g.onMounted(()=>{e.noHighlight||n.value||(un("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`}),un("script",{...t.value.js,id:`${z}-hljs`,onload(){n.value=window.hljs}},"hljs"))}),g.watch(()=>t.value.css,()=>{e.noHighlight||pW("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`})}),n},OO=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,jx=new Set,Hm=typeof process=="object"&&process?process:{},Ax=(e,t,n,i)=>{typeof Hm.emitWarning=="function"?Hm.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let Ec=globalThis.AbortController,Gx=globalThis.AbortSignal;if(typeof Ec>"u"){Gx=class{constructor(){Xe(this,"onabort");Xe(this,"_onabort",[]);Xe(this,"reason");Xe(this,"aborted",!1)}addEventListener(i,r){this._onabort.push(r)}},Ec=class{constructor(){Xe(this,"signal",new Gx);t()}abort(i){var r,o;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const a of this.signal._onabort)a(i);(o=(r=this.signal).onabort)==null||o.call(r,i)}}};let e=((Iz=Hm.env)==null?void 0:Iz.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const t=()=>{e&&(e=!1,Ax("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const o9=e=>!jx.has(e),ro=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Ix=e=>ro(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Yc:null:null;class Yc extends Array{constructor(t){super(t),this.fill(0)}}const ha=class ha{constructor(t,n){Xe(this,"heap");Xe(this,"length");if(!T(ha,_O))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(t),this.length=0}static create(t){const n=Ix(t);if(!n)return[];fe(ha,_O,!0);const i=new ha(t,n);return fe(ha,_O,!1),i}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};_O=new WeakMap,Qe(ha,_O,!1);let Km=ha;const DQ=class DQ{constructor(t){Qe(this,Gs);Qe(this,_d);Qe(this,Or);Qe(this,lr);Qe(this,Ns);Qe(this,WO);Qe(this,qO);Qe(this,Le);Qe(this,Ls);Qe(this,ga);Qe(this,Ti,void 0);Qe(this,En,void 0);Qe(this,_i,void 0);Qe(this,Ri,void 0);Qe(this,RO,void 0);Xe(this,"ttl");Xe(this,"ttlResolution");Xe(this,"ttlAutopurge");Xe(this,"updateAgeOnGet");Xe(this,"updateAgeOnHas");Xe(this,"allowStale");Xe(this,"noDisposeOnSet");Xe(this,"noUpdateTTL");Xe(this,"maxEntrySize");Xe(this,"sizeCalculation");Xe(this,"noDeleteOnFetchRejection");Xe(this,"noDeleteOnStaleGet");Xe(this,"allowStaleOnFetchAbort");Xe(this,"allowStaleOnFetchRejection");Xe(this,"ignoreFetchAbort");Qe(this,_t,void 0);Qe(this,zi,void 0);Qe(this,Pt,void 0);Qe(this,Ke,void 0);Qe(this,ge,void 0);Qe(this,ln,void 0);Qe(this,Yn,void 0);Qe(this,Jt,void 0);Qe(this,Ut,void 0);Qe(this,Wi,void 0);Qe(this,Et,void 0);Qe(this,qi,void 0);Qe(this,Zi,void 0);Qe(this,Vn,void 0);Qe(this,Ui,void 0);Qe(this,yo,void 0);Qe(this,sn,void 0);Qe(this,pa,()=>{});Qe(this,qr,()=>{});Qe(this,Is,()=>{});Qe(this,Cn,()=>!1);Qe(this,ma,t=>{});Qe(this,zO,(t,n,i)=>{});Qe(this,Ds,(t,n,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Xe(this,ZOe,"LRUCache");const{max:n=0,ttl:i,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:O,allowStale:l,dispose:s,disposeAfter:u,noDisposeOnSet:c,noUpdateTTL:f,maxSize:h=0,maxEntrySize:p=0,sizeCalculation:m,fetchMethod:b,noDeleteOnFetchRejection:$,noDeleteOnStaleGet:Q,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:k,ignoreFetchAbort:S}=t;if(n!==0&&!ro(n))throw new TypeError("max option must be a nonnegative integer");const R=n?Ix(n):Array;if(!R)throw new Error("invalid max value: "+n);if(fe(this,Ti,n),fe(this,En,h),this.maxEntrySize=p||T(this,En),this.sizeCalculation=m,this.sizeCalculation){if(!T(this,En)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,RO,b),fe(this,yo,!!b),fe(this,Pt,new Map),fe(this,Ke,new Array(n).fill(void 0)),fe(this,ge,new Array(n).fill(void 0)),fe(this,ln,new R(n)),fe(this,Yn,new R(n)),fe(this,Jt,0),fe(this,Ut,0),fe(this,Wi,Km.create(n)),fe(this,_t,0),fe(this,zi,0),typeof s=="function"&&fe(this,_i,s),typeof u=="function"?(fe(this,Ri,u),fe(this,Et,[])):(fe(this,Ri,void 0),fe(this,Et,void 0)),fe(this,Ui,!!T(this,_i)),fe(this,sn,!!T(this,Ri)),this.noDisposeOnSet=!!c,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!$,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(T(this,En)!==0&&!ro(T(this,En)))throw new TypeError("maxSize must be a positive integer if specified");if(!ro(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");le(this,_d,Jz).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!O,this.ttlResolution=ro(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!ro(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,Gs,MQ).call(this)}if(T(this,Ti)===0&&this.ttl===0&&T(this,En)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,Ti)&&!T(this,En)){const w="LRU_CACHE_UNBOUNDED";o9(w)&&(jx.add(w),Ax("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",w,DQ))}}static unsafeExposeInternals(t){return{starts:T(t,Zi),ttls:T(t,Vn),sizes:T(t,qi),keyMap:T(t,Pt),keyList:T(t,Ke),valList:T(t,ge),next:T(t,ln),prev:T(t,Yn),get head(){return T(t,Jt)},get tail(){return T(t,Ut)},free:T(t,Wi),isBackgroundFetch:n=>{var i;return le(i=t,Le,et).call(i,n)},backgroundFetch:(n,i,r,o)=>{var a;return le(a=t,qO,Fd).call(a,n,i,r,o)},moveToTail:n=>{var i;return le(i=t,ga,Js).call(i,n)},indexes:n=>{var i;return le(i=t,Or,ko).call(i,n)},rindexes:n=>{var i;return le(i=t,lr,xo).call(i,n)},isStale:n=>{var i;return T(i=t,Cn).call(i,n)}}}get max(){return T(this,Ti)}get maxSize(){return T(this,En)}get calculatedSize(){return T(this,zi)}get size(){return T(this,_t)}get fetchMethod(){return T(this,RO)}get dispose(){return T(this,_i)}get disposeAfter(){return T(this,Ri)}getRemainingTTL(t){return T(this,Pt).has(t)?1/0:0}*entries(){for(const t of le(this,Or,ko).call(this))T(this,ge)[t]!==void 0&&T(this,Ke)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield[T(this,Ke)[t],T(this,ge)[t]])}*rentries(){for(const t of le(this,lr,xo).call(this))T(this,ge)[t]!==void 0&&T(this,Ke)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield[T(this,Ke)[t],T(this,ge)[t]])}*keys(){for(const t of le(this,Or,ko).call(this)){const n=T(this,Ke)[t];n!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield n)}}*rkeys(){for(const t of le(this,lr,xo).call(this)){const n=T(this,Ke)[t];n!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield n)}}*values(){for(const t of le(this,Or,ko).call(this))T(this,ge)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield T(this,ge)[t])}*rvalues(){for(const t of le(this,lr,xo).call(this))T(this,ge)[t]!==void 0&&!le(this,Le,et).call(this,T(this,ge)[t])&&(yield T(this,ge)[t])}[Symbol.iterator](){return this.entries()}find(t,n={}){for(const i of le(this,Or,ko).call(this)){const r=T(this,ge)[i],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&t(o,T(this,Ke)[i],this))return this.get(T(this,Ke)[i],n)}}forEach(t,n=this){for(const i of le(this,Or,ko).call(this)){const r=T(this,ge)[i],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,T(this,Ke)[i],this)}}rforEach(t,n=this){for(const i of le(this,lr,xo).call(this)){const r=T(this,ge)[i],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,T(this,Ke)[i],this)}}purgeStale(){let t=!1;for(const n of le(this,lr,xo).call(this,{allowStale:!0}))T(this,Cn).call(this,n)&&(this.delete(T(this,Ke)[n]),t=!0);return t}info(t){const n=T(this,Pt).get(t);if(n===void 0)return;const i=T(this,ge)[n],r=le(this,Le,et).call(this,i)?i.__staleWhileFetching:i;if(r===void 0)return;const o={value:r};if(T(this,Vn)&&T(this,Zi)){const a=T(this,Vn)[n],O=T(this,Zi)[n];if(a&&O){const l=a-(OO.now()-O);o.ttl=l,o.start=Date.now()}}return T(this,qi)&&(o.size=T(this,qi)[n]),o}dump(){const t=[];for(const n of le(this,Or,ko).call(this,{allowStale:!0})){const i=T(this,Ke)[n],r=T(this,ge)[n],o=le(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||i===void 0)continue;const a={value:o};if(T(this,Vn)&&T(this,Zi)){a.ttl=T(this,Vn)[n];const O=OO.now()-T(this,Zi)[n];a.start=Math.floor(Date.now()-O)}T(this,qi)&&(a.size=T(this,qi)[n]),t.unshift([i,a])}return t}load(t){this.clear();for(const[n,i]of t){if(i.start){const r=Date.now()-i.start;i.start=OO.now()-r}this.set(n,i.value,i)}}set(t,n,i={}){var f,h,p,m,b;if(n===void 0)return this.delete(t),this;const{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:O=this.sizeCalculation,status:l}=i;let{noUpdateTTL:s=this.noUpdateTTL}=i;const u=T(this,Ds).call(this,t,n,i.size||0,O);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(t),this;let c=T(this,_t)===0?void 0:T(this,Pt).get(t);if(c===void 0)c=T(this,_t)===0?T(this,Ut):T(this,Wi).length!==0?T(this,Wi).pop():T(this,_t)===T(this,Ti)?le(this,WO,Ld).call(this,!1):T(this,_t),T(this,Ke)[c]=t,T(this,ge)[c]=n,T(this,Pt).set(t,c),T(this,ln)[T(this,Ut)]=c,T(this,Yn)[c]=T(this,Ut),fe(this,Ut,c),Nd(this,_t)._++,T(this,zO).call(this,c,u,l),l&&(l.set="add"),s=!1;else{le(this,ga,Js).call(this,c);const $=T(this,ge)[c];if(n!==$){if(T(this,yo)&&le(this,Le,et).call(this,$)){$.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Q}=$;Q!==void 0&&!a&&(T(this,Ui)&&((f=T(this,_i))==null||f.call(this,Q,t,"set")),T(this,sn)&&((h=T(this,Et))==null||h.push([Q,t,"set"])))}else a||(T(this,Ui)&&((p=T(this,_i))==null||p.call(this,$,t,"set")),T(this,sn)&&((m=T(this,Et))==null||m.push([$,t,"set"])));if(T(this,ma).call(this,c),T(this,zO).call(this,c,u,l),T(this,ge)[c]=n,l){l.set="replace";const Q=$&&le(this,Le,et).call(this,$)?$.__staleWhileFetching:$;Q!==void 0&&(l.oldValue=Q)}}else l&&(l.set="update")}if(r!==0&&!T(this,Vn)&&le(this,Gs,MQ).call(this),T(this,Vn)&&(s||T(this,Is).call(this,c,r,o),l&&T(this,qr).call(this,l,c)),!a&&T(this,sn)&&T(this,Et)){const $=T(this,Et);let Q;for(;Q=$==null?void 0:$.shift();)(b=T(this,Ri))==null||b.call(this,...Q)}return this}pop(){var t;try{for(;T(this,_t);){const n=T(this,ge)[T(this,Jt)];if(le(this,WO,Ld).call(this,!0),le(this,Le,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(T(this,sn)&&T(this,Et)){const n=T(this,Et);let i;for(;i=n==null?void 0:n.shift();)(t=T(this,Ri))==null||t.call(this,...i)}}}has(t,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=n,o=T(this,Pt).get(t);if(o!==void 0){const a=T(this,ge)[o];if(le(this,Le,et).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(T(this,Cn).call(this,o))r&&(r.has="stale",T(this,qr).call(this,r,o));else return i&&T(this,pa).call(this,o),r&&(r.has="hit",T(this,qr).call(this,r,o)),!0}else r&&(r.has="miss");return!1}peek(t,n={}){const{allowStale:i=this.allowStale}=n,r=T(this,Pt).get(t);if(r===void 0||!i&&T(this,Cn).call(this,r))return;const o=T(this,ge)[r];return le(this,Le,et).call(this,o)?o.__staleWhileFetching:o}async fetch(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:O=this.noDisposeOnSet,size:l=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:$,signal:Q}=n;if(!T(this,yo))return $&&($.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:$});const P={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:O,size:l,sizeCalculation:s,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:$,signal:Q};let k=T(this,Pt).get(t);if(k===void 0){$&&($.fetch="miss");const S=le(this,qO,Fd).call(this,t,k,P,m);return S.__returned=S}else{const S=T(this,ge)[k];if(le(this,Le,et).call(this,S)){const E=i&&S.__staleWhileFetching!==void 0;return $&&($.fetch="inflight",E&&($.returnedStale=!0)),E?S.__staleWhileFetching:S.__returned=S}const R=T(this,Cn).call(this,k);if(!b&&!R)return $&&($.fetch="hit"),le(this,ga,Js).call(this,k),r&&T(this,pa).call(this,k),$&&T(this,qr).call(this,$,k),S;const w=le(this,qO,Fd).call(this,t,k,P,m),v=w.__staleWhileFetching!==void 0&&i;return $&&($.fetch=R?"stale":"refresh",v&&R&&($.returnedStale=!0)),v?w.__staleWhileFetching:w.__returned=w}}get(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=n,O=T(this,Pt).get(t);if(O!==void 0){const l=T(this,ge)[O],s=le(this,Le,et).call(this,l);return a&&T(this,qr).call(this,a,O),T(this,Cn).call(this,O)?(a&&(a.get="stale"),s?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(o||this.delete(t),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),s?l.__staleWhileFetching:(le(this,ga,Js).call(this,O),r&&T(this,pa).call(this,O),l))}else a&&(a.get="miss")}delete(t){var i,r,o,a;let n=!1;if(T(this,_t)!==0){const O=T(this,Pt).get(t);if(O!==void 0)if(n=!0,T(this,_t)===1)this.clear();else{T(this,ma).call(this,O);const l=T(this,ge)[O];if(le(this,Le,et).call(this,l)?l.__abortController.abort(new Error("deleted")):(T(this,Ui)||T(this,sn))&&(T(this,Ui)&&((i=T(this,_i))==null||i.call(this,l,t,"delete")),T(this,sn)&&((r=T(this,Et))==null||r.push([l,t,"delete"]))),T(this,Pt).delete(t),T(this,Ke)[O]=void 0,T(this,ge)[O]=void 0,O===T(this,Ut))fe(this,Ut,T(this,Yn)[O]);else if(O===T(this,Jt))fe(this,Jt,T(this,ln)[O]);else{const s=T(this,Yn)[O];T(this,ln)[s]=T(this,ln)[O];const u=T(this,ln)[O];T(this,Yn)[u]=T(this,Yn)[O]}Nd(this,_t)._--,T(this,Wi).push(O)}}if(T(this,sn)&&((o=T(this,Et))!=null&&o.length)){const O=T(this,Et);let l;for(;l=O==null?void 0:O.shift();)(a=T(this,Ri))==null||a.call(this,...l)}return n}clear(){var t,n,i;for(const r of le(this,lr,xo).call(this,{allowStale:!0})){const o=T(this,ge)[r];if(le(this,Le,et).call(this,o))o.__abortController.abort(new Error("deleted"));else{const a=T(this,Ke)[r];T(this,Ui)&&((t=T(this,_i))==null||t.call(this,o,a,"delete")),T(this,sn)&&((n=T(this,Et))==null||n.push([o,a,"delete"]))}}if(T(this,Pt).clear(),T(this,ge).fill(void 0),T(this,Ke).fill(void 0),T(this,Vn)&&T(this,Zi)&&(T(this,Vn).fill(0),T(this,Zi).fill(0)),T(this,qi)&&T(this,qi).fill(0),fe(this,Jt,0),fe(this,Ut,0),T(this,Wi).length=0,fe(this,zi,0),fe(this,_t,0),T(this,sn)&&T(this,Et)){const r=T(this,Et);let o;for(;o=r==null?void 0:r.shift();)(i=T(this,Ri))==null||i.call(this,...o)}}};ZOe=Symbol.toStringTag,Ti=new WeakMap,En=new WeakMap,_i=new WeakMap,Ri=new WeakMap,RO=new WeakMap,_t=new WeakMap,zi=new WeakMap,Pt=new WeakMap,Ke=new WeakMap,ge=new WeakMap,ln=new WeakMap,Yn=new WeakMap,Jt=new WeakMap,Ut=new WeakMap,Wi=new WeakMap,Et=new WeakMap,qi=new WeakMap,Zi=new WeakMap,Vn=new WeakMap,Ui=new WeakMap,yo=new WeakMap,sn=new WeakMap,Gs=new WeakSet,MQ=function(){const t=new Yc(T(this,Ti)),n=new Yc(T(this,Ti));fe(this,Vn,t),fe(this,Zi,n),fe(this,Is,(o,a,O=OO.now())=>{if(n[o]=a!==0?O:0,t[o]=a,a!==0&&this.ttlAutopurge){const l=setTimeout(()=>{T(this,Cn).call(this,o)&&this.delete(T(this,Ke)[o])},a+1);l.unref&&l.unref()}}),fe(this,pa,o=>{n[o]=t[o]!==0?OO.now():0}),fe(this,qr,(o,a)=>{if(t[a]){const O=t[a],l=n[a];if(!O||!l)return;o.ttl=O,o.start=l,o.now=i||r();const s=o.now-l;o.remainingTTL=O-s}});let i=0;const r=()=>{const o=OO.now();if(this.ttlResolution>0){i=o;const a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{const a=T(this,Pt).get(o);if(a===void 0)return 0;const O=t[a],l=n[a];if(!O||!l)return 1/0;const s=(i||r())-l;return O-s},fe(this,Cn,o=>{const a=n[o],O=t[o];return!!O&&!!a&&(i||r())-a>O})},pa=new WeakMap,qr=new WeakMap,Is=new WeakMap,Cn=new WeakMap,_d=new WeakSet,Jz=function(){const t=new Yc(T(this,Ti));fe(this,zi,0),fe(this,qi,t),fe(this,ma,n=>{fe(this,zi,T(this,zi)-t[n]),t[n]=0}),fe(this,Ds,(n,i,r,o)=>{if(le(this,Le,et).call(this,i))return 0;if(!ro(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(i,n),!ro(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),fe(this,zO,(n,i,r)=>{if(t[n]=i,T(this,En)){const o=T(this,En)-t[n];for(;T(this,zi)>o;)le(this,WO,Ld).call(this,!0)}fe(this,zi,T(this,zi)+t[n]),r&&(r.entrySize=i,r.totalCalculatedSize=T(this,zi))})},ma=new WeakMap,zO=new WeakMap,Ds=new WeakMap,Or=new WeakSet,ko=function*({allowStale:t=this.allowStale}={}){if(T(this,_t))for(let n=T(this,Ut);!(!le(this,Ns,BQ).call(this,n)||((t||!T(this,Cn).call(this,n))&&(yield n),n===T(this,Jt)));)n=T(this,Yn)[n]},lr=new WeakSet,xo=function*({allowStale:t=this.allowStale}={}){if(T(this,_t))for(let n=T(this,Jt);!(!le(this,Ns,BQ).call(this,n)||((t||!T(this,Cn).call(this,n))&&(yield n),n===T(this,Ut)));)n=T(this,ln)[n]},Ns=new WeakSet,BQ=function(t){return t!==void 0&&T(this,Pt).get(T(this,Ke)[t])===t},WO=new WeakSet,Ld=function(t){var o,a;const n=T(this,Jt),i=T(this,Ke)[n],r=T(this,ge)[n];return T(this,yo)&&le(this,Le,et).call(this,r)?r.__abortController.abort(new Error("evicted")):(T(this,Ui)||T(this,sn))&&(T(this,Ui)&&((o=T(this,_i))==null||o.call(this,r,i,"evict")),T(this,sn)&&((a=T(this,Et))==null||a.push([r,i,"evict"]))),T(this,ma).call(this,n),t&&(T(this,Ke)[n]=void 0,T(this,ge)[n]=void 0,T(this,Wi).push(n)),T(this,_t)===1?(fe(this,Jt,fe(this,Ut,0)),T(this,Wi).length=0):fe(this,Jt,T(this,ln)[n]),T(this,Pt).delete(i),Nd(this,_t)._--,n},qO=new WeakSet,Fd=function(t,n,i,r){const o=n===void 0?void 0:T(this,ge)[n];if(le(this,Le,et).call(this,o))return o;const a=new Ec,{signal:O}=i;O==null||O.addEventListener("abort",()=>a.abort(O.reason),{signal:a.signal});const l={signal:a.signal,options:i,context:r},s=(m,b=!1)=>{const{aborted:$}=a.signal,Q=i.ignoreFetchAbort&&m!==void 0;if(i.status&&($&&!b?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,Q&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),$&&!Q&&!b)return c(a.signal.reason);const P=h;return T(this,ge)[n]===h&&(m===void 0?P.__staleWhileFetching?T(this,ge)[n]=P.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,m,l.options))),m},u=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),c(m)),c=m=>{const{aborted:b}=a.signal,$=b&&i.allowStaleOnFetchAbort,Q=$||i.allowStaleOnFetchRejection,P=Q||i.noDeleteOnFetchRejection,k=h;if(T(this,ge)[n]===h&&(!P||k.__staleWhileFetching===void 0?this.delete(t):$||(T(this,ge)[n]=k.__staleWhileFetching)),Q)return i.status&&k.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw m},f=(m,b)=>{var Q;const $=(Q=T(this,RO))==null?void 0:Q.call(this,t,o,l);$&&$ instanceof Promise&&$.then(P=>m(P===void 0?void 0:P),b),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=P=>s(P,!0)))})};i.status&&(i.status.fetchDispatched=!0);const h=new Promise(f).then(s,u),p=Object.assign(h,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return n===void 0?(this.set(t,p,{...l.options,status:void 0}),n=T(this,Pt).get(t)):T(this,ge)[n]=p,p},Le=new WeakSet,et=function(t){if(!T(this,yo))return!1;const n=t;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ec},Ls=new WeakSet,HQ=function(t,n){T(this,Yn)[n]=t,T(this,ln)[t]=n},ga=new WeakSet,Js=function(t){t!==T(this,Ut)&&(t===T(this,Jt)?fe(this,Jt,T(this,ln)[t]):le(this,Ls,HQ).call(this,T(this,Yn)[t],T(this,ln)[t]),le(this,Ls,HQ).call(this,T(this,Ut),t),fe(this,Ut,t))};let Jm=DQ;const a9=e=>{const t=g.inject("theme"),{editorExtensions:n,editorExtensionsAttrs:i,mermaidConfig:r}=dt,o=g.shallowRef(n.mermaid.instance),a=g.shallowRef(-1),O=new Jm({max:1e3,ttl:6e5}),l=()=>{const u=o.value;!e.noMermaid&&u&&(u.initialize(r({startOnLoad:!1,theme:t.value==="dark"?"dark":"default"})),a.value=a.value+1)};return g.watch(()=>t.value,()=>{O.clear(),l()}),g.onMounted(()=>{var c,f;if(e.noMermaid||o.value)return;const u=n.mermaid.js;/\.mjs/.test(u)?(un("link",{...(c=i.mermaid)==null?void 0:c.js,rel:"modulepreload",href:u,id:`${z}-mermaid-m`}),import(u).then(h=>{o.value=h.default,l()})):un("script",{...(f=i.mermaid)==null?void 0:f.js,src:u,id:`${z}-mermaid`,onload(){o.value=window.mermaid,l()}},"mermaid")}),{mermaidRef:o,reRenderRef:a,replaceMermaid:()=>{g.nextTick(()=>{if(!e.noMermaid&&o.value){const u=document.querySelectorAll(`div.${z}-mermaid`),c=document.createElement("div");c.style.width=document.body.offsetWidth+"px",c.style.height=document.body.offsetHeight+"px",c.style.position="fixed",c.style.zIndex="-10000",c.style.top="-10000";let f=u.length;f>0&&document.body.appendChild(c),u.forEach(async h=>{let p=O.get(h.innerText);if(!p){const b=Hd(),$=o.value.renderAsync||o.value.render;let Q="";try{Q=await $(b,h.innerText,c)}catch{}p=await e.sanitizeMermaid(typeof Q=="string"?Q:Q.svg),O.set(h.innerText,p)}const m=document.createElement("p");m.className=`${z}-mermaid`,m.setAttribute("data-processed",""),m.innerHTML=p,h.dataset.line!==void 0&&(m.dataset.line=h.dataset.line),h.replaceWith(m),--f===0&&c.remove()})}})}}},O9=e=>{const t=g.shallowRef(dt.editorExtensions.katex.instance);return g.onMounted(()=>{if(e.noKatex||t.value)return;const{editorExtensions:n}=dt;un("script",{src:n.katex.js,id:`${z}-katex`,onload(){t.value=window.katex}},"katex"),un("link",{rel:"stylesheet",href:n.katex.css,id:`${z}-katexCss`})}),t},l9=(e,t)=>{const n=e.renderer.rules.fence.bind(e.renderer.rules);e.renderer.rules.fence=(i,r,o,a,O)=>{const l=i[r],s=l.content.trim();if(l.info==="mermaid"){let u;return i[r].map&&i[r].level===0&&(u=i[r].map[0],i[r].attrSet("data-line",String(u))),`<div class="${z}-mermaid" ${u!==void 0?"data-line="+u:""} data-mermaid-theme=${t.themeRef.value}>${s}</div>`}return n(i,r,o,a,O)}},Vc=(e,t)=>{const n=e.attrs?e.attrs.slice():[];return t.forEach(i=>{const r=e.attrIndex(i[0]);r<0?n.push(i):(n[r]=n[r].slice(),n[r][1]+=` ${i[1]}`)}),n},Dx=(e,t)=>{let n=!0,i=!0;const r=e.posMax,o=t>0?e.src.charCodeAt(t-1):-1,a=t+1<=r?e.src.charCodeAt(t+1):-1;return(o===32||o===9||a>=48&&a<=57)&&(i=!1),(a===32||a===9)&&(n=!1),{can_open:n,can_close:i}},s9=(e,t)=>{let n,i,r,o;if(e.src[e.pos]!=="$")return!1;if(r=Dx(e,e.pos),!r.can_open)return t||(e.pending+="$"),e.pos+=1,!0;const a=e.pos+1;for(n=a;(n=e.src.indexOf("$",n))!==-1;){for(o=n-1;e.src[o]==="\\";)o-=1;if((n-o)%2==1)break;n+=1}return n===-1?(t||(e.pending+="$"),e.pos=a,!0):n-a===0?(t||(e.pending+="$$"),e.pos=a+1,!0):(r=Dx(e,n),r.can_close?(t||(i=e.push("math_inline","math",0),i.markup="$",i.content=e.src.slice(a,n)),e.pos=n+1,!0):(t||(e.pending+="$"),e.pos=a,!0))},u9=(e,t,n,i)=>{let r,o,a,O,l=!1,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s+2>u||e.src.slice(s,s+2)!=="$$")return!1;if(s+=2,r=e.src.slice(s,u),i)return!0;for(r.trim().slice(-2)==="$$"&&(r=r.trim().slice(0,-2),l=!0),a=t;!l&&(a++,!(a>=n||(s=e.bMarks[a]+e.tShift[a],u=e.eMarks[a],s<u&&e.tShift[a]<e.blkIndent)));)e.src.slice(s,u).trim().slice(-2)==="$$"&&(O=e.src.slice(0,u).lastIndexOf("$$"),o=e.src.slice(s,O),l=!0);e.line=a+1;const c=e.push("math_block","math",0);return c.block=!0,c.content=(r&&r.trim()?r+`
|
|
114
|
+
`:"")+e.getLines(t+1,a,e.tShift[t],!0)+(o&&o.trim()?o:""),c.map=[t,e.line],c.markup="$$",!0},c9=(e,{katexRef:t})=>{const n=(r,o,a,O,l)=>{const s=r[o],u={attrs:Vc(s,[["class",`${z}-katex-inline`]])};if(t.value){const c=t.value.renderToString(s.content,{throwOnError:!1});return`<span ${l.renderAttrs(u)} data-processed>${c}</span>`}else return`<span ${l.renderAttrs(u)}>${s.content}</span>`},i=(r,o,a,O,l)=>{const s=r[o],u={attrs:Vc(s,[["class",`${z}-katex-block`]])};if(t.value){const c=t.value.renderToString(s.content,{throwOnError:!1,displayMode:!0});return`<p ${l.renderAttrs(u)} data-processed>${c}</p>`}else return`<p ${l.renderAttrs(u)}>${s.content}</p>`};e.inline.ruler.after("escape","math_inline",s9),e.block.ruler.after("blockquote","math_block",u9,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=n,e.renderer.rules.math_block=i},f9=(e,t)=>{t=t||{};const n=3,i=t.marker||"!",r=i.charCodeAt(0),o=i.length;let a="",O="";const l=(u,c,f,h,p)=>{const m=u[c];return m.type==="admonition_open"?u[c].attrPush(["class",`${z}-admonition ${z}-admonition-${m.info}`]):m.type==="admonition_title_open"&&u[c].attrPush(["class",`${z}-admonition-title`]),p.renderToken(u,c,f)},s=u=>{const c=u.trim().split(" ",2);O="",a=c[0],c.length>1&&(O=u.substring(a.length+2))};e.block.ruler.before("code","admonition",(u,c,f,h)=>{let p,m,b,$=!1,Q=u.bMarks[c]+u.tShift[c],P=u.eMarks[c];if(r!==u.src.charCodeAt(Q))return!1;for(p=Q+1;p<=P&&i[(p-Q)%o]===u.src[p];p++);const k=Math.floor((p-Q)/o);if(k!==n)return!1;p-=(p-Q)%o;const S=u.src.slice(Q,p),R=u.src.slice(p,P);if(s(R),h)return!0;for(m=c;m++,!(m>=f||(Q=u.bMarks[m]+u.tShift[m],P=u.eMarks[m],Q<P&&u.sCount[m]<u.blkIndent));)if(r===u.src.charCodeAt(Q)&&!(u.sCount[m]-u.blkIndent>=4)){for(p=Q+1;p<=P&&i[(p-Q)%o]===u.src[p];p++);if(!(Math.floor((p-Q)/o)<k)&&(p-=(p-Q)%o,p=u.skipSpaces(p),!(p<P))){$=!0;break}}const w=u.parentType,x=u.lineMax;return u.parentType="root",u.lineMax=m,b=u.push("admonition_open","div",1),b.markup=S,b.block=!0,b.info=a,b.map=[c,m],O&&(b=u.push("admonition_title_open","p",1),b.markup=S+" "+a,b.map=[c,m],b=u.push("inline","",0),b.content=O,b.map=[c,u.line-1],b.children=[],b=u.push("admonition_title_close","p",-1),b.markup=S+" "+a),u.md.block.tokenize(u,c+1,m),b=u.push("admonition_close","div",-1),b.markup=u.src.slice(Q,p),b.block=!0,u.parentType=w,u.lineMax=x,u.line=m+($?1:0),!0},{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.admonition_open=l,e.renderer.rules.admonition_title_open=l,e.renderer.rules.admonition_title_close=l,e.renderer.rules.admonition_close=l},d9=(e,t)=>{e.renderer.rules.heading_open=(n,i)=>{var O;const r=n[i],o=((O=n[i+1].children)==null?void 0:O.reduce((l,s)=>l+(["text","code_inline"].includes(s.type)&&s.content||""),""))||"",a=r.markup.length;return t.headsRef.value.push({text:o,level:a}),r.map&&r.level===0&&r.attrSet("id",t.mdHeadingId(o,a,t.headsRef.value.length)),e.renderer.renderToken(n,i,t)},e.renderer.rules.heading_close=(n,i,r,o,a)=>a.renderToken(n,i,r)},Nx=(e,t)=>{if(typeof t[e]=="string")return t[e];const n=`<i class="${z}-iconfont ${z}-icon-${e}"></i>`;switch(dt.iconfontType){case"svg":return`<svg class="${z}-icon" aria-hidden="true"><use xlink:href="#${z}-icon-${e}"></use></svg>`;default:return n}},h9=(e,t)=>{const n=e.renderer.rules.fence,i=e.utils.unescapeAll,r=/\[(\w*)(?::([\w ]*))?\]/,o=/::(open|close)/,a=c=>c.info?i(c.info).trim():"",O=c=>{const f=a(c),[h=null,p=""]=(r.exec(f)||[]).slice(1);return[h,p]},l=c=>{const f=a(c);return f?f.split(/(\s+)/g)[0]:""},s=c=>{const f=c.info.match(o)||[],h=f[1]==="open"||f[1]!=="close"&&t.codeFoldable&&c.content.trim().split(`
|
|
115
|
+
`).length<t.autoFoldThreshold,p=f[1]||t.codeFoldable?"details":"div",m=f[1]||t.codeFoldable?"summary":"div";return{open:h,tagContainer:p,tagHeader:m}},u=(c,f,h,p,m)=>{var Y;if(c[f].hidden)return"";const b=(Y=t.usedLanguageTextRef.value)==null?void 0:Y.copyCode.text,$=t.customIconRef.value.copy||b,Q=!!t.customIconRef.value.copy,P=`<span class="${z}-collapse-tips">${Nx("collapse-tips",t.customIconRef.value)}</span>`,[k]=O(c[f]);if(k===null){const{open:N,tagContainer:F,tagHeader:I}=s(c[f]),L=[["class",`${z}-code`]];N&&L.push(["open",""]);const ie={attrs:Vc(c[f],L)};c[f].info=c[f].info.replace(o,"");const he=n(c,f,h,p,m);return`<${F} ${m.renderAttrs(ie)}>
|
|
116
116
|
<${I} class="${z}-code-head">
|
|
117
117
|
<div class="${z}-code-flag"><span></span><span></span><span></span></div>
|
|
118
118
|
<div class="${z}-code-action">
|