md-editor-v3 6.5.2 → 6.5.3

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.
@@ -1 +1,65 @@
1
- "use strict";const o=require("vue"),R=require("./config.cjs"),y=require("./event-bus.cjs"),G=require("./index5.cjs"),W=require("@vavt/util"),P=`.${R.prefix}-preview > [data-line]`,D=(e,l)=>+getComputedStyle(e).getPropertyValue(l).replace("px",""),j=(e,l)=>{const C=W.debounce(()=>{e.removeEventListener("scroll",i),e.addEventListener("scroll",i),l.removeEventListener("scroll",i),l.addEventListener("scroll",i)},50),i=I=>{const m=e.clientHeight,L=l.clientHeight,d=e.scrollHeight,s=l.scrollHeight,a=(d-m)/(s-L);I.target===e?(l.removeEventListener("scroll",i),l.scrollTo({top:e.scrollTop/a}),C()):(e.removeEventListener("scroll",i),e.scrollTo({top:l.scrollTop*a}),C())};return[()=>{C().finally(()=>{e.dispatchEvent(new Event("scroll"))})},()=>{e.removeEventListener("scroll",i),l.removeEventListener("scroll",i)}]},U=(e,l,C)=>{const{view:i}=C,I=W.createSmoothScroll(),m=c=>i.lineBlockAt(i.state.doc.line(c+1).from).top,L=c=>i.lineBlockAt(i.state.doc.line(c+1).from).bottom;let d=[],s=[],a=[];const N=()=>{d=[],s=Array.from(l.querySelectorAll(P)),a=s.map(n=>Number(n.dataset.line));const c=[...a],{lines:g}=i.state.doc;c[0]!==0&&c.unshift(0);let H=c.shift()||0,t=c.shift()||g;for(let n=0;n<g;n++)n===t&&(H=n,t=c.shift()||g),d.push({start:H,end:t-1})},w=(c,g)=>{let H=1;for(let t=s.length-1;t-1>=0;t--){const n=s[t],f=s[t-1];if(n.offsetTop+n.offsetHeight>g&&f.offsetTop<g){H=Number(f.dataset.line);break}}for(let t=d.length-1;t>=0;t--){const n=L(d[t].end),f=m(d[t].start);if(n>c&&f<=c){H=H<d[t].start?H:d[t].start;break}}return H};let A=0,$=0;const V=()=>{if($!==0)return!1;A++;const{scrollDOM:c,contentHeight:g}=i;let H=D(l,"padding-block-start");const t=i.lineBlockAtHeight(c.scrollTop),{number:n}=i.state.doc.lineAt(t.from),f=d[n-1];if(!f)return!1;let v=1;const k=l.querySelector(`[data-line="${f.start}"]`)||l.firstElementChild?.firstElementChild,u=l.querySelector(`[data-line="${f.end+1}"]`)||l.lastElementChild?.lastElementChild,r=c.scrollHeight-c.clientHeight,b=l.scrollHeight-l.clientHeight;let T=m(f.start),h=L(f.end),x=k.offsetTop,S=u.offsetTop-x;T===0&&(x=0,k===u?(H=0,h=g-c.offsetHeight,S=b):S=u.offsetTop),v=(c.scrollTop-T)/(h-T);const M=u==l.lastElementChild?.lastElementChild?u.offsetTop+u.clientHeight:u.offsetTop;if(h>=r||M>b){const p=w(r,b);T=m(p),v=(c.scrollTop-T)/(r-T);const q=l.querySelector(`[data-line="${p}"]`);T>0&&q&&(x=q.offsetTop),S=b-x+D(l,"padding-block-start")}const E=x-H+S*v;I(l,E,()=>{A--})},B=()=>{if(A!==0)return;$++;const{scrollDOM:c}=i,g=l.scrollTop,H=l.scrollHeight,t=c.scrollHeight-c.clientHeight,n=l.scrollHeight-l.clientHeight;let f=l.firstElementChild?.firstElementChild,v=l.firstElementChild?.lastElementChild;if(a.length>0){let M=Math.ceil(a[a.length-1]*(g/H)),E=a.findLastIndex(p=>p<=M);E=E===-1?0:E,M=a[E];for(let p=E;p>=0&&p<a.length;)if(s[p].offsetTop>g){if(p-1>=0){p--;continue}M=-1,E=-1;break}else{if(p+1<a.length&&s[p+1].offsetTop<g){p++;continue}M=a[p],E=p;break}switch(E){case-1:{f=l.firstElementChild?.firstElementChild,v=s[0];break}case a.length-1:{f=s[E],v=l.firstElementChild?.lastElementChild;break}default:f=s[E],v=s[E+1===s.length?E:E+1]}}let k=f===l.firstElementChild?.firstElementChild?0:f.offsetTop-D(f,"margin-block-start"),u=v.offsetTop,r=0;const{start:b,end:T}=d[Number(f.dataset.line||0)];let h=m(b);const x=m(T+1===i.state.doc.lines?T:T+1);let S=0;if(x>t||v.offsetTop+v.offsetHeight>n){const M=w(t,n),E=l.querySelector(`[data-line="${M}"]`);k=E?E.offsetTop-D(E,"margin-block-start"):k,h=m(M),r=(g-k)/(n-k),S=t-h}else f===l.firstElementChild?.firstElementChild?(f===v&&(u=v.offsetTop+v.offsetHeight+D(v,"margin-block-end")),S=x,r=Math.max(g/u,0)):(r=Math.max((g-k)/(u-k),0),S=x-h);I(e,h+S*r,()=>{$--})},O=c=>{const{scrollDOM:g,contentHeight:H}=i,t=g.clientHeight;if(H<=t||l.firstElementChild.clientHeight<=l.clientHeight||i.state.doc.lines<=d[d.length-1]?.end)return!1;c.target===e?V():B()};return[()=>{N(),e.addEventListener("scroll",O),l.addEventListener("scroll",O),e.dispatchEvent(new Event("scroll"))},()=>{e.removeEventListener("scroll",O),l.removeEventListener("scroll",O)}]},z={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},F=o.defineComponent({props:z,setup(e){const l=o.inject("scrollElementRef"),C=o.inject("roorNodeRef"),i=o.ref();o.watch(()=>e.tocItem.active,m=>{m&&e.onActive(e.tocItem,i.value)}),o.onMounted(()=>{e.tocItem.active&&e.onActive(e.tocItem,i.value)});const I=m=>{if(m.stopPropagation(),e.onClick(m,e.tocItem),m.defaultPrevented)return;const L=e.mdHeadingId({text:e.tocItem.text,level:e.tocItem.level,index:e.tocItem.index,currentToken:e.tocItem.currentToken,nextToken:e.tocItem.nextToken}),d=C.value.getElementById(L),s=l.value;if(d&&s){let a=d.offsetParent,N=d.offsetTop;if(s.contains(a))for(;a&&s!=a;)N+=a?.offsetTop,a=a?.offsetParent;const w=d.previousElementSibling;let A=0;w||(A=D(d,"margin-block-start")),s?.scrollTo({top:N-e.scrollElementOffsetTop-A,behavior:"smooth"})}};return()=>o.createVNode("div",{ref:i,class:[`${R.prefix}-catalog-link`,e.tocItem.active&&`${R.prefix}-catalog-active`],onClick:I},[o.createVNode("span",{title:e.tocItem.text},[e.tocItem.text]),e.tocItem.children&&e.tocItem.children.length>0&&o.createVNode("div",{class:`${R.prefix}-catalog-wrapper`},[e.tocItem.children.map(m=>o.createVNode(F,{mdHeadingId:e.mdHeadingId,key:`${e.tocItem.text}-link-${m.level}-${m.text}`,tocItem:m,onActive:e.onActive,onClick:e.onClick,scrollElementOffsetTop:e.scrollElementOffsetTop},null))])])}}),J={editorId:{type:String,default:void 0},class:{type:String,default:""},mdHeadingId:{type:Function,default:({text: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},syncWith:{type:String,default:"preview"},catalogMaxDepth:{type:Number,default:void 0}},_=o.defineComponent({name:"MdCatalog",props:J,emits:["onClick","onActive"],setup(e,l){const C=e.editorId,i=`#${C}-preview-wrapper`,I=o.reactive({list:[],show:!1,scrollElement:e.scrollElement||i}),m=o.shallowRef(),L=o.ref(),d=o.ref(),s=o.ref(),a=o.ref(),N=o.shallowRef(),w=o.ref({});o.provide("scrollElementRef",d),o.provide("roorNodeRef",a);const A=o.computed(()=>{const t=[];return I.list.forEach((n,f)=>{if(e.catalogMaxDepth&&n.level>e.catalogMaxDepth)return;const{text:v,level:k,line:u}=n,r={level:k,text:v,line:u,index:f+1,active:m.value===n};if(t.length===0)t.push(r);else{let b=t[t.length-1];if(r.level>b.level)for(let T=b.level+1;T<=6;T++){const{children:h}=b;if(!h){b.children=[r];break}if(b=h[h.length-1],r.level<=b.level){h.push(r);break}}else t.push(r)}}),t}),$=()=>{if(I.scrollElement instanceof HTMLElement)return I.scrollElement;let t=document;return(I.scrollElement===i||e.isScrollElementInShadow)&&(t=L.value?.getRootNode()),t.querySelector(I.scrollElement)},V=t=>{if(t.length===0)return m.value=void 0,I.list=[],!1;const{activeHead:n,activeIndex:f}=t.reduce((u,r,b)=>{let T=0;if(e.syncWith==="preview"){const h=a.value?.getElementById(e.mdHeadingId({text:r.text,level:r.level,index:b+1,currentToken:r.currentToken,nextToken:r.nextToken}));h instanceof HTMLElement&&(T=G.getRelativeTop(h,d.value))}else{const h=N.value;if(h){const x=h.lineBlockAt(h.state.doc.line(r.line+1).from).top,S=h.scrollDOM.scrollTop;T=x-S}}return T<e.offsetTop&&T>u.minTop?{activeHead:r,activeIndex:b,minTop:T}:u},{activeHead:t[0],activeIndex:0,minTop:Number.MIN_SAFE_INTEGER});let v=n;const{catalogMaxDepth:k}=e;if(k&&v.level>k){for(let u=f;u>=0;u--){const r=t[u];if(r.level<=k){v=r;break}}if(v.level>k){const u=t.find(r=>r.level<=k);u&&(v=u)}}m.value=v,I.list=t},B=(t,n)=>{w.value.top=n.offsetTop+D(n,"padding-block-start")+"px",e.onActive?.(t,n),l.emit("onActive",t,n)},O=()=>{V(I.list)},c=t=>{if(s.value?.removeEventListener("scroll",O),e.syncWith==="editor")s.value=N.value?.scrollDOM;else{const n=$();d.value=n,s.value=n===document.documentElement?document:n}V(t),s.value?.addEventListener("scroll",O)},g=t=>{N.value=t};o.watch([()=>e.syncWith,N,()=>e.catalogMaxDepth],()=>{c(I.list)}),o.onMounted(()=>{a.value=L.value.getRootNode(),y.bus.on(C,{name:y.CATALOG_CHANGED,callback:c}),y.bus.on(C,{name:y.GET_EDITOR_VIEW,callback:g}),y.bus.emit(C,y.PUSH_CATALOG),y.bus.emit(C,y.SEND_EDITOR_VIEW)}),o.onBeforeUnmount(()=>{y.bus.remove(C,y.CATALOG_CHANGED,c),y.bus.remove(C,y.GET_EDITOR_VIEW,g),s.value?.removeEventListener("scroll",O)});const H=(t,n)=>{e.onClick?.(t,n),l.emit("onClick",t,n)};return()=>o.createVNode("div",{class:[`${R.prefix}-catalog`,e.theme==="dark"&&`${R.prefix}-catalog-dark`,e.class||""],ref:L},[A.value.length>0&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:`${R.prefix}-catalog-indicator`,style:w.value},null),o.createVNode("div",{class:`${R.prefix}-catalog-container`},[A.value.map(t=>o.createVNode(F,{mdHeadingId:e.mdHeadingId,tocItem:t,key:`link-${t.level}-${t.text}`,onActive:B,onClick:H,scrollElementOffsetTop:e.scrollElementOffsetTop},null))])])])}});_.install=e=>(e.component(_.name,_),e);exports.MdCatalog=_;exports.scrollAuto=U;exports.scrollAutoWithScale=j;
1
+ "use strict";const n=require("vue"),j=require("@vavt/util"),h=require("./config.cjs"),p=require("./event-bus.cjs"),S=require("./dom.cjs"),re=require("@vavt/copy2clipboard"),ie=require("markdown-it"),ae=require("markdown-it-image-figures"),le=require("markdown-it-sub"),se=require("markdown-it-sup"),ce=require("./index5.cjs"),de=require("medium-zoom"),A={hljs:`${h.prefix}-hljs`,hlcss:`${h.prefix}-hlCss`,prettier:`${h.prefix}-prettier`,prettierMD:`${h.prefix}-prettierMD`,cropperjs:`${h.prefix}-cropper`,croppercss:`${h.prefix}-cropperCss`,screenfull:`${h.prefix}-screenfull`,mermaidM:`${h.prefix}-mermaid-m`,mermaid:`${h.prefix}-mermaid`,katexjs:`${h.prefix}-katex`,katexcss:`${h.prefix}-katexCss`,echarts:`${h.prefix}-echarts`},ue=(e,t,a)=>{const{editorId:o}=a,r=n.reactive({buildFinished:!1,html:""});n.watch(()=>e.modelValue,()=>{r.buildFinished=!1}),n.onMounted(()=>{p.bus.on(o,{name:p.BUILD_FINISHED,callback(m){r.buildFinished=!0,r.html=m}}),p.bus.on(o,{name:p.ON_SAVE,callback(){const m=new Promise(u=>{if(r.buildFinished)u(r.html);else{const f=c=>{u(c),p.bus.remove(o,p.BUILD_FINISHED,f)};p.bus.on(o,{name:p.BUILD_FINISHED,callback:f})}});e.onSave?e.onSave(e.modelValue,m):t.emit("onSave",e.modelValue,m)}})})},Y=(e,{editorId:t,rootRef:a,setting:o})=>{const r=h.globalConfig.editorExtensions.highlight,m=h.globalConfig.editorExtensionsAttrs.highlight;n.provide("editorId",t),n.provide("rootRef",a),n.provide("theme",n.computed(()=>e.theme)),n.provide("language",n.computed(()=>e.language)),n.provide("highlight",n.computed(()=>{const{js:f}=r,c={...h.codeCss,...r.css},{js:l,css:s={}}=m||{},i=e.codeStyleReverse&&e.codeStyleReverseList.includes(e.previewTheme)?"dark":e.theme,d=c[e.codeTheme]?c[e.codeTheme][i]:h.codeCss.atom[i],x=c[e.codeTheme]&&s[e.codeTheme]?s[e.codeTheme][i]:s.atom?s.atom[i]:{};return{js:{src:f,...l},css:{href:d,...x}}})),n.provide("showCodeRowNumber",e.showCodeRowNumber);const u=n.computed(()=>{const f={...h.staticTextDefault,...h.globalConfig.editorConfig.languageUserDefined};return j.deepMerge(j.deepClone(h.staticTextDefault["en-US"]),f[e.language]||{})});return n.provide("usedLanguageText",u),n.provide("previewTheme",n.computed(()=>e.previewTheme)),n.provide("customIcon",n.computed(()=>e.customIcon)),n.provide("setting",n.computed(()=>o?{...o}:{preview:!0,htmlPreview:!1,previewOnly:!1,pageFullscreen:!1,fullscreen:!1})),{editorId:t}},fe=(e,t)=>(n.provide("tabWidth",e.tabWidth),n.provide("disabled",n.computed(()=>e.disabled)),n.provide("showToolbarName",n.computed(()=>e.showToolbarName)),n.provide("noUploadImg",e.noUploadImg),n.provide("tableShape",n.computed(()=>e.tableShape)),n.provide("noPrettier",e.noPrettier),n.provide("codeTheme",n.computed(()=>e.codeTheme)),n.provide("updateSetting",t.updateSetting),n.provide("catalogVisible",n.computed(()=>t.catalogVisible.value)),n.provide("defToolbars",t.defToolbars),n.provide("floatingToolbars",n.computed(()=>e.floatingToolbars)),Y(e,t)),me=e=>{const{noPrettier:t,noUploadImg:a}=e,{editorExtensions:o,editorExtensionsAttrs:r}=h.globalConfig,m=t||o.prettier.prettierInstance,u=t||o.prettier.parserMarkdownInstance,f=a||o.cropper.instance;n.onMounted(()=>{if(!f){const{js:c={},css:l={}}=r.cropper||{};S.appendHandler("link",{...l,rel:"stylesheet",href:o.cropper.css,id:A.croppercss}),S.appendHandler("script",{...c,src:o.cropper.js,id:A.cropperjs})}if(!m){const{standaloneJs:c={}}=r.prettier||{};S.appendHandler("script",{...c,src:o.prettier.standaloneJs,id:A.prettier})}if(!u){const{parserMarkdownJs:c={}}=r.prettier||{};S.appendHandler("script",{...c,src:o.prettier.parserMarkdownJs,id:A.prettierMD})}})},pe=(e,t,a)=>{const{editorId:o}=a;n.onMounted(()=>{p.bus.on(o,{name:p.ERROR_CATCHER,callback:r=>{e.onError?.(r),t.emit("onError",r)}})})},he=(e,t,a)=>{const{editorId:o}=a,r=n.reactive({pageFullscreen:e.pageFullscreen,fullscreen:!1,preview:e.preview,htmlPreview:e.preview?!1:e.htmlPreview,previewOnly:!1}),m=n.reactive({...r}),u=(l,s)=>{const i=s===void 0?!r[l]:s;switch(l){case"preview":{r.htmlPreview=!1,r.previewOnly=!1;break}case"htmlPreview":{r.preview=!1,r.previewOnly=!1;break}case"previewOnly":{i?!r.preview&&!r.htmlPreview&&(r.preview=!0):(m.preview||(r.preview=!1),m.htmlPreview||(r.htmlPreview=!1));break}}m[l]=i,r[l]=i};let f="";const c=()=>{r.pageFullscreen||r.fullscreen?document.body.style.overflow="hidden":document.body.style.overflow=f};return n.watch(()=>[r.pageFullscreen,r.fullscreen],c),n.onMounted(()=>{p.bus.on(o,{name:p.UPLOAD_IMAGE,callback(l,s){const i=d=>{p.bus.emit(o,p.REPLACE,"image",{desc:"",urls:d}),s?.()};e.onUploadImg?e.onUploadImg(l,i):t.emit("onUploadImg",l,i)}}),f=document.body.style.overflow,c()}),[r,u]},ge=(e,t)=>{const{editorId:a}=t,o=n.ref(!1);return n.onMounted(()=>{p.bus.on(a,{name:p.CHANGE_CATALOG_VISIBLE,callback:r=>{r===void 0?o.value=!o.value:o.value=r}})}),o},ve=(e,t,a)=>{const{editorId:o,catalogVisible:r,setting:m,updateSetting:u,codeRef:f}=a;n.watch(()=>m.pageFullscreen,l=>{p.bus.emit(o,p.PAGE_FULL_SCREEN_CHANGED,l)}),n.watch(()=>m.fullscreen,l=>{p.bus.emit(o,p.FULL_SCREEN_CHANGED,l)}),n.watch(()=>m.preview,l=>{p.bus.emit(o,p.PREVIEW_CHANGED,l)}),n.watch(()=>m.previewOnly,l=>{p.bus.emit(o,p.PREVIEW_ONLY_CHANGED,l)}),n.watch(()=>m.htmlPreview,l=>{p.bus.emit(o,p.HTML_PREVIEW_CHANGED,l)}),n.watch(r,l=>{p.bus.emit(o,p.CATALOG_VISIBLE_CHANGED,l)});const c={on(l,s){switch(l){case"pageFullscreen":{p.bus.on(o,{name:p.PAGE_FULL_SCREEN_CHANGED,callback(i){s(i)}});break}case"fullscreen":{p.bus.on(o,{name:p.FULL_SCREEN_CHANGED,callback(i){s(i)}});break}case"preview":{p.bus.on(o,{name:p.PREVIEW_CHANGED,callback(i){s(i)}});break}case"previewOnly":{p.bus.on(o,{name:p.PREVIEW_ONLY_CHANGED,callback(i){s(i)}});break}case"htmlPreview":{p.bus.on(o,{name:p.HTML_PREVIEW_CHANGED,callback(i){s(i)}});break}case"catalog":{p.bus.on(o,{name:p.CATALOG_VISIBLE_CHANGED,callback(i){s(i)}});break}}},togglePageFullscreen(l){u("pageFullscreen",l)},toggleFullscreen(l){p.bus.emit(o,p.CHANGE_FULL_SCREEN,l)},togglePreview(l){u("preview",l)},togglePreviewOnly(l){u("previewOnly",l)},toggleHtmlPreview(l){u("htmlPreview",l)},toggleCatalog(l){p.bus.emit(o,p.CHANGE_CATALOG_VISIBLE,l)},triggerSave(){p.bus.emit(o,p.ON_SAVE)},insert(l){p.bus.emit(o,p.REPLACE,"universal",{generate:l})},focus(l){f.value?.focus(l)},rerender(){p.bus.emit(o,p.RERENDER)},getSelectedText(){return f.value?.getSelectedText()},resetHistory(){f.value?.resetHistory()},domEventHandlers(l){p.bus.emit(o,p.EVENT_LISTENER,l)},execCommand(l){p.bus.emit(o,p.REPLACE,l)},getEditorView(){return f.value?.getEditorView()}};t.expose(c)},Q=e=>{const t=n.useId();return e.id||e.editorId||`${h.prefix}-${t}`},be=(e,t,a)=>{const o=n.inject("editorId"),r=n.inject("rootRef"),m=n.inject("usedLanguageText"),u=n.inject("setting"),f=()=>{r.value.querySelectorAll(`#${o} .${h.prefix}-preview .${h.prefix}-code`).forEach(s=>{let i=-1;const d=s.querySelector(`.${h.prefix}-copy-button:not([data-processed])`);d&&(d.onclick=x=>{x.preventDefault(),clearTimeout(i);const b=(s.querySelector("input:checked + pre code")||s.querySelector("pre code")).textContent,{text:g,successTips:$,failTips:y}=m.value.copyCode;let C=$;re(e.formatCopiedText(b||"")).catch(()=>{C=y}).finally(()=>{d.dataset.isIcon?d.dataset.tips=C:d.innerHTML=C,i=window.setTimeout(()=>{d.dataset.isIcon?d.dataset.tips=g:d.innerHTML=g},1500)})},d.setAttribute("data-processed","true"))})},c=()=>{n.nextTick(f)},l=s=>{s&&n.nextTick(f)};n.watch([t,a],c),n.watch(()=>u.value.preview,l),n.watch(()=>u.value.htmlPreview,l),n.onMounted(f)},ye=e=>{const t=n.inject("editorId"),a=n.inject("theme"),o=n.inject("rootRef"),{editorExtensions:r,editorExtensionsAttrs:m,echartsConfig:u}=h.globalConfig;let f=r.echarts.instance;const c=n.shallowRef(-1),l=()=>{!e.noEcharts&&f&&(c.value=c.value+1)};n.watch(()=>a.value,()=>{l()}),n.onMounted(()=>{if(e.noEcharts||f)return;const b=r.echarts.js;S.appendHandler("script",{...m.echarts?.js,src:b,id:A.echarts,onload(){f=window.echarts,l()}},"echarts")});let s=[],i=[],d=[];const x=(b=!1)=>{if(!s.length){b&&(i.forEach(C=>{C.dispose?.()}),d.forEach(C=>{C.disconnect?.()}),i=[],d=[]);return}const g=[],$=[],y=[];s.forEach((C,T)=>{const w=i[T],k=d[T];if(b||!C||!C.isConnected||(o?.value?!o.value.contains(C):!1)){w?.dispose?.(),k?.disconnect?.();return}g.push(C),w&&$.push(w),k&&y.push(k)}),s=g,i=$,d=y},v=()=>{x(),!e.noEcharts&&f&&Array.from(o.value.querySelectorAll(`#${t} div.${h.prefix}-echarts:not([data-processed])`)).forEach(g=>{if(g.dataset.closed==="false")return!1;try{const $=r.echarts.parseOption(g.innerText,{editorId:t,element:g}),y=u($),C=f.init(g,a.value);C.setOption(y),g.setAttribute("data-processed",""),s.push(g),i.push(C);const T=new ResizeObserver(()=>{C.resize()});T.observe(g),d.push(T)}catch($){p.bus.emit(t,p.ERROR_CATCHER,{name:"echarts",message:$?.message,error:$})}})};return n.onBeforeUnmount(()=>{x(!0)}),{reRenderEcharts:c,replaceEcharts:v}},Ce=e=>{const t=n.inject("highlight"),a=n.shallowRef(h.globalConfig.editorExtensions.highlight.instance);return n.onMounted(()=>{e.noHighlight||a.value||(S.appendHandler("link",{...t.value.css,rel:"stylesheet",id:A.hlcss}),S.appendHandler("script",{...t.value.js,id:A.hljs,onload(){a.value=window.hljs}},"hljs"))}),n.watch(()=>t.value.css,()=>{e.noHighlight||h.globalConfig.editorExtensions.highlight.instance||S.updateHandler("link",{...t.value.css,rel:"stylesheet",id:A.hlcss})}),a},xe=e=>{const t=n.shallowRef(h.globalConfig.editorExtensions.katex.instance);return n.onMounted(()=>{if(e.noKatex||t.value)return;const{editorExtensions:a,editorExtensionsAttrs:o}=h.globalConfig;S.appendHandler("script",{...o.katex?.js,src:a.katex.js,id:A.katexjs,onload(){t.value=window.katex}},"katex"),S.appendHandler("link",{...o.katex?.css,rel:"stylesheet",href:a.katex.css,id:A.katexcss})}),t};class we{constructor(t){this.options=t}options;cache=new Map;isExpired(t){return t.expiresAt<=Date.now()}deleteExpired(t,a){const o=a??this.cache.get(t);return!o||!this.isExpired(o)?!1:(this.cache.delete(t),!0)}trim(){for(const[t,a]of this.cache)if(!this.deleteExpired(t,a))break;for(;this.cache.size>this.options.max;){const t=this.cache.keys().next().value;if(t===void 0)break;this.cache.delete(t)}}get(t){const a=this.cache.get(t);if(!(!a||this.deleteExpired(t,a)))return this.cache.delete(t),this.cache.set(t,a),a.value}set(t,a){this.cache.delete(t),this.cache.set(t,{value:a,expiresAt:Date.now()+this.options.ttl}),this.trim()}clear(){this.cache.clear()}}const U=new we({max:1e3,ttl:6e5}),Ee=e=>{const t=n.inject("editorId"),a=n.inject("theme"),o=n.inject("rootRef"),{editorExtensions:r,editorExtensionsAttrs:m,mermaidConfig:u}=h.globalConfig;let f=r.mermaid.instance;const c=n.shallowRef(-1),l=()=>{if(!e.noMermaid&&f){const i=a.value==="dark"?{startOnLoad:!1,theme:"dark"}:{startOnLoad:!1,theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#ffffff",primaryTextColor:"#1f2329",primaryBorderColor:"#b7c0cc",secondaryColor:"#f7f8fa",tertiaryColor:"#f7f8fa",lineColor:"#596273",edgeLabelBackground:"#ffffff",clusterBkg:"#ffffff",clusterBorder:"#b7c0cc"}};f.initialize(u(i)),c.value=c.value+1}};return n.watch(()=>a.value,()=>{U.clear(),l()}),n.onMounted(()=>{if(e.noMermaid||f)return;const i=r.mermaid.js;/\.mjs/.test(i)?(S.appendHandler("link",{...m.mermaid?.js,rel:"modulepreload",href:i,id:A.mermaidM}),import(i).then(d=>{f=d.default,l()}).catch(d=>{p.bus.emit(t,p.ERROR_CATCHER,{name:"mermaid",message:`Failed to load mermaid module: ${d.message}`,error:d})})):S.appendHandler("script",{...m.mermaid?.js,src:i,id:A.mermaid,onload(){f=window.mermaid,l()}},"mermaid")}),{reRenderRef:c,replaceMermaid:async()=>{if(!e.noMermaid&&f){const i=o.value.querySelectorAll(`div.${h.prefix}-mermaid`),d=document.createElement("div"),x=document.body.offsetWidth>1366?document.body.offsetWidth:1366,v=document.body.offsetHeight>768?document.body.offsetHeight:768;d.style.width=x+"px",d.style.height=v+"px",d.style.position="fixed",d.style.zIndex="-10000",d.style.top="-10000";let b=i.length;b>0&&document.body.appendChild(d),await Promise.allSettled(Array.from(i).map(g=>(async y=>{if(y.dataset.closed==="false")return!1;const C=y.innerText;let T=U.get(C);if(!T){const w=j.randomId();let k={svg:""};try{k=await f.render(w,C,d),T=await e.sanitizeMermaid(k.svg);const I=document.createElement("p");I.className=`${h.prefix}-mermaid`,I.setAttribute("data-processed",""),I.setAttribute("data-content",C),I.innerHTML=T,I.children[0]?.removeAttribute("height"),U.set(C,I.innerHTML),y.dataset.line!==void 0&&(I.dataset.line=y.dataset.line),y.replaceWith(I)}catch(I){p.bus.emit(t,p.ERROR_CATCHER,{name:"mermaid",message:I.message,error:I})}--b===0&&d.remove()}})(g)))}}}},$e=(e,t)=>{t=t||{};const a=3,o=t.marker||"!",r=o.charCodeAt(0),m=o.length;let u="",f="";const c=(s,i,d,x,v)=>{const b=s[i];return b.type==="admonition_open"?s[i].attrPush(["class",`${h.prefix}-admonition ${h.prefix}-admonition-${b.info}`]):b.type==="admonition_title_open"&&s[i].attrPush(["class",`${h.prefix}-admonition-title`]),v.renderToken(s,i,d)},l=s=>{const i=s.trim().split(" ",2);f="",u=i[0],i.length>1&&(f=s.substring(u.length+2))};e.block.ruler.before("code","admonition",(s,i,d,x)=>{let v,b,g,$=!1,y=s.bMarks[i]+s.tShift[i],C=s.eMarks[i];if(r!==s.src.charCodeAt(y))return!1;for(v=y+1;v<=C&&o[(v-y)%m]===s.src[v];v++);const T=Math.floor((v-y)/m);if(T!==a)return!1;v-=(v-y)%m;const w=s.src.slice(y,v),k=s.src.slice(v,C);if(l(k),x)return!0;for(b=i;b++,!(b>=d||(y=s.bMarks[b]+s.tShift[b],C=s.eMarks[b],y<C&&s.sCount[b]<s.blkIndent));)if(r===s.src.charCodeAt(y)&&!(s.sCount[b]-s.blkIndent>=4)){for(v=y+1;v<=C&&o[(v-y)%m]===s.src[v];v++);if(!(Math.floor((v-y)/m)<T)&&(v-=(v-y)%m,v=s.skipSpaces(v),!(v<C))){$=!0;break}}const I=s.parentType,H=s.lineMax;return s.parentType="root",s.lineMax=b,g=s.push("admonition_open","div",1),g.markup=w,g.block=!0,g.info=u,g.map=[i,b],f&&(g=s.push("admonition_title_open","p",1),g.markup=w+" "+u,g.map=[i,b],g=s.push("inline","",0),g.content=f,g.map=[i,s.line-1],g.children=[],g=s.push("admonition_title_close","p",-1),g.markup=w+" "+u),s.md.block.tokenize(s,i+1,b),g=s.push("admonition_close","div",-1),g.markup=s.src.slice(y,v),g.block=!0,s.parentType=I,s.lineMax=H,s.line=b+($?1:0),!0},{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.admonition_open=c,e.renderer.rules.admonition_title_open=c,e.renderer.rules.admonition_title_close=c,e.renderer.rules.admonition_close=c},z=(e,t)=>{const a=e.attrs?e.attrs.slice():[];return t.forEach(o=>{const r=e.attrIndex(o[0]);r<0?a.push(o):(a[r]=a[r].slice(),a[r][1]+=` ${o[1]}`)}),a},Ie=(e,t)=>{const a=e.renderer.rules.fence,o=e.utils.unescapeAll,r=/\[(\w*)(?::([\w ]*))?\]/,m=/::(open|close)/,u=i=>i.info?o(i.info).trim():"",f=i=>{const d=u(i),[x=null,v=""]=(r.exec(d)||[]).slice(1);return[x,v]},c=i=>{const d=u(i);return d?d.split(/(\s+)/g)[0]:""},l=i=>{const d=i.info.match(m)||[],x=d[1]==="open"||d[1]!=="close"&&t.codeFoldable&&i.content.trim().split(`
2
+ `).length<t.autoFoldThreshold,v=d[1]||t.codeFoldable?"details":"div",b=d[1]||t.codeFoldable?"summary":"div";return{open:x,tagContainer:v,tagHeader:b}},s=(i,d,x,v,b)=>{if(i[d].hidden)return"";const g=t.usedLanguageTextRef.value?.copyCode.text,$=t.customIconRef.value.copy||g,y=!!t.customIconRef.value.copy,C=`<span class="${h.prefix}-collapse-tips">${S.StrIcon("collapse-tips",t.customIconRef.value)}</span>`,[T]=f(i[d]);if(T===null){const{open:E,tagContainer:R,tagHeader:G}=l(i[d]),L=[["class",`${h.prefix}-code`]];E&&L.push(["open",""]);const W={attrs:z(i[d],L)};i[d].info=i[d].info.replace(m,"");const O=a(i,d,x,v,b);return`
3
+ <${R} ${b.renderAttrs(W)}>
4
+ <${G} class="${h.prefix}-code-head">
5
+ <div class="${h.prefix}-code-flag"><span></span><span></span><span></span></div>
6
+ <div class="${h.prefix}-code-action">
7
+ <span class="${h.prefix}-code-lang">${e.utils.escapeHtml(i[d].info.trim())}</span>
8
+ <span class="${h.prefix}-copy-button" data-tips="${g}"${y?" data-is-icon=true":""}>${$}</span>
9
+ ${t.extraTools instanceof Function?t.extraTools({lang:i[d].info.trim()}):t.extraTools||""}
10
+ ${R==="details"?C:""}
11
+ </div>
12
+ </${G}>
13
+ ${O}
14
+ </${R}>
15
+ `}let w,k,I,H,M="",F="",P="";const{open:D,tagContainer:_,tagHeader:N}=l(i[d]),B=[["class",`${h.prefix}-code`]];D&&B.push(["open",""]);const V={attrs:z(i[d],B)};for(let E=d;E<i.length&&(w=i[E],[k,I]=f(w),k===T);E++){w.info=w.info.replace(r,"").replace(m,""),w.hidden=!0;const R=`${h.prefix}-codetab-${t.editorId}-${d}-${E-d}`;H=E-d>0?"":"checked",M+=`
16
+ <li>
17
+ <input
18
+ type="radio"
19
+ id="label-${h.prefix}-codetab-label-1-${t.editorId}-${d}-${E-d}"
20
+ name="${h.prefix}-codetab-label-${t.editorId}-${d}"
21
+ class="${R}"
22
+ ${H}
23
+ >
24
+ <label
25
+ for="label-${h.prefix}-codetab-label-1-${t.editorId}-${d}-${E-d}"
26
+ onclick="this.getRootNode().querySelectorAll('.${R}').forEach(e => e.click())"
27
+ >
28
+ ${e.utils.escapeHtml(I||c(w))}
29
+ </label>
30
+ </li>`,F+=`
31
+ <div role="tabpanel">
32
+ <input
33
+ type="radio"
34
+ name="${h.prefix}-codetab-pre-${t.editorId}-${d}"
35
+ class="${R}"
36
+ ${H}
37
+ role="presentation">
38
+ ${a(i,E,x,v,b)}
39
+ </div>`,P+=`
40
+ <input
41
+ type="radio"
42
+ name="${h.prefix}-codetab-lang-${t.editorId}-${d}"
43
+ class="${R}"
44
+ ${H}
45
+ role="presentation">
46
+ <span class=${h.prefix}-code-lang role="note">${e.utils.escapeHtml(c(w))}</span>`}return`
47
+ <${_} ${b.renderAttrs(V)}>
48
+ <${N} class="${h.prefix}-code-head">
49
+ <div class="${h.prefix}-code-flag">
50
+ <ul class="${h.prefix}-codetab-label" role="tablist">${M}</ul>
51
+ </div>
52
+ <div class="${h.prefix}-code-action">
53
+ <span class="${h.prefix}-codetab-lang">${P}</span>
54
+ <span class="${h.prefix}-copy-button" data-tips="${g}"${y?" data-is-icon=true":""}>${$}</span>
55
+ ${t.extraTools instanceof Function?t.extraTools({lang:i[d].info.trim()}):t.extraTools||""}
56
+ ${_==="details"?C:""}
57
+ </div>
58
+ </${N}>
59
+ ${F}
60
+ </${_}>
61
+ `};e.renderer.rules.fence=s,e.renderer.rules.code_block=s},Te=(e,t)=>{const a=e.renderer.rules.fence.bind(e.renderer.rules);e.renderer.rules.fence=(o,r,m,u,f)=>{const c=o[r],l=c.content.trim();if(c.info==="echarts"){if(c.attrSet("class",`${h.prefix}-echarts`),c.attrSet("data-echarts-theme",t.themeRef.value),c.map&&c.level===0){const s=c.map[1]-1,d=!!u.srcLines[s]?.trim()?.startsWith("```");c.attrSet("data-closed",`${d}`),c.attrSet("data-line",String(c.map[0]))}return`<div ${f.renderAttrs(c)} style="width: 100%; aspect-ratio: 4 / 3;">${e.utils.escapeHtml(l)}</div>`}return a(o,r,m,u,f)}},ke=(e,t)=>{e.renderer.rules.heading_open=(a,o)=>{const r=a[o],m=a[o+1].children?.reduce((f,c)=>f+(["text","code_inline","math_inline"].includes(c.type)&&c.content||""),"")||"",u=r.markup.length;return t.headsRef.value.push({text:m,level:u,line:r.map[0],currentToken:r,nextToken:a[o+1]}),r.map&&r.level===0&&r.attrSet("id",t.mdHeadingId({text:m,level:u,index:t.headsRef.value.length,currentToken:r,nextToken:a[o+1]})),e.renderer.renderToken(a,o,t)},e.renderer.rules.heading_close=(a,o,r,m,u)=>u.renderToken(a,o,r)},K={block:[{open:"$$",close:"$$"},{open:"\\[",close:"\\]"}],inline:[{open:"$$",close:"$$"},{open:"$",close:"$"},{open:"\\[",close:"\\]"},{open:"\\(",close:"\\)"}]},Se=e=>(t,a)=>{const o=e.delimiters;for(const r of o){if(!t.src.startsWith(r.open,t.pos))continue;const m=t.pos+r.open.length;let u=m;for(;(u=t.src.indexOf(r.close,u))!==-1;){let f=0,c=u-1;for(;c>=0&&t.src[c]==="\\";)f++,c--;if(f%2===0)break;u+=r.close.length}if(u!==-1){if(u-m===0)return a||(t.pending+=r.open+r.close),t.pos=u+r.close.length,!0;if(!a){const f=t.push("math_inline","math",0);f.markup=r.open,f.content=t.src.slice(m,u)}return t.pos=u+r.close.length,!0}}return!1},Re=e=>(t,a,o,r)=>{const m=e.delimiters,u=t.bMarks[a]+t.tShift[a],f=t.eMarks[a],c=(l,s,i)=>{t.line=s;const d=t.push("math_block","math",0);return d.block=!0,d.content=l,d.map=[a,t.line],d.markup=i,!0};for(const l of m){const s=u;if(t.src.slice(s,s+l.open.length)!==l.open)continue;const i=s+l.open.length,d=t.src.slice(i,f).trim(),x=d==="",v=d===l.close,b=d.endsWith(l.close);if(!x&&!v&&!b)continue;if(r)return!0;if(v)return c("",a+1,l.open);if(!x&&b){const w=d.slice(0,-l.close.length);return c(w,a+1,l.open)}let g=a+1,$=!1,y="";for(;g<o;g++){const w=t.bMarks[g]+t.tShift[g],k=t.eMarks[g];if(w<k&&t.tShift[g]<t.blkIndent)break;if(t.src.slice(w,k).trim().endsWith(l.close)){const H=t.src.slice(0,k).lastIndexOf(l.close);y=t.src.slice(w,H),$=!0;break}}if(!$)continue;const T=t.getLines(a+1,g,t.tShift[a],!0)+(y.trim()?y:"");return c(T,g+1,l.open)}return!1},Ae=(e,{katexRef:t,inlineDelimiters:a,blockDelimiters:o})=>{const r=(f,c,l,s,i=!1)=>{const d={attrs:z(f,[["class",c]])},x=s.renderAttrs(d);if(!t.value)return`<${l} ${x}>${f.content}</${l}>`;const v=t.value.renderToString(f.content,h.globalConfig.katexConfig({throwOnError:!1,displayMode:i}));return`<${l} ${x} data-processed>${v}</${l}>`},m=(f,c,l,s,i)=>r(f[c],`${h.prefix}-katex-inline`,"span",i),u=(f,c,l,s,i)=>r(f[c],`${h.prefix}-katex-block`,"p",i,!0);e.inline.ruler.before("escape","math_inline",Se({delimiters:a||K.inline})),e.block.ruler.after("blockquote","math_block",Re({delimiters:o||K.block}),{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=m,e.renderer.rules.math_block=u},He=(e,t)=>{const a=e.renderer.rules.fence.bind(e.renderer.rules);e.renderer.rules.fence=(o,r,m,u,f)=>{const c=o[r],l=c.content.trim();if(c.info==="mermaid"){if(c.attrSet("class",`${h.prefix}-mermaid`),c.attrSet("data-mermaid-theme",t.themeRef.value),c.map&&c.level===0){const i=c.map[1]-1,x=!!u.srcLines[i]?.trim()?.startsWith("```");c.attrSet("data-closed",`${x}`),c.attrSet("data-line",String(c.map[0]))}const s=U.get(l);return s?(c.attrSet("data-processed",""),c.attrSet("data-content",l),`<p ${f.renderAttrs(c)}>${s}</p>`):`<div ${f.renderAttrs(c)}>${e.utils.escapeHtml(l)}</div>`}return a(o,r,m,u,f)}},Z=(e,t,a)=>{const o=e.attrIndex(t),r=[t,a];o<0?e.attrPush(r):(e.attrs=e.attrs||[],e.attrs[o]=r)},Me=e=>e.type==="inline",Le=e=>e.type==="paragraph_open",Fe=e=>e.type==="list_item_open",Pe=e=>e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0,_e=(e,t)=>Me(e[t])&&Le(e[t-1])&&Fe(e[t-2])&&Pe(e[t]),je=(e,t)=>{const a=e[t].level-1;for(let o=t-1;o>=0;o--)if(e[o].level===a)return o;return-1},Ne=e=>{const t=new e("html_inline","",0);return t.content="<label>",t},Oe=e=>{const t=new e("html_inline","",0);return t.content="</label>",t},De=(e,t,a)=>{const o=new a("html_inline","",0);return o.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",o.attrs=[["for",t]],o},Be=(e,t,a)=>{const o=new t("html_inline","",0),r=a.enabled?" ":' disabled="" ';return e.content.indexOf("[ ] ")===0?o.content='<input class="task-list-item-checkbox"'+r+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(o.content='<input class="task-list-item-checkbox" checked=""'+r+'type="checkbox">'),o},Ve=(e,t,a)=>{if(e.children=e.children||[],e.children.unshift(Be(e,t,a)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),a.label)if(a.labelAfter){e.children.pop();const o="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+o+'">',e.children.push(De(e.content,o,t))}else e.children.unshift(Ne(t)),e.children.push(Oe(t))},Ge=(e,t={})=>{e.core.ruler.after("inline","github-task-lists",a=>{const o=a.tokens;for(let r=2;r<o.length;r++)_e(o,r)&&(Ve(o[r],a.Token,t),Z(o[r-2],"class","task-list-item"+(t.enabled?" enabled":" ")),Z(o[je(o,r-2)],"class","contains-task-list"))})},Ue=e=>{e.core.ruler.push("init-line-number",t=>(t.tokens.forEach(a=>{a.map&&(a.attrs||(a.attrs=[]),a.attrs.push(["data-line",a.map[0].toString()]))}),!0))},qe=(e,t)=>{const{editorConfig:a,markdownItConfig:o,markdownItPlugins:r,editorExtensions:m}=h.globalConfig,u=n.inject("editorId"),f=n.inject("language"),c=n.inject("usedLanguageText"),l=n.inject("showCodeRowNumber"),s=n.inject("theme"),i=n.inject("customIcon"),d=n.inject("rootRef"),x=n.inject("setting"),v=n.ref([]),b=Ce(e),g=xe(e),{reRenderRef:$,replaceMermaid:y}=Ee(e),{reRenderEcharts:C,replaceEcharts:T}=ye(e),w=ie({html:!0,breaks:!0,linkify:!0});o(w,{editorId:u});const k=[{type:"image",plugin:ae,options:{figcaption:!0,classes:"md-zoom"}},{type:"admonition",plugin:$e,options:{}},{type:"taskList",plugin:Ge,options:{}},{type:"heading",plugin:ke,options:{mdHeadingId:e.mdHeadingId,headsRef:v}},{type:"code",plugin:Ie,options:{editorId:u,usedLanguageTextRef:c,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,customIconRef:i}},{type:"sub",plugin:le,options:{}},{type:"sup",plugin:se,options:{}}];e.noKatex||k.push({type:"katex",plugin:Ae,options:{katexRef:g}}),e.noMermaid||k.push({type:"mermaid",plugin:He,options:{themeRef:s}}),e.noEcharts||k.push({type:"echarts",plugin:Te,options:{themeRef:s}}),r(k,{editorId:u}).forEach(E=>{w.use(E.plugin,E.options)});const I=w.options.highlight;w.set({highlight:(E,R,G)=>{if(I){const O=I(E,R,G);if(O)return O}let L;!e.noHighlight&&b.value?b.value.getLanguage(R)?L=b.value.highlight(E,{language:R,ignoreIllegals:!0}).value:L=b.value.highlightAuto(E).value:L=w.utils.escapeHtml(E);const W=l?ce.generateCodeRowNumber(L.replace(/^\n+|\n+$/g,""),E.replace(/^\n+|\n+$/g,"")):`<span class="${h.prefix}-code-block">${L.replace(/^\n+|\n+$/g,"")}</span>`;return`<pre><code class="language-${R}" language=${R}>${W}</code></pre>`}}),Ue(w);const H=n.ref(`_article-key_${j.randomId()}`),M=n.ref(e.sanitize(w.render(e.modelValue,{srcLines:e.modelValue.split(`
62
+ `)})));let F=()=>{},P=()=>{};const D=()=>{const E=d.value?.querySelectorAll(`#${u} p.${h.prefix}-mermaid:not([data-closed=false])`);P(),P=S.copyMermaid(E,{customIcon:i.value}),m.mermaid?.enableZoom&&(F(),F=S.zoomMermaid(E,{customIcon:i.value}))},_=()=>{p.bus.emit(u,p.BUILD_FINISHED,M.value),e.onHtmlChanged(M.value),e.onGetCatalog(v.value),p.bus.emit(u,p.CATALOG_CHANGED,v.value),n.nextTick(()=>{y().then(D),T()})},N=()=>{v.value=[],M.value=e.sanitize(w.render(e.modelValue,{srcLines:e.modelValue.split(`
63
+ `)}))},B=n.computed(()=>(e.noKatex||!!g.value)&&(e.noHighlight||!!b.value));let V=-1;return n.watch([n.toRef(e,"modelValue"),B,$,f],()=>{V=window.setTimeout(()=>{N()},t?0:a.renderDelay)}),n.watch(()=>x.value.preview,()=>{x.value.preview&&n.nextTick(()=>{y().then(D),T(),p.bus.emit(u,p.CATALOG_CHANGED,v.value)})}),n.watch([M,C],()=>{_()}),n.onMounted(_),n.onMounted(()=>{p.bus.on(u,{name:p.PUSH_CATALOG,callback(){p.bus.emit(u,p.CATALOG_CHANGED,v.value)}}),p.bus.on(u,{name:p.RERENDER,callback:()=>{H.value=`_article-key_${j.randomId()}`,N()}})}),n.onBeforeUnmount(()=>{F(),P(),clearTimeout(V)}),{html:M,key:H}},We=(e,t)=>{const a=n.inject("editorId"),o=n.inject("setting"),{noImgZoomIn:r}=e,m=j.debounce(()=>{const u=document.querySelectorAll(`#${a}-preview img:not(.not-zoom):not(.medium-zoom-image)`);u.length!==0&&de(u,{background:"#00000073"})});n.onMounted(async()=>{!r&&o.value.preview&&await m()}),n.watch([t,()=>o.value.preview],async()=>{!r&&o.value.preview&&await m()})},J={checked:{regexp:/- \[x\]/,value:"- [ ]"},unChecked:{regexp:/- \[\s\]/,value:"- [x]"}},ze=(e,t)=>{const a=n.inject("editorId"),o=n.inject("rootRef");let r=()=>{};const m=()=>{if(!o.value)return!1;const u=o.value.querySelectorAll(".task-list-item.enabled"),f=c=>{c.preventDefault();const l=c.target.checked?"unChecked":"checked",s=c.target.parentElement?.dataset.line;if(!s)return;const i=Number(s),d=e.modelValue.split(`
64
+ `),x=d[Number(i)].replace(J[l].regexp,J[l].value);e.previewOnly?(d[Number(i)]=x,e.onChange(d.join(`
65
+ `))):p.bus.emit(a,p.TASK_STATE_CHANGED,i+1,x)};u.forEach(c=>{c.addEventListener("click",f)}),r=()=>{u.forEach(c=>{c.removeEventListener("click",f)})}};n.onBeforeUnmount(()=>{r()}),n.watch([t],()=>{r(),n.nextTick(m)},{immediate:!0})},Ke=(e,t,a)=>{const o=n.inject("setting"),r=()=>{n.nextTick(()=>{e.onRemount?.()})},m=u=>{u&&r()};n.watch([t,a],r),n.watch(()=>o.value.preview,m),n.watch(()=>o.value.htmlPreview,m),n.onMounted(r)},ee={modelValue:{type:String,default:""},onChange:{type:Function,default:()=>{}},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},onRemount:{type:Function},noEcharts:{type:Boolean},previewComponent:{type:[Object,Function],default:void 0}},Ze={...ee,updateModelValue:{type:Function,default:()=>{}},placeholder:{type:String,default:""},scrollAuto:{type:Boolean},autofocus:{type:Boolean},readonly:{type:Boolean},maxlength:{type:Number},autoDetectCode:{type:Boolean},onBlur:{type:Function,default:()=>{}},onFocus:{type:Function,default:()=>{}},completions:{type:Array},onInput:{type:Function},onDrop:{type:Function,default:()=>{}},inputBoxWidth:{type:String},oninputBoxWidthChange:{type:Function},transformImgUrl:{type:Function,default:e=>e},catalogLayout:{type:String},catalogMaxDepth:{type:Number}},X=e=>{const a=new DOMParser().parseFromString(e,"text/html");return Array.from(a.body.childNodes)},Je=(e,t)=>e.nodeType!==t.nodeType?!1:e.nodeType===Node.TEXT_NODE||e.nodeType===Node.COMMENT_NODE?e.textContent===t.textContent:e.nodeType===Node.ELEMENT_NODE?e.outerHTML===t.outerHTML:e.isEqualNode?e.isEqualNode(t):!1,Xe=n.defineComponent({name:"UpdateOnDemand",props:{id:{type:String,required:!0},class:{type:[String,Array,Object],required:!0},html:{type:String,required:!0}},setup(e){const t=n.ref(),a=e.html,o=(r,m)=>{if(!t.value)return;const u=t.value,f=Array.from(u.childNodes),c=Math.min(r.length,m.length);let l=-1;for(let i=0;i<c;i++)if(!Je(r[i],m[i])){l=i;break}if(l===-1)if(m.length>r.length)l=r.length;else if(r.length>m.length)l=m.length;else return;const s=Math.min(l,f.length);for(let i=f.length-1;i>=s;i--)f[i].remove();for(let i=l;i<r.length;i++)u.appendChild(r[i].cloneNode(!0))};return n.watch(()=>e.html,(r,m)=>{const u=X(r),f=X(m||"");o(u,f)}),()=>n.createVNode("div",{id:e.id,class:e.class,innerHTML:a,ref:t},null)}}),te=n.defineComponent({name:"ContentPreview",props:ee,setup(e){const t=n.inject("editorId"),a=n.inject("setting"),o=n.inject("previewTheme"),r=n.inject("showCodeRowNumber"),{html:m,key:u}=qe(e,e.previewOnly);be(e,m,u),We(e,m),ze(e,m),Ke(e,m,u);const f=n.computed(()=>[`${h.prefix}-preview`,`${o?.value}-theme`,r&&`${h.prefix}-scrn`].filter(Boolean)),c=()=>{const l=`${t}-preview`;return e.previewComponent?n.h(e.previewComponent,{key:u.value,html:m.value,id:l,class:f.value}):n.createVNode(Xe,{key:u.value,html:m.value,id:l,class:f.value},null)};return()=>n.createVNode(n.Fragment,null,[a.value.preview&&(e.previewOnly?c():n.createVNode("div",{id:`${t}-preview-wrapper`,class:`${h.prefix}-preview-wrapper`,key:"content-preview-wrapper"},[c()])),a.value.htmlPreview&&n.createVNode("div",{id:`${t}-html-wrapper`,class:`${h.prefix}-preview-wrapper`,key:"html-preview-wrapper"},[n.createVNode("div",{class:`${h.prefix}-html`},[m.value])])])}}),Ye=({text:e})=>e,ne={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:Ye},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},onRemount:{type:Function,default:void 0},noEcharts:{type:Boolean,default:!1},previewComponent:{type:[Object,Function],default:void 0}},Qe={...ne,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:h.allToolbar},floatingToolbars:{type:Array,default:[]},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:h.allFooter},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},catalogLayout:{type:String,default:"fixed"},catalogMaxDepth:{type:Number,default:void 0}},oe=["onHtmlChanged","onGetCatalog","onChange","onRemount","update:modelValue"],et=[...oe,"onSave","onUploadImg","onError","onBlur","onFocus","onInput","onDrop","oninputBoxWidthChange"],tt=(e,t,a)=>{const{editorId:o}=a,r={rerender(){p.bus.emit(o,p.RERENDER)}};t.expose(r)},q=n.defineComponent({name:"MdPreview",props:ne,emits:oe,setup(e,t){const{noKatex:a,noMermaid:o,noHighlight:r}=e,m=n.ref(),u=Q(e);Y(e,{rootRef:m,editorId:u}),tt(e,t,{editorId:u}),n.onBeforeUnmount(()=>{p.bus.clear(u)});const f=i=>{e.onChange?.(i),t.emit("onChange",i),t.emit("update:modelValue",i)},c=i=>{e.onHtmlChanged?.(i),t.emit("onHtmlChanged",i)},l=i=>{e.onGetCatalog?.(i),t.emit("onGetCatalog",i)},s=()=>{e.onRemount?.(),t.emit("onRemount")};return()=>n.createVNode("div",{id:u,class:[h.prefix,e.class,e.theme==="dark"&&`${h.prefix}-dark`,`${h.prefix}-previewOnly`],style:e.style,ref:m},[n.createVNode(te,{modelValue:e.modelValue,onChange:f,onHtmlChanged:c,onGetCatalog:l,mdHeadingId:e.mdHeadingId,noMermaid:o,sanitize:e.sanitize,noKatex:a,formatCopiedText:e.formatCopiedText,noHighlight:r,noImgZoomIn:e.noImgZoomIn,previewOnly:!0,sanitizeMermaid:e.sanitizeMermaid,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,onRemount:s,noEcharts:e.noEcharts,previewComponent:e.previewComponent},null)])}});q.install=e=>(e.component(q.name,q),e);exports.CDN_IDS=A;exports.ContentPreview=te;exports.MdPreview=q;exports.contentProps=Ze;exports.editorEmits=et;exports.editorProps=Qe;exports.useCatalog=ge;exports.useConfig=he;exports.useEditorId=Q;exports.useErrorCatcher=pe;exports.useExpansion=me;exports.useExpose=ve;exports.useOnSave=ue;exports.useProvide=fe;
package/lib/cjs/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Te=require("./MdEditor.cjs"),Se=require("./NormalToolbar.cjs"),ke=require("./chunks/index.cjs"),xe=require("./ModalToolbar.cjs"),Ee=require("./chunks/index2.cjs"),Ce=require("./chunks/dom.cjs"),ie=require("vue"),X=require("./chunks/config.cjs"),_e=require("./chunks/vue-tsx.cjs"),re=require("./chunks/index3.cjs"),Le=require("./chunks/index4.cjs"),he=require("./config.cjs");function Ie(t,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const g in s)if(g!=="default"&&!(g in t)){const e=Object.getOwnPropertyDescriptor(s,g);e&&Object.defineProperty(t,g,e.get?e:{enumerable:!0,get:()=>s[g]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Pe={onClick:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0}},Q=ie.defineComponent({name:"NormalFooterToolbar",props:Pe,emits:["onClick"],setup(t,n){return()=>{const i=_e.getSlot({props:t,ctx:n});return ie.createVNode("div",{class:[`${X.prefix}-footer-item`,t.disabled&&`${X.prefix}-disabled`],onClick:s=>{t.disabled||(t.onClick?.(s),n.emit("onClick",s))}},[i])}}});Q.install=t=>(t.component(Q.name,Q),t);function qe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={exports:{}},w={},B={exports:{}},W={},ne;function be(){if(ne)return W;ne=1;function t(){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 n(e,v,u){}function i(e,v,u){}var s=/javascript\s*\:/img;function g(e,v){return s.test(v)?"":v}return W.whiteList=t(),W.getDefaultWhiteList=t,W.onAttr=n,W.onIgnoreAttr=i,W.safeAttrValue=g,W}var Z,se;function me(){return se||(se=1,Z={indexOf:function(t,n){var i,s;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,s=t.length;i<s;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var s,g;if(Array.prototype.forEach)return t.forEach(n,i);for(s=0,g=t.length;s<g;s++)n.call(i,t[s],s,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}}),Z}var J,oe;function Re(){if(oe)return J;oe=1;var t=me();function n(i,s){i=t.trimRight(i),i[i.length-1]!==";"&&(i+=";");var g=i.length,e=!1,v=0,u=0,T="";function k(){if(!e){var f=t.trim(i.slice(v,u)),a=f.indexOf(":");if(a!==-1){var y=t.trim(f.slice(0,a)),S=t.trim(f.slice(a+1));if(y){var c=s(v,T.length,y,S,f);c&&(T+=c+"; ")}}}v=u+1}for(;u<g;u++){var x=i[u];if(x==="/"&&i[u+1]==="*"){var r=i.indexOf("*/",u+2);if(r===-1)break;u=r+1,v=u+1,e=!1}else x==="("?e=!0:x===")"?e=!1:x===";"?e||k():x===`
2
- `&&k()}return t.trim(T)}return J=n,J}var K,le;function Oe(){if(le)return K;le=1;var t=be(),n=Re();me();function i(e){return e==null}function s(e){var v={};for(var u in e)v[u]=e[u];return v}function g(e){e=s(e||{}),e.whiteList=e.whiteList||t.whiteList,e.onAttr=e.onAttr||t.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||t.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||t.safeAttrValue,this.options=e}return g.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var v=this,u=v.options,T=u.whiteList,k=u.onAttr,x=u.onIgnoreAttr,r=u.safeAttrValue,f=n(e,function(a,y,S,c,I){var p=T[S],d=!1;if(p===!0?d=p:typeof p=="function"?d=p(c):p instanceof RegExp&&(d=p.test(c)),d!==!0&&(d=!1),c=r(S,c),!!c){var C={position:y,sourcePosition:a,source:I,isWhite:d};if(d){var m=k(S,c,C);return i(m)?S+":"+c:m}else{var m=x(S,c,C);if(!i(m))return m}}});return f},K=g,K}var fe;function te(){return fe||(fe=1,(function(t,n){var i=be(),s=Oe();function g(v,u){var T=new s(u);return T.process(v)}n=t.exports=g,n.FilterCSS=s;for(var e in i)n[e]=i[e];typeof window<"u"&&(window.filterCSS=t.exports)})(B,B.exports)),B.exports}var Y,ue;function ae(){return ue||(ue=1,Y={indexOf:function(t,n){var i,s;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,s=t.length;i<s;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var s,g;if(Array.prototype.forEach)return t.forEach(n,i);for(s=0,g=t.length;s<g;s++)n.call(i,t[s],s,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var n=/\s|\n|\t/,i=n.exec(t);return i?i.index:-1}}),Y}var ce;function we(){if(ce)return w;ce=1;var t=te().FilterCSS,n=te().getDefaultWhiteList,i=ae();function s(){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 g=new t;function e(o,b,l){}function v(o,b,l){}function u(o,b,l){}function T(o,b,l){}function k(o){return o.replace(r,"&lt;").replace(f,"&gt;")}function x(o,b,l,h){if(l=$(l),b==="href"||b==="src"){if(l=i.trim(l),l==="#")return"#";if(!(l.substr(0,7)==="http://"||l.substr(0,8)==="https://"||l.substr(0,7)==="mailto:"||l.substr(0,4)==="tel:"||l.substr(0,11)==="data:image/"||l.substr(0,6)==="ftp://"||l.substr(0,2)==="./"||l.substr(0,3)==="../"||l[0]==="#"||l[0]==="/"))return""}else if(b==="background"){if(p.lastIndex=0,p.test(l))return""}else if(b==="style"){if(d.lastIndex=0,d.test(l)||(C.lastIndex=0,C.test(l)&&(p.lastIndex=0,p.test(l))))return"";h!==!1&&(h=h||g,l=h.process(l))}return l=P(l),l}var r=/</g,f=/>/g,a=/"/g,y=/&quot;/g,S=/&#([a-zA-Z0-9]*);?/gim,c=/&colon;?/gim,I=/&newline;?/gim,p=/((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,d=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,C=/u\s*r\s*l\s*\(.*/gi;function m(o){return o.replace(a,"&quot;")}function A(o){return o.replace(y,'"')}function E(o){return o.replace(S,function(l,h){return h[0]==="x"||h[0]==="X"?String.fromCharCode(parseInt(h.substr(1),16)):String.fromCharCode(parseInt(h,10))})}function _(o){return o.replace(c,":").replace(I," ")}function D(o){for(var b="",l=0,h=o.length;l<h;l++)b+=o.charCodeAt(l)<32?" ":o.charAt(l);return i.trim(b)}function $(o){return o=A(o),o=E(o),o=_(o),o=D(o),o}function P(o){return o=m(o),o=k(o),o}function R(){return""}function j(o,b){typeof b!="function"&&(b=function(){});var l=!Array.isArray(o);function h(L){return l?!0:i.indexOf(o,L)!==-1}var q=[],O=!1;return{onIgnoreTag:function(L,M,N){if(h(L))if(N.isClosing){var U="[/removed]",Ae=N.position+U.length;return q.push([O!==!1?O:N.position,Ae]),O=!1,U}else return O||(O=N.position),"[removed]";else return b(L,M,N)},remove:function(L){var M="",N=0;return i.forEach(q,function(U){M+=L.slice(N,U[0]),N=U[1]}),M+=L.slice(N),M}}}function V(o){for(var b="",l=0;l<o.length;){var h=o.indexOf("<!--",l);if(h===-1){b+=o.slice(l);break}b+=o.slice(l,h);var q=o.indexOf("-->",h);if(q===-1)break;l=q+3}return b}function F(o){var b=o.split("");return b=b.filter(function(l){var h=l.charCodeAt(0);return h===127?!1:h<=31?h===10||h===13:!0}),b.join("")}return w.whiteList=s(),w.getDefaultWhiteList=s,w.onTag=e,w.onIgnoreTag=v,w.onTagAttr=u,w.onIgnoreTagAttr=T,w.safeAttrValue=x,w.escapeHtml=k,w.escapeQuote=m,w.unescapeQuote=A,w.escapeHtmlEntities=E,w.escapeDangerHtml5Entities=_,w.clearNonPrintableCharacter=D,w.friendlyAttrValue=$,w.escapeAttrValue=P,w.onIgnoreTagStripAll=R,w.StripTagBody=j,w.stripCommentTag=V,w.stripBlankChar=F,w.attributeWrapSign='"',w.cssFilter=g,w.getDefaultCSSWhiteList=n,w}var H={},ge;function ye(){if(ge)return H;ge=1;var t=ae();function n(r){var f=t.spaceIndex(r),a;return f===-1?a=r.slice(1,-1):a=r.slice(1,f+1),a=t.trim(a).toLowerCase(),a.slice(0,1)==="/"&&(a=a.slice(1)),a.slice(-1)==="/"&&(a=a.slice(0,-1)),a}function i(r){return r.slice(0,2)==="</"}function s(r,f,a){var y="",S=0,c=!1,I=!1,p=0,d=r.length,C="",m="";e:for(p=0;p<d;p++){var A=r.charAt(p);if(c===!1){if(A==="<"){c=p;continue}}else if(I===!1){if(A==="<"){y+=a(r.slice(S,p)),c=p,S=p;continue}if(A===">"||p===d-1){y+=a(r.slice(S,c)),m=r.slice(c,p+1),C=n(m),y+=f(c,y.length,C,m,i(m)),S=p+1,c=!1;continue}if(A==='"'||A==="'")for(var E=1,_=r.charAt(p-E);_.trim()===""||_==="=";){if(_==="="){I=A;continue e}_=r.charAt(p-++E)}}else if(A===I){I=!1;continue}}return S<d&&(y+=a(r.substr(S))),y}var g=/[^a-zA-Z0-9\\_:.-]/gim;function e(r,f){var a=0,y=0,S=[],c=!1,I=r.length;function p(E,_){if(E=t.trim(E),E=E.replace(g,"").toLowerCase(),!(E.length<1)){var D=f(E,_||"");D&&S.push(D)}}for(var d=0;d<I;d++){var C=r.charAt(d),m,A;if(c===!1&&C==="="){c=r.slice(a,d),a=d+1,y=r.charAt(a)==='"'||r.charAt(a)==="'"?a:u(r,d+1);continue}if(c!==!1&&d===y){if(A=r.indexOf(C,d+1),A===-1)break;m=t.trim(r.slice(y+1,A)),p(c,m),c=!1,d=A,a=d+1;continue}if(/\s|\n|\t/.test(C))if(r=r.replace(/\s|\n|\t/g," "),c===!1)if(A=v(r,d),A===-1){m=t.trim(r.slice(a,d)),p(m),c=!1,a=d+1;continue}else{d=A-1;continue}else if(A=T(r,d-1),A===-1){m=t.trim(r.slice(a,d)),m=x(m),p(c,m),c=!1,a=d+1;continue}else continue}return a<r.length&&(c===!1?p(r.slice(a)):p(c,x(t.trim(r.slice(a))))),t.trim(S.join(" "))}function v(r,f){for(;f<r.length;f++){var a=r[f];if(a!==" ")return a==="="?f:-1}}function u(r,f){for(;f<r.length;f++){var a=r[f];if(a!==" ")return a==="'"||a==='"'?f:-1}}function T(r,f){for(;f>0;f--){var a=r[f];if(a!==" ")return a==="="?f:-1}}function k(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'"}function x(r){return k(r)?r.substr(1,r.length-2):r}return H.parseTag=s,H.parseAttr=e,H}var ee,de;function Ne(){if(de)return ee;de=1;var t=te().FilterCSS,n=we(),i=ye(),s=i.parseTag,g=i.parseAttr,e=ae();function v(r){return r==null}function u(r){var f=e.spaceIndex(r);if(f===-1)return{html:"",closing:r[r.length-2]==="/"};r=e.trim(r.slice(f+1,-1));var a=r[r.length-1]==="/";return a&&(r=e.trim(r.slice(0,-1))),{html:r,closing:a}}function T(r){var f={};for(var a in r)f[a]=r[a];return f}function k(r){var f={};for(var a in r)Array.isArray(r[a])?f[a.toLowerCase()]=r[a].map(function(y){return y.toLowerCase()}):f[a.toLowerCase()]=r[a];return f}function x(r){r=T(r||{}),r.stripIgnoreTag&&(r.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),r.onIgnoreTag=n.onIgnoreTagStripAll),r.whiteList||r.allowList?r.whiteList=k(r.whiteList||r.allowList):r.whiteList=n.whiteList,this.attributeWrapSign=r.singleQuotedAttributeValue===!0?"'":n.attributeWrapSign,r.onTag=r.onTag||n.onTag,r.onTagAttr=r.onTagAttr||n.onTagAttr,r.onIgnoreTag=r.onIgnoreTag||n.onIgnoreTag,r.onIgnoreTagAttr=r.onIgnoreTagAttr||n.onIgnoreTagAttr,r.safeAttrValue=r.safeAttrValue||n.safeAttrValue,r.escapeHtml=r.escapeHtml||n.escapeHtml,this.options=r,r.css===!1?this.cssFilter=!1:(r.css=r.css||{},this.cssFilter=new t(r.css))}return x.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var f=this,a=f.options,y=a.whiteList,S=a.onTag,c=a.onIgnoreTag,I=a.onTagAttr,p=a.onIgnoreTagAttr,d=a.safeAttrValue,C=a.escapeHtml,m=f.attributeWrapSign,A=f.cssFilter;a.stripBlankChar&&(r=n.stripBlankChar(r)),a.allowCommentTag||(r=n.stripCommentTag(r));var E=!1;a.stripIgnoreTagBody&&(E=n.StripTagBody(a.stripIgnoreTagBody,c),c=E.onIgnoreTag);var _=s(r,function(D,$,P,R,j){var V={sourcePosition:D,position:$,isClosing:j,isWhite:Object.prototype.hasOwnProperty.call(y,P)},F=S(P,R,V);if(!v(F))return F;if(V.isWhite){if(V.isClosing)return"</"+P+">";var o=u(R),b=y[P],l=g(o.html,function(h,q){var O=e.indexOf(b,h)!==-1,L=I(P,h,q,O);return v(L)?O?(q=d(P,h,q,A),q?h+"="+m+q+m:h):(L=p(P,h,q,O),v(L)?void 0:L):L});return R="<"+P,l&&(R+=" "+l),o.closing&&(R+=" /"),R+=">",R}else return F=c(P,R,V),v(F)?C(R):F},C);return E&&(_=E.remove(_)),_},ee=x,ee}var pe;function De(){return pe||(pe=1,(function(t,n){var i=we(),s=ye(),g=Ne();function e(u,T){var k=new g(T);return k.process(u)}n=t.exports=e,n.filterXSS=e,n.FilterXSS=g,(function(){for(var u in i)n[u]=i[u];for(var T in s)n[T]=s[T]})(),typeof window<"u"&&(window.filterXSS=t.exports);function v(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}v()&&(self.filterXSS=t.exports)})(z,z.exports)),z.exports}var G=De();const Fe=qe(G),We=Ie({__proto__:null,default:Fe},[G]),ve={img:["class"],input:["class","disabled","type","checked"],iframe:["class","width","height","src","title","border","frameborder","framespacing","allow","allowfullscreen"]},Xe=(t,n)=>{const{extendedWhiteList:i={},xss:s={}}=n;let g;if(typeof s=="function")g=new G.FilterXSS(s(We));else{const e=G.getDefaultWhiteList();[...Object.keys(i),...Object.keys(ve)].forEach(u=>{const T=e[u]||[],k=ve[u]||[],x=i[u]||[];e[u]=[...new Set([...T,...k,...x])]}),g=new G.FilterXSS({whiteList:e,...s})}t.core.ruler.after("linkify","xss",e=>{for(let v=0;v<e.tokens.length;v++){const u=e.tokens[v];switch(u.type){case"html_block":{u.content=g.process(u.content);break}case"inline":{(u.children||[]).forEach(k=>{k.type==="html_inline"&&(k.content=g.process(k.content))});break}}}})},Ve=()=>{Object.keys(re.CDN_IDS).forEach(t=>{const n=document.getElementById(re.CDN_IDS[t]);n&&n.remove()})};exports.MdEditor=Te;exports.NormalToolbar=Se;exports.DropdownToolbar=ke.DropdownToolbar;exports.ModalToolbar=xe;exports.MdModal=Ee.MdModal;exports.StrIcon=Ce.StrIcon;exports.allFooter=X.allFooter;exports.allToolbar=X.allToolbar;exports.config=X.config;exports.editorExtensionsAttrs=X.editorExtensionsAttrs;exports.prefix=X.prefix;exports.MdPreview=re.MdPreview;exports.MdCatalog=Le.MdCatalog;exports.en_US=he.en_US;exports.zh_CN=he.zh_CN;exports.NormalFooterToolbar=Q;exports.XSSPlugin=Xe;exports.clearSideEffects=Ve;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Te=require("./MdEditor.cjs"),Se=require("./NormalToolbar.cjs"),ke=require("./chunks/index.cjs"),xe=require("./ModalToolbar.cjs"),Ee=require("./chunks/index2.cjs"),Ce=require("./chunks/dom.cjs"),ie=require("vue"),X=require("./chunks/config.cjs"),_e=require("./chunks/vue-tsx.cjs"),Le=require("./chunks/index3.cjs"),re=require("./chunks/index4.cjs"),he=require("./config.cjs");function Ie(t,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const g in s)if(g!=="default"&&!(g in t)){const e=Object.getOwnPropertyDescriptor(s,g);e&&Object.defineProperty(t,g,e.get?e:{enumerable:!0,get:()=>s[g]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Pe={onClick:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0}},Q=ie.defineComponent({name:"NormalFooterToolbar",props:Pe,emits:["onClick"],setup(t,n){return()=>{const i=_e.getSlot({props:t,ctx:n});return ie.createVNode("div",{class:[`${X.prefix}-footer-item`,t.disabled&&`${X.prefix}-disabled`],onClick:s=>{t.disabled||(t.onClick?.(s),n.emit("onClick",s))}},[i])}}});Q.install=t=>(t.component(Q.name,Q),t);function qe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={exports:{}},w={},B={exports:{}},W={},ne;function be(){if(ne)return W;ne=1;function t(){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 n(e,v,u){}function i(e,v,u){}var s=/javascript\s*\:/img;function g(e,v){return s.test(v)?"":v}return W.whiteList=t(),W.getDefaultWhiteList=t,W.onAttr=n,W.onIgnoreAttr=i,W.safeAttrValue=g,W}var Z,se;function me(){return se||(se=1,Z={indexOf:function(t,n){var i,s;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,s=t.length;i<s;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var s,g;if(Array.prototype.forEach)return t.forEach(n,i);for(s=0,g=t.length;s<g;s++)n.call(i,t[s],s,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}}),Z}var J,oe;function Re(){if(oe)return J;oe=1;var t=me();function n(i,s){i=t.trimRight(i),i[i.length-1]!==";"&&(i+=";");var g=i.length,e=!1,v=0,u=0,T="";function k(){if(!e){var f=t.trim(i.slice(v,u)),a=f.indexOf(":");if(a!==-1){var y=t.trim(f.slice(0,a)),S=t.trim(f.slice(a+1));if(y){var c=s(v,T.length,y,S,f);c&&(T+=c+"; ")}}}v=u+1}for(;u<g;u++){var x=i[u];if(x==="/"&&i[u+1]==="*"){var r=i.indexOf("*/",u+2);if(r===-1)break;u=r+1,v=u+1,e=!1}else x==="("?e=!0:x===")"?e=!1:x===";"?e||k():x===`
2
+ `&&k()}return t.trim(T)}return J=n,J}var K,le;function Oe(){if(le)return K;le=1;var t=be(),n=Re();me();function i(e){return e==null}function s(e){var v={};for(var u in e)v[u]=e[u];return v}function g(e){e=s(e||{}),e.whiteList=e.whiteList||t.whiteList,e.onAttr=e.onAttr||t.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||t.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||t.safeAttrValue,this.options=e}return g.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var v=this,u=v.options,T=u.whiteList,k=u.onAttr,x=u.onIgnoreAttr,r=u.safeAttrValue,f=n(e,function(a,y,S,c,I){var p=T[S],d=!1;if(p===!0?d=p:typeof p=="function"?d=p(c):p instanceof RegExp&&(d=p.test(c)),d!==!0&&(d=!1),c=r(S,c),!!c){var C={position:y,sourcePosition:a,source:I,isWhite:d};if(d){var m=k(S,c,C);return i(m)?S+":"+c:m}else{var m=x(S,c,C);if(!i(m))return m}}});return f},K=g,K}var fe;function te(){return fe||(fe=1,(function(t,n){var i=be(),s=Oe();function g(v,u){var T=new s(u);return T.process(v)}n=t.exports=g,n.FilterCSS=s;for(var e in i)n[e]=i[e];typeof window<"u"&&(window.filterCSS=t.exports)})(B,B.exports)),B.exports}var Y,ue;function ae(){return ue||(ue=1,Y={indexOf:function(t,n){var i,s;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,s=t.length;i<s;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var s,g;if(Array.prototype.forEach)return t.forEach(n,i);for(s=0,g=t.length;s<g;s++)n.call(i,t[s],s,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var n=/\s|\n|\t/,i=n.exec(t);return i?i.index:-1}}),Y}var ce;function we(){if(ce)return w;ce=1;var t=te().FilterCSS,n=te().getDefaultWhiteList,i=ae();function s(){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 g=new t;function e(o,b,l){}function v(o,b,l){}function u(o,b,l){}function T(o,b,l){}function k(o){return o.replace(r,"&lt;").replace(f,"&gt;")}function x(o,b,l,h){if(l=$(l),b==="href"||b==="src"){if(l=i.trim(l),l==="#")return"#";if(!(l.substr(0,7)==="http://"||l.substr(0,8)==="https://"||l.substr(0,7)==="mailto:"||l.substr(0,4)==="tel:"||l.substr(0,11)==="data:image/"||l.substr(0,6)==="ftp://"||l.substr(0,2)==="./"||l.substr(0,3)==="../"||l[0]==="#"||l[0]==="/"))return""}else if(b==="background"){if(p.lastIndex=0,p.test(l))return""}else if(b==="style"){if(d.lastIndex=0,d.test(l)||(C.lastIndex=0,C.test(l)&&(p.lastIndex=0,p.test(l))))return"";h!==!1&&(h=h||g,l=h.process(l))}return l=P(l),l}var r=/</g,f=/>/g,a=/"/g,y=/&quot;/g,S=/&#([a-zA-Z0-9]*);?/gim,c=/&colon;?/gim,I=/&newline;?/gim,p=/((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,d=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,C=/u\s*r\s*l\s*\(.*/gi;function m(o){return o.replace(a,"&quot;")}function A(o){return o.replace(y,'"')}function E(o){return o.replace(S,function(l,h){return h[0]==="x"||h[0]==="X"?String.fromCharCode(parseInt(h.substr(1),16)):String.fromCharCode(parseInt(h,10))})}function _(o){return o.replace(c,":").replace(I," ")}function D(o){for(var b="",l=0,h=o.length;l<h;l++)b+=o.charCodeAt(l)<32?" ":o.charAt(l);return i.trim(b)}function $(o){return o=A(o),o=E(o),o=_(o),o=D(o),o}function P(o){return o=m(o),o=k(o),o}function R(){return""}function j(o,b){typeof b!="function"&&(b=function(){});var l=!Array.isArray(o);function h(L){return l?!0:i.indexOf(o,L)!==-1}var q=[],O=!1;return{onIgnoreTag:function(L,M,N){if(h(L))if(N.isClosing){var U="[/removed]",Ae=N.position+U.length;return q.push([O!==!1?O:N.position,Ae]),O=!1,U}else return O||(O=N.position),"[removed]";else return b(L,M,N)},remove:function(L){var M="",N=0;return i.forEach(q,function(U){M+=L.slice(N,U[0]),N=U[1]}),M+=L.slice(N),M}}}function V(o){for(var b="",l=0;l<o.length;){var h=o.indexOf("<!--",l);if(h===-1){b+=o.slice(l);break}b+=o.slice(l,h);var q=o.indexOf("-->",h);if(q===-1)break;l=q+3}return b}function F(o){var b=o.split("");return b=b.filter(function(l){var h=l.charCodeAt(0);return h===127?!1:h<=31?h===10||h===13:!0}),b.join("")}return w.whiteList=s(),w.getDefaultWhiteList=s,w.onTag=e,w.onIgnoreTag=v,w.onTagAttr=u,w.onIgnoreTagAttr=T,w.safeAttrValue=x,w.escapeHtml=k,w.escapeQuote=m,w.unescapeQuote=A,w.escapeHtmlEntities=E,w.escapeDangerHtml5Entities=_,w.clearNonPrintableCharacter=D,w.friendlyAttrValue=$,w.escapeAttrValue=P,w.onIgnoreTagStripAll=R,w.StripTagBody=j,w.stripCommentTag=V,w.stripBlankChar=F,w.attributeWrapSign='"',w.cssFilter=g,w.getDefaultCSSWhiteList=n,w}var H={},ge;function ye(){if(ge)return H;ge=1;var t=ae();function n(r){var f=t.spaceIndex(r),a;return f===-1?a=r.slice(1,-1):a=r.slice(1,f+1),a=t.trim(a).toLowerCase(),a.slice(0,1)==="/"&&(a=a.slice(1)),a.slice(-1)==="/"&&(a=a.slice(0,-1)),a}function i(r){return r.slice(0,2)==="</"}function s(r,f,a){var y="",S=0,c=!1,I=!1,p=0,d=r.length,C="",m="";e:for(p=0;p<d;p++){var A=r.charAt(p);if(c===!1){if(A==="<"){c=p;continue}}else if(I===!1){if(A==="<"){y+=a(r.slice(S,p)),c=p,S=p;continue}if(A===">"||p===d-1){y+=a(r.slice(S,c)),m=r.slice(c,p+1),C=n(m),y+=f(c,y.length,C,m,i(m)),S=p+1,c=!1;continue}if(A==='"'||A==="'")for(var E=1,_=r.charAt(p-E);_.trim()===""||_==="=";){if(_==="="){I=A;continue e}_=r.charAt(p-++E)}}else if(A===I){I=!1;continue}}return S<d&&(y+=a(r.substr(S))),y}var g=/[^a-zA-Z0-9\\_:.-]/gim;function e(r,f){var a=0,y=0,S=[],c=!1,I=r.length;function p(E,_){if(E=t.trim(E),E=E.replace(g,"").toLowerCase(),!(E.length<1)){var D=f(E,_||"");D&&S.push(D)}}for(var d=0;d<I;d++){var C=r.charAt(d),m,A;if(c===!1&&C==="="){c=r.slice(a,d),a=d+1,y=r.charAt(a)==='"'||r.charAt(a)==="'"?a:u(r,d+1);continue}if(c!==!1&&d===y){if(A=r.indexOf(C,d+1),A===-1)break;m=t.trim(r.slice(y+1,A)),p(c,m),c=!1,d=A,a=d+1;continue}if(/\s|\n|\t/.test(C))if(r=r.replace(/\s|\n|\t/g," "),c===!1)if(A=v(r,d),A===-1){m=t.trim(r.slice(a,d)),p(m),c=!1,a=d+1;continue}else{d=A-1;continue}else if(A=T(r,d-1),A===-1){m=t.trim(r.slice(a,d)),m=x(m),p(c,m),c=!1,a=d+1;continue}else continue}return a<r.length&&(c===!1?p(r.slice(a)):p(c,x(t.trim(r.slice(a))))),t.trim(S.join(" "))}function v(r,f){for(;f<r.length;f++){var a=r[f];if(a!==" ")return a==="="?f:-1}}function u(r,f){for(;f<r.length;f++){var a=r[f];if(a!==" ")return a==="'"||a==='"'?f:-1}}function T(r,f){for(;f>0;f--){var a=r[f];if(a!==" ")return a==="="?f:-1}}function k(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'"}function x(r){return k(r)?r.substr(1,r.length-2):r}return H.parseTag=s,H.parseAttr=e,H}var ee,de;function Ne(){if(de)return ee;de=1;var t=te().FilterCSS,n=we(),i=ye(),s=i.parseTag,g=i.parseAttr,e=ae();function v(r){return r==null}function u(r){var f=e.spaceIndex(r);if(f===-1)return{html:"",closing:r[r.length-2]==="/"};r=e.trim(r.slice(f+1,-1));var a=r[r.length-1]==="/";return a&&(r=e.trim(r.slice(0,-1))),{html:r,closing:a}}function T(r){var f={};for(var a in r)f[a]=r[a];return f}function k(r){var f={};for(var a in r)Array.isArray(r[a])?f[a.toLowerCase()]=r[a].map(function(y){return y.toLowerCase()}):f[a.toLowerCase()]=r[a];return f}function x(r){r=T(r||{}),r.stripIgnoreTag&&(r.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),r.onIgnoreTag=n.onIgnoreTagStripAll),r.whiteList||r.allowList?r.whiteList=k(r.whiteList||r.allowList):r.whiteList=n.whiteList,this.attributeWrapSign=r.singleQuotedAttributeValue===!0?"'":n.attributeWrapSign,r.onTag=r.onTag||n.onTag,r.onTagAttr=r.onTagAttr||n.onTagAttr,r.onIgnoreTag=r.onIgnoreTag||n.onIgnoreTag,r.onIgnoreTagAttr=r.onIgnoreTagAttr||n.onIgnoreTagAttr,r.safeAttrValue=r.safeAttrValue||n.safeAttrValue,r.escapeHtml=r.escapeHtml||n.escapeHtml,this.options=r,r.css===!1?this.cssFilter=!1:(r.css=r.css||{},this.cssFilter=new t(r.css))}return x.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var f=this,a=f.options,y=a.whiteList,S=a.onTag,c=a.onIgnoreTag,I=a.onTagAttr,p=a.onIgnoreTagAttr,d=a.safeAttrValue,C=a.escapeHtml,m=f.attributeWrapSign,A=f.cssFilter;a.stripBlankChar&&(r=n.stripBlankChar(r)),a.allowCommentTag||(r=n.stripCommentTag(r));var E=!1;a.stripIgnoreTagBody&&(E=n.StripTagBody(a.stripIgnoreTagBody,c),c=E.onIgnoreTag);var _=s(r,function(D,$,P,R,j){var V={sourcePosition:D,position:$,isClosing:j,isWhite:Object.prototype.hasOwnProperty.call(y,P)},F=S(P,R,V);if(!v(F))return F;if(V.isWhite){if(V.isClosing)return"</"+P+">";var o=u(R),b=y[P],l=g(o.html,function(h,q){var O=e.indexOf(b,h)!==-1,L=I(P,h,q,O);return v(L)?O?(q=d(P,h,q,A),q?h+"="+m+q+m:h):(L=p(P,h,q,O),v(L)?void 0:L):L});return R="<"+P,l&&(R+=" "+l),o.closing&&(R+=" /"),R+=">",R}else return F=c(P,R,V),v(F)?C(R):F},C);return E&&(_=E.remove(_)),_},ee=x,ee}var pe;function De(){return pe||(pe=1,(function(t,n){var i=we(),s=ye(),g=Ne();function e(u,T){var k=new g(T);return k.process(u)}n=t.exports=e,n.filterXSS=e,n.FilterXSS=g,(function(){for(var u in i)n[u]=i[u];for(var T in s)n[T]=s[T]})(),typeof window<"u"&&(window.filterXSS=t.exports);function v(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}v()&&(self.filterXSS=t.exports)})(z,z.exports)),z.exports}var G=De();const Fe=qe(G),We=Ie({__proto__:null,default:Fe},[G]),ve={img:["class"],input:["class","disabled","type","checked"],iframe:["class","width","height","src","title","border","frameborder","framespacing","allow","allowfullscreen"]},Xe=(t,n)=>{const{extendedWhiteList:i={},xss:s={}}=n;let g;if(typeof s=="function")g=new G.FilterXSS(s(We));else{const e=G.getDefaultWhiteList();[...Object.keys(i),...Object.keys(ve)].forEach(u=>{const T=e[u]||[],k=ve[u]||[],x=i[u]||[];e[u]=[...new Set([...T,...k,...x])]}),g=new G.FilterXSS({whiteList:e,...s})}t.core.ruler.after("linkify","xss",e=>{for(let v=0;v<e.tokens.length;v++){const u=e.tokens[v];switch(u.type){case"html_block":{u.content=g.process(u.content);break}case"inline":{(u.children||[]).forEach(k=>{k.type==="html_inline"&&(k.content=g.process(k.content))});break}}}})},Ve=()=>{Object.keys(re.CDN_IDS).forEach(t=>{const n=document.getElementById(re.CDN_IDS[t]);n&&n.remove()})};exports.MdEditor=Te;exports.NormalToolbar=Se;exports.DropdownToolbar=ke.DropdownToolbar;exports.ModalToolbar=xe;exports.MdModal=Ee.MdModal;exports.StrIcon=Ce.StrIcon;exports.allFooter=X.allFooter;exports.allToolbar=X.allToolbar;exports.config=X.config;exports.editorExtensionsAttrs=X.editorExtensionsAttrs;exports.prefix=X.prefix;exports.MdCatalog=Le.MdCatalog;exports.MdPreview=re.MdPreview;exports.en_US=he.en_US;exports.zh_CN=he.zh_CN;exports.NormalFooterToolbar=Q;exports.XSSPlugin=Xe;exports.clearSideEffects=Ve;
@@ -1,4 +1,4 @@
1
- import { M as f } from "./chunks/index4.mjs";
1
+ import { M as f } from "./chunks/index3.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,12 +1,12 @@
1
1
  import { a as te, D as at } from "./chunks/index.mjs";
2
- import { s as lt, a as nt, M as We } from "./chunks/index4.mjs";
3
- import { C as rt, c as st, a as it, e as ct, b as ut, u as dt, d as mt, f as bt, g as vt, h as gt, i as ht, j as ft, k as pt, M as Tt } from "./chunks/index3.mjs";
2
+ import { s as lt, a as nt, M as We } from "./chunks/index3.mjs";
3
+ import { C as rt, c as st, a as it, e as ct, b as ut, u as dt, d as mt, f as bt, g as vt, h as gt, i as ht, j as ft, k as pt, M as Tt } from "./chunks/index4.mjs";
4
4
  import wt from "./ModalToolbar.mjs";
5
5
  import yt from "./NormalToolbar.mjs";
6
6
  import { inject as r, watch as N, nextTick as ie, onMounted as K, ref as I, defineComponent as C, createVNode as a, reactive as Y, toRef as ke, computed as P, Fragment as _e, cloneVNode as ne, createApp as Ct, shallowRef as kt, onBeforeUnmount as he } from "vue";
7
- import { g as Z, p as l, a as $t, M as ae, d as xt, b as St } from "./chunks/config.mjs";
7
+ import { g as Z, p as l, b as $t, M as ae, d as xt, a as St } from "./chunks/config.mjs";
8
8
  import { linkTo as It, throttle as Et, createSmoothScroll as ze, draggingScroll as Lt } from "@vavt/util";
9
- import { deleteLine as Nt, history as $e, defaultKeymap as At, historyKeymap as Dt, indentWithTab as Rt, undo as Mt, redo as Ft } from "@codemirror/commands";
9
+ import { deleteLine as Nt, history as $e, undo as At, redo as Dt, defaultKeymap as Rt, historyKeymap as Mt, indentWithTab as Ft } from "@codemirror/commands";
10
10
  import { markdown as Bt } from "@codemirror/lang-markdown";
11
11
  import { languages as Pt } from "@codemirror/language-data";
12
12
  import { EditorState as ce, EditorSelection as U, Compartment as j, StateEffect as re, StateField as qe, RangeSetBuilder as Ht } from "@codemirror/state";
@@ -2265,6 +2265,10 @@ const Ze = () => {
2265
2265
  constructor(v, m, f, g) {
2266
2266
  super(), this.short = v, this.raw = m, this.from = f, this.to = g;
2267
2267
  }
2268
+ short;
2269
+ raw;
2270
+ from;
2271
+ to;
2268
2272
  toDOM(v) {
2269
2273
  const m = document.createElement("span");
2270
2274
  return m.textContent = this.short, m.className = "cm-short-text", m.title = this.raw, m.style.display = "inline", m.style.textDecoration = "underline", m.addEventListener("mousedown", (f) => {
@@ -2334,9 +2338,9 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2334
2338
  noPrettier: g
2335
2339
  }), we = () => [
2336
2340
  ...Qe,
2337
- ...At,
2338
- ...Dt,
2339
- Rt
2341
+ ...Rt,
2342
+ ...Mt,
2343
+ Ft
2340
2344
  ], oe = {
2341
2345
  paste: Ea(e, T),
2342
2346
  blur: e.onBlur,
@@ -2441,12 +2445,12 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2441
2445
  }, 0), h.on(o, {
2442
2446
  name: Ke,
2443
2447
  callback() {
2444
- Mt(w);
2448
+ At(w);
2445
2449
  }
2446
2450
  }), h.on(o, {
2447
2451
  name: Ue,
2448
2452
  callback() {
2449
- Ft(w);
2453
+ Dt(w);
2450
2454
  }
2451
2455
  }), h.on(o, {
2452
2456
  name: y,
@@ -1,4 +1,4 @@
1
- import { M as f } from "./chunks/index3.mjs";
1
+ import { M as f } from "./chunks/index4.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -426,8 +426,8 @@ const u = "md-editor", p = "MdEditor", s = "https://unpkg.com", n = `${s}/@highl
426
426
  }), w = 0.1;
427
427
  export {
428
428
  w as M,
429
- k as a,
430
- b,
429
+ b as a,
430
+ k as b,
431
431
  j as c,
432
432
  p as d,
433
433
  y as e,
@@ -37,7 +37,7 @@ export {
37
37
  f as G,
38
38
  p as H,
39
39
  i as O,
40
- _ as P,
40
+ H as P,
41
41
  G as R,
42
42
  u as S,
43
43
  O as T,
@@ -47,10 +47,10 @@ export {
47
47
  T as c,
48
48
  h as d,
49
49
  V as e,
50
- A as f,
51
- R as g,
52
- g as h,
53
- D as i,
54
- S as j,
55
- H as k
50
+ S as f,
51
+ _ as g,
52
+ A as h,
53
+ R as i,
54
+ g as j,
55
+ D as k
56
56
  };