md-editor-v3 5.2.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2766,18 +2766,16 @@ const useResize = (props2, contentRef, resizeRef) => {
2766
2766
  const resizeMouseup = () => {
2767
2767
  document.removeEventListener("mousemove", resizeMousemove);
2768
2768
  };
2769
- vue.watch(
2770
- [resizeRef],
2771
- () => {
2772
- document.removeEventListener("mousedown", resizeMousedown);
2773
- document.removeEventListener("mouseup", resizeMouseup);
2774
- document.addEventListener("mousedown", resizeMousedown);
2775
- document.addEventListener("mouseup", resizeMouseup);
2776
- },
2777
- {
2778
- immediate: true
2779
- }
2780
- );
2769
+ vue.watch([resizeRef], () => {
2770
+ document.removeEventListener("mousedown", resizeMousedown);
2771
+ document.removeEventListener("mouseup", resizeMouseup);
2772
+ document.addEventListener("mousedown", resizeMousedown);
2773
+ document.addEventListener("mouseup", resizeMouseup);
2774
+ });
2775
+ vue.onMounted(() => {
2776
+ document.addEventListener("mousedown", resizeMousedown);
2777
+ document.addEventListener("mouseup", resizeMouseup);
2778
+ });
2781
2779
  vue.onBeforeUnmount(() => {
2782
2780
  document.removeEventListener("mousedown", resizeMousedown);
2783
2781
  document.removeEventListener("mouseup", resizeMouseup);
@@ -2765,18 +2765,16 @@ const useResize = (props2, contentRef, resizeRef) => {
2765
2765
  const resizeMouseup = () => {
2766
2766
  document.removeEventListener("mousemove", resizeMousemove);
2767
2767
  };
2768
- watch(
2769
- [resizeRef],
2770
- () => {
2771
- document.removeEventListener("mousedown", resizeMousedown);
2772
- document.removeEventListener("mouseup", resizeMouseup);
2773
- document.addEventListener("mousedown", resizeMousedown);
2774
- document.addEventListener("mouseup", resizeMouseup);
2775
- },
2776
- {
2777
- immediate: true
2778
- }
2779
- );
2768
+ watch([resizeRef], () => {
2769
+ document.removeEventListener("mousedown", resizeMousedown);
2770
+ document.removeEventListener("mouseup", resizeMouseup);
2771
+ document.addEventListener("mousedown", resizeMousedown);
2772
+ document.addEventListener("mouseup", resizeMouseup);
2773
+ });
2774
+ onMounted(() => {
2775
+ document.addEventListener("mousedown", resizeMousedown);
2776
+ document.addEventListener("mouseup", resizeMouseup);
2777
+ });
2780
2778
  onBeforeUnmount(() => {
2781
2779
  document.removeEventListener("mousedown", resizeMousedown);
2782
2780
  document.removeEventListener("mouseup", resizeMouseup);
package/lib/umd/index.js CHANGED
@@ -350,7 +350,7 @@ See: https://github.com/francoischalifour/medium-zoom`)}},c6=function(t){var n=d
350
350
  </${_}>
351
351
  ${W}
352
352
  </${Z}>
353
- `};e.renderer.rules.fence=u,e.renderer.rules.code_block=u},mv=(e,t,n)=>{const i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):(e.attrs=e.attrs||[],e.attrs[i]=r)},b8=e=>e.type==="inline",y8=e=>e.type==="paragraph_open",S8=e=>e.type==="list_item_open",P8=e=>e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0,k8=(e,t)=>b8(e[t])&&y8(e[t-1])&&S8(e[t-2])&&P8(e[t]),x8=(e,t)=>{const n=e[t].level-1;for(let i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1},v8=e=>{const t=new e("html_inline","",0);return t.content="<label>",t},w8=e=>{const t=new e("html_inline","",0);return t.content="</label>",t},T8=(e,t,n)=>{const i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i},X8=(e,t,n)=>{const i=new t("html_inline","",0),r=n.enabled?" ":' disabled="" ';return e.content.indexOf("[ ] ")===0?i.content='<input class="task-list-item-checkbox"'+r+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(i.content='<input class="task-list-item-checkbox" checked=""'+r+'type="checkbox">'),i},_8=(e,t,n)=>{if(e.children=e.children||[],e.children.unshift(X8(e,t,n)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),n.label)if(n.labelAfter){e.children.pop();const i="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+i+'">',e.children.push(T8(e.content,i,t))}else e.children.unshift(v8(t)),e.children.push(w8(t))},R8=(e,t={})=>{e.core.ruler.after("inline","github-task-lists",n=>{const i=n.tokens;for(let r=2;r<i.length;r++)k8(i,r)&&(_8(i[r],n.Token,t),mv(i[r-2],"class","task-list-item"+(t.enabled?" enabled":" ")),mv(i[x8(i,r-2)],"class","contains-task-list"))})},z8=e=>{e.core.ruler.push("init-line-number",t=>(t.tokens.forEach(n=>{n.map&&(n.attrs||(n.attrs=[]),n.attrs.push(["data-line",n.map[0].toString()]))}),!0))},W8=(e,t)=>{const{editorConfig:n,markdownItConfig:i,markdownItPlugins:r}=ht,o=m.inject("editorId"),a=m.inject("language"),O=m.inject("usedLanguageText"),l=m.inject("showCodeRowNumber"),s=m.inject("theme"),u=m.inject("customIcon"),c=m.inject("rootRef"),f=m.ref([]),d=l8(e),p=c8(e),{reRenderRef:Q,replaceMermaid:b}=u8(e),$=ii({html:!0,breaks:!0,linkify:!0});i($,{editorId:o});const g=[{type:"image",plugin:t8,options:{figcaption:!0,classes:"md-zoom"}},{type:"admonition",plugin:m8,options:{}},{type:"taskList",plugin:R8,options:{}},{type:"heading",plugin:g8,options:{mdHeadingId:e.mdHeadingId,headsRef:f}},{type:"code",plugin:Q8,options:{editorId:o,usedLanguageTextRef:O,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,customIconRef:u}},{type:"sub",plugin:r8,options:{}},{type:"sup",plugin:O8,options:{}}];e.noKatex||g.push({type:"katex",plugin:p8,options:{katexRef:p}}),e.noMermaid||g.push({type:"mermaid",plugin:f8,options:{themeRef:s}}),r(g,{editorId:o}).forEach(W=>{$.use(W.plugin,W.options)});const S=$.options.highlight;$.set({highlight:(W,V,E)=>{if(S){const q=S(W,V,E);if(q)return q}let Z;!e.noHighlight&&d.value?d.value.getLanguage(V)?Z=d.value.highlight(W,{language:V,ignoreIllegals:!0}).value:Z=d.value.highlightAuto(W).value:Z=$.utils.escapeHtml(W);const _=l?xW(Z.replace(/^\n+|\n+$/g,""),W.replace(/^\n+|\n+$/g,"")):`<span class="${X}-code-block">${Z.replace(/^\n+|\n+$/g,"")}</span>`;return`<pre><code class="language-${V}" language=${V}>${_}</code></pre>`}}),z8($);const k=m.ref(`_article-key_${uh()}`),y=m.ref(e.sanitize($.render(e.modelValue))),T=()=>{F.emit(o,hu,y.value),e.onHtmlChanged(y.value),e.onGetCatalog(f.value),F.emit(o,KO,f.value),m.nextTick(()=>{b().then(()=>{var W;Wb((W=c.value)==null?void 0:W.querySelectorAll(`#${o} .${X}-mermaid`))})})},x=()=>{f.value=[],y.value=e.sanitize($.render(e.modelValue)),T()},w=m.computed(()=>(e.noKatex||p.value)&&(e.noHighlight||d.value));let v=-1;return m.watch([m.toRef(e,"modelValue"),w,Q,a],()=>{v=window.setTimeout(()=>{x()},t?0:n.renderDelay)}),m.watch(()=>e.setting.preview,()=>{e.setting.preview&&m.nextTick(()=>{b().then(()=>{var W;Wb((W=c.value)==null?void 0:W.querySelectorAll(`#${o} .${X}-mermaid`))}),F.emit(o,KO,f.value)})}),m.onMounted(T),m.onMounted(()=>{F.on(o,{name:Xb,callback(){F.emit(o,KO,f.value)}}),F.on(o,{name:gh,callback:()=>{k.value=`_article-key_${uh()}`,x()}})}),m.onBeforeUnmount(()=>{clearTimeout(v)}),{html:y,key:k}},q8=(e,t,n)=>{const i=m.reactive({resizedWidth:e.inputBoxWidth}),r=m.reactive({width:e.inputBoxWidth}),o=m.reactive({left:e.inputBoxWidth,display:"initial"}),a=m.ref(e.setting.preview||e.setting.htmlPreview),O=u=>{var Q,b,$;const c=((Q=t.value)==null?void 0:Q.offsetWidth)||0,f=((b=t.value)==null?void 0:b.getBoundingClientRect().x)||0;let d=u.x-f;d<fu?d=fu:d>c-fu&&(d=c-fu);const p=`${d}px`;r.width=p,o.left=p,i.resizedWidth=p,($=e.oninputBoxWidthChange)==null||$.call(e,p)},l=u=>{u.target===n.value&&document.addEventListener("mousemove",O)},s=()=>{document.removeEventListener("mousemove",O)};return m.watch([n],()=>{document.removeEventListener("mousedown",l),document.removeEventListener("mouseup",s),document.addEventListener("mousedown",l),document.addEventListener("mouseup",s)},{immediate:!0}),m.onBeforeUnmount(()=>{document.removeEventListener("mousedown",l),document.removeEventListener("mouseup",s)}),m.watch(()=>e.inputBoxWidth,u=>{u&&(i.resizedWidth=u,r.width=u,o.left=u)}),m.watch([m.toRef(e.setting,"htmlPreview"),m.toRef(e.setting,"preview"),m.toRef(e.setting,"previewOnly")],()=>{e.setting.previewOnly?(r.width="0%",o.display="none",a.value=!0):!e.setting.htmlPreview&&!e.setting.preview?(r.width="100%",o.display="none",a.value=!1):(r.width=i.resizedWidth,o.display="initial",a.value=!0)},{immediate:!0}),{inputWrapperStyle:r,resizeOperateStyle:o,showPreviewWrapper:a}},gv={checked:{regexp:/- \[x\]/,value:"- [ ]"},unChecked:{regexp:/- \[\s\]/,value:"- [x]"}},U8=(e,t)=>{const n=m.inject("editorId"),i=m.inject("rootRef");let r=()=>{};const o=()=>{if(!i.value)return!1;const a=i.value.querySelectorAll(".task-list-item.enabled"),O=l=>{var p;l.preventDefault();const s=l.target.checked?"unChecked":"checked",u=(p=l.target.parentElement)==null?void 0:p.dataset.line;if(!u)return;const c=Number(u),f=e.modelValue.split(`
353
+ `};e.renderer.rules.fence=u,e.renderer.rules.code_block=u},mv=(e,t,n)=>{const i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):(e.attrs=e.attrs||[],e.attrs[i]=r)},b8=e=>e.type==="inline",y8=e=>e.type==="paragraph_open",S8=e=>e.type==="list_item_open",P8=e=>e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0,k8=(e,t)=>b8(e[t])&&y8(e[t-1])&&S8(e[t-2])&&P8(e[t]),x8=(e,t)=>{const n=e[t].level-1;for(let i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1},v8=e=>{const t=new e("html_inline","",0);return t.content="<label>",t},w8=e=>{const t=new e("html_inline","",0);return t.content="</label>",t},T8=(e,t,n)=>{const i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i},X8=(e,t,n)=>{const i=new t("html_inline","",0),r=n.enabled?" ":' disabled="" ';return e.content.indexOf("[ ] ")===0?i.content='<input class="task-list-item-checkbox"'+r+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(i.content='<input class="task-list-item-checkbox" checked=""'+r+'type="checkbox">'),i},_8=(e,t,n)=>{if(e.children=e.children||[],e.children.unshift(X8(e,t,n)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),n.label)if(n.labelAfter){e.children.pop();const i="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+i+'">',e.children.push(T8(e.content,i,t))}else e.children.unshift(v8(t)),e.children.push(w8(t))},R8=(e,t={})=>{e.core.ruler.after("inline","github-task-lists",n=>{const i=n.tokens;for(let r=2;r<i.length;r++)k8(i,r)&&(_8(i[r],n.Token,t),mv(i[r-2],"class","task-list-item"+(t.enabled?" enabled":" ")),mv(i[x8(i,r-2)],"class","contains-task-list"))})},z8=e=>{e.core.ruler.push("init-line-number",t=>(t.tokens.forEach(n=>{n.map&&(n.attrs||(n.attrs=[]),n.attrs.push(["data-line",n.map[0].toString()]))}),!0))},W8=(e,t)=>{const{editorConfig:n,markdownItConfig:i,markdownItPlugins:r}=ht,o=m.inject("editorId"),a=m.inject("language"),O=m.inject("usedLanguageText"),l=m.inject("showCodeRowNumber"),s=m.inject("theme"),u=m.inject("customIcon"),c=m.inject("rootRef"),f=m.ref([]),d=l8(e),p=c8(e),{reRenderRef:Q,replaceMermaid:b}=u8(e),$=ii({html:!0,breaks:!0,linkify:!0});i($,{editorId:o});const g=[{type:"image",plugin:t8,options:{figcaption:!0,classes:"md-zoom"}},{type:"admonition",plugin:m8,options:{}},{type:"taskList",plugin:R8,options:{}},{type:"heading",plugin:g8,options:{mdHeadingId:e.mdHeadingId,headsRef:f}},{type:"code",plugin:Q8,options:{editorId:o,usedLanguageTextRef:O,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,customIconRef:u}},{type:"sub",plugin:r8,options:{}},{type:"sup",plugin:O8,options:{}}];e.noKatex||g.push({type:"katex",plugin:p8,options:{katexRef:p}}),e.noMermaid||g.push({type:"mermaid",plugin:f8,options:{themeRef:s}}),r(g,{editorId:o}).forEach(W=>{$.use(W.plugin,W.options)});const S=$.options.highlight;$.set({highlight:(W,V,E)=>{if(S){const q=S(W,V,E);if(q)return q}let Z;!e.noHighlight&&d.value?d.value.getLanguage(V)?Z=d.value.highlight(W,{language:V,ignoreIllegals:!0}).value:Z=d.value.highlightAuto(W).value:Z=$.utils.escapeHtml(W);const _=l?xW(Z.replace(/^\n+|\n+$/g,""),W.replace(/^\n+|\n+$/g,"")):`<span class="${X}-code-block">${Z.replace(/^\n+|\n+$/g,"")}</span>`;return`<pre><code class="language-${V}" language=${V}>${_}</code></pre>`}}),z8($);const k=m.ref(`_article-key_${uh()}`),y=m.ref(e.sanitize($.render(e.modelValue))),T=()=>{F.emit(o,hu,y.value),e.onHtmlChanged(y.value),e.onGetCatalog(f.value),F.emit(o,KO,f.value),m.nextTick(()=>{b().then(()=>{var W;Wb((W=c.value)==null?void 0:W.querySelectorAll(`#${o} .${X}-mermaid`))})})},x=()=>{f.value=[],y.value=e.sanitize($.render(e.modelValue)),T()},w=m.computed(()=>(e.noKatex||p.value)&&(e.noHighlight||d.value));let v=-1;return m.watch([m.toRef(e,"modelValue"),w,Q,a],()=>{v=window.setTimeout(()=>{x()},t?0:n.renderDelay)}),m.watch(()=>e.setting.preview,()=>{e.setting.preview&&m.nextTick(()=>{b().then(()=>{var W;Wb((W=c.value)==null?void 0:W.querySelectorAll(`#${o} .${X}-mermaid`))}),F.emit(o,KO,f.value)})}),m.onMounted(T),m.onMounted(()=>{F.on(o,{name:Xb,callback(){F.emit(o,KO,f.value)}}),F.on(o,{name:gh,callback:()=>{k.value=`_article-key_${uh()}`,x()}})}),m.onBeforeUnmount(()=>{clearTimeout(v)}),{html:y,key:k}},q8=(e,t,n)=>{const i=m.reactive({resizedWidth:e.inputBoxWidth}),r=m.reactive({width:e.inputBoxWidth}),o=m.reactive({left:e.inputBoxWidth,display:"initial"}),a=m.ref(e.setting.preview||e.setting.htmlPreview),O=u=>{var Q,b,$;const c=((Q=t.value)==null?void 0:Q.offsetWidth)||0,f=((b=t.value)==null?void 0:b.getBoundingClientRect().x)||0;let d=u.x-f;d<fu?d=fu:d>c-fu&&(d=c-fu);const p=`${d}px`;r.width=p,o.left=p,i.resizedWidth=p,($=e.oninputBoxWidthChange)==null||$.call(e,p)},l=u=>{u.target===n.value&&document.addEventListener("mousemove",O)},s=()=>{document.removeEventListener("mousemove",O)};return m.watch([n],()=>{document.removeEventListener("mousedown",l),document.removeEventListener("mouseup",s),document.addEventListener("mousedown",l),document.addEventListener("mouseup",s)}),m.onMounted(()=>{document.addEventListener("mousedown",l),document.addEventListener("mouseup",s)}),m.onBeforeUnmount(()=>{document.removeEventListener("mousedown",l),document.removeEventListener("mouseup",s)}),m.watch(()=>e.inputBoxWidth,u=>{u&&(i.resizedWidth=u,r.width=u,o.left=u)}),m.watch([m.toRef(e.setting,"htmlPreview"),m.toRef(e.setting,"preview"),m.toRef(e.setting,"previewOnly")],()=>{e.setting.previewOnly?(r.width="0%",o.display="none",a.value=!0):!e.setting.htmlPreview&&!e.setting.preview?(r.width="100%",o.display="none",a.value=!1):(r.width=i.resizedWidth,o.display="initial",a.value=!0)},{immediate:!0}),{inputWrapperStyle:r,resizeOperateStyle:o,showPreviewWrapper:a}},gv={checked:{regexp:/- \[x\]/,value:"- [ ]"},unChecked:{regexp:/- \[\s\]/,value:"- [x]"}},U8=(e,t)=>{const n=m.inject("editorId"),i=m.inject("rootRef");let r=()=>{};const o=()=>{if(!i.value)return!1;const a=i.value.querySelectorAll(".task-list-item.enabled"),O=l=>{var p;l.preventDefault();const s=l.target.checked?"unChecked":"checked",u=(p=l.target.parentElement)==null?void 0:p.dataset.line;if(!u)return;const c=Number(u),f=e.modelValue.split(`
354
354
  `),d=f[Number(c)].replace(gv[s].regexp,gv[s].value);e.previewOnly?(f[Number(c)]=d,e.onChange(f.join(`
355
355
  `))):F.emit(n,Rb,c+1,d)};a.forEach(l=>{l.addEventListener("click",O)}),r=()=>{a.forEach(l=>{l.removeEventListener("click",O)})}};m.onBeforeUnmount(()=>{r()}),m.watch([t],()=>{r(),m.nextTick(o)},{immediate:!0})},$v={modelValue:{type:String,default:""},onChange:{type:Function,default:()=>{}},setting:{type:Object,default:()=>({preview:!0})},onHtmlChanged:{type:Function,default:()=>{}},onGetCatalog:{type:Function,default:()=>{}},mdHeadingId:{type:Function,default:()=>""},noMermaid:{type:Boolean,default:!1},sanitize:{type:Function,default:e=>e},noKatex:{type:Boolean,default:!1},formatCopiedText:{type:Function,default:e=>e},noHighlight:{type:Boolean,default:!1},previewOnly:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean},sanitizeMermaid:{type:Function},codeFoldable:{type:Boolean},autoFoldThreshold:{type:Number}},Z8={...$v,updateModelValue:{type:Function,default:()=>{}},placeholder:{type:String,default:""},scrollAuto:{type:Boolean},autofocus:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},maxlength:{type:Number},autoDetectCode:{type:Boolean},onBlur:{type:Function,default:()=>{}},onFocus:{type:Function,default:()=>{}},noPrettier:{type:Boolean},completions:{type:Array},catalogVisible:{type:Boolean},theme:{type:String,default:"light"},onInput:{type:Function},onDrop:{type:Function,default:()=>{}},inputBoxWidth:{type:String},oninputBoxWidthChange:{type:Function},transformImgUrl:{type:Function,default:e=>e}},Qv=m.defineComponent({name:"ContentPreview",props:$v,setup(e){const t=m.inject("editorId"),n=m.inject("previewTheme"),i=m.inject("showCodeRowNumber"),{html:r,key:o}=W8(e,e.previewOnly);return k6(e,r,o),m6(e,r),U8(e,r),()=>m.createVNode(m.Fragment,null,[e.setting.preview&&m.createVNode("div",{id:`${t}-preview-wrapper`,class:`${X}-preview-wrapper`,key:"content-preview-wrapper"},[m.createVNode("div",{key:o.value,id:`${t}-preview`,class:[`${X}-preview`,`${n==null?void 0:n.value}-theme`,i&&`${X}-scrn`],innerHTML:r.value},null)]),!e.previewOnly&&e.setting.htmlPreview&&m.createVNode("div",{id:`${t}-html-wrapper`,class:`${X}-preview-wrapper`,key:"html-preview-wrapper"},[m.createVNode("div",{class:`${X}-html`},[r.value])])])}}),V8={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},bv=m.defineComponent({props:V8,setup(e){const t=m.inject("scrollElementRef"),n=m.inject("roorNodeRef"),i=m.ref();return m.watch(()=>e.tocItem.active,r=>{r&&(i.value?e.onActive(e.tocItem,i.value):m.nextTick(()=>{e.onActive(e.tocItem,i.value)}))},{immediate:!0}),()=>{const{tocItem:r,mdHeadingId:o,onClick:a,scrollElementOffsetTop:O}=e;return m.createVNode("div",{ref:i,class:[`${X}-catalog-link`,r.active&&`${X}-catalog-active`],onClick:l=>{a(l,r),l.stopPropagation();const s=o(r.text,r.level,r.index),u=n.value.getElementById(s),c=t.value;if(u&&c){let f=u.offsetParent,d=u.offsetTop;if(c.contains(f))for(;f&&c!=f;)d+=f==null?void 0:f.offsetTop,f=f==null?void 0:f.offsetParent;const p=u.previousElementSibling;let Q=0;p||(Q=Ra(u,"margin-top")),c==null||c.scrollTo({top:d-O-Q,behavior:"smooth"})}}},[m.createVNode("span",{title:r.text},[r.text]),r.children&&r.children.length>0&&m.createVNode("div",{class:`${X}-catalog-wrapper`},[r.children.map(l=>m.createVNode(bv,{mdHeadingId:o,key:`${r.text}-link-${l.level}-${l.text}`,tocItem:l,onActive:e.onActive,onClick:a,scrollElementOffsetTop:O},null))])])}}}),Y8={editorId:{type:String,default:void 0},class:{type:String,default:""},mdHeadingId:{type:Function,default:e=>e},scrollElement:{type:[String,Object],default:void 0},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function,default:void 0},onActive:{type:Function,default:void 0},isScrollElementInShadow:{type:Boolean,default:!1}},gO=m.defineComponent({name:"MdCatalog",props:Y8,emits:["onClick","onActive"],setup(e,t){const n=e.editorId,i=`#${n}-preview-wrapper`,r=m.reactive({list:[],show:!1,scrollElement:e.scrollElement||i}),o=m.shallowRef(),a=m.ref(),O=m.ref(),l=m.ref(),s=m.ref(),u=m.ref({});m.provide("scrollElementRef",O),m.provide("roorNodeRef",s);const c=m.computed(()=>{const $=[];return r.list.forEach((g,S)=>{const{text:k,level:y}=g,T={level:y,text:k,index:S+1,active:o.value===g};if($.length===0)$.push(T);else{let x=$[$.length-1];if(T.level>x.level)for(let w=x.level+1;w<=6;w++){const{children:v}=x;if(!v){x.children=[T];break}if(x=v[v.length-1],T.level<=x.level){v.push(T);break}}else $.push(T)}}),$}),f=()=>{var g;if(r.scrollElement instanceof HTMLElement)return r.scrollElement;let $=document;return(r.scrollElement===i||e.isScrollElementInShadow)&&($=(g=a.value)==null?void 0:g.getRootNode()),$.querySelector(r.scrollElement)},d=$=>{if($.length===0)return o.value=void 0,r.list=[],!1;const{activeHead:g}=$.reduce((S,k,y)=>{var x;const T=(x=s.value)==null?void 0:x.getElementById(e.mdHeadingId(k.text,k.level,y+1));if(T instanceof HTMLElement){const w=vW(T,O.value);if(w<e.offsetTop&&w>S.minTop)return{activeHead:k,minTop:w}}return S},{activeHead:$[0],minTop:Number.MIN_SAFE_INTEGER});o.value=g,r.list=$},p=($,g)=>{u.value.top=g.offsetTop+Ra(g,"padding-top")+"px",e.onActive?e.onActive($,g):t.emit("onActive",$,g)},Q=()=>{d(r.list)},b=$=>{var S,k;const g=f();O.value=g,l.value=g===document.documentElement?document:g,(S=l.value)==null||S.removeEventListener("scroll",Q),d($),(k=l.value)==null||k.addEventListener("scroll",Q)};return m.onMounted(()=>{s.value=a.value.getRootNode(),F.on(n,{name:KO,callback:b}),F.emit(n,Xb)}),m.onBeforeUnmount(()=>{var $;F.remove(n,KO,b),($=l.value)==null||$.removeEventListener("scroll",Q)}),()=>m.createVNode("div",{class:[`${X}-catalog`,e.theme==="dark"&&`${X}-catalog-dark`,e.class||""],ref:a},[c.value.length>0&&m.createVNode(m.Fragment,null,[m.createVNode("div",{class:`${X}-catalog-indicator`,style:u.value},null),m.createVNode("div",{class:`${X}-catalog-container`},[c.value.map($=>m.createVNode(bv,{mdHeadingId:e.mdHeadingId,tocItem:$,key:`link-${$.level}-${$.text}`,onActive:p,onClick:(g,S)=>{e.onClick?e.onClick(g,S):t.emit("onClick",g,S)},scrollElementOffsetTop:e.scrollElementOffsetTop},null))])])])}});gO.install=e=>(e.component(gO.name,gO),e);const E8=m.defineComponent({name:"MDEditorContent",props:Z8,setup(e,t){const n=m.inject("editorId"),i=m.ref(""),r=m.ref(),o=m.ref(),{inputWrapperRef:a,codeMirrorUt:O,resetHistory:l}=s6(e),{inputWrapperStyle:s,resizeOperateStyle:u,showPreviewWrapper:c}=q8(e,r,o);return YW(e,i,O),t.expose({getSelectedText(){var f;return(f=O.value)==null?void 0:f.getSelectedText()},focus(f){var d;(d=O.value)==null||d.focus(f)},resetHistory:l,getEditorView(){var f;return(f=O.value)==null?void 0:f.view}}),()=>m.createVNode("div",{class:`${X}-content${c.value?" has-preview":""}`,ref:r},[m.createVNode("div",{class:`${X}-input-wrapper`,style:s,ref:a},null),(e.setting.htmlPreview||e.setting.preview)&&m.createVNode("div",{class:`${X}-resize-operate`,style:u,ref:o},null),c.value&&m.createVNode(Qv,{modelValue:e.modelValue,onChange:e.onChange,setting:e.setting,onHtmlChanged:f=>{i.value=f,e.onHtmlChanged(f)},onGetCatalog:e.onGetCatalog,mdHeadingId:e.mdHeadingId,noMermaid:e.noMermaid,sanitize:e.sanitize,noKatex:e.noKatex,formatCopiedText:e.formatCopiedText,noHighlight:e.noHighlight,noImgZoomIn:e.noImgZoomIn,sanitizeMermaid:e.sanitizeMermaid,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold},null),e.catalogVisible&&m.createVNode(gO,{theme:e.theme,class:`${X}-catalog-editor`,editorId:n,mdHeadingId:e.mdHeadingId,key:"internal-catalog",scrollElementOffsetTop:2},null)])}}),C8=m.defineComponent({props:{modelValue:{type:String,default:""}},setup(e){const t=m.inject("usedLanguageText");return()=>{var n,i;return m.createVNode("div",{class:`${X}-footer-item`},[m.createVNode("label",{class:`${X}-footer-label`},[`${(n=t.value.footer)==null?void 0:n.markdownTotal}:`]),m.createVNode("span",null,[((i=e.modelValue)==null?void 0:i.length)||0])])}}}),j8={checked:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},disabled:{type:Boolean,default:void 0}},A8=m.defineComponent({name:`${X}-checkbox`,props:j8,setup(e){return()=>m.createVNode("div",{class:[`${X}-checkbox`,e.checked&&`${X}-checkbox-checked`,e.disabled&&`${X}-disabled`],onClick:()=>{e.disabled||e.onChange(!e.checked)}},null)}}),G8={scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}}},I8=m.defineComponent({props:G8,setup(e){const t=m.inject("usedLanguageText"),n=m.inject("disabled");return()=>{var i;return m.createVNode("div",{class:[`${X}-footer-item`,(n==null?void 0:n.value)&&`${X}-disabled`]},[m.createVNode("label",{class:`${X}-footer-label`,onClick:()=>{e.onScrollAutoChange(!e.scrollAuto)}},[(i=t==null?void 0:t.value.footer)==null?void 0:i.scrollAuto]),m.createVNode(A8,{checked:e.scrollAuto,onChange:e.onScrollAutoChange,disabled:n==null?void 0:n.value},null)])}}}),D8={modelValue:{type:String,default:""},footers:{type:Array,default:[]},scrollAuto:{type:Boolean},noScrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}},defFooters:{type:Object}},N8=m.defineComponent({name:"MDEditorFooter",props:D8,setup(e){const t=m.inject("theme"),n=m.inject("language"),i=m.inject("disabled"),r=m.computed(()=>{const a=e.footers.indexOf("="),O=a===-1?e.footers:e.footers.slice(0,a),l=a===-1?[]:e.footers.slice(a,Number.MAX_SAFE_INTEGER);return[O,l]}),o=a=>{var O,l,s,u,c,f;if(hh.includes(a))switch(a){case"markdownTotal":return m.createVNode(C8,{modelValue:e.modelValue},null);case"scrollSwitch":return!e.noScrollAuto&&m.createVNode(I8,{scrollAuto:e.scrollAuto,onScrollAutoChange:e.onScrollAutoChange},null)}else if(e.defFooters instanceof Array){const d=e.defFooters[a];return d?m.cloneVNode(d,{theme:((O=d.props)==null?void 0:O.theme)||t.value,language:((l=d.props)==null?void 0:l.language)||n.value,disabled:((s=d.props)==null?void 0:s.disabled)||(i==null?void 0:i.value)}):""}else if(e.defFooters&&e.defFooters.children instanceof Array){const d=e.defFooters.children[a];return d?m.cloneVNode(d,{theme:((u=d.props)==null?void 0:u.theme)||t.value,language:((c=d.props)==null?void 0:c.language)||n.value,disabled:((f=d.props)==null?void 0:f.disabled)||(i==null?void 0:i.value)}):""}else return""};return()=>{const a=r.value[0].map(l=>o(l)),O=r.value[1].map(l=>o(l));return m.createVNode("div",{class:`${X}-footer`},[m.createVNode("div",{class:`${X}-footer-left`},[a]),m.createVNode("div",{class:`${X}-footer-right`},[O])])}}}),L8=(e,t,n)=>{const{editorId:i}=n,r=m.reactive({buildFinished:!1,html:""});m.watch(()=>e.modelValue,()=>{r.buildFinished=!1}),m.onMounted(()=>{F.on(i,{name:hu,callback(o){r.buildFinished=!0,r.html=o}}),F.on(i,{name:du,callback(){const o=new Promise(a=>{if(r.buildFinished)a(r.html);else{const O=l=>{a(l),F.remove(i,hu,O)};F.on(i,{name:hu,callback:O})}});e.onSave?e.onSave(e.modelValue,o):t.emit("onSave",e.modelValue,o)}})})},yv=(e,t)=>{const n=ht.editorExtensions.highlight,i=ht.editorExtensionsAttrs.highlight,r=e7(e);m.provide("editorId",r),m.provide("rootRef",t),m.provide("theme",m.computed(()=>e.theme)),m.provide("language",m.computed(()=>e.language)),m.provide("highlight",m.computed(()=>{const{js:a}=n,O={...fh,...n.css},{js:l,css:s={}}=i||{},u=e.codeStyleReverse&&e.codeStyleReverseList.includes(e.previewTheme)?"dark":e.theme,c=O[e.codeTheme]?O[e.codeTheme][u]:fh.atom[u],f=O[e.codeTheme]&&s[e.codeTheme]?s[e.codeTheme][u]:s.atom?s.atom[u]:{};return{js:{src:a,...l},css:{href:c,...f}}})),m.provide("showCodeRowNumber",e.showCodeRowNumber);const o=m.computed(()=>{const a={...cu,...ht.editorConfig.languageUserDefined};return ch(HO(cu["en-US"]),a[e.language]||{})});return m.provide("usedLanguageText",o),m.provide("previewTheme",m.computed(()=>e.previewTheme)),m.provide("customIcon",m.computed(()=>e.customIcon)),{editorId:r}},M8=(e,t)=>(m.provide("tabWidth",e.tabWidth),m.provide("disabled",m.computed(()=>e.disabled)),yv(e,t)),F8=e=>{const{noPrettier:t,noUploadImg:n}=e,{editorExtensions:i,editorExtensionsAttrs:r}=ht,o=t||i.prettier.prettierInstance,a=t||i.prettier.parserMarkdownInstance,O=n||i.cropper.instance;m.onMounted(()=>{if(!O){const{js:l={},css:s={}}=r.cropper||{};Ln("link",{...s,rel:"stylesheet",href:i.cropper.css,id:cn.croppercss}),Ln("script",{...l,src:i.cropper.js,id:cn.cropperjs})}if(!o){const{standaloneJs:l={}}=r.prettier||{};Ln("script",{...l,src:i.prettier.standaloneJs,id:cn.prettier})}if(!a){const{parserMarkdownJs:l={}}=r.prettier||{};Ln("script",{...l,src:i.prettier.parserMarkdownJs,id:cn.prettierMD})}})},B8=(e,t,n)=>{const{editorId:i}=n;m.onMounted(()=>{F.on(i,{name:Ro,callback:r=>{e.onError instanceof Function?e.onError(r):t.emit("onError",r)}})})},H8=(e,t,n)=>{const{editorId:i}=n,r=m.reactive({pageFullscreen:e.pageFullscreen,fullscreen:!1,preview:e.preview,htmlPreview:e.preview?!1:e.htmlPreview,previewOnly:!1}),o=m.reactive({...r}),a=(s,u)=>{const c=u===void 0?!r[s]:u;switch(s){case"preview":{r.htmlPreview=!1,r.previewOnly=!1;break}case"htmlPreview":{r.preview=!1,r.previewOnly=!1;break}case"previewOnly":{c?!r.preview&&!r.htmlPreview&&(r.preview=!0):(o.preview||(r.preview=!1),o.htmlPreview||(r.htmlPreview=!1));break}}o[s]=c,r[s]=c};let O="";const l=()=>{r.pageFullscreen||r.fullscreen?document.body.style.overflow="hidden":document.body.style.overflow=O};return m.watch(()=>[r.pageFullscreen,r.fullscreen],l),m.onMounted(()=>{F.on(i,{name:pu,callback(s,u){const c=f=>{F.emit(i,Ge,"image",{desc:"",urls:f}),u==null||u()};e.onUploadImg?e.onUploadImg(s,c):t.emit("onUploadImg",s,c)}}),O=document.body.style.overflow,l()}),[r,a]},K8=(e,t)=>{const{editorId:n}=t,i=m.ref(!1);return m.onMounted(()=>{F.on(n,{name:ph,callback:r=>{r===void 0?i.value=!i.value:i.value=r}})}),i},J8=(e,t,n)=>{const{editorId:i,catalogVisible:r,setting:o,updateSetting:a,codeRef:O}=n;m.watch(()=>o.pageFullscreen,s=>{F.emit(i,yb,s)}),m.watch(()=>o.fullscreen,s=>{F.emit(i,Sb,s)}),m.watch(()=>o.preview,s=>{F.emit(i,Pb,s)}),m.watch(()=>o.previewOnly,s=>{F.emit(i,kb,s)}),m.watch(()=>o.htmlPreview,s=>{F.emit(i,xb,s)}),m.watch(r,s=>{F.emit(i,vb,s)});const l={on(s,u){switch(s){case"pageFullscreen":{F.on(i,{name:yb,callback(c){u(c)}});break}case"fullscreen":{F.on(i,{name:Sb,callback(c){u(c)}});break}case"preview":{F.on(i,{name:Pb,callback(c){u(c)}});break}case"previewOnly":{F.on(i,{name:kb,callback(c){u(c)}});break}case"htmlPreview":{F.on(i,{name:xb,callback(c){u(c)}});break}case"catalog":{F.on(i,{name:vb,callback(c){u(c)}});break}}},togglePageFullscreen(s){a("pageFullscreen",s)},toggleFullscreen(s){F.emit(i,bb,s)},togglePreview(s){a("preview",s)},togglePreviewOnly(s){a("previewOnly",s)},toggleHtmlPreview(s){a("htmlPreview",s)},toggleCatalog(s){F.emit(i,ph,s)},triggerSave(){F.emit(i,du)},insert(s){F.emit(i,Ge,"universal",{generate:s})},focus(s){var u;(u=O.value)==null||u.focus(s)},rerender(){F.emit(i,gh)},getSelectedText(){var s;return(s=O.value)==null?void 0:s.getSelectedText()},resetHistory(){var s;(s=O.value)==null||s.resetHistory()},domEventHandlers(s){F.emit(i,_b,s)},execCommand(s){F.emit(i,Ge,s)},getEditorView(){var s;return(s=O.value)==null?void 0:s.getEditorView()}};t.expose(l)},e7=e=>{const t=m.useId();return e.id||e.editorId||`${X}-${t}`},Sv={modelValue:{type:String,default:""},onChange:{type:Function,default:void 0},theme:{type:String,default:"light"},class:{type:String,default:""},language:{type:String,default:"zh-CN"},onHtmlChanged:{type:Function,default:void 0},onGetCatalog:{type:Function,default:void 0},editorId:{type:String,default:void 0},id:{type:String,default:void 0},showCodeRowNumber:{type:Boolean,default:!0},previewTheme:{type:String,default:"default"},style:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:e=>e},sanitize:{type:Function,default:e=>e},noMermaid:{type:Boolean,default:!1},noKatex:{type:Boolean,default:!1},codeTheme:{type:String,default:"atom"},formatCopiedText:{type:Function,default:e=>e},codeStyleReverse:{type:Boolean,default:!0},codeStyleReverseList:{type:Array,default:["default","mk-cute"]},noHighlight:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean,default:!1},customIcon:{type:Object,default:{}},sanitizeMermaid:{type:Function,default:e=>Promise.resolve(e)},codeFoldable:{type:Boolean,default:!0},autoFoldThreshold:{type:Number,default:30}},t7={...Sv,onSave:{type:Function,default:void 0},onUploadImg:{type:Function,default:void 0},pageFullscreen:{type:Boolean,default:!1},preview:{type:Boolean,default:!0},htmlPreview:{type:Boolean,default:!1},toolbars:{type:Array,default:dh},toolbarsExclude:{type:Array,default:[]},noPrettier:{type:Boolean,default:!1},tabWidth:{type:Number,default:2},tableShape:{type:Array,default:[6,4]},placeholder:{type:String,default:""},defToolbars:{type:[String,Object],default:void 0},onError:{type:Function,default:void 0},footers:{type:Array,default:hh},scrollAuto:{type:Boolean,default:!0},defFooters:{type:[String,Object],default:void 0},noUploadImg:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},maxLength:{type:Number,default:void 0},autoDetectCode:{type:Boolean,default:!1},onBlur:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},completions:{type:Array,default:void 0},showToolbarName:{type:Boolean,default:!1},onInput:{type:Function,default:void 0},onDrop:{type:Function,default:void 0},inputBoxWidth:{type:String,default:"50%"},oninputBoxWidthChange:{type:Function,default:void 0},transformImgUrl:{type:Function,default:e=>e}},Pv=["onHtmlChanged","onGetCatalog","onChange","update:modelValue"],n7=[...Pv,"onSave","onUploadImg","onError","onBlur","onFocus","onInput","onDrop","oninputBoxWidthChange"],ef=m.defineComponent({name:"MdEditorV3",props:t7,emits:n7,setup(e,t){const{noKatex:n,noMermaid:i,noPrettier:r,noUploadImg:o,noHighlight:a}=e,O=m.reactive({scrollAuto:e.scrollAuto}),l=m.ref(),s=m.ref(),{editorId:u}=M8(e,l),[c,f]=H8(e,t,{editorId:u}),d=K8(e,{editorId:u});return L8(e,t,{editorId:u}),F8(e),B8(e,t,{editorId:u}),J8(e,t,{editorId:u,catalogVisible:d,setting:c,updateSetting:f,codeRef:s}),m.onBeforeUnmount(()=>{F.clear(u)}),()=>{const p=tn({props:e,ctx:t},"defToolbars"),Q=tn({props:e,ctx:t},"defFooters");return m.createVNode("div",{id:u,class:[X,e.class,e.theme==="dark"&&`${X}-dark`,c.fullscreen||c.pageFullscreen?`${X}-fullscreen`:""],style:e.style,ref:l},[e.toolbars.length>0&&m.createVNode(qW,{noPrettier:r,toolbars:e.toolbars,toolbarsExclude:e.toolbarsExclude,setting:c,updateSetting:f,tableShape:e.tableShape,defToolbars:p,noUploadImg:o,showToolbarName:e.showToolbarName,catalogVisible:d.value,codeTheme:e.codeTheme},null),m.createVNode(E8,{ref:s,modelValue:e.modelValue,setting:c,mdHeadingId:e.mdHeadingId,noMermaid:i,noPrettier:r,sanitize:e.sanitize,placeholder:e.placeholder,noKatex:n,scrollAuto:O.scrollAuto,formatCopiedText:e.formatCopiedText,autofocus:e.autoFocus,disabled:e.disabled,readonly:e.readOnly,maxlength:e.maxLength,autoDetectCode:e.autoDetectCode,noHighlight:a,updateModelValue:b=>{t.emit("update:modelValue",b)},onChange:b=>{e.onChange&&e.onChange(b),t.emit("onChange",b)},onHtmlChanged:b=>{e.onHtmlChanged&&e.onHtmlChanged(b),t.emit("onHtmlChanged",b)},onGetCatalog:b=>{e.onGetCatalog&&e.onGetCatalog(b),t.emit("onGetCatalog",b)},onBlur:b=>{e.onBlur&&e.onBlur(b),t.emit("onBlur",b)},onFocus:b=>{e.onFocus&&e.onFocus(b),t.emit("onFocus",b)},onInput:b=>{e.onInput&&e.onInput(b),t.emit("onInput",b)},completions:e.completions,catalogVisible:d.value,theme:e.theme,noImgZoomIn:e.noImgZoomIn,onDrop:b=>{e.onDrop&&e.onDrop(b),t.emit("onDrop",b)},inputBoxWidth:e.inputBoxWidth,oninputBoxWidthChange:b=>{e.oninputBoxWidthChange&&e.oninputBoxWidthChange(b),t.emit("oninputBoxWidthChange",b)},sanitizeMermaid:e.sanitizeMermaid,transformImgUrl:e.transformImgUrl,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold},null),e.footers.length>0&&m.createVNode(N8,{modelValue:e.modelValue,footers:e.footers,defFooters:Q,noScrollAuto:!c.preview&&!c.htmlPreview||c.previewOnly,scrollAuto:O.scrollAuto,onScrollAutoChange:b=>O.scrollAuto=b},null)])}}}),i7={title:{type:String,default:""},trigger:{type:[String,Object],default:void 0},onClick:{type:Function,default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},rs=m.defineComponent({name:"NormalToolbar",props:i7,emits:["onClick"],setup(e,t){return()=>{const n=tn({props:e,ctx:t},"trigger"),i=tn({props:e,ctx:t});return m.createVNode("div",{class:[`${X}-toolbar-item`,e.disabled&&`${X}-disabled`],title:e.title,onClick:r=>{var o;e.disabled||((o=e.onClick)==null||o.call(e,r),t.emit("onClick",r))}},[i||n])}}});rs.install=e=>(e.component(rs.name,rs),e);const r7={title:{type:String,default:""},visible:{type:Boolean,default:void 0},trigger:{type:[String,Object],default:void 0},onChange:{type:Function,default:void 0},overlay:{type:[String,Object],default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},os=m.defineComponent({name:"DropdownToolbar",props:r7,emits:["onChange"],setup(e,t){const n=m.inject("editorId");return()=>{const i=tn({props:e,ctx:t},"trigger"),r=tn({props:e,ctx:t},"overlay"),o=tn({props:e,ctx:t});return m.createVNode(_a,{relative:`#${n}-toolbar-wrapper`,visible:e.visible,onChange:a=>{e.onChange instanceof Function?e.onChange(a):t.emit("onChange",a)},overlay:r,disabled:e.disabled},{default:()=>[m.createVNode("div",{class:[`${X}-toolbar-item`,e.disabled&&`${X}-disabled`],title:e.title||""},[o||i])]})}}});os.install=e=>(e.component(os.name,os),e);function o7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!m.isVNode(e)}const a7={title:{type:String,default:""},modalTitle:{type:[String,Object],default:""},visible:{type:Boolean,default:void 0},width:{type:String,default:"auto"},height:{type:String,default:"auto"},trigger:{type:[String,Object],default:void 0},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:void 0},class:{type:String,default:void 0},style:{type:[Object,String],default:void 0},showMask:{type:Boolean,default:!0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},as=m.defineComponent({name:"ModalToolbar",props:a7,emits:["onClick","onClose","onAdjust"],setup(e,t){return()=>{const n=tn({props:e,ctx:t},"trigger"),i=tn({props:e,ctx:t},"modalTitle"),r=tn({props:e,ctx:t});return m.createVNode(m.Fragment,null,[m.createVNode("div",{class:[`${X}-toolbar-item`,e.disabled&&`${X}-disabled`],title:e.title,onClick:()=>{var o;e.disabled||((o=e.onClick)==null||o.call(e),t.emit("onClick"))}},[n]),m.createVNode(zo,{style:e.style,class:e.class,width:e.width,height:e.height,title:i,visible:e.visible,showMask:e.showMask,onClose:()=>{e.onClose instanceof Function?e.onClose():t.emit("onClose")},showAdjust:e.showAdjust,isFullscreen:e.isFullscreen,onAdjust:o=>{e.onAdjust instanceof Function?e.onAdjust(o):t.emit("onAdjust",o)}},o7(r)?r:{default:()=>[r]})])}}});as.install=e=>(e.component(as.name,as),e);const O7=(e,t,n)=>{const{editorId:i}=n,r={rerender(){F.emit(i,gh)}};t.expose(r)},Os=m.defineComponent({name:"MdPreview",props:Sv,emits:Pv,setup(e,t){const{noKatex:n,noMermaid:i,noHighlight:r}=e,o=m.ref(),{editorId:a}=yv(e,o);return O7(e,t,{editorId:a}),m.onBeforeUnmount(()=>{F.clear(a)}),()=>m.createVNode("div",{id:a,class:[X,e.class,e.theme==="dark"&&`${X}-dark`,`${X}-previewOnly`],style:e.style,ref:o},[m.createVNode(Qv,{modelValue:e.modelValue,onChange:O=>{e.onChange&&e.onChange(O),t.emit("onChange",O),t.emit("update:modelValue",O)},onHtmlChanged:O=>{e.onHtmlChanged?e.onHtmlChanged(O):t.emit("onHtmlChanged",O)},onGetCatalog:O=>{e.onGetCatalog?e.onGetCatalog(O):t.emit("onGetCatalog",O)},mdHeadingId:e.mdHeadingId,noMermaid:i,sanitize:e.sanitize,noKatex:n,formatCopiedText:e.formatCopiedText,noHighlight:r,noImgZoomIn:e.noImgZoomIn,previewOnly:!0,sanitizeMermaid:e.sanitizeMermaid,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold},null)])}});Os.install=e=>(e.component(Os.name,Os),e),ef.install=e=>(e.component(ef.name,ef),e.use(rs).use(os).use(as).use(gO).use(Os),e);const l7={onClick:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0}},tf=m.defineComponent({name:"NormalFooterToolbar",props:l7,emits:["onClick"],setup(e,t){return()=>{const n=tn({props:e,ctx:t});return m.createVNode("div",{class:[`${X}-footer-item`,e.disabled&&`${X}-disabled`],onClick:i=>{var r;e.disabled||((r=e.onClick)==null||r.call(e,i),t.emit("onClick",i))}},[n])}}});tf.install=e=>(e.component(tf.name,tf),e);var mg={exports:{}},nt={},gg={exports:{}},Lo={};function kv(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function s7(e,t,n){}function u7(e,t,n){}var c7=/javascript\s*\:/img;function f7(e,t){return c7.test(t)?"":t}Lo.whiteList=kv(),Lo.getDefaultWhiteList=kv,Lo.onAttr=s7,Lo.onIgnoreAttr=u7,Lo.safeAttrValue=f7;var d7={indexOf:function(e,t){var n,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var i,r;if(Array.prototype.forEach)return e.forEach(t,n);for(i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},ls=d7;function h7(e,t){e=ls.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,i=!1,r=0,o=0,a="";function O(){if(!i){var u=ls.trim(e.slice(r,o)),c=u.indexOf(":");if(c!==-1){var f=ls.trim(u.slice(0,c)),d=ls.trim(u.slice(c+1));if(f){var p=t(r,a.length,f,d,u);p&&(a+=p+"; ")}}}r=o+1}for(;o<n;o++){var l=e[o];if(l==="/"&&e[o+1]==="*"){var s=e.indexOf("*/",o+2);if(s===-1)break;o=s+1,r=o+1,i=!1}else l==="("?i=!0:l===")"?i=!1:l===";"?i||O():l===`
356
356
  `&&O()}return ls.trim(a)}var p7=h7,nf=Lo,m7=p7;function xv(e){return e==null}function g7(e){var t={};for(var n in e)t[n]=e[n];return t}function vv(e){e=g7(e||{}),e.whiteList=e.whiteList||nf.whiteList,e.onAttr=e.onAttr||nf.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||nf.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||nf.safeAttrValue,this.options=e}vv.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,i=n.whiteList,r=n.onAttr,o=n.onIgnoreAttr,a=n.safeAttrValue,O=m7(e,function(l,s,u,c,f){var d=i[u],p=!1;if(d===!0?p=d:typeof d=="function"?p=d(c):d instanceof RegExp&&(p=d.test(c)),p!==!0&&(p=!1),c=a(u,c),!!c){var Q={position:s,sourcePosition:l,source:f,isWhite:p};if(p){var b=r(u,c,Q);return xv(b)?u+":"+c:b}else{var b=o(u,c,Q);if(!xv(b))return b}}});return O};var $7=vv;(function(e,t){var n=Lo,i=$7;function r(a,O){var l=new i(O);return l.process(a)}t=e.exports=r,t.FilterCSS=i;for(var o in n)t[o]=n[o];typeof window<"u"&&(window.filterCSS=e.exports)})(gg,gg.exports);var $g=gg.exports,Qg={indexOf:function(e,t){var n,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var i,r;if(Array.prototype.forEach)return e.forEach(t,n);for(i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},Q7=$g.FilterCSS,b7=$g.getDefaultWhiteList,rf=Qg;function wv(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Tv=new Q7;function y7(e,t,n){}function S7(e,t,n){}function P7(e,t,n){}function k7(e,t,n){}function Xv(e){return e.replace(v7,"&lt;").replace(w7,"&gt;")}function x7(e,t,n,i){if(n=Vv(n),t==="href"||t==="src"){if(n=rf.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(of.lastIndex=0,of.test(n))return""}else if(t==="style"){if(_v.lastIndex=0,_v.test(n)||(Rv.lastIndex=0,Rv.test(n)&&(of.lastIndex=0,of.test(n))))return"";i!==!1&&(i=i||Tv,n=i.process(n))}return n=Yv(n),n}var v7=/</g,w7=/>/g,T7=/"/g,X7=/&quot;/g,_7=/&#([a-zA-Z0-9]*);?/gim,R7=/&colon;?/gim,z7=/&newline;?/gim,of=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,_v=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Rv=/u\s*r\s*l\s*\(.*/gi;function zv(e){return e.replace(T7,"&quot;")}function Wv(e){return e.replace(X7,'"')}function qv(e){return e.replace(_7,function(n,i){return i[0]==="x"||i[0]==="X"?String.fromCharCode(parseInt(i.substr(1),16)):String.fromCharCode(parseInt(i,10))})}function Uv(e){return e.replace(R7,":").replace(z7," ")}function Zv(e){for(var t="",n=0,i=e.length;n<i;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return rf.trim(t)}function Vv(e){return e=Wv(e),e=qv(e),e=Uv(e),e=Zv(e),e}function Yv(e){return e=zv(e),e=Xv(e),e}function W7(){return""}function q7(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function i(a){return n?!0:rf.indexOf(e,a)!==-1}var r=[],o=!1;return{onIgnoreTag:function(a,O,l){if(i(a))if(l.isClosing){var s="[/removed]",u=l.position+s.length;return r.push([o!==!1?o:l.position,u]),o=!1,s}else return o||(o=l.position),"[removed]";else return t(a,O,l)},remove:function(a){var O="",l=0;return rf.forEach(r,function(s){O+=a.slice(l,s[0]),l=s[1]}),O+=a.slice(l),O}}}function U7(e){for(var t="",n=0;n<e.length;){var i=e.indexOf("<!--",n);if(i===-1){t+=e.slice(n);break}t+=e.slice(n,i);var r=e.indexOf("-->",i);if(r===-1)break;n=r+3}return t}function Z7(e){var t=e.split("");return t=t.filter(function(n){var i=n.charCodeAt(0);return i===127?!1:i<=31?i===10||i===13:!0}),t.join("")}nt.whiteList=wv(),nt.getDefaultWhiteList=wv,nt.onTag=y7,nt.onIgnoreTag=S7,nt.onTagAttr=P7,nt.onIgnoreTagAttr=k7,nt.safeAttrValue=x7,nt.escapeHtml=Xv,nt.escapeQuote=zv,nt.unescapeQuote=Wv,nt.escapeHtmlEntities=qv,nt.escapeDangerHtml5Entities=Uv,nt.clearNonPrintableCharacter=Zv,nt.friendlyAttrValue=Vv,nt.escapeAttrValue=Yv,nt.onIgnoreTagStripAll=W7,nt.StripTagBody=q7,nt.stripCommentTag=U7,nt.stripBlankChar=Z7,nt.attributeWrapSign='"',nt.cssFilter=Tv,nt.getDefaultCSSWhiteList=b7;var af={},so=Qg;function V7(e){var t=so.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=so.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function Y7(e){return e.slice(0,2)==="</"}function E7(e,t,n){var i="",r=0,o=!1,a=!1,O=0,l=e.length,s="",u="";e:for(O=0;O<l;O++){var c=e.charAt(O);if(o===!1){if(c==="<"){o=O;continue}}else if(a===!1){if(c==="<"){i+=n(e.slice(r,O)),o=O,r=O;continue}if(c===">"||O===l-1){i+=n(e.slice(r,o)),u=e.slice(o,O+1),s=V7(u),i+=t(o,i.length,s,u,Y7(u)),r=O+1,o=!1;continue}if(c==='"'||c==="'")for(var f=1,d=e.charAt(O-f);d.trim()===""||d==="=";){if(d==="="){a=c;continue e}d=e.charAt(O-++f)}}else if(c===a){a=!1;continue}}return r<l&&(i+=n(e.substr(r))),i}var C7=/[^a-zA-Z0-9\\_:.-]/gim;function j7(e,t){var n=0,i=0,r=[],o=!1,a=e.length;function O(f,d){if(f=so.trim(f),f=f.replace(C7,"").toLowerCase(),!(f.length<1)){var p=t(f,d||"");p&&r.push(p)}}for(var l=0;l<a;l++){var s=e.charAt(l),u,c;if(o===!1&&s==="="){o=e.slice(n,l),n=l+1,i=e.charAt(n)==='"'||e.charAt(n)==="'"?n:G7(e,l+1);continue}if(o!==!1&&l===i){if(c=e.indexOf(s,l+1),c===-1)break;u=so.trim(e.slice(i+1,c)),O(o,u),o=!1,l=c,n=l+1;continue}if(/\s|\n|\t/.test(s))if(e=e.replace(/\s|\n|\t/g," "),o===!1)if(c=A7(e,l),c===-1){u=so.trim(e.slice(n,l)),O(u),o=!1,n=l+1;continue}else{l=c-1;continue}else if(c=I7(e,l-1),c===-1){u=so.trim(e.slice(n,l)),u=Ev(u),O(o,u),o=!1,n=l+1;continue}else continue}return n<e.length&&(o===!1?O(e.slice(n)):O(o,Ev(so.trim(e.slice(n))))),so.trim(r.join(" "))}function A7(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function G7(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function I7(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function D7(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function Ev(e){return D7(e)?e.substr(1,e.length-2):e}af.parseTag=E7,af.parseAttr=j7;var N7=$g.FilterCSS,ri=nt,Cv=af,L7=Cv.parseTag,M7=Cv.parseAttr,Of=Qg;function lf(e){return e==null}function F7(e){var t=Of.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Of.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Of.trim(e.slice(0,-1))),{html:e,closing:n}}function B7(e){var t={};for(var n in e)t[n]=e[n];return t}function H7(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(i){return i.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function jv(e){e=B7(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=ri.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=H7(e.whiteList||e.allowList):e.whiteList=ri.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":ri.attributeWrapSign,e.onTag=e.onTag||ri.onTag,e.onTagAttr=e.onTagAttr||ri.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||ri.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||ri.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||ri.safeAttrValue,e.escapeHtml=e.escapeHtml||ri.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new N7(e.css))}jv.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,i=n.whiteList,r=n.onTag,o=n.onIgnoreTag,a=n.onTagAttr,O=n.onIgnoreTagAttr,l=n.safeAttrValue,s=n.escapeHtml,u=t.attributeWrapSign,c=t.cssFilter;n.stripBlankChar&&(e=ri.stripBlankChar(e)),n.allowCommentTag||(e=ri.stripCommentTag(e));var f=!1;n.stripIgnoreTagBody&&(f=ri.StripTagBody(n.stripIgnoreTagBody,o),o=f.onIgnoreTag);var d=L7(e,function(p,Q,b,$,g){var S={sourcePosition:p,position:Q,isClosing:g,isWhite:Object.prototype.hasOwnProperty.call(i,b)},k=r(b,$,S);if(!lf(k))return k;if(S.isWhite){if(S.isClosing)return"</"+b+">";var y=F7($),T=i[b],x=M7(y.html,function(w,v){var W=Of.indexOf(T,w)!==-1,V=a(b,w,v,W);return lf(V)?W?(v=l(b,w,v,c),v?w+"="+u+v+u:w):(V=O(b,w,v,W),lf(V)?void 0:V):V});return $="<"+b,x&&($+=" "+x),y.closing&&($+=" /"),$+=">",$}else return k=o(b,$,S),lf(k)?s($):k},s);return f&&(d=f.remove(d)),d};var K7=jv;(function(e,t){var n=nt,i=af,r=K7;function o(O,l){var s=new r(l);return s.process(O)}t=e.exports=o,t.filterXSS=o,t.FilterXSS=r,function(){for(var O in n)t[O]=n[O];for(var l in i)t[l]=i[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function a(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}a()&&(self.filterXSS=e.exports)})(mg,mg.exports);var ss=mg.exports;const J7=dt({__proto__:null,default:gx(ss)},[ss]),Av={img:["class"],input:["class","disabled","type","checked"],iframe:["class","width","height","src","title","border","frameborder","framespacing","allow","allowfullscreen"]},ej=(e,t)=>{const{extendedWhiteList:n={},xss:i={}}=t;let r;if(typeof i=="function")r=new ss.FilterXSS(i(J7));else{const o=ss.getDefaultWhiteList();[...Object.keys(n),...Object.keys(Av)].forEach(O=>{const l=o[O]||[],s=Av[O]||[],u=n[O]||[];o[O]=[...new Set([...l,...s,...u])]}),r=new ss.FilterXSS({whiteList:o,...i})}e.core.ruler.after("linkify","xss",o=>{for(let a=0;a<o.tokens.length;a++){const O=o.tokens[a];switch(O.type){case"html_block":{O.content=r.process(O.content);break}case"inline":{(O.children||[]).forEach(s=>{s.type==="html_inline"&&(s.content=r.process(s.content))});break}}}})},tj=cu["zh-CN"],nj=cu["en-US"],ij=()=>{Object.keys(cn).forEach(e=>{const t=document.getElementById(cn[e]);t&&t.remove()})},rj=36,Gv=1,oj=2,$O=3,bg=4,aj=5,Oj=6,lj=7,sj=8,uj=9,cj=10,fj=11,dj=12,hj=13,pj=14,mj=15,gj=16,$j=17,Iv=18,Qj=19,Dv=20,Nv=21,Lv=22,bj=23,yj=24;function yg(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Sj(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Mo(e,t,n){for(let i=!1;;){if(e.next<0)return;if(e.next==t&&!i){e.advance();return}i=n&&!i&&e.next==92,e.advance()}}function Pj(e,t){e:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue e;e.advance()}if(e.next==36){e.advance();return}}else e.advance()}}function kj(e,t){let n="[{<(".indexOf(String.fromCharCode(t)),i=n<0?t:"]}>)".charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==i&&e.peek(1)==39){e.advance(2);return}e.advance()}}function Sg(e,t){for(;!(e.next!=95&&!yg(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function xj(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),Mo(e,t,!1)}else Sg(e)}function Mv(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function Fv(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function Bv(e){for(;!(e.next<0||e.next==10);)e.advance()}function Fo(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}const Pg=` \r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-editor-v3",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "vue",