index-f32d3dd1.js 309 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. var Hi=Object.defineProperty,Ni=Object.defineProperties;var Oi=Object.getOwnPropertyDescriptors;var zn=Object.getOwnPropertySymbols;var Di=Object.prototype.hasOwnProperty,Ii=Object.prototype.propertyIsEnumerable;var Fn=(Ce,Oe,xe)=>Oe in Ce?Hi(Ce,Oe,{enumerable:!0,configurable:!0,writable:!0,value:xe}):Ce[Oe]=xe,kt=(Ce,Oe)=>{for(var xe in Oe||(Oe={}))Di.call(Oe,xe)&&Fn(Ce,xe,Oe[xe]);if(zn)for(var xe of zn(Oe))Ii.call(Oe,xe)&&Fn(Ce,xe,Oe[xe]);return Ce},Gn=(Ce,Oe)=>Ni(Ce,Oi(Oe));var Kn=(Ce,Oe,xe)=>new Promise((Re,St)=>{var jt=Fe=>{try{mt(xe.next(Fe))}catch(ft){St(ft)}},Rt=Fe=>{try{mt(xe.throw(Fe))}catch(ft){St(ft)}},mt=Fe=>Fe.done?Re(Fe.value):Promise.resolve(Fe.value).then(jt,Rt);mt((xe=xe.apply(Ce,Oe)).next())});import{c0 as Xn,bX as Jn,d as Zn,r as ut,c2 as ji,d4 as Qn,j as It,A as Ri,u as pt,c3 as Yn,c4 as $n,p as Pi,_ as qi,o as er,l as tr,X as Bi,ax as nr,__tla as Vi}from"./index-fd0fd824.js";import{b as Ui,__tla as Wi}from"./index-2901f384.js";import{o as rr,__tla as zi}from"./onMountedOrActivated-c075b0f3.js";let ir,or,Fi=Promise.all([(()=>{try{return Vi}catch(Ce){}})(),(()=>{try{return Wi}catch(Ce){}})(),(()=>{try{return zi}catch(Ce){}})()]).then(()=>Kn(void 0,null,function*(){var Ce={exports:{}};(function(Be,Ke){(function(He,Ne){Be.exports=Ne()})(Xn,()=>(()=>{var He={471:P=>{var M=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},f=-1;M.Diff=function(d,u){return[d,u]},M.prototype.diff_main=function(d,u,c,y){y===void 0&&(y=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var s=y;if(d==null||u==null)throw new Error("Null input. (diff_main)");if(d==u)return d?[new M.Diff(0,d)]:[];c===void 0&&(c=!0);var l=c,p=this.diff_commonPrefix(d,u),v=d.substring(0,p);d=d.substring(p),u=u.substring(p),p=this.diff_commonSuffix(d,u);var L=d.substring(d.length-p);d=d.substring(0,d.length-p),u=u.substring(0,u.length-p);var E=this.diff_compute_(d,u,l,s);return v&&E.unshift(new M.Diff(0,v)),L&&E.push(new M.Diff(0,L)),this.diff_cleanupMerge(E),E},M.prototype.diff_compute_=function(d,u,c,y){var s;if(!d)return[new M.Diff(1,u)];if(!u)return[new M.Diff(f,d)];var l=d.length>u.length?d:u,p=d.length>u.length?u:d,v=l.indexOf(p);if(v!=-1)return s=[new M.Diff(1,l.substring(0,v)),new M.Diff(0,p),new M.Diff(1,l.substring(v+p.length))],d.length>u.length&&(s[0][0]=s[2][0]=f),s;if(p.length==1)return[new M.Diff(f,d),new M.Diff(1,u)];var L=this.diff_halfMatch_(d,u);if(L){var E=L[0],T=L[1],g=L[2],k=L[3],m=L[4],C=this.diff_main(E,g,c,y),O=this.diff_main(T,k,c,y);return C.concat([new M.Diff(0,m)],O)}return c&&d.length>100&&u.length>100?this.diff_lineMode_(d,u,y):this.diff_bisect_(d,u,y)},M.prototype.diff_lineMode_=function(d,u,c){var y=this.diff_linesToChars_(d,u);d=y.chars1,u=y.chars2;var s=y.lineArray,l=this.diff_main(d,u,!1,c);this.diff_charsToLines_(l,s),this.diff_cleanupSemantic(l),l.push(new M.Diff(0,""));for(var p=0,v=0,L=0,E="",T="";p<l.length;){switch(l[p][0]){case 1:L++,T+=l[p][1];break;case f:v++,E+=l[p][1];break;case 0:if(v>=1&&L>=1){l.splice(p-v-L,v+L),p=p-v-L;for(var g=this.diff_main(E,T,!1,c),k=g.length-1;k>=0;k--)l.splice(p,0,g[k]);p+=g.length}L=0,v=0,E="",T=""}p++}return l.pop(),l},M.prototype.diff_bisect_=function(d,u,c){for(var y=d.length,s=u.length,l=Math.ceil((y+s)/2),p=l,v=2*l,L=new Array(v),E=new Array(v),T=0;T<v;T++)L[T]=-1,E[T]=-1;L[p+1]=0,E[p+1]=0;for(var g=y-s,k=g%2!=0,m=0,C=0,O=0,j=0,x=0;x<l&&!(new Date().getTime()>c);x++){for(var V=-x+m;V<=x-C;V+=2){for(var ie=p+V,me=(ke=V==-x||V!=x&&L[ie-1]<L[ie+1]?L[ie+1]:L[ie-1]+1)-V;ke<y&&me<s&&d.charAt(ke)==u.charAt(me);)ke++,me++;if(L[ie]=ke,ke>y)C+=2;else if(me>s)m+=2;else if(k&&(ve=p+g-V)>=0&&ve<v&&E[ve]!=-1&&ke>=(de=y-E[ve]))return this.diff_bisectSplit_(d,u,ke,me,c)}for(var fe=-x+O;fe<=x-j;fe+=2){for(var de,ve=p+fe,Se=(de=fe==-x||fe!=x&&E[ve-1]<E[ve+1]?E[ve+1]:E[ve-1]+1)-fe;de<y&&Se<s&&d.charAt(y-de-1)==u.charAt(s-Se-1);)de++,Se++;if(E[ve]=de,de>y)j+=2;else if(Se>s)O+=2;else if(!k&&(ie=p+g-fe)>=0&&ie<v&&L[ie]!=-1){var ke;if(me=p+(ke=L[ie])-ie,ke>=(de=y-de))return this.diff_bisectSplit_(d,u,ke,me,c)}}}return[new M.Diff(f,d),new M.Diff(1,u)]},M.prototype.diff_bisectSplit_=function(d,u,c,y,s){var l=d.substring(0,c),p=u.substring(0,y),v=d.substring(c),L=u.substring(y),E=this.diff_main(l,p,!1,s),T=this.diff_main(v,L,!1,s);return E.concat(T)},M.prototype.diff_linesToChars_=function(d,u){var c=[],y={};function s(v){for(var L="",E=0,T=-1,g=c.length;T<v.length-1;){(T=v.indexOf(`
  2. `,E))==-1&&(T=v.length-1);var k=v.substring(E,T+1);(y.hasOwnProperty?y.hasOwnProperty(k):y[k]!==void 0)?L+=String.fromCharCode(y[k]):(g==l&&(k=v.substring(E),T=v.length),L+=String.fromCharCode(g),y[k]=g,c[g++]=k),E=T+1}return L}c[0]="";var l=4e4,p=s(d);return l=65535,{chars1:p,chars2:s(u),lineArray:c}},M.prototype.diff_charsToLines_=function(d,u){for(var c=0;c<d.length;c++){for(var y=d[c][1],s=[],l=0;l<y.length;l++)s[l]=u[y.charCodeAt(l)];d[c][1]=s.join("")}},M.prototype.diff_commonPrefix=function(d,u){if(!d||!u||d.charAt(0)!=u.charAt(0))return 0;for(var c=0,y=Math.min(d.length,u.length),s=y,l=0;c<s;)d.substring(l,s)==u.substring(l,s)?l=c=s:y=s,s=Math.floor((y-c)/2+c);return s},M.prototype.diff_commonSuffix=function(d,u){if(!d||!u||d.charAt(d.length-1)!=u.charAt(u.length-1))return 0;for(var c=0,y=Math.min(d.length,u.length),s=y,l=0;c<s;)d.substring(d.length-s,d.length-l)==u.substring(u.length-s,u.length-l)?l=c=s:y=s,s=Math.floor((y-c)/2+c);return s},M.prototype.diff_commonOverlap_=function(d,u){var c=d.length,y=u.length;if(c==0||y==0)return 0;c>y?d=d.substring(c-y):c<y&&(u=u.substring(0,c));var s=Math.min(c,y);if(d==u)return s;for(var l=0,p=1;;){var v=d.substring(s-p),L=u.indexOf(v);if(L==-1)return l;p+=L,L!=0&&d.substring(s-p)!=u.substring(0,p)||(l=p,p++)}},M.prototype.diff_halfMatch_=function(d,u){if(this.Diff_Timeout<=0)return null;var c=d.length>u.length?d:u,y=d.length>u.length?u:d;if(c.length<4||2*y.length<c.length)return null;var s=this;function l(m,C,O){for(var j,x,V,ie,me=m.substring(O,O+Math.floor(m.length/4)),fe=-1,de="";(fe=C.indexOf(me,fe+1))!=-1;){var ve=s.diff_commonPrefix(m.substring(O),C.substring(fe)),Se=s.diff_commonSuffix(m.substring(0,O),C.substring(0,fe));de.length<Se+ve&&(de=C.substring(fe-Se,fe)+C.substring(fe,fe+ve),j=m.substring(0,O-Se),x=m.substring(O+ve),V=C.substring(0,fe-Se),ie=C.substring(fe+ve))}return 2*de.length>=m.length?[j,x,V,ie,de]:null}var p,v,L,E,T,g=l(c,y,Math.ceil(c.length/4)),k=l(c,y,Math.ceil(c.length/2));return g||k?(p=k?g&&g[4].length>k[4].length?g:k:g,d.length>u.length?(v=p[0],L=p[1],E=p[2],T=p[3]):(E=p[0],T=p[1],v=p[2],L=p[3]),[v,L,E,T,p[4]]):null},M.prototype.diff_cleanupSemantic=function(d){for(var u=!1,c=[],y=0,s=null,l=0,p=0,v=0,L=0,E=0;l<d.length;)d[l][0]==0?(c[y++]=l,p=L,v=E,L=0,E=0,s=d[l][1]):(d[l][0]==1?L+=d[l][1].length:E+=d[l][1].length,s&&s.length<=Math.max(p,v)&&s.length<=Math.max(L,E)&&(d.splice(c[y-1],0,new M.Diff(f,s)),d[c[y-1]+1][0]=1,y--,l=--y>0?c[y-1]:-1,p=0,v=0,L=0,E=0,s=null,u=!0)),l++;for(u&&this.diff_cleanupMerge(d),this.diff_cleanupSemanticLossless(d),l=1;l<d.length;){if(d[l-1][0]==f&&d[l][0]==1){var T=d[l-1][1],g=d[l][1],k=this.diff_commonOverlap_(T,g),m=this.diff_commonOverlap_(g,T);k>=m?(k>=T.length/2||k>=g.length/2)&&(d.splice(l,0,new M.Diff(0,g.substring(0,k))),d[l-1][1]=T.substring(0,T.length-k),d[l+1][1]=g.substring(k),l++):(m>=T.length/2||m>=g.length/2)&&(d.splice(l,0,new M.Diff(0,T.substring(0,m))),d[l-1][0]=1,d[l-1][1]=g.substring(0,g.length-m),d[l+1][0]=f,d[l+1][1]=T.substring(m),l++),l++}l++}},M.prototype.diff_cleanupSemanticLossless=function(d){function u(m,C){if(!m||!C)return 6;var O=m.charAt(m.length-1),j=C.charAt(0),x=O.match(M.nonAlphaNumericRegex_),V=j.match(M.nonAlphaNumericRegex_),ie=x&&O.match(M.whitespaceRegex_),me=V&&j.match(M.whitespaceRegex_),fe=ie&&O.match(M.linebreakRegex_),de=me&&j.match(M.linebreakRegex_),ve=fe&&m.match(M.blanklineEndRegex_),Se=de&&C.match(M.blanklineStartRegex_);return ve||Se?5:fe||de?4:x&&!ie&&me?3:ie||me?2:x||V?1:0}for(var c=1;c<d.length-1;){if(d[c-1][0]==0&&d[c+1][0]==0){var y=d[c-1][1],s=d[c][1],l=d[c+1][1],p=this.diff_commonSuffix(y,s);if(p){var v=s.substring(s.length-p);y=y.substring(0,y.length-p),s=v+s.substring(0,s.length-p),l=v+l}for(var L=y,E=s,T=l,g=u(y,s)+u(s,l);s.charAt(0)===l.charAt(0);){y+=s.charAt(0),s=s.substring(1)+l.charAt(0),l=l.substring(1);var k=u(y,s)+u(s,l);k>=g&&(g=k,L=y,E=s,T=l)}d[c-1][1]!=L&&(L?d[c-1][1]=L:(d.splice(c-1,1),c--),d[c][1]=E,T?d[c+1][1]=T:(d.splice(c+1,1),c--))}c++}},M.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,M.whitespaceRegex_=/\s/,M.linebreakRegex_=/[\r\n]/,M.blanklineEndRegex_=/\n\r?\n$/,M.blanklineStartRegex_=/^\r?\n\r?\n/,M.prototype.diff_cleanupEfficiency=function(d){for(var u=!1,c=[],y=0,s=null,l=0,p=!1,v=!1,L=!1,E=!1;l<d.length;)d[l][0]==0?(d[l][1].length<this.Diff_EditCost&&(L||E)?(c[y++]=l,p=L,v=E,s=d[l][1]):(y=0,s=null),L=E=!1):(d[l][0]==f?E=!0:L=!0,s&&(p&&v&&L&&E||s.length<this.Diff_EditCost/2&&p+v+L+E==3)&&(d.splice(c[y-1],0,new M.Diff(f,s)),d[c[y-1]+1][0]=1,y--,s=null,p&&v?(L=E=!0,y=0):(l=--y>0?c[y-1]:-1,L=E=!1),u=!0)),l++;u&&this.diff_cleanupMerge(d)},M.prototype.diff_cleanupMerge=function(d){d.push(new M.Diff(0,""));for(var u,c=0,y=0,s=0,l="",p="";c<d.length;)switch(d[c][0]){case 1:s++,p+=d[c][1],c++;break;case f:y++,l+=d[c][1],c++;break;case 0:y+s>1?(y!==0&&s!==0&&((u=this.diff_commonPrefix(p,l))!==0&&(c-y-s>0&&d[c-y-s-1][0]==0?d[c-y-s-1][1]+=p.substring(0,u):(d.splice(0,0,new M.Diff(0,p.substring(0,u))),c++),p=p.substring(u),l=l.substring(u)),(u=this.diff_commonSuffix(p,l))!==0&&(d[c][1]=p.substring(p.length-u)+d[c][1],p=p.substring(0,p.length-u),l=l.substring(0,l.length-u))),c-=y+s,d.splice(c,y+s),l.length&&(d.splice(c,0,new M.Diff(f,l)),c++),p.length&&(d.splice(c,0,new M.Diff(1,p)),c++),c++):c!==0&&d[c-1][0]==0?(d[c-1][1]+=d[c][1],d.splice(c,1)):c++,s=0,y=0,l="",p=""}d[d.length-1][1]===""&&d.pop();var v=!1;for(c=1;c<d.length-1;)d[c-1][0]==0&&d[c+1][0]==0&&(d[c][1].substring(d[c][1].length-d[c-1][1].length)==d[c-1][1]?(d[c][1]=d[c-1][1]+d[c][1].substring(0,d[c][1].length-d[c-1][1].length),d[c+1][1]=d[c-1][1]+d[c+1][1],d.splice(c-1,1),v=!0):d[c][1].substring(0,d[c+1][1].length)==d[c+1][1]&&(d[c-1][1]+=d[c+1][1],d[c][1]=d[c][1].substring(d[c+1][1].length)+d[c+1][1],d.splice(c+1,1),v=!0)),c++;v&&this.diff_cleanupMerge(d)},M.prototype.diff_xIndex=function(d,u){var c,y=0,s=0,l=0,p=0;for(c=0;c<d.length&&(d[c][0]!==1&&(y+=d[c][1].length),d[c][0]!==f&&(s+=d[c][1].length),!(y>u));c++)l=y,p=s;return d.length!=c&&d[c][0]===f?p:p+(u-l)},M.prototype.diff_prettyHtml=function(d){for(var u=[],c=/&/g,y=/</g,s=/>/g,l=/\n/g,p=0;p<d.length;p++){var v=d[p][0],L=d[p][1].replace(c,"&amp;").replace(y,"&lt;").replace(s,"&gt;").replace(l,"&para;<br>");switch(v){case 1:u[p]='<ins style="background:#e6ffe6;">'+L+"</ins>";break;case f:u[p]='<del style="background:#ffe6e6;">'+L+"</del>";break;case 0:u[p]="<span>"+L+"</span>"}}return u.join("")},M.prototype.diff_text1=function(d){for(var u=[],c=0;c<d.length;c++)d[c][0]!==1&&(u[c]=d[c][1]);return u.join("")},M.prototype.diff_text2=function(d){for(var u=[],c=0;c<d.length;c++)d[c][0]!==f&&(u[c]=d[c][1]);return u.join("")},M.prototype.diff_levenshtein=function(d){for(var u=0,c=0,y=0,s=0;s<d.length;s++){var l=d[s][0],p=d[s][1];switch(l){case 1:c+=p.length;break;case f:y+=p.length;break;case 0:u+=Math.max(c,y),c=0,y=0}}return u+=Math.max(c,y)},M.prototype.diff_toDelta=function(d){for(var u=[],c=0;c<d.length;c++)switch(d[c][0]){case 1:u[c]="+"+encodeURI(d[c][1]);break;case f:u[c]="-"+d[c][1].length;break;case 0:u[c]="="+d[c][1].length}return u.join(" ").replace(/%20/g," ")},M.prototype.diff_fromDelta=function(d,u){for(var c=[],y=0,s=0,l=u.split(/\t/g),p=0;p<l.length;p++){var v=l[p].substring(1);switch(l[p].charAt(0)){case"+":try{c[y++]=new M.Diff(1,decodeURI(v))}catch(T){throw new Error("Illegal escape in diff_fromDelta: "+v)}break;case"-":case"=":var L=parseInt(v,10);if(isNaN(L)||L<0)throw new Error("Invalid number in diff_fromDelta: "+v);var E=d.substring(s,s+=L);l[p].charAt(0)=="="?c[y++]=new M.Diff(0,E):c[y++]=new M.Diff(f,E);break;default:if(l[p])throw new Error("Invalid diff operation in diff_fromDelta: "+l[p])}}if(s!=d.length)throw new Error("Delta length ("+s+") does not equal source text length ("+d.length+").");return c},M.prototype.match_main=function(d,u,c){if(d==null||u==null||c==null)throw new Error("Null input. (match_main)");return c=Math.max(0,Math.min(c,d.length)),d==u?0:d.length?d.substring(c,c+u.length)==u?c:this.match_bitap_(d,u,c):-1},M.prototype.match_bitap_=function(d,u,c){if(u.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var y=this.match_alphabet_(u),s=this;function l(me,fe){var de=me/u.length,ve=Math.abs(c-fe);return s.Match_Distance?de+ve/s.Match_Distance:ve?1:de}var p=this.Match_Threshold,v=d.indexOf(u,c);v!=-1&&(p=Math.min(l(0,v),p),(v=d.lastIndexOf(u,c+u.length))!=-1&&(p=Math.min(l(0,v),p)));var L,E,T=1<<u.length-1;v=-1;for(var g,k=u.length+d.length,m=0;m<u.length;m++){for(L=0,E=k;L<E;)l(m,c+E)<=p?L=E:k=E,E=Math.floor((k-L)/2+L);k=E;var C=Math.max(1,c-E+1),O=Math.min(c+E,d.length)+u.length,j=Array(O+2);j[O+1]=(1<<m)-1;for(var x=O;x>=C;x--){var V=y[d.charAt(x-1)];if(j[x]=m===0?(j[x+1]<<1|1)&V:(j[x+1]<<1|1)&V|(g[x+1]|g[x])<<1|1|g[x+1],j[x]&T){var ie=l(m,x-1);if(ie<=p){if(p=ie,!((v=x-1)>c))break;C=Math.max(1,2*c-v)}}}if(l(m+1,c)>p)break;g=j}return v},M.prototype.match_alphabet_=function(d){for(var u={},c=0;c<d.length;c++)u[d.charAt(c)]=0;for(c=0;c<d.length;c++)u[d.charAt(c)]|=1<<d.length-c-1;return u},M.prototype.patch_addContext_=function(d,u){if(u.length!=0){if(d.start2===null)throw Error("patch not initialized");for(var c=u.substring(d.start2,d.start2+d.length1),y=0;u.indexOf(c)!=u.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)y+=this.Patch_Margin,c=u.substring(d.start2-y,d.start2+d.length1+y);y+=this.Patch_Margin;var s=u.substring(d.start2-y,d.start2);s&&d.diffs.unshift(new M.Diff(0,s));var l=u.substring(d.start2+d.length1,d.start2+d.length1+y);l&&d.diffs.push(new M.Diff(0,l)),d.start1-=s.length,d.start2-=s.length,d.length1+=s.length+l.length,d.length2+=s.length+l.length}},M.prototype.patch_make=function(d,u,c){var y,s;if(typeof d=="string"&&typeof u=="string"&&c===void 0)y=d,(s=this.diff_main(y,u,!0)).length>2&&(this.diff_cleanupSemantic(s),this.diff_cleanupEfficiency(s));else if(d&&typeof d=="object"&&u===void 0&&c===void 0)s=d,y=this.diff_text1(s);else if(typeof d=="string"&&u&&typeof u=="object"&&c===void 0)y=d,s=u;else{if(typeof d!="string"||typeof u!="string"||!c||typeof c!="object")throw new Error("Unknown call format to patch_make.");y=d,s=c}if(s.length===0)return[];for(var l=[],p=new M.patch_obj,v=0,L=0,E=0,T=y,g=y,k=0;k<s.length;k++){var m=s[k][0],C=s[k][1];switch(v||m===0||(p.start1=L,p.start2=E),m){case 1:p.diffs[v++]=s[k],p.length2+=C.length,g=g.substring(0,E)+C+g.substring(E);break;case f:p.length1+=C.length,p.diffs[v++]=s[k],g=g.substring(0,E)+g.substring(E+C.length);break;case 0:C.length<=2*this.Patch_Margin&&v&&s.length!=k+1?(p.diffs[v++]=s[k],p.length1+=C.length,p.length2+=C.length):C.length>=2*this.Patch_Margin&&v&&(this.patch_addContext_(p,T),l.push(p),p=new M.patch_obj,v=0,T=g,L=E)}m!==1&&(L+=C.length),m!==f&&(E+=C.length)}return v&&(this.patch_addContext_(p,T),l.push(p)),l},M.prototype.patch_deepCopy=function(d){for(var u=[],c=0;c<d.length;c++){var y=d[c],s=new M.patch_obj;s.diffs=[];for(var l=0;l<y.diffs.length;l++)s.diffs[l]=new M.Diff(y.diffs[l][0],y.diffs[l][1]);s.start1=y.start1,s.start2=y.start2,s.length1=y.length1,s.length2=y.length2,u[c]=s}return u},M.prototype.patch_apply=function(d,u){if(d.length==0)return[u,[]];d=this.patch_deepCopy(d);var c=this.patch_addPadding(d);u=c+u+c,this.patch_splitMax(d);for(var y=0,s=[],l=0;l<d.length;l++){var p,v,L=d[l].start2+y,E=this.diff_text1(d[l].diffs),T=-1;if(E.length>this.Match_MaxBits?(p=this.match_main(u,E.substring(0,this.Match_MaxBits),L))!=-1&&((T=this.match_main(u,E.substring(E.length-this.Match_MaxBits),L+E.length-this.Match_MaxBits))==-1||p>=T)&&(p=-1):p=this.match_main(u,E,L),p==-1)s[l]=!1,y-=d[l].length2-d[l].length1;else if(s[l]=!0,y=p-L,E==(v=T==-1?u.substring(p,p+E.length):u.substring(p,T+this.Match_MaxBits)))u=u.substring(0,p)+this.diff_text2(d[l].diffs)+u.substring(p+E.length);else{var g=this.diff_main(E,v,!1);if(E.length>this.Match_MaxBits&&this.diff_levenshtein(g)/E.length>this.Patch_DeleteThreshold)s[l]=!1;else{this.diff_cleanupSemanticLossless(g);for(var k,m=0,C=0;C<d[l].diffs.length;C++){var O=d[l].diffs[C];O[0]!==0&&(k=this.diff_xIndex(g,m)),O[0]===1?u=u.substring(0,p+k)+O[1]+u.substring(p+k):O[0]===f&&(u=u.substring(0,p+k)+u.substring(p+this.diff_xIndex(g,m+O[1].length))),O[0]!==f&&(m+=O[1].length)}}}}return[u=u.substring(c.length,u.length-c.length),s]},M.prototype.patch_addPadding=function(d){for(var u=this.Patch_Margin,c="",y=1;y<=u;y++)c+=String.fromCharCode(y);for(y=0;y<d.length;y++)d[y].start1+=u,d[y].start2+=u;var s=d[0],l=s.diffs;if(l.length==0||l[0][0]!=0)l.unshift(new M.Diff(0,c)),s.start1-=u,s.start2-=u,s.length1+=u,s.length2+=u;else if(u>l[0][1].length){var p=u-l[0][1].length;l[0][1]=c.substring(l[0][1].length)+l[0][1],s.start1-=p,s.start2-=p,s.length1+=p,s.length2+=p}return(l=(s=d[d.length-1]).diffs).length==0||l[l.length-1][0]!=0?(l.push(new M.Diff(0,c)),s.length1+=u,s.length2+=u):u>l[l.length-1][1].length&&(p=u-l[l.length-1][1].length,l[l.length-1][1]+=c.substring(0,p),s.length1+=p,s.length2+=p),c},M.prototype.patch_splitMax=function(d){for(var u=this.Match_MaxBits,c=0;c<d.length;c++)if(!(d[c].length1<=u)){var y=d[c];d.splice(c--,1);for(var s=y.start1,l=y.start2,p="";y.diffs.length!==0;){var v=new M.patch_obj,L=!0;for(v.start1=s-p.length,v.start2=l-p.length,p!==""&&(v.length1=v.length2=p.length,v.diffs.push(new M.Diff(0,p)));y.diffs.length!==0&&v.length1<u-this.Patch_Margin;){var E=y.diffs[0][0],T=y.diffs[0][1];E===1?(v.length2+=T.length,l+=T.length,v.diffs.push(y.diffs.shift()),L=!1):E===f&&v.diffs.length==1&&v.diffs[0][0]==0&&T.length>2*u?(v.length1+=T.length,s+=T.length,L=!1,v.diffs.push(new M.Diff(E,T)),y.diffs.shift()):(T=T.substring(0,u-v.length1-this.Patch_Margin),v.length1+=T.length,s+=T.length,E===0?(v.length2+=T.length,l+=T.length):L=!1,v.diffs.push(new M.Diff(E,T)),T==y.diffs[0][1]?y.diffs.shift():y.diffs[0][1]=y.diffs[0][1].substring(T.length))}p=(p=this.diff_text2(v.diffs)).substring(p.length-this.Patch_Margin);var g=this.diff_text1(y.diffs).substring(0,this.Patch_Margin);g!==""&&(v.length1+=g.length,v.length2+=g.length,v.diffs.length!==0&&v.diffs[v.diffs.length-1][0]===0?v.diffs[v.diffs.length-1][1]+=g:v.diffs.push(new M.Diff(0,g))),L||d.splice(++c,0,v)}}},M.prototype.patch_toText=function(d){for(var u=[],c=0;c<d.length;c++)u[c]=d[c];return u.join("")},M.prototype.patch_fromText=function(d){var u=[];if(!d)return u;for(var c=d.split(`
  3. `),y=0,s=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;y<c.length;){var l=c[y].match(s);if(!l)throw new Error("Invalid patch string: "+c[y]);var p=new M.patch_obj;for(u.push(p),p.start1=parseInt(l[1],10),l[2]===""?(p.start1--,p.length1=1):l[2]=="0"?p.length1=0:(p.start1--,p.length1=parseInt(l[2],10)),p.start2=parseInt(l[3],10),l[4]===""?(p.start2--,p.length2=1):l[4]=="0"?p.length2=0:(p.start2--,p.length2=parseInt(l[4],10)),y++;y<c.length;){var v=c[y].charAt(0);try{var L=decodeURI(c[y].substring(1))}catch(E){throw new Error("Illegal escape in patch_fromText: "+L)}if(v=="-")p.diffs.push(new M.Diff(f,L));else if(v=="+")p.diffs.push(new M.Diff(1,L));else if(v==" ")p.diffs.push(new M.Diff(0,L));else{if(v=="@")break;if(v!=="")throw new Error('Invalid patch mode "'+v+'" in: '+L)}y++}}return u},(M.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var d,u=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@
  4. `],c=0;c<this.diffs.length;c++){switch(this.diffs[c][0]){case 1:d="+";break;case f:d="-";break;case 0:d=" "}u[c+1]=d+encodeURI(this.diffs[c][1])+`
  5. `}return u.join("").replace(/%20/g," ")},P.exports=M,P.exports.diff_match_patch=M,P.exports.DIFF_DELETE=f,P.exports.DIFF_INSERT=1,P.exports.DIFF_EQUAL=0},872:(P,M,f)=>{f.d(M,{default:()=>ee});var d=f(478),u=f(156),c=f(314),y=f(730),s=f(66),l=f(218),p=f(702),v=function(N){N===void 0&&(N=document);var J=function(I){var D=document.createElement("img");D.src=I.getAttribute("data-src"),D.addEventListener("load",function(){I.getAttribute("style")||I.getAttribute("class")||I.getAttribute("width")||I.getAttribute("height")||D.naturalHeight>D.naturalWidth&&D.naturalWidth/D.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&D.naturalHeight>window.innerHeight-40&&(I.style.height=window.innerHeight-40+"px"),I.src=D.src}),I.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return N.querySelectorAll("img").forEach(function(I){I.getAttribute("data-src")&&J(I)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),N.querySelectorAll("img").forEach(function(I){window.vditorImageIntersectionObserver.observe(I)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(I){I.forEach(function(D){(D.isIntersecting===void 0?D.intersectionRatio!==0:D.isIntersecting)&&D.target.getAttribute("data-src")&&J(D.target)})}),N.querySelectorAll("img").forEach(function(I){window.vditorImageIntersectionObserver.observe(I)}))},L=f(466),E=f(554),T=f(40),g=f(563),k=f(749),m=f(818),C=f(408),O=f(54),j=f(227),x=f(526),V=f(827),ie=f(640),me=f(895),fe=f(393),de=function(N,J){if(J===void 0&&(J="zh_CN"),typeof speechSynthesis<"u"&&typeof SpeechSynthesisUtterance<"u"){var I=function(){var ue,he;return speechSynthesis.getVoices().forEach(function(oe){oe.lang===J.replace("_","-")&&(ue=oe),oe.default&&(he=oe)}),ue||(ue=he),ue},D='<svg><use xlink:href="#vditor-icon-play"></use></svg>',re='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(D='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',re='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var $=document.querySelector(".vditor-speech");$||(($=document.createElement("button")).className="vditor-speech",N.insertAdjacentElement("beforeend",$),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=I));var te=I(),Z=new SpeechSynthesisUtterance;Z.voice=te,Z.onend=Z.onerror=function(){$.style.display="none",speechSynthesis.cancel(),$.classList.remove("vditor-speech--current"),$.innerHTML=D},N.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(ue){var he=ue.target;if(he.classList.contains("vditor-speech")||he.parentElement.classList.contains("vditor-speech"))return $.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),$.innerHTML=re):(speechSynthesis.pause(),$.innerHTML=D)):(Z.text=$.getAttribute("data-text"),speechSynthesis.speak(Z),$.classList.add("vditor-speech--current"),$.innerHTML=re),(0,fe.Hc)(window.vditorSpeechRange),void N.focus();if($.style.display="none",speechSynthesis.cancel(),$.classList.remove("vditor-speech--current"),$.innerHTML=D,getSelection().rangeCount!==0){var oe=getSelection().getRangeAt(0),Xe=oe.toString().trim();if(Xe){window.vditorSpeechRange=oe.cloneRange();var $e=oe.getBoundingClientRect();$.innerHTML=D,$.style.display="block",$.style.top=$e.top+$e.height+document.querySelector("html").scrollTop-20+"px",window.ontouchstart!==void 0?$.style.left=ue.changedTouches[ue.changedTouches.length-1].pageX+2+"px":$.style.left=ue.clientX+2+"px",$.setAttribute("data-text",Xe)}}})}},ve=function(N,J,I,D){return new(I||(I=Promise))(function(re,$){function te(he){try{ue(D.next(he))}catch(oe){$(oe)}}function Z(he){try{ue(D.throw(he))}catch(oe){$(oe)}}function ue(he){var oe;he.done?re(he.value):(oe=he.value,oe instanceof I?oe:new I(function(Xe){Xe(oe)})).then(te,Z)}ue((D=D.apply(N,J||[])).next())})},Se=function(N,J){var I,D,re,$,te={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return $={next:Z(0),throw:Z(1),return:Z(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function Z(ue){return function(he){return function(oe){if(I)throw new TypeError("Generator is already executing.");for(;te;)try{if(I=1,D&&(re=2&oe[0]?D.return:oe[0]?D.throw||((re=D.return)&&re.call(D),0):D.next)&&!(re=re.call(D,oe[1])).done)return re;switch(D=0,re&&(oe=[2&oe[0],re.value]),oe[0]){case 0:case 1:re=oe;break;case 4:return te.label++,{value:oe[1],done:!1};case 5:te.label++,D=oe[1],oe=[0];continue;case 7:oe=te.ops.pop(),te.trys.pop();continue;default:if(re=te.trys,!((re=re.length>0&&re[re.length-1])||oe[0]!==6&&oe[0]!==2)){te=0;continue}if(oe[0]===3&&(!re||oe[1]>re[0]&&oe[1]<re[3])){te.label=oe[1];break}if(oe[0]===6&&te.label<re[1]){te.label=re[1],re=oe;break}if(re&&te.label<re[2]){te.label=re[2],te.ops.push(oe);break}re[2]&&te.ops.pop(),te.trys.pop();continue}oe=J.call(N,te)}catch(Xe){oe=[6,Xe],D=0}finally{I=re=0}if(5&oe[0])throw oe[1];return{value:oe[0]?oe[1]:void 0,done:!0}}([ue,he])}}},ke=function(N){var J,I={anchor:0,cdn:O.g.CDN,customEmoji:{},emojiPath:O.g.CDN+"/dist/images/emoji",hljs:O.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:O.g.MARKDOWN_OPTIONS,math:O.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:O.g.THEME_OPTIONS};return N.cdn&&(!((J=N.theme)===null||J===void 0)&&J.path||(I.theme.path=N.cdn+"/dist/css/content-theme"),N.emojiPath||(I.emojiPath=N.cdn+"/dist/images/emoji")),(0,ie.T)(I,N)},Pe=function(N,J){var I=ke(J);return(0,x.G)(I.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var D=(0,me.X)({autoSpace:I.markdown.autoSpace,gfmAutoLink:I.markdown.gfmAutoLink,codeBlockPreview:I.markdown.codeBlockPreview,emojiSite:I.emojiPath,emojis:I.customEmoji,fixTermTypo:I.markdown.fixTermTypo,footnotes:I.markdown.footnotes,headingAnchor:I.anchor!==0,inlineMathDigit:I.math.inlineDigit,lazyLoadImage:I.lazyLoadImage,linkBase:I.markdown.linkBase,linkPrefix:I.markdown.linkPrefix,listStyle:I.markdown.listStyle,mark:I.markdown.mark,mathBlockPreview:I.markdown.mathBlockPreview,paragraphBeginningSpace:I.markdown.paragraphBeginningSpace,sanitize:I.markdown.sanitize,toc:I.markdown.toc});return J!=null&&J.renderers&&D.SetJSRenderers({renderers:{Md2HTML:J.renderers}}),D.SetHeadingID(!0),D.Md2HTML(N)})},ye=function(N,J,I){return ve(void 0,void 0,void 0,function(){var D,re,$;return Se(this,function(te){switch(te.label){case 0:return D=ke(I),[4,Pe(J,D)];case 1:if(re=te.sent(),D.transform&&(re=D.transform(re)),N.innerHTML=re,N.classList.add("vditor-reset"),D.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(D.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return $="vditorI18nScript"+D.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(ue){ue.id!==$&&document.head.removeChild(ue)}),[4,(0,x.G)(D.cdn+"/dist/js/i18n/"+D.lang+".js",$)];case 3:te.sent(),te.label=4;case 4:return[3,6];case 5:window.VditorI18n=D.i18n,te.label=6;case 6:return D.icon?[4,(0,x.G)(D.cdn+"/dist/js/icons/"+D.icon+".js","vditorIconScript")]:[3,8];case 7:te.sent(),te.label=8;case 8:return(0,j.Z)(D.theme.current,D.theme.path),D.anchor===1&&N.classList.add("vditor-reset--anchor"),(0,y.O)(N,D.hljs),(0,p.s)(D.hljs,N,D.cdn),(0,L.H)(N,{cdn:D.cdn,math:D.math}),(0,T.i)(N,D.cdn,D.mode),(0,g.K)(N,D.cdn,D.mode),(0,s.P)(N,D.cdn),(0,l.v)(N,D.cdn),(0,c.p)(N,D.cdn,D.mode),(0,k.P)(N,D.cdn,D.mode),(0,C.B)(N,D.cdn),(0,d.Q)(N,D.cdn),D.render.media.enable&&(0,E.Y)(N),D.speech.enable&&de(N),D.anchor!==0&&(Z=D.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(ue){Z===1&&ue.classList.add("vditor-anchor--left"),ue.onclick=function(){var he=ue.getAttribute("href").substr(1),oe=document.getElementById("vditorAnchor-"+he).offsetTop;document.querySelector("html").scrollTop=oe}}),window.onhashchange=function(){var ue=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));ue&&(document.querySelector("html").scrollTop=ue.offsetTop)}),D.after&&D.after(),D.lazyLoadImage&&v(N),N.addEventListener("click",function(ue){var he=(0,V.lG)(ue.target,"SPAN");if(he&&(0,V.fb)(he,"vditor-toc")){var oe=N.querySelector("#"+he.getAttribute("data-target-id"));oe&&window.scrollTo(window.scrollX,oe.offsetTop)}}),[2]}var Z})})},_=f(863),ge=f(312);const ee=function(){function N(){}return N.adapterRender=u,N.previewImage=_.E,N.codeRender=y.O,N.graphvizRender=l.v,N.highlightRender=p.s,N.mathRender=L.H,N.mermaidRender=T.i,N.markmapRender=g.K,N.flowchartRender=s.P,N.chartRender=c.p,N.abcRender=d.Q,N.mindmapRender=k.P,N.plantumlRender=C.B,N.outlineRender=m.k,N.mediaRender=E.Y,N.speechRender=de,N.lazyLoadImageRender=v,N.md2html=Pe,N.preview=ye,N.setCodeTheme=ge.Y,N.setContentTheme=j.Z,N}()},54:(P,M,f)=>{f.d(M,{H:()=>d,g:()=>u});var d="3.10.4",u=function(){function c(){}return c.ZWSP="\u200B",c.DROP_EDITOR="application/editor",c.MOBILE_WIDTH=520,c.CLASS_MENU_DISABLED="vditor-menu--disabled",c.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],c.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],c.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],c.CDN="https://unpkg.com/vditor@3.10.4",c.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},c.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},c.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},c.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:c.CDN+"/dist/css/content-theme"},c}()},478:(P,M,f)=>{f.d(M,{Q:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var p=c.abcRenderAdapter.getElements(s);p.length>0&&(0,u.G)(l+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){p.forEach(function(v){v.parentElement.classList.contains("vditor-wysiwyg__pre")||v.parentElement.classList.contains("vditor-ir__marker--pre")||v.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(v,c.abcRenderAdapter.getCode(v).trim()),v.style.overflowX="auto",v.setAttribute("data-processed","true"))})})}},156:(P,M,f)=>{f.r(M),f.d(M,{abcRenderAdapter:()=>l,chartRenderAdapter:()=>s,flowchartRenderAdapter:()=>v,graphvizRenderAdapter:()=>p,markmapRenderAdapter:()=>c,mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,mindmapRenderAdapter:()=>y,plantumlRenderAdapter:()=>L});var d={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-math")}},u={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-mermaid")}},c={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-markmap")}},y={getCode:function(E){return E.getAttribute("data-code")},getElements:function(E){return E.querySelectorAll(".language-mindmap")}},s={getCode:function(E){return E.innerText},getElements:function(E){return E.querySelectorAll(".language-echarts")}},l={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-abc")}},p={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-graphviz")}},v={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-flowchart")}},L={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-plantuml")}}},314:(P,M,f)=>{f.d(M,{p:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l,p){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var v=c.chartRenderAdapter.getElements(s);v.length>0&&(0,u.G)(l+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var E=c.chartRenderAdapter.getCode(L).trim();if(E)try{if(L.getAttribute("data-processed")==="true")return;var T=JSON.parse(E);echarts.init(L,p==="dark"?"dark":void 0).setOption(T),L.setAttribute("data-processed","true")}catch(g){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+g}}})})}},730:(P,M,f)=>{f.d(M,{O:()=>c});var d=f(51),u=f(54),c=function(y,s){Array.from(y.querySelectorAll("pre > code")).filter(function(l,p){return!l.parentElement.classList.contains("vditor-wysiwyg__pre")&&!l.parentElement.classList.contains("vditor-ir__marker--pre")&&!(l.classList.contains("language-mermaid")||l.classList.contains("language-flowchart")||l.classList.contains("language-echarts")||l.classList.contains("language-mindmap")||l.classList.contains("language-plantuml")||l.classList.contains("language-markmap")||l.classList.contains("language-abc")||l.classList.contains("language-graphviz")||l.classList.contains("language-math"))&&!(l.style.maxHeight.indexOf("px")>-1)&&!(y.classList.contains("vditor-preview")&&p>5)}).forEach(function(l){var p,v,L,E=l.innerText;if(l.classList.contains("highlight-chroma")){var T=l.cloneNode(!0);T.querySelectorAll(".highlight-ln").forEach(function(C){C.remove()}),E=T.innerText}else E.endsWith(`
  6. `)&&(E=E.substr(0,E.length-1));var g='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(g='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var k=document.createElement("div");k.className="vditor-copy",k.innerHTML='<span aria-label="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"\u590D\u5236")+`"
  7. onmouseover="this.setAttribute('aria-label', '`+(((v=window.VditorI18n)===null||v===void 0?void 0:v.copy)||"\u590D\u5236")+`')"
  8. class="vditor-tooltipped vditor-tooltipped__w"
  9. onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"\u5DF2\u590D\u5236")+`');this.previousElementSibling.blur()">`+g+"</span>";var m=document.createElement("textarea");m.value=(0,d.X)(E),k.insertAdjacentElement("afterbegin",m),s&&s.renderMenu&&s.renderMenu(l,k),l.before(k),l.style.maxHeight=window.outerHeight-40+"px",l.insertAdjacentHTML("afterend",'<span style="position: absolute">'+u.g.ZWSP+"</span>")})}},66:(P,M,f)=>{f.d(M,{P:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){l===void 0&&(l=d.g.CDN);var p=c.flowchartRenderAdapter.getElements(s);p.length!==0&&(0,u.G)(l+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){p.forEach(function(v){if(v.getAttribute("data-processed")!=="true"){var L=flowchart.parse(c.flowchartRenderAdapter.getCode(v));v.innerHTML="",L.drawSVG(v),v.setAttribute("data-processed","true")}})})}},218:(P,M,f)=>{f.d(M,{v:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){l===void 0&&(l=d.g.CDN);var p=c.graphvizRenderAdapter.getElements(s);p.length!==0&&(0,u.G)(l+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){p.forEach(function(v){var L=c.graphvizRenderAdapter.getCode(v);if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")&&v.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var E=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),T=(window.URL||window.webkitURL).createObjectURL(E),g=new Worker(T);new Viz({worker:g}).renderSVGElement(L).then(function(k){v.innerHTML=k.outerHTML}).catch(function(k){v.innerHTML="graphviz render error: <br>"+k,v.className="vditor-reset--error"})}catch(k){}v.setAttribute("data-processed","true")}})})}},702:(P,M,f)=>{f.d(M,{s:()=>y});var d=f(54),u=f(526),c=f(578),y=function(s,l,p){l===void 0&&(l=document),p===void 0&&(p=d.g.CDN);var v=s.style;d.g.CODE_THEME.includes(v)||(v="github");var L=document.getElementById("vditorHljsStyle"),E=p+"/dist/js/highlight.js/styles/"+v+".css";L&&L.getAttribute("href")!==E&&L.remove(),(0,c.c)(p+"/dist/js/highlight.js/styles/"+v+".css","vditorHljsStyle"),s.enable!==!1&&l.querySelectorAll("pre > code").length!==0&&(0,u.G)(p+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){l.querySelectorAll("pre > code").forEach(function(T){if(!T.parentElement.classList.contains("vditor-ir__marker--pre")&&!T.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(T.classList.contains("language-mermaid")||T.classList.contains("language-flowchart")||T.classList.contains("language-echarts")||T.classList.contains("language-mindmap")||T.classList.contains("language-plantuml")||T.classList.contains("language-abc")||T.classList.contains("language-graphviz")||T.classList.contains("language-math"))&&(s.defaultLang!==""&&T.className.indexOf("language-")===-1&&T.classList.add("language-"+s.defaultLang),hljs.highlightElement(T),s.lineNumber)){T.classList.add("vditor-linenumber");var g=T.querySelector(".vditor-linenumber__temp");g||((g=document.createElement("div")).className="vditor-linenumber__temp",T.insertAdjacentElement("beforeend",g));var k=getComputedStyle(T).whiteSpace,m=!1;k!=="pre-wrap"&&k!=="pre-line"||(m=!0);var C="",O=T.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(j){var x="";m&&(g.textContent=j||`
  10. `,x=' style="height:'+g.getBoundingClientRect().height+'px"'),C+="<span"+x+"></span>"}),g.style.display="none",C='<span class="vditor-linenumber__rows">'+C+"</span>",T.insertAdjacentHTML("beforeend",C)}})})})})}},563:(P,M,f)=>{f.d(M,{K:()=>l});var d=f(54),u=f(526),c=f(156),y={},s=function(p,v){var L=window.markmap,E=L.Transformer,T=L.Markmap,g=L.deriveOptions,k=(L.globalCSS,new E);p.innerHTML='<svg style="width:100%"></svg>';var m=p.firstChild,C=T.create(m,null),O=function(ie,me){var fe=ie.transform(me),de=Object.keys(fe.features).filter(function(ye){return!y[ye]});de.forEach(function(ye){y[ye]=!0});var ve=ie.getAssets(de),Se=ve.styles,ke=ve.scripts,Pe=window.markmap;return Se&&Pe.loadCSS(Se),ke&&Pe.loadJS(ke),fe}(k,v),j=O.root,x=O.frontmatter,V=g(x==null?void 0:x.markmap);C.setData(j,V),C.fit()},l=function(p,v,L){v===void 0&&(v=d.g.CDN);var E=c.markmapRenderAdapter.getElements(p);E.length!==0&&(0,u.G)(v+"/dist/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){E.forEach(function(T){var g=c.markmapRenderAdapter.getCode(T);if(T.getAttribute("data-processed")!=="true"&&g.trim()!==""){var k=document.createElement("div");k.className="language-markmap",T.parentNode.appendChild(k),s(k,g),T.parentNode.childNodes[0].nodeName=="CODE"&&T.parentNode.removeChild(T.parentNode.childNodes[0])}})})}},466:(P,M,f)=>{f.d(M,{H:()=>l});var d=f(54),u=f(526),c=f(578),y=f(51),s=f(156),l=function(p,v){var L=s.mathRenderAdapter.getElements(p);if(L.length!==0){var E={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(v&&v.math&&(v.math=Object.assign({},E.math,v.math)),(v=Object.assign({},E,v)).math.engine==="KaTeX")(0,c.c)(v.cdn+"/dist/js/katex/katex.min.css?v=0.16.9","vditorKatexStyle"),(0,u.G)(v.cdn+"/dist/js/katex/katex.min.js?v=0.16.9","vditorKatexScript").then(function(){(0,u.G)(v.cdn+"/dist/js/katex/mhchem.min.js?v=0.16.9","vditorKatexChemScript").then(function(){L.forEach(function(g){if(!g.parentElement.classList.contains("vditor-wysiwyg__pre")&&!g.parentElement.classList.contains("vditor-ir__marker--pre")&&!g.getAttribute("data-math")){var k=(0,y.X)(s.mathRenderAdapter.getCode(g));g.setAttribute("data-math",k);try{g.innerHTML=katex.renderToString(k,{displayMode:g.tagName==="DIV",output:"html",macros:v.math.macros})}catch(m){g.innerHTML=m.message,g.className="language-math vditor-reset--error"}g.addEventListener("copy",function(m){m.stopPropagation(),m.preventDefault();var C=m.currentTarget.closest(".language-math");m.clipboardData.setData("text/html",C.innerHTML),m.clipboardData.setData("text/plain",C.getAttribute("data-math"))})}})})});else if(v.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:v.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:v.math.macros}},Object.assign(window.MathJax,v.math.mathJaxOptions)),(0,u.J)(v.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var T=function(g,k){var m=(0,y.X)(g.textContent).trim(),C=window.MathJax.getMetricsFor(g);C.display=g.tagName==="DIV",window.MathJax.tex2svgPromise(m,C).then(function(O){g.innerHTML="",g.setAttribute("data-math",m),g.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var j=O.querySelector('[data-mml-node="merror"]');j&&j.textContent.trim()!==""&&(g.innerHTML=j.textContent.trim(),g.className="vditor-reset--error"),k&&k()})};window.MathJax.startup.promise.then(function(){for(var g=[],k=function(C){var O=L[C];O.parentElement.classList.contains("vditor-wysiwyg__pre")||O.parentElement.classList.contains("vditor-ir__marker--pre")||O.getAttribute("data-math")||!(0,y.X)(O.textContent).trim()||g.push(function(j){C===L.length-1?T(O):T(O,j)})},m=0;m<L.length;m++)k(m);(function(C){if(C.length!==0){var O=0,j=C[C.length-1],x=function(){var V=C[O++];V===j?V():V(x)};x()}})(g)})}}}},554:(P,M,f)=>{f.d(M,{Y:()=>u});var d=f(835),u=function(c){c&&c.querySelectorAll("a").forEach(function(y){var s=y.getAttribute("href");s&&(s.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(l,p){l.insertAdjacentHTML("afterend",'<video controls="controls" src="'+p+'"></video>'),l.remove()}(y,s):s.match(/^.+.(mp3|wav|flac)$/)?function(l,p){l.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+p+'"></audio>'),l.remove()}(y,s):function(l,p){var v=p.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),L=p.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),E=p.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),T=p.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),g=p.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),k=p.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),m=p.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),C=p.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(v&&v[1].length===11)l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+v[1]+(v[2]?"?start="+v[2]:"")+'"></iframe>'),l.remove();else if(L&&L[1])l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+L[1]+'"></iframe>'),l.remove();else if(E&&E[1])l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+E[1]+'"></iframe>'),l.remove();else if(T&&T[1])l.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  11. src="//coub.com/embed/`+T[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),l.remove();else if(g&&g[0])l.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  12. src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(g[0])+'"></iframe>'),l.remove();else if(k&&k[2])l.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  13. src="https://www.dailymotion.com/embed/video/`+k[2]+'"></iframe>'),l.remove();else if(p.indexOf("bilibili.com")>-1&&(p.indexOf("bvid=")>-1||m&&m[1])){var O={bvid:(0,d.o)("bvid",p)||m&&m[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(p.startsWith("http")?p:"https:"+p).search.split("&").forEach(function(V,ie){if(V){ie===0&&(V=V.substr(1));var me=V.split("=");O[me[0]]=me[1]}});var j="https://player.bilibili.com/player.html?",x=Object.keys(O);x.forEach(function(V,ie){j+=V+"="+O[V],ie<x.length-1&&(j+="&")}),l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'+j+'"></iframe>'),l.remove()}else C&&C[1]&&(l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+C[1]+'"></iframe>'),l.remove())}(y,s))})}},40:(P,M,f)=>{f.d(M,{i:()=>p});var d=f(54),u=f(526),c=f(156),y=f(835),s=function(v,L,E,T){return new(E||(E=Promise))(function(g,k){function m(j){try{O(T.next(j))}catch(x){k(x)}}function C(j){try{O(T.throw(j))}catch(x){k(x)}}function O(j){var x;j.done?g(j.value):(x=j.value,x instanceof E?x:new E(function(V){V(x)})).then(m,C)}O((T=T.apply(v,L||[])).next())})},l=function(v,L){var E,T,g,k,m={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return k={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function C(O){return function(j){return function(x){if(E)throw new TypeError("Generator is already executing.");for(;m;)try{if(E=1,T&&(g=2&x[0]?T.return:x[0]?T.throw||((g=T.return)&&g.call(T),0):T.next)&&!(g=g.call(T,x[1])).done)return g;switch(T=0,g&&(x=[2&x[0],g.value]),x[0]){case 0:case 1:g=x;break;case 4:return m.label++,{value:x[1],done:!1};case 5:m.label++,T=x[1],x=[0];continue;case 7:x=m.ops.pop(),m.trys.pop();continue;default:if(g=m.trys,!((g=g.length>0&&g[g.length-1])||x[0]!==6&&x[0]!==2)){m=0;continue}if(x[0]===3&&(!g||x[1]>g[0]&&x[1]<g[3])){m.label=x[1];break}if(x[0]===6&&m.label<g[1]){m.label=g[1],g=x;break}if(g&&m.label<g[2]){m.label=g[2],m.ops.push(x);break}g[2]&&m.ops.pop(),m.trys.pop();continue}x=L.call(v,m)}catch(V){x=[6,V],T=0}finally{E=g=0}if(5&x[0])throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}([O,j])}}},p=function(v,L,E){L===void 0&&(L=d.g.CDN);var T=c.mermaidRenderAdapter.getElements(v);T.length!==0&&(0,u.G)(L+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var g={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};E==="dark"&&(g.theme="dark"),mermaid.initialize(g),T.forEach(function(k){return s(void 0,void 0,void 0,function(){var m,C,O,j,x;return l(this,function(V){switch(V.label){case 0:if(m=c.mermaidRenderAdapter.getCode(k),k.getAttribute("data-processed")==="true"||m.trim()==="")return[2];C="mermaid"+(0,y.W)(),V.label=1;case 1:return V.trys.push([1,3,,4]),[4,mermaid.render(C,k.textContent)];case 2:return O=V.sent(),k.innerHTML=O.svg,[3,4];case 3:return j=V.sent(),x=document.querySelector("#"+C),k.innerHTML=x.outerHTML+`<br>
  14. <div style="text-align: left"><small>`+j.message.replace(/\n/,"<br>")+"</small></div>",x.parentElement.remove(),[3,4];case 4:return k.setAttribute("data-processed","true"),[2]}})})})})}},749:(P,M,f)=>{f.d(M,{P:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l,p){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var v=c.mindmapRenderAdapter.getElements(s);v.length>0&&(0,u.G)(l+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var E=c.mindmapRenderAdapter.getCode(L);if(E)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(E))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(T,g){var k;return!((k=g==null?void 0:g.data)===null||k===void 0)&&k.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(T){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+T}}})})}},818:(P,M,f)=>{f.d(M,{k:()=>c});var d=f(64),u=f(466),c=function(y,s,l){var p="",v=[];if(Array.from(y.children).forEach(function(g,k){if((0,d.W)(g)){if(l){var m=g.id.lastIndexOf("_");g.id=g.id.substring(0,m===-1?void 0:m)+"_"+k}v.push(g.id),p+=g.outerHTML.replace("<wbr>","")}}),p==="")return s.innerHTML="","";var L=document.createElement("div");if(l)l.lute.SetToC(!0),l.currentMode!=="wysiwyg"||l.preview.element.contains(y)?l.currentMode!=="ir"||l.preview.element.contains(y)?L.innerHTML=l.lute.HTML2VditorDOM("<p>[ToC]</p>"+p):L.innerHTML=l.lute.SpinVditorIRDOM("<p>[ToC]</p>"+p):L.innerHTML=l.lute.SpinVditorDOM("<p>[ToC]</p>"+p),l.lute.SetToC(l.options.preview.markdown.toc);else{s.classList.add("vditor-outline");var E=Lute.New();E.SetToC(!0),L.innerHTML=E.HTML2VditorDOM("<p>[ToC]</p>"+p)}var T=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return T.forEach(function(g,k){if(g.nextElementSibling&&g.nextElementSibling.tagName==="UL"){var m="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(m='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),g.innerHTML=m+"<span>"+g.innerHTML+"</span>"}else g.innerHTML="<svg></svg><span>"+g.innerHTML+"</span>";g.setAttribute("data-target-id",v[k])}),p=L.firstElementChild.innerHTML,T.length===0?(s.innerHTML="",p):(s.innerHTML=p,l&&(0,u.H)(s,{cdn:l.options.cdn,math:l.options.preview.math}),s.firstElementChild.addEventListener("click",function(g){for(var k=g.target;k&&!k.isEqualNode(s);){if(k.classList.contains("vditor-outline__action")){k.classList.contains("vditor-outline__action--close")?(k.classList.remove("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:block")):(k.classList.add("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:none")),g.preventDefault(),g.stopPropagation();break}if(k.getAttribute("data-target-id")){g.preventDefault(),g.stopPropagation();var m=document.getElementById(k.getAttribute("data-target-id"));if(!m)return;if(l)if(l.options.height==="auto"){var C=m.offsetTop+l.element.offsetTop;l.options.toolbarConfig.pin||(C+=l.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,C)}else l.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,l.element.offsetTop),l.preview.element.contains(y)?y.parentElement.scrollTop=m.offsetTop:y.scrollTop=m.offsetTop;else window.scrollTo(window.scrollX,m.offsetTop);break}k=k.parentElement}}),p)}},408:(P,M,f)=>{f.d(M,{B:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var p=c.plantumlRenderAdapter.getElements(s);p.length!==0&&(0,u.G)(l+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){p.forEach(function(v){if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")){var L=c.plantumlRenderAdapter.getCode(v).trim();if(L)try{v.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'"/>'}catch(E){v.className="vditor-reset--error",v.innerHTML="plantuml render error: <br>"+E}}})})}},895:(P,M,f)=>{f.d(M,{X:()=>d});var d=function(u){var c=Lute.New();return c.PutEmojis(u.emojis),c.SetEmojiSite(u.emojiSite),c.SetHeadingAnchor(u.headingAnchor),c.SetInlineMathAllowDigitAfterOpenMarker(u.inlineMathDigit),c.SetAutoSpace(u.autoSpace),c.SetToC(u.toc),c.SetFootnotes(u.footnotes),c.SetFixTermTypo(u.fixTermTypo),c.SetVditorCodeBlockPreview(u.codeBlockPreview),c.SetVditorMathBlockPreview(u.mathBlockPreview),c.SetSanitize(u.sanitize),c.SetChineseParagraphBeginningSpace(u.paragraphBeginningSpace),c.SetRenderListStyle(u.listStyle),c.SetLinkBase(u.linkBase),c.SetLinkPrefix(u.linkPrefix),c.SetMark(u.mark),c.SetGFMAutoLink(u.gfmAutoLink),u.lazyLoadImage&&c.SetImageLazyLoading(u.lazyLoadImage),c}},863:(P,M,f)=>{f.d(M,{E:()=>d});var d=function(u,c,y){y===void 0&&(y="classic");var s=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(y==="dark"?" vditor--dark":"")+`">
  15. <div class="vditor-img__bar">
  16. <span class="vditor-img__btn" data-deg="0">
  17. <svg><use xlink:href="#vditor-icon-redo"></use></svg>
  18. `+window.VditorI18n.spin+`
  19. </span>
  20. <span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
  21. X &nbsp;`+window.VditorI18n.close+`
  22. </span>
  23. </div>
  24. <div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
  25. <img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+s.left+"px, "+(s.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
  26. </div>
  27. </div>`),document.body.style.overflow="hidden";var l=document.querySelector(".vditor-img img"),p="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-u.naturalHeight)/2+"px, 0)";setTimeout(function(){l.setAttribute("style","transition: transform .3s ease-in-out;transform: "+p),setTimeout(function(){l.parentElement.scrollTo((l.parentElement.scrollWidth-l.parentElement.clientWidth)/2,(l.parentElement.scrollHeight-l.parentElement.clientHeight)/2)},400)});var v=document.querySelector(".vditor-img__btn");v.addEventListener("click",function(){var L=parseInt(v.getAttribute("data-deg"),10)+90;L/90%2==1&&u.naturalWidth>l.parentElement.clientHeight?l.style.transform="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+(u.naturalWidth/2-u.naturalHeight/2)+"px, 0) rotateZ("+L+"deg)":l.style.transform=p+" rotateZ("+L+"deg)",v.setAttribute("data-deg",L.toString()),setTimeout(function(){l.parentElement.scrollTo((l.parentElement.scrollWidth-l.parentElement.clientWidth)/2,(l.parentElement.scrollHeight-l.parentElement.clientHeight)/2)},400)})}},312:(P,M,f)=>{f.d(M,{Y:()=>c});var d=f(54),u=f(578),c=function(y,s){s===void 0&&(s=d.g.CDN),d.g.CODE_THEME.includes(y)||(y="github");var l=document.getElementById("vditorHljsStyle"),p=s+"/dist/js/highlight.js/styles/"+y+".css";l?l.getAttribute("href")!==p&&(l.remove(),(0,u.c)(p,"vditorHljsStyle")):(0,u.c)(p,"vditorHljsStyle")}},227:(P,M,f)=>{f.d(M,{Z:()=>u});var d=f(578),u=function(c,y){if(c&&y){var s=document.getElementById("vditorContentTheme"),l=y+"/"+c+".css";s?s.getAttribute("href")!==l&&(s.remove(),(0,d.c)(l,"vditorContentTheme")):(0,d.c)(l,"vditorContentTheme")}}},526:(P,M,f)=>{f.d(M,{G:()=>u,J:()=>d});var d=function(c,y){if(document.getElementById(y))return!1;var s=new XMLHttpRequest;s.open("GET",c,!1),s.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),s.send("");var l=document.createElement("script");l.type="text/javascript",l.text=s.responseText,l.id=y,document.head.appendChild(l)},u=function(c,y){return new Promise(function(s,l){if(document.getElementById(y))return s(),!1;var p=document.createElement("script");p.src=c,p.async=!0,document.head.appendChild(p),p.onerror=function(v){l(v)},p.onload=function(){if(document.getElementById(y))return p.remove(),s(),!1;p.id=y,s()}})}},578:(P,M,f)=>{f.d(M,{c:()=>d});var d=function(u,c){if(!document.getElementById(c)){var y=document.createElement("link");y.id=c,y.rel="stylesheet",y.type="text/css",y.href=u,document.getElementsByTagName("head")[0].appendChild(y)}}},51:(P,M,f)=>{f.d(M,{X:()=>d});var d=function(u){return u.replace(/\u00a0/g," ")}},794:(P,M,f)=>{f.d(M,{G6:()=>d,Le:()=>y,i7:()=>p,ns:()=>l,pK:()=>c,vU:()=>u,yl:()=>s});var d=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},u=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},c=function(){try{return typeof localStorage<"u"}catch(v){return!1}},y=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},s=function(v){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!v.metaKey||v.ctrlKey):!(v.metaKey||!v.ctrlKey)},l=function(v){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?v.indexOf("\u21E7")>-1&&u()&&(v=v.replace(";",":").replace("=","+").replace("-","_")):(v=(v=v.startsWith("\u2318")?v.replace("\u2318","\u2318+"):v.startsWith("\u2325")&&v.substr(1,1)!=="\u2318"?v.replace("\u2325","\u2325+"):v.replace("\u21E7\u2318","\u2318+\u21E7+").replace("\u2325\u2318","\u2325+\u2318+")).replace("\u2318","Ctrl").replace("\u21E7","Shift").replace("\u2325","Alt")).indexOf("Shift")>-1&&(v=v.replace(";",":").replace("=","+").replace("-","_")),v},p=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},835:(P,M,f)=>{f.d(M,{W:()=>d,o:()=>u});var d=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(c){return(parseInt(c,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(c,10)/4).toString(16)})},u=function(c,y){y===void 0&&(y=window.location.search);var s=y.substring(y.indexOf("?")),l=s.indexOf("#");return new URLSearchParams(s.substring(0,l>=0?l:void 0)).get(c)}},827:(P,M,f)=>{f.d(M,{DX:()=>L,E2:()=>c,F9:()=>l,JQ:()=>u,O9:()=>y,a1:()=>s,fb:()=>v,lG:()=>p});var d=f(64),u=function(E,T){for(var g=v(E,T),k=!1,m=!1;g&&!g.classList.contains("vditor-reset")&&!m;)(k=v(g.parentElement,T))?g=k:m=!0;return g||!1},c=function(E,T){for(var g=(0,d.S)(E,T),k=!1,m=!1;g&&!g.classList.contains("vditor-reset")&&!m;)(k=(0,d.S)(g.parentElement,T))?g=k:m=!0;return g||!1},y=function(E){var T=c(E,"UL"),g=c(E,"OL"),k=T;return g&&(!T||T&&g.contains(T))&&(k=g),k},s=function(E,T,g){if(!E)return!1;E.nodeType===3&&(E=E.parentElement);for(var k=E,m=!1;k&&!m&&!k.classList.contains("vditor-reset");)k.getAttribute(T)===g?m=!0:k=k.parentElement;return m&&k},l=function(E){if(!E)return!1;E.nodeType===3&&(E=E.parentElement);var T=E,g=!1,k=s(E,"data-block","0");if(k)return k;for(;T&&!g&&!T.classList.contains("vditor-reset");)T.tagName==="H1"||T.tagName==="H2"||T.tagName==="H3"||T.tagName==="H4"||T.tagName==="H5"||T.tagName==="H6"||T.tagName==="P"||T.tagName==="BLOCKQUOTE"||T.tagName==="OL"||T.tagName==="UL"?g=!0:T=T.parentElement;return g&&T},p=function(E,T){if(!E)return!1;E.nodeType===3&&(E=E.parentElement);for(var g=E,k=!1;g&&!k&&!g.classList.contains("vditor-reset");)g.nodeName===T?k=!0:g=g.parentElement;return k&&g},v=function(E,T){if(!E)return!1;E.nodeType===3&&(E=E.parentElement);for(var g=E,k=!1;g&&!k&&!g.classList.contains("vditor-reset");)g.classList.contains(T)?k=!0:g=g.parentElement;return k&&g},L=function(E){for(;E&&E.lastChild;)E=E.lastChild;return E}},64:(P,M,f)=>{f.d(M,{S:()=>d,W:()=>u});var d=function(c,y){if(!c)return!1;c.nodeType===3&&(c=c.parentElement);for(var s=c,l=!1;s&&!l&&!s.classList.contains("vditor-reset");)s.nodeName.indexOf(y)===0?l=!0:s=s.parentElement;return l&&s},u=function(c){var y=d(c,"H");return!(!y||y.tagName.length!==2||y.tagName==="HR")&&y}},640:(P,M,f)=>{f.d(M,{T:()=>d});var d=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];for(var y={},s=function(p){for(var v in p)p.hasOwnProperty(v)&&(Object.prototype.toString.call(p[v])==="[object Object]"?y[v]=d(y[v],p[v]):y[v]=p[v])},l=0;l<u.length;l++)s(u[l]);return y}},393:(P,M,f)=>{f.d(M,{$j:()=>L,Gb:()=>l,Hc:()=>p,Ny:()=>s,ib:()=>E,im:()=>v,oC:()=>T,zh:()=>y});var d=f(54),u=f(794),c=f(827),y=function(g){var k,m=g[g.currentMode].element;return getSelection().rangeCount>0&&(k=getSelection().getRangeAt(0),m.isEqualNode(k.startContainer)||m.contains(k.startContainer))?k:g[g.currentMode].range?g[g.currentMode].range:(m.focus(),(k=m.ownerDocument.createRange()).setStart(m,0),k.collapse(!0),k)},s=function(g){var k=window.getSelection().getRangeAt(0);if(!g.contains(k.startContainer)&&!(0,c.fb)(k.startContainer,"vditor-panel--none"))return{left:0,top:0};var m,C=g.parentElement.getBoundingClientRect();if(k.getClientRects().length===0)if(k.startContainer.nodeType===3){var O=k.startContainer.parentElement;if(!(O&&O.getClientRects().length>0))return{left:0,top:0};m=O.getClientRects()[0]}else{var j=k.startContainer.children;if(j[k.startOffset]&&j[k.startOffset].getClientRects().length>0)m=j[k.startOffset].getClientRects()[0];else if(k.startContainer.childNodes.length>0){var x=k.cloneRange();k.selectNode(k.startContainer.childNodes[Math.max(0,k.startOffset-1)]),m=k.getClientRects()[0],k.setEnd(x.endContainer,x.endOffset),k.setStart(x.startContainer,x.startOffset)}else m=k.startContainer.getClientRects()[0];if(!m){for(var V=k.startContainer.childNodes[k.startOffset];!V.getClientRects||V.getClientRects&&V.getClientRects().length===0;)V=V.parentElement;m=V.getClientRects()[0]}}else m=k.getClientRects()[0];return{left:m.left-C.left,top:m.top-C.top}},l=function(g,k){if(!k){if(getSelection().rangeCount===0)return!1;k=getSelection().getRangeAt(0)}var m=k.commonAncestorContainer;return g.isEqualNode(m)||g.contains(m)},p=function(g){var k=window.getSelection();k.removeAllRanges(),k.addRange(g)},v=function(g,k,m){var C={end:0,start:0};if(!m){if(getSelection().rangeCount===0)return C;m=window.getSelection().getRangeAt(0)}if(l(k,m)){var O=m.cloneRange();g.childNodes[0]&&g.childNodes[0].childNodes[0]?O.setStart(g.childNodes[0].childNodes[0],0):O.selectNodeContents(g),O.setEnd(m.startContainer,m.startOffset),C.start=O.toString().length,C.end=C.start+m.toString().length}return C},L=function(g,k,m){var C=0,O=0,j=m.childNodes[O],x=!1,V=!1;g=Math.max(0,g),k=Math.max(0,k);var ie=m.ownerDocument.createRange();for(ie.setStart(j||m,0),ie.collapse(!0);!V&&j;){var me=C+j.textContent.length;if(!x&&g>=C&&g<=me&&(g===0?ie.setStart(j,0):j.childNodes[0].nodeType===3?ie.setStart(j.childNodes[0],g-C):j.nextSibling?ie.setStartBefore(j.nextSibling):ie.setStartAfter(j),x=!0,g===k)){V=!0;break}x&&k>=C&&k<=me&&(k===0?ie.setEnd(j,0):j.childNodes[0].nodeType===3?ie.setEnd(j.childNodes[0],k-C):j.nextSibling?ie.setEndBefore(j.nextSibling):ie.setEndAfter(j),V=!0),C=me,j=m.childNodes[++O]}return!V&&m.childNodes[O-1]&&ie.setStartBefore(m.childNodes[O-1]),p(ie),ie},E=function(g,k){var m=g.querySelector("wbr");if(m){if(m.previousElementSibling)if(m.previousElementSibling.isSameNode(m.previousSibling)){if(m.previousElementSibling.lastChild)return k.setStartBefore(m),k.collapse(!0),p(k),!(0,u.i7)()||m.previousElementSibling.tagName!=="EM"&&m.previousElementSibling.tagName!=="STRONG"&&m.previousElementSibling.tagName!=="S"||(k.insertNode(document.createTextNode(d.g.ZWSP)),k.collapse(!1)),void m.remove();k.setStartAfter(m.previousElementSibling)}else k.setStart(m.previousSibling,m.previousSibling.textContent.length);else m.previousSibling?k.setStart(m.previousSibling,m.previousSibling.textContent.length):m.nextSibling?m.nextSibling.nodeType===3?k.setStart(m.nextSibling,0):k.setStartBefore(m.nextSibling):k.setStart(m.parentElement,0);k.collapse(!0),m.remove(),p(k)}},T=function(g,k){var m=document.createElement("div");m.innerHTML=g;var C=m.querySelectorAll("p");C.length===1&&!C[0].previousSibling&&!C[0].nextSibling&&k[k.currentMode].element.children.length>0&&m.firstElementChild.tagName==="P"&&(g=C[0].innerHTML.trim());var O=document.createElement("div");O.innerHTML=g;var j=y(k);if(j.toString()!==""&&(k[k.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),O.firstElementChild&&O.firstElementChild.getAttribute("data-block")==="0"){O.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var x=(0,c.F9)(j.startContainer);x?x.insertAdjacentHTML("afterend",O.innerHTML):k[k.currentMode].element.insertAdjacentHTML("beforeend",O.innerHTML),E(k[k.currentMode].element,j)}else{var V=document.createElement("template");V.innerHTML=g,j.insertNode(V.content.cloneNode(!0)),j.collapse(!1),p(j)}}}},Ne={};function K(P){var M=Ne[P];if(M!==void 0)return M.exports;var f=Ne[P]={exports:{}};return He[P](f,f.exports,K),f.exports}K.d=(P,M)=>{for(var f in M)K.o(M,f)&&!K.o(P,f)&&Object.defineProperty(P,f,{enumerable:!0,get:M[f]})},K.o=(P,M)=>Object.prototype.hasOwnProperty.call(P,M),K.r=P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})};var De={};return(()=>{K.d(De,{default:()=>xi});var P,M=K(872),f=K(54),d=K(51),u=function(e){return e.currentMode==="sv"?(0,d.X)((e.sv.element.textContent+`
  28. `).replace(/\n\n$/,`
  29. `)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},c=K(526),y=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(t){var n=this;t.devtools.element.style.display==="block"&&(0,c.G)(t.options.cdn+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){n.ASTChart||(n.ASTChart=echarts.init(t.devtools.element.lastElementChild));try{n.element.lastElementChild.style.display="block",n.element.firstElementChild.innerHTML="",n.ASTChart.setOption({series:[{data:JSON.parse(t.lute.RenderEChartsJSON(u(t))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),n.ASTChart.resize()}catch(i){n.element.lastElementChild.style.display="none",n.element.firstElementChild.innerHTML=i}})},e}(),s=K(794),l=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains("vditor-menu--current")&&i.classList.remove("vditor-menu--current")}})},p=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains("vditor-menu--current")&&i.classList.add("vditor-menu--current")}})},v=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains(f.g.CLASS_MENU_DISABLED)&&i.classList.remove(f.g.CLASS_MENU_DISABLED)}})},L=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains(f.g.CLASS_MENU_DISABLED)&&i.classList.add(f.g.CLASS_MENU_DISABLED)}})},E=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="none")})},T=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="block")})},g=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(i){n&&i.isEqualNode(n)||(i.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},k=function(e,t,n,i){n.addEventListener((0,s.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(f.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(o){o.classList.remove("vditor-hint--current")}),t.style.display==="block"?t.style.display="none":(g(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},m=K(827),C=K(64),O=function(e,t,n,i){},j=K(478),x=K(314),V=K(730),ie=K(66),me=K(218),fe=K(702),de=K(466),ve=K(40),Se=K(563),ke=K(749),Pe=K(408),ye=function(e,t){if(e)if(e.parentElement.getAttribute("data-type")!=="html-block"){var n=e.firstElementChild.className.replace("language-","");n==="abc"?(0,j.Q)(e,t.options.cdn):n==="mermaid"?(0,ve.i)(e,t.options.cdn,t.options.theme):n==="markmap"?(0,Se.K)(e,t.options.cdn,t.options.theme):n==="flowchart"?(0,ie.P)(e,t.options.cdn):n==="echarts"?(0,x.p)(e,t.options.cdn,t.options.theme):n==="mindmap"?(0,ke.P)(e,t.options.cdn,t.options.theme):n==="plantuml"?(0,Pe.B)(e,t.options.cdn):n==="graphviz"?(0,me.v)(e,t.options.cdn):n==="math"?(0,de.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(i){if(i.language===n)return i.render(e,t),!0})||((0,fe.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,V.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},_=K(393),ge=function(e){if(e.currentMode!=="sv"){var t=e[e.currentMode].element,n=e.outline.render(e);n===""&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(i){i.innerHTML=n,(0,de.H)(i,{cdn:e.options.cdn,math:e.options.preview.math})})}},ee=function(e,t){var n=(0,m.lG)(e.target,"SPAN");if(n&&(0,m.fb)(n,"vditor-toc")){var i=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(i)if(t.options.height==="auto"){var r=i.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(r+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,r)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=i.offsetTop}},N=function(e,t,n,i){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if(n.key==="Backspace"&&(0,_.im)(e,t[t.currentMode].element,i).start===0)return e.previousElementSibling.remove(),pe(t),!0;if(at(t,n,i,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if(n.key==="Delete"&&(0,_.im)(e,t[t.currentMode].element,i).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),pe(t),!0;if(bt(t,n,i,e,e.nextElementSibling))return!0}if(n.key==="Backspace"||n.key==="Delete"){var r=(0,m.fb)(i.startContainer,"vditor-toc");if(r)return r.remove(),pe(t),!0}},J=function(e,t,n,i){n===void 0&&(n=!1);var r=(0,m.F9)(t.startContainer);if(r&&!n&&r.getAttribute("data-type")!=="code-block"){if(Jt(r.innerHTML)&&r.previousElementSibling||Zt(r.innerHTML))return;for(var o=(0,_.im)(r,e.ir.element,t).start,a=!0,h=o-1;h>r.textContent.substr(0,o).lastIndexOf(`
  30. `);h--)if(r.textContent.charAt(h)!==" "&&r.textContent.charAt(h)!==" "){a=!1;break}o===0&&(a=!1);var w=!0;for(h=o-1;h<r.textContent.length;h++)if(r.textContent.charAt(h)!==" "&&r.textContent.charAt(h)!==`
  31. `){w=!1;break}if(a)return void(typeof e.options.input=="function"&&e.options.input(u(e)));if(w&&!(0,m.fb)(t.startContainer,"vditor-ir__marker")){var S=t.startContainer.previousSibling;return S&&S.nodeType!==3&&S.classList.contains("vditor-ir__node--expand")&&S.classList.remove("vditor-ir__node--expand"),void(typeof e.options.input=="function"&&e.options.input(u(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(Q){Q.classList.remove("vditor-ir__node--expand")}),r||(r=e.ir.element),!r.querySelector("wbr")){var b=(0,m.fb)(t.startContainer,"vditor-ir__preview");b?b.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}r.querySelectorAll("[style]").forEach(function(Q){Q.removeAttribute("style")}),r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.ir.element);var H,B=r.isEqualNode(e.ir.element),G=(0,m.a1)(r,"data-type","footnotes-block"),A="";if(B)A=r.innerHTML;else{var U=(0,C.S)(t.startContainer,"BLOCKQUOTE"),z=(0,m.O9)(t.startContainer);if(z&&(r=z),U&&(!z||z&&!U.contains(z))&&(r=U),G&&(r=G),A=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var q=r.previousElementSibling,F=r.nextElementSibling;!q||q.tagName!=="UL"&&q.tagName!=="OL"||(A=q.outerHTML+A,q.remove()),!F||F.tagName!=="UL"&&F.tagName!=="OL"||(A+=F.outerHTML,F.remove()),A=A.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else r.previousElementSibling&&r.previousElementSibling.textContent.replace(f.g.ZWSP,"")!==""&&i&&i.inputType==="insertParagraph"&&(A=r.previousElementSibling.outerHTML+A,r.previousElementSibling.remove());r.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Q){Q&&!r.isEqualNode(Q)&&(A+=Q.outerHTML,Q.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(Q){Q&&!r.isEqualNode(Q)&&(A+=Q.outerHTML,Q.remove())}))}if(O("SpinVditorIRDOM",A,"argument",e.options.debugger),A=e.lute.SpinVditorIRDOM(A),O("SpinVditorIRDOM",A,"result",e.options.debugger),B)r.innerHTML=A;else if(r.outerHTML=A,G){var W=(0,m.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(W){var R=W.textContent,Y=R.substring(1,R.indexOf("]:")),se=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+Y+'"]');se&&se.setAttribute("aria-label",R.substr(Y.length+3).trim().substr(0,24))}}var ne,le=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");le.forEach(function(Q,ce){ce===0?H=Q:(H.insertAdjacentHTML("beforeend",Q.innerHTML),Q.remove())}),le.length>0&&e.ir.element.insertAdjacentElement("beforeend",le[0]);var ae=e.ir.element.querySelectorAll("[data-type='footnotes-block']");ae.forEach(function(Q,ce){ce===0?ne=Q:(ne.insertAdjacentHTML("beforeend",Q.innerHTML),Q.remove())}),ae.length>0&&e.ir.element.insertAdjacentElement("beforeend",ae[0]),(0,_.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(Q){ye(Q,e)}),ge(e),Je(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},I=function(e,t){if(e==="")return!1;if(e.indexOf("\u21E7")===-1&&e.indexOf("\u2318")===-1&&e.indexOf("\u2325")===-1)return!((0,s.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if(e==="\u21E7Tab")return!((0,s.yl)(t)||t.altKey||!t.shiftKey||t.code!=="Tab");var n=e.split("");if(e.startsWith("\u2325")){var i=n.length===3?n[2]:n[1];return!((n.length===3?!(0,s.yl)(t):(0,s.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(i)?"Digit":"Key")+i)}e==="\u2318Enter"&&(n=["\u2318","Enter"]);var r=n.length>2&&n[0]==="\u21E7",o=r?n[2]:n[1];return!r||!(0,s.vU)()&&/Mac/.test(navigator.platform)||(o==="-"?o="_":o==="="&&(o="+")),!(!(0,s.yl)(t)||t.key.toLowerCase()!==o.toLowerCase()||t.altKey||!(!r&&!t.shiftKey||r&&t.shiftKey))},D=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(a){a.classList.remove("vditor-ir__node--expand")});var n=(0,m.JQ)(e.startContainer,"vditor-ir__node"),i=!e.collapsed&&(0,m.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===i){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,_.Hc)(e));var r=function(a){var h=a.startContainer;if(h.nodeType===3&&h.nodeValue.length!==a.startOffset)return!1;for(var w=h.nextSibling;w&&w.textContent==="";)w=w.nextSibling;if(!w){var S=(0,m.fb)(h,"vditor-ir__marker");if(S&&!S.nextSibling){var b=h.parentElement.parentElement.nextSibling;if(b&&b.nodeType!==3&&b.classList.contains("vditor-ir__node"))return b}return!1}return!(!w||w.nodeType===3||!w.classList.contains("vditor-ir__node")||w.getAttribute("data-block"))&&w}(e);if(r)return r.classList.add("vditor-ir__node--expand"),void r.classList.remove("vditor-ir__node--hidden");var o=function(a){var h=a.startContainer,w=h.previousSibling;return!(h.nodeType!==3||a.startOffset!==0||!w||w.nodeType===3||!w.classList.contains("vditor-ir__node")||w.getAttribute("data-block"))&&w}(e);return o?(o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden")):void 0}},re=K(863),$=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(n){for(var i=n.parentElement,r=i.nextSibling;r&&r.textContent.startsWith(" ");){var o=r;o.childNodes.forEach(function(a){i.append(a.cloneNode(!0))}),r=r.nextSibling,o.remove()}t&&t(i)})},te=function(e,t){var n,i=getSelection().getRangeAt(0).cloneRange(),r=i.startContainer;i.startContainer.nodeType!==3&&i.startContainer.tagName==="DIV"&&(r=i.startContainer.childNodes[i.startOffset-1]);var o=(0,m.a1)(r,"data-block","0");if(o&&t&&(t.inputType==="deleteContentBackward"||t.data===" ")){for(var a=(0,_.im)(o,e.sv.element,i).start,h=!0,w=a-1;w>o.textContent.substr(0,a).lastIndexOf(`
  32. `);w--)if(o.textContent.charAt(w)!==" "&&o.textContent.charAt(w)!==" "){h=!1;break}if(a===0&&(h=!1),h)return void Ae(e);if(t.inputType==="deleteContentBackward"){var S=(0,m.a1)(r,"data-type","code-block-open-marker")||(0,m.a1)(r,"data-type","code-block-close-marker");if(S){var b;if(S.getAttribute("data-type")==="code-block-close-marker"&&(b=Tt(r,"code-block-open-marker"))||S.getAttribute("data-type")==="code-block-open-marker"&&(b=Tt(r,"code-block-close-marker",!1)))return b.textContent=S.textContent,void Ae(e)}var H=(0,m.a1)(r,"data-type","math-block-open-marker");if(H){var B=H.nextElementSibling.nextElementSibling;return void(B&&B.getAttribute("data-type")==="math-block-close-marker"&&(B.remove(),Ae(e)))}o.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(q){q.textContent.length===1&&q.remove()}),o.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(q){q.textContent.length===1&&q.remove()});var G=(0,m.a1)(r,"data-type","heading-marker");if(G&&G.textContent.indexOf("#")===-1)return void Ae(e)}if((t.data===" "||t.inputType==="deleteContentBackward")&&((0,m.a1)(r,"data-type","padding")||(0,m.a1)(r,"data-type","li-marker")||(0,m.a1)(r,"data-type","task-marker")||(0,m.a1)(r,"data-type","blockquote-marker")))return void Ae(e)}if(o&&o.textContent.trimRight()==="$$")Ae(e);else{o||(o=e.sv.element),((n=o.firstElementChild)===null||n===void 0?void 0:n.getAttribute("data-type"))==="link-ref-defs-block"&&(o=e.sv.element),(0,m.a1)(r,"data-type","footnotes-link")&&(o=e.sv.element),o.textContent.indexOf(Lute.Caret)===-1&&i.insertNode(document.createTextNode(Lute.Caret)),o.querySelectorAll("[style]").forEach(function(q){q.removeAttribute("style")}),o.querySelectorAll("font").forEach(function(q){q.outerHTML=q.innerHTML});var A=o.textContent,U=o.isEqualNode(e.sv.element);if(U)A=o.textContent;else{o.previousElementSibling&&(A=o.previousElementSibling.textContent+A,o.previousElementSibling.remove()),o.previousElementSibling&&A.indexOf(`---
  33. `)===0&&(A=o.previousElementSibling.textContent+A,o.previousElementSibling.remove());var z="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(q,F){q&&!o.isEqualNode(q.parentElement)&&(z+=q.parentElement.textContent+`
  34. `,q.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(q,F){q&&!o.isEqualNode(q.parentElement)&&(z+=q.parentElement.textContent+`
  35. `,q.parentElement.remove())}),A=z+A}A=un(A,e),U?o.innerHTML=A:o.outerHTML=A,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(q){e.sv.element.insertAdjacentElement("beforeend",q.parentElement)}),$(e.sv.element,function(q){e.sv.element.insertAdjacentElement("beforeend",q)}),(0,_.ib)(e.sv.element,i),Te(e),Ae(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},Z=K(227),ue=function(e){e.options.theme==="dark"?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},he=function(e){var t=window.innerWidth<=f.g.MOBILE_WIDTH?10:35;if(e.wysiwyg.element.parentElement.style.display!=="none"){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px "+Math.max(t,n)+"px"}e.ir.element.parentElement.style.display!=="none"&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px "+Math.max(t,n)+"px"),e.preview.element.style.display!=="block"?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0)+"px"},oe=function(e){if(e.options.typewriterMode){var t=window.innerHeight;typeof e.options.height=="number"?(t=e.options.height,typeof e.options.minHeight=="number"&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function Xe(){window.removeEventListener("resize",P)}var $e,nn,ar=function(e){oe(e),Xe(),window.addEventListener("resize",P=function(){he(e),oe(e)});var t=(0,s.pK)()&&localStorage.getItem(e.options.cache.id);return e.options.cache.enable&&t||(e.options.value?t=e.options.value:e.originalInnerHTML?t=e.lute.HTML2Md(e.originalInnerHTML):e.options.cache.enable||(t="")),t||""},ht=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if(e[e.currentMode].element.getAttribute("contenteditable")!=="false"&&(0,_.Gb)(e[e.currentMode].element)){l(e.toolbar.elements,f.g.EDIT_TOOLBARS),v(e.toolbar.elements,f.g.EDIT_TOOLBARS);var t=(0,_.zh)(e),n=t.startContainer;t.startContainer.nodeType===3&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),(e.currentMode==="sv"?(0,m.a1)(n,"data-type","heading"):(0,C.W)(n))&&p(e.toolbar.elements,["headings"]),(e.currentMode==="sv"?(0,m.a1)(n,"data-type","blockquote"):(0,m.lG)(n,"BLOCKQUOTE"))&&p(e.toolbar.elements,["quote"]),(0,m.a1)(n,"data-type","strong")&&p(e.toolbar.elements,["bold"]),(0,m.a1)(n,"data-type","em")&&p(e.toolbar.elements,["italic"]),(0,m.a1)(n,"data-type","s")&&p(e.toolbar.elements,["strike"]),(0,m.a1)(n,"data-type","a")&&p(e.toolbar.elements,["link"]);var i=(0,m.lG)(n,"LI");i?(i.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):i.parentElement.tagName==="OL"?p(e.toolbar.elements,["ordered-list"]):i.parentElement.tagName==="UL"&&p(e.toolbar.elements,["list"]),v(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,m.a1)(n,"data-type","code-block")&&(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),p(e.toolbar.elements,["code"])),(0,m.a1)(n,"data-type","code")&&(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])),(0,m.a1)(n,"data-type","table")&&L(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},we=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=u(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},rn=function(e){for(var t="",n=e.nextSibling;n;)n.nodeType===3?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},on=function(e){for(var t="",n=e.previousSibling;n;)t=n.nodeType===3?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},an=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(n.nodeType===3){var i=document.createElement("p");i.setAttribute("data-block","0"),i.textContent=n.textContent;var r=t.startContainer.nodeType===3?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(i,n),n.remove(),t.setStart(i.firstChild,Math.min(i.firstChild.textContent.length,r)),t.collapse(!0),(0,_.Hc)(t),!0}if(!n.getAttribute("data-block"))return n.tagName==="P"?n.remove():(n.tagName==="DIV"?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>"):n.tagName==="BR"?n.outerHTML='<p data-block="0">'+n.outerHTML+"<wbr></p>":(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.outerHTML+"</p>"),(0,_.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},Mt=function(e,t){var n=(0,_.zh)(e),i=(0,m.F9)(n.startContainer);i||(i=n.startContainer.childNodes[n.startOffset]),i||e.wysiwyg.element.children.length!==0||(i=e.wysiwyg.element),i&&!i.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),i.innerHTML.trim()==="<wbr>"&&(i.innerHTML="<wbr><br>"),i.tagName==="BLOCKQUOTE"||i.classList.contains("vditor-reset")?i.innerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">":i.outerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">",(0,_.ib)(e.wysiwyg.element,n),ge(e))},Pt=function(e){var t=getSelection().getRangeAt(0),n=(0,m.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>",(0,_.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},vt=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling,r=i.ownerDocument.createRange();i.tagName==="CODE"?(i.style.display="inline-block",n?r.setStart(i.firstChild,1):r.selectNodeContents(i)):(i.style.display="block",i.firstChild.firstChild||i.firstChild.appendChild(document.createTextNode("")),r.selectNodeContents(i.firstChild)),n?r.collapse(!0):r.collapse(!1),(0,_.Hc)(r),e.firstElementChild.classList.contains("language-mindmap")||Te(t)},Ie=function(e,t){if(I("\u21E7\u2318X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},et=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(e.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,_.Gb)(e.wysiwyg.element)){l(e.toolbar.elements,f.g.EDIT_TOOLBARS),v(e.toolbar.elements,f.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=t.startContainer.nodeType===3?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var i=(0,m.a1)(n,"data-type","footnotes-block");if(i)return e.wysiwyg.popover.innerHTML="",Ue(i,e),void Ve(e,i);var r=(0,m.lG)(n,"LI");r?(r.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):r.parentElement.tagName==="OL"?p(e.toolbar.elements,["ordered-list"]):r.parentElement.tagName==="UL"&&p(e.toolbar.elements,["list"]),v(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,m.lG)(n,"BLOCKQUOTE")&&p(e.toolbar.elements,["quote"]),((0,m.lG)(n,"B")||(0,m.lG)(n,"STRONG"))&&p(e.toolbar.elements,["bold"]),((0,m.lG)(n,"I")||(0,m.lG)(n,"EM"))&&p(e.toolbar.elements,["italic"]),((0,m.lG)(n,"STRIKE")||(0,m.lG)(n,"S"))&&p(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(X){X.classList.remove("vditor-comment--focus")});var o=(0,m.fb)(n,"vditor-comment");if(o){var a=o.getAttribute("data-cmtids").split(" ");if(a.length>1&&o.nextSibling.isSameNode(o.nextElementSibling)){var h=o.nextElementSibling.getAttribute("data-cmtids").split(" ");a.find(function(X){if(h.includes(X))return a=[X],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(X){X.getAttribute("data-cmtids").indexOf(a[0])>-1&&X.classList.add("vditor-comment--focus")})}var w=(0,m.lG)(n,"A");w&&p(e.toolbar.elements,["link"]);var S=(0,m.lG)(n,"TABLE"),b=(0,C.W)(n);(0,m.lG)(n,"CODE")?(0,m.lG)(n,"PRE")?(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),p(e.toolbar.elements,["code"])):(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])):b?(L(e.toolbar.elements,["bold"]),p(e.toolbar.elements,["headings"])):S&&L(e.toolbar.elements,["table"]);var H=(0,m.fb)(n,"vditor-toc");if(H)return e.wysiwyg.popover.innerHTML="",Ue(H,e),void Ve(e,H);var B=(0,C.S)(n,"BLOCKQUOTE");if(B&&(e.wysiwyg.popover.innerHTML="",rt(t,B,e),it(t,B,e),Ue(B,e),Ve(e,B)),r&&(e.wysiwyg.popover.innerHTML="",rt(t,r,e),it(t,r,e),Ue(r,e),Ve(e,r)),S){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var G=function(){var X=S.rows.length,Ee=S.rows[0].cells.length,nt=parseInt(ce.value,10)||X,Qe=parseInt(Me.value,10)||Ee;if(nt!==X||Ee!==Qe){if(Ee!==Qe)for(var Bn=Qe-Ee,ct=0;ct<S.rows.length;ct++)if(Bn>0)for(var Vn=0;Vn<Bn;Vn++)ct===0?S.rows[ct].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):S.rows[ct].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var $t=Ee-1;$t>=Qe;$t--)S.rows[ct].cells[$t].remove();if(X!==nt){var Un=nt-X;if(Un>0){for(var en="<tr>",dt=0;dt<Qe;dt++)en+="<td> </td>";for(var Wn=0;Wn<Un;Wn++)S.querySelector("tbody")?S.querySelector("tbody").insertAdjacentHTML("beforeend",en):S.querySelector("thead").insertAdjacentHTML("afterend",en+"</tr>")}else for(dt=X-1;dt>=nt;dt--)S.rows[dt].remove(),S.rows.length===1&&S.querySelector("tbody").remove()}typeof e.options.input=="function"&&e.options.input(u(e))}},A=function(X){xt(S,X),X==="right"?(F.classList.remove("vditor-icon--current"),W.classList.remove("vditor-icon--current"),R.classList.add("vditor-icon--current")):X==="center"?(F.classList.remove("vditor-icon--current"),R.classList.remove("vditor-icon--current"),W.classList.add("vditor-icon--current")):(W.classList.remove("vditor-icon--current"),R.classList.remove("vditor-icon--current"),F.classList.add("vditor-icon--current")),(0,_.Hc)(t),we(e)},U=(0,m.lG)(n,"TD"),z=(0,m.lG)(n,"TH"),q="left";U?q=U.getAttribute("align")||"left":z&&(q=z.getAttribute("align")||"center");var F=document.createElement("button");F.setAttribute("type","button"),F.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,s.ns)("\u21E7\u2318L")+">"),F.setAttribute("data-type","left"),F.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',F.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(q==="left"?" vditor-icon--current":""),F.onclick=function(){A("left")};var W=document.createElement("button");W.setAttribute("type","button"),W.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,s.ns)("\u21E7\u2318C")+">"),W.setAttribute("data-type","center"),W.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',W.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(q==="center"?" vditor-icon--current":""),W.onclick=function(){A("center")};var R=document.createElement("button");R.setAttribute("type","button"),R.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,s.ns)("\u21E7\u2318R")+">"),R.setAttribute("data-type","right"),R.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',R.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(q==="right"?" vditor-icon--current":""),R.onclick=function(){A("right")};var Y=document.createElement("button");Y.setAttribute("type","button"),Y.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,s.ns)("\u2318=")+">"),Y.setAttribute("data-type","insertRow"),Y.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',Y.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Y.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,m.lG)(X,"TD")||(0,m.lG)(X,"TH");Ee&&kn(e,t,Ee)};var se=document.createElement("button");se.setAttribute("type","button"),se.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,s.ns)("\u21E7\u2318F")+">"),se.setAttribute("data-type","insertRow"),se.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',se.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",se.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,m.lG)(X,"TD")||(0,m.lG)(X,"TH");Ee&&Sn(e,t,Ee)};var ne=document.createElement("button");ne.setAttribute("type","button"),ne.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,s.ns)("\u21E7\u2318=")+">"),ne.setAttribute("data-type","insertColumn"),ne.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',ne.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",ne.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,m.lG)(X,"TD")||(0,m.lG)(X,"TH");Ee&&Ht(e,S,Ee)};var le=document.createElement("button");le.setAttribute("type","button"),le.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,s.ns)("\u21E7\u2318G")+">"),le.setAttribute("data-type","insertColumn"),le.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',le.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",le.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,m.lG)(X,"TD")||(0,m.lG)(X,"TH");Ee&&Ht(e,S,Ee,"beforebegin")};var ae=document.createElement("button");ae.setAttribute("type","button"),ae.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,s.ns)("\u2318-")+">"),ae.setAttribute("data-type","deleteRow"),ae.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',ae.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",ae.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,m.lG)(X,"TD")||(0,m.lG)(X,"TH");Ee&&Ln(e,t,Ee)};var Q=document.createElement("button");Q.setAttribute("type","button"),Q.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,s.ns)("\u21E7\u2318-")+">"),Q.setAttribute("data-type","deleteColumn"),Q.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',Q.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Q.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,m.lG)(X,"TD")||(0,m.lG)(X,"TH");Ee&&Mn(e,t,S,Ee)},(We=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),We.className="vditor-tooltipped vditor-tooltipped__n";var ce=document.createElement("input");We.appendChild(ce),ce.type="number",ce.min="1",ce.className="vditor-input",ce.style.width="42px",ce.style.textAlign="center",ce.setAttribute("placeholder",window.VditorI18n.row),ce.value=S.rows.length.toString(),ce.oninput=function(){G()},ce.onkeydown=function(X){if(!X.isComposing)return X.key==="Tab"?(Me.focus(),Me.select(),void X.preventDefault()):void(Ie(e,X)||Ge(X,t))};var be=document.createElement("span");be.setAttribute("aria-label",window.VditorI18n.column),be.className="vditor-tooltipped vditor-tooltipped__n";var Me=document.createElement("input");be.appendChild(Me),Me.type="number",Me.min="1",Me.className="vditor-input",Me.style.width="42px",Me.style.textAlign="center",Me.setAttribute("placeholder",window.VditorI18n.column),Me.value=S.rows[0].cells.length.toString(),Me.oninput=function(){G()},Me.onkeydown=function(X){if(!X.isComposing)return X.key==="Tab"?(ce.focus(),ce.select(),void X.preventDefault()):void(Ie(e,X)||Ge(X,t))},rt(t,S,e),it(t,S,e),Ue(S,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",F),e.wysiwyg.popover.insertAdjacentElement("beforeend",W),e.wysiwyg.popover.insertAdjacentElement("beforeend",R),e.wysiwyg.popover.insertAdjacentElement("beforeend",se),e.wysiwyg.popover.insertAdjacentElement("beforeend",Y),e.wysiwyg.popover.insertAdjacentElement("beforeend",le),e.wysiwyg.popover.insertAdjacentElement("beforeend",ne),e.wysiwyg.popover.insertAdjacentElement("beforeend",ae),e.wysiwyg.popover.insertAdjacentElement("beforeend",Q),e.wysiwyg.popover.insertAdjacentElement("beforeend",We),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",be),Ve(e,S)}var Ze=(0,m.a1)(n,"data-type","link-ref");Ze&&ln(e,Ze,t);var je=(0,m.a1)(n,"data-type","footnotes-ref");if(je){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(We=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,s.ns)("\u2325Enter")+">"),We.className="vditor-tooltipped vditor-tooltipped__n";var qe=document.createElement("input");We.appendChild(qe),qe.className="vditor-input",qe.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,s.ns)("\u2325Enter")+">"),qe.style.width="120px",qe.value=je.getAttribute("data-footnotes-label"),qe.oninput=function(){qe.value.trim()!==""&&je.setAttribute("data-footnotes-label",qe.value),typeof e.options.input=="function"&&e.options.input(u(e))},qe.onkeydown=function(X){X.isComposing||Ie(e,X)||Ge(X,t)},Ue(je,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",We),Ve(e,je)}var _e=(0,m.fb)(n,"vditor-wysiwyg__block"),lt=!!_e&&_e.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(X){(!_e||_e&&lt&&!_e.contains(X))&&(X.previousElementSibling.style.display="none")}),_e&&lt){if(e.wysiwyg.popover.innerHTML="",rt(t,_e,e),it(t,_e,e),Ue(_e,e),_e.getAttribute("data-type")==="code-block"){var Dt=document.createElement("span");Dt.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,s.ns)("\u2325Enter")+">"),Dt.className="vditor-tooltipped vditor-tooltipped__n";var ze=document.createElement("input");Dt.appendChild(ze);var Et=_e.firstElementChild.firstElementChild;ze.className="vditor-input",ze.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,s.ns)("\u2325Enter")+">"),ze.value=Et.className.indexOf("language-")>-1?Et.className.split("-")[1].split(" ")[0]:"",ze.oninput=function(X){ze.value.trim()!==""?Et.className="language-"+ze.value:(Et.className="",e.hint.recentLanguage=""),_e.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(_e.lastElementChild.innerHTML=_e.firstElementChild.innerHTML,ye(_e.lastElementChild,e)),we(e),X.detail===1&&(t.setStart(Et.firstChild,0),t.collapse(!0),(0,_.Hc)(t))},ze.onkeydown=function(X){if(!X.isComposing&&!Ie(e,X)){if(X.key==="Escape"&&e.hint.element.style.display==="block")return e.hint.element.style.display="none",void X.preventDefault();e.hint.select(X,e),Ge(X,t)}},ze.onkeyup=function(X){if(!X.isComposing&&X.key!=="Enter"&&X.key!=="ArrowUp"&&X.key!=="Escape"&&X.key!=="ArrowDown"){var Ee=[],nt=ze.value.substring(0,ze.selectionStart);(e.options.preview.hljs.langs||f.g.CODE_LANGUAGES).forEach(function(Qe){Qe.indexOf(nt.toLowerCase())>-1&&Ee.push({html:Qe,value:Qe})}),e.hint.genHTML(Ee,nt,e),X.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",Dt)}Ve(e,_e)}else _e=void 0;if(b){var We;e.wysiwyg.popover.innerHTML="",(We=document.createElement("span")).setAttribute("aria-label","ID<"+(0,s.ns)("\u2325Enter")+">"),We.className="vditor-tooltipped vditor-tooltipped__n";var Ye=document.createElement("input");We.appendChild(Ye),Ye.className="vditor-input",Ye.setAttribute("placeholder","ID<"+(0,s.ns)("\u2325Enter")+">"),Ye.style.width="120px",Ye.value=b.getAttribute("data-id")||"",Ye.oninput=function(){b.setAttribute("data-id",Ye.value),typeof e.options.input=="function"&&e.options.input(u(e))},Ye.onkeydown=function(X){X.isComposing||Ie(e,X)||Ge(X,t)},rt(t,b,e),it(t,b,e),Ue(b,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",We),Ve(e,b)}if(w&&qt(e,w,t),!(B||r||S||_e||w||Ze||je||b||H)){var st=(0,m.a1)(n,"data-block","0");st&&st.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",rt(t,st,e),it(t,st,e),Ue(st,e),Ve(e,st)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(X){X.style.display="none"});var qn=(0,m.a1)(t.startContainer,"data-type","backslash");qn&&(qn.querySelector("span").style.display="inline")}},200)},Ve=function(e,t){var n=t,i=(0,m.lG)(t,"TABLE");i&&(n=i),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},ln=function(e,t,n){n===void 0&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.tagName==="IMG"?t.setAttribute("alt",o.value):t.textContent=o.value),h.value.trim()!==""&&t.setAttribute("data-link-label",h.value),typeof e.options.input=="function"&&e.options.input(u(e))},r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.getAttribute("alt")||t.textContent,o.oninput=function(){i()},o.onkeydown=function(w){Ie(e,w)||Ge(w,n)||gt(e,t,w,h)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.linkRef),a.className="vditor-tooltipped vditor-tooltipped__n";var h=document.createElement("input");a.appendChild(h),h.className="vditor-input",h.setAttribute("placeholder",window.VditorI18n.linkRef),h.value=t.getAttribute("data-link-label"),h.oninput=function(){i()},h.onkeydown=function(w){Ie(e,w)||Ge(w,n)||gt(e,t,w,o)},Ue(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),Ve(e,t)},rt=function(e,t,n){var i=t.previousElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","up"),r.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,s.ns)("\u21E7\u2318U")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("beforebegin",t),(0,_.ib)(n.wysiwyg.element,e),we(n),et(n),Te(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},it=function(e,t,n){var i=t.nextElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","down"),r.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,s.ns)("\u21E7\u2318D")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("afterend",t),(0,_.ib)(n.wysiwyg.element,e),we(n),et(n),Te(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},Ue=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,s.ns)("\u21E7\u2318X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var i=(0,_.zh)(t);i.setStartAfter(e),(0,_.Hc)(i),e.remove(),we(t),et(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&ge(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},gt=function(e,t,n,i){if(!n.isComposing){if(n.key==="Tab")return i.focus(),i.select(),void n.preventDefault();if(!(0,s.yl)(n)&&!n.shiftKey&&n.altKey&&n.key==="Enter"){var r=(0,_.zh)(e);t.insertAdjacentHTML("afterend",f.g.ZWSP),r.setStartAfter(t.nextSibling),r.collapse(!0),(0,_.Hc)(r),n.preventDefault()}}},qt=function(e,t,n){e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.innerHTML=o.value),t.setAttribute("href",h.value),t.setAttribute("title",S.value),we(e)};t.querySelectorAll("[data-marker]").forEach(function(b){b.removeAttribute("data-marker")});var r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.innerHTML||"",o.oninput=function(){i()},o.onkeydown=function(b){Ie(e,b)||Ge(b,n)||gt(e,t,b,h)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n";var h=document.createElement("input");a.appendChild(h),h.className="vditor-input",h.setAttribute("placeholder",window.VditorI18n.link),h.value=t.getAttribute("href")||"",h.oninput=function(){i()},h.onkeydown=function(b){Ie(e,b)||Ge(b,n)||gt(e,t,b,S)};var w=document.createElement("span");w.setAttribute("aria-label",window.VditorI18n.tooltipText),w.className="vditor-tooltipped vditor-tooltipped__n";var S=document.createElement("input");w.appendChild(S),S.className="vditor-input",S.setAttribute("placeholder",window.VditorI18n.tooltipText),S.style.width="60px",S.value=t.getAttribute("title")||"",S.oninput=function(){i()},S.onkeydown=function(b){Ie(e,b)||Ge(b,n)||gt(e,t,b,o)},Ue(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),e.wysiwyg.popover.insertAdjacentElement("beforeend",w),Ve(e,t)},Ge=function(e,t){if(!(0,s.yl)(e)&&!e.shiftKey&&e.key==="Enter"||e.key==="Escape")return t&&(0,_.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},ot=function(e){e.currentMode==="wysiwyg"?et(e):e.currentMode==="ir"&&ht(e)},sn=function(e,t,n){n===void 0&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var i=e.wysiwyg.element;i.innerHTML=e.lute.Md2VditorDOM(t),i.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(r){ye(r,e),r.previousElementSibling.setAttribute("style","display:none")}),we(e,n)},lr=function(e,t,n){for(var i=e.startContainer.parentElement,r=!1,o="",a="",h=function(A){var U=on(A.startContainer),z=rn(A.startContainer),q=A.startContainer.textContent,F=A.startOffset,W="",R="";return(q.substr(0,F)!==""&&q.substr(0,F)!==f.g.ZWSP||U)&&(W=""+U+q.substr(0,F)),(q.substr(F)!==""&&q.substr(F)!==f.g.ZWSP||z)&&(R=""+q.substr(F)+z),{afterHTML:R,beforeHTML:W}}(e),w=h.beforeHTML,S=h.afterHTML;i&&!r;){var b=i.tagName;if(b==="STRIKE"&&(b="S"),b==="I"&&(b="EM"),b==="B"&&(b="STRONG"),b==="S"||b==="STRONG"||b==="EM"){var H="",B="",G="";i.parentElement.getAttribute("data-block")!=="0"&&(B=on(i),G=rn(i)),(w||B)&&(w=H=B+"<"+b+">"+w+"</"+b+">"),(n==="bold"&&b==="STRONG"||n==="italic"&&b==="EM"||n==="strikeThrough"&&b==="S")&&(H+=""+o+f.g.ZWSP+"<wbr>"+a,r=!0),(S||G)&&(H+=S="<"+b+">"+S+"</"+b+">"+G),i.parentElement.getAttribute("data-block")!=="0"?(i=i.parentElement).innerHTML=H:(i.outerHTML=H,i=i.parentElement),o="<"+b+">"+o,a="</"+b+">"+a}else r=!0}(0,_.ib)(t.wysiwyg.element,e)},Le=function(e,t){var n,i=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var r=t.hotkey?" <"+(0,s.ns)(t.hotkey)+">":"";t.level===2&&(r=t.hotkey?" &lt;"+(0,s.ns)(t.hotkey)+"&gt;":"");var o=t.tip?t.tip+r:""+window.VditorI18n[t.name]+r,a=t.name==="upload"?"div":"button";if(t.level===2)this.element.innerHTML="<"+a+' data-type="'+t.name+'">'+o+"</"+a+">";else{this.element.classList.add("vditor-toolbar__item");var h=document.createElement(a);h.setAttribute("data-type",t.name),h.className="vditor-tooltipped vditor-tooltipped__"+t.tipPosition,h.setAttribute("aria-label",o),h.innerHTML=t.icon,this.element.appendChild(h)}t.prefix&&this.element.children[0].addEventListener((0,s.Le)(),function(w){w.preventDefault(),i.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)||(e.currentMode==="wysiwyg"?function(S,b,H){if(!(S.wysiwyg.composingLock&&H instanceof CustomEvent)){var B=!0,G=!0;S.wysiwyg.element.querySelector("wbr")&&S.wysiwyg.element.querySelector("wbr").remove();var A=(0,_.zh)(S),U=b.getAttribute("data-type");if(b.classList.contains("vditor-menu--current"))if(U==="strike"&&(U="strikeThrough"),U==="quote"){var z=(0,m.lG)(A.startContainer,"BLOCKQUOTE");z||(z=A.startContainer.childNodes[A.startOffset]),z&&(B=!1,b.classList.remove("vditor-menu--current"),A.insertNode(document.createElement("wbr")),z.outerHTML=z.innerHTML.trim()===""?'<p data-block="0">'+z.innerHTML+"</p>":z.innerHTML,(0,_.ib)(S.wysiwyg.element,A))}else if(U==="inline-code"){var q=(0,m.lG)(A.startContainer,"CODE");q||(q=A.startContainer.childNodes[A.startOffset]),q&&(q.outerHTML=q.innerHTML.replace(f.g.ZWSP,"")+"<wbr>",(0,_.ib)(S.wysiwyg.element,A))}else U==="link"?(A.collapsed&&A.selectNode(A.startContainer.parentElement),document.execCommand("unlink",!1,"")):U==="check"||U==="list"||U==="ordered-list"?(Ct(S,A,U),(0,_.ib)(S.wysiwyg.element,A),B=!1,b.classList.remove("vditor-menu--current")):(B=!1,b.classList.remove("vditor-menu--current"),A.toString()===""?lr(A,S,U):document.execCommand(U,!1,""));else{S.wysiwyg.element.childNodes.length===0&&(S.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,_.ib)(S.wysiwyg.element,A));var F=(0,m.F9)(A.startContainer);if(U==="quote"){if(F||(F=A.startContainer.childNodes[A.startOffset]),F){B=!1,b.classList.add("vditor-menu--current"),A.insertNode(document.createElement("wbr"));var W=(0,m.lG)(A.startContainer,"LI");W&&F.contains(W)?W.innerHTML='<blockquote data-block="0">'+W.innerHTML+"</blockquote>":F.outerHTML='<blockquote data-block="0">'+F.outerHTML+"</blockquote>",(0,_.ib)(S.wysiwyg.element,A)}}else if(U==="check"||U==="list"||U==="ordered-list")Ct(S,A,U,!1),(0,_.ib)(S.wysiwyg.element,A),B=!1,l(S.toolbar.elements,["check","list","ordered-list"]),b.classList.add("vditor-menu--current");else if(U==="inline-code"){if(A.toString()==="")(R=document.createElement("code")).textContent=f.g.ZWSP,A.insertNode(R),A.setStart(R.firstChild,1),A.collapse(!0),(0,_.Hc)(A);else if(A.startContainer.nodeType===3){var R=document.createElement("code");A.surroundContents(R),A.insertNode(R),(0,_.Hc)(A)}b.classList.add("vditor-menu--current")}else if(U==="code")(R=document.createElement("div")).className="vditor-wysiwyg__block",R.setAttribute("data-type","code-block"),R.setAttribute("data-block","0"),R.setAttribute("data-marker","```"),A.toString()===""?R.innerHTML=`<pre><code><wbr>
  36. </code></pre>`:(R.innerHTML="<pre><code>"+A.toString()+"<wbr></code></pre>",A.deleteContents()),A.insertNode(R),F&&(F.outerHTML=S.lute.SpinVditorDOM(F.outerHTML)),(0,_.ib)(S.wysiwyg.element,A),S.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(Me){ye(Me,S)}),b.classList.add("vditor-menu--disabled");else if(U==="link"){if(A.toString()===""){var Y=document.createElement("a");Y.innerText=f.g.ZWSP,A.insertNode(Y),A.setStart(Y.firstChild,1),A.collapse(!0),qt(S,Y,A);var se=S.wysiwyg.popover.querySelector("input");se.value="",se.focus(),G=!1}else{(R=document.createElement("a")).setAttribute("href",""),R.innerHTML=A.toString(),A.surroundContents(R),A.insertNode(R),(0,_.Hc)(A),qt(S,R,A);var ne=S.wysiwyg.popover.querySelectorAll("input");ne[0].value=R.innerText,ne[1].focus()}B=!1,b.classList.add("vditor-menu--current")}else if(U==="table"){var le='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(A.toString().trim()==="")F&&F.innerHTML.trim().replace(f.g.ZWSP,"")===""?F.outerHTML=le:document.execCommand("insertHTML",!1,le),A.selectNode(S.wysiwyg.element.querySelector("wbr").previousSibling),S.wysiwyg.element.querySelector("wbr").remove(),(0,_.Hc)(A);else{le='<table data-block="0"><thead><tr>';var ae=A.toString().split(`
  37. `),Q=ae[0].split(",").length>ae[0].split(" ").length?",":" ";ae.forEach(function(Me,Ze){Ze===0?(Me.split(Q).forEach(function(je,qe){le+=qe===0?"<th>"+je+"<wbr></th>":"<th>"+je+"</th>"}),le+="</tr></thead>"):(le+=Ze===1?"<tbody><tr>":"<tr>",Me.split(Q).forEach(function(je){le+="<td>"+je+"</td>"}),le+="</tr>")}),le+="</tbody></table>",document.execCommand("insertHTML",!1,le),(0,_.ib)(S.wysiwyg.element,A)}B=!1,b.classList.add("vditor-menu--disabled")}else if(U==="line"){if(F){var ce=`<hr data-block="0"><p data-block="0"><wbr>
  38. </p>`;F.innerHTML.trim()===""?F.outerHTML=ce:F.insertAdjacentHTML("afterend",ce),(0,_.ib)(S.wysiwyg.element,A)}}else if(B=!1,b.classList.add("vditor-menu--current"),U==="strike"&&(U="strikeThrough"),A.toString()!==""||U!=="bold"&&U!=="italic"&&U!=="strikeThrough")document.execCommand(U,!1,"");else{var be="strong";U==="italic"?be="em":U==="strikeThrough"&&(be="s"),(R=document.createElement(be)).textContent=f.g.ZWSP,A.insertNode(R),R.previousSibling&&R.previousSibling.textContent===f.g.ZWSP&&(R.previousSibling.textContent=""),A.setStart(R.firstChild,1),A.collapse(!0),(0,_.Hc)(A)}}B&&et(S),G&&we(S)}}(e,i.element.children[0],w):e.currentMode==="ir"?wr(e,i.element.children[0],t.prefix||"",t.suffix||""):ur(e,i.element.children[0],t.prefix||"",t.suffix||""))})},sr=($e=function(e,t){return $e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},$e(e,t)},function(e,t){function n(){this.constructor=e}$e(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),tt=function(e,t,n){var i;if(typeof n!="string"?(g(e,["subToolbar","hint"]),n.preventDefault(),i=u(e)):i=n,e.currentMode!==t||typeof n=="string"){if(e.devtools&&e.devtools.renderEchart(e),e.options.preview.mode==="both"&&t==="sv"?e.preview.element.style.display="block":e.preview.element.style.display="none",v(e.toolbar.elements,f.g.EDIT_TOOLBARS),l(e.toolbar.elements,f.g.EDIT_TOOLBARS),L(e.toolbar.elements,["outdent","indent"]),t==="ir")E(e.toolbar.elements,["both"]),T(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(i),Je(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),he(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){ye(o,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,de.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})});else if(t==="wysiwyg")E(e.toolbar.elements,["both"]),T(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",he(e),sn(e,i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,de.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if(t==="sv"){T(e.toolbar.elements,["both"]),E(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",(e.options.preview.mode==="both"||e.options.preview.mode==="editor")&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var r=un(i,e);r==="<div data-block='0'></div>"&&(r=""),e.sv.element.innerHTML=r,$(e.sv.element),Ae(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),he(e)}e.undo.resetIcon(e),typeof n!="string"&&(e[e.currentMode].element.focus(),ot(e)),ge(e),oe(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(o){o.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'+e.currentMode+'"]').classList.add("vditor-menu--current")),e.outline.toggle(e,e.currentMode!=="sv"&&e.options.outline.enable,typeof n!="string")}},cr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'+window.VditorI18n.wysiwyg+" &lt;"+(0,s.ns)("\u2325\u23187")+`></button>
  39. <button data-mode="ir">`+window.VditorI18n.instantRendering+" &lt;"+(0,s.ns)("\u2325\u23188")+`></button>
  40. <button data-mode="sv">`+window.VditorI18n.splitView+" &lt;"+(0,s.ns)("\u2325\u23189")+"></button>",r.element.appendChild(o),r._bindEvent(n,o,i),r}return sr(t,e),t.prototype._bindEvent=function(n,i,r){var o=this.element.children[0];k(n,i,o,r.level),i.children.item(0).addEventListener((0,s.Le)(),function(a){tt(n,"wysiwyg",a),a.preventDefault(),a.stopPropagation()}),i.children.item(1).addEventListener((0,s.Le)(),function(a){tt(n,"ir",a),a.preventDefault(),a.stopPropagation()}),i.children.item(2).addEventListener((0,s.Le)(),function(a){tt(n,"sv",a),a.preventDefault(),a.stopPropagation()})},t}(Le),yt=function(e,t){return(0,_.Gb)(e,t)?getSelection().toString():""},Bt=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(u(e)),g(e,["subToolbar","hint"])})},cn=function(e,t){t.addEventListener("dblclick",function(n){n.target.tagName==="IMG"&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,re.E)(n.target,e.options.lang,e.options.theme))})},Vt=function(e,t){t.addEventListener("blur",function(n){if(e.currentMode==="ir"){var i=e.ir.element.querySelector(".vditor-ir__node--expand");i&&i.classList.remove("vditor-ir__node--expand")}else e.currentMode!=="wysiwyg"||e.wysiwyg.selectPopover.contains(n.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,_.zh)(e),e.options.blur&&e.options.blur(u(e))})},Ut=function(e,t){t.addEventListener("dragstart",function(n){n.dataTransfer.setData(f.g.DROP_EDITOR,f.g.DROP_EDITOR)}),t.addEventListener("drop",function(n){n.dataTransfer.getData(f.g.DROP_EDITOR)?pe(e):(n.dataTransfer.types.includes("Files")||n.dataTransfer.types.includes("text/html"))&&Nt(e,n,{pasteCode:function(i){document.execCommand("insertHTML",!1,i)}})})},Wt=function(e,t,n){t.addEventListener("copy",function(i){return n(i,e)})},zt=function(e,t,n){t.addEventListener("cut",function(i){n(i,e),e.options.comment.enable&&e.currentMode==="wysiwyg"&&e.wysiwyg.getComments(e),document.execCommand("delete")})},Te=function(e){if(e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,_.Ny)(t).top;e.options.height!=="auto"||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),(e.options.height!=="auto"||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},Ft=function(e,t){t.addEventListener("keydown",function(n){if(!n.isComposing&&e.options.keydown&&e.options.keydown(n),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(n,e)){if(e.options.comment.enable&&e.currentMode==="wysiwyg"&&(n.key==="Backspace"||I("\u2318X",n))&&e.wysiwyg.getComments(e),e.currentMode==="sv"){if(function(r,o){var a,h,w,S,b;if(r.sv.composingLock=o.isComposing,o.isComposing||(o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,s.yl)(o)&&o.key!=="Escape"))return!1;var H=(0,_.zh)(r),B=H.startContainer;H.startContainer.nodeType!==3&&H.startContainer.tagName==="DIV"&&(B=H.startContainer.childNodes[H.startOffset-1]);var G=(0,m.a1)(B,"data-type","text"),A=(0,m.a1)(B,"data-type","blockquote-marker");if(!A&&H.startOffset===0&&G&&G.previousElementSibling&&G.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(A=G.previousElementSibling),A&&o.key==="Enter"&&!(0,s.yl)(o)&&!o.altKey&&A.nextElementSibling.textContent.trim()===""&&(0,_.im)(A,r.sv.element,H).start===A.textContent.length)return((a=A.previousElementSibling)===null||a===void 0?void 0:a.getAttribute("data-type"))==="padding"&&A.previousElementSibling.setAttribute("data-action","enter-remove"),A.remove(),Ae(r),o.preventDefault(),!0;var U=(0,m.a1)(B,"data-type","li-marker"),z=(0,m.a1)(B,"data-type","task-marker"),q=U;if(q||z&&z.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(q=z),q||H.startOffset!==0||!G||!G.previousElementSibling||G.previousElementSibling.getAttribute("data-type")!=="li-marker"&&G.previousElementSibling.getAttribute("data-type")!=="task-marker"||(q=G.previousElementSibling),q){var F=(0,_.im)(q,r.sv.element,H).start,W=q.getAttribute("data-type")==="task-marker",R=q;if(W&&(R=q.previousElementSibling.previousElementSibling.previousElementSibling),F===q.textContent.length){if(o.key==="Enter"&&!(0,s.yl)(o)&&!o.altKey&&!o.shiftKey&&q.nextElementSibling.textContent.trim()==="")return((h=R.previousElementSibling)===null||h===void 0?void 0:h.getAttribute("data-type"))==="padding"?(R.previousElementSibling.remove(),te(r)):(W&&(R.remove(),q.previousElementSibling.previousElementSibling.remove(),q.previousElementSibling.remove()),q.nextElementSibling.remove(),q.remove(),Ae(r)),o.preventDefault(),!0;if(o.key==="Tab")return R.insertAdjacentHTML("beforebegin",'<span data-type="padding">'+R.textContent.replace(/\S/g," ")+"</span>"),/^\d/.test(R.textContent)&&(R.textContent=R.textContent.replace(/^\d{1,}/,"1"),H.selectNodeContents(q.firstChild),H.collapse(!1)),te(r),o.preventDefault(),!0}}if(Qt(r,H,o))return!0;var Y=(0,m.a1)(B,"data-block","0"),se=(0,C.S)(B,"SPAN");if(o.key==="Enter"&&!(0,s.yl)(o)&&!o.altKey&&!o.shiftKey&&Y){var ne=!1,le=Y.textContent.match(/^\n+/);(0,_.im)(Y,r.sv.element).start<=(le?le[0].length:0)&&(ne=!0);var ae=`
  41. `;if(se){if(((w=se.previousElementSibling)===null||w===void 0?void 0:w.getAttribute("data-action"))==="enter-remove")return se.previousElementSibling.remove(),Ae(r),o.preventDefault(),!0;ae+=dr(se)}return H.insertNode(document.createTextNode(ae)),H.collapse(!1),Y&&Y.textContent.trim()!==""&&!ne?te(r):Ae(r),o.preventDefault(),!0}if(o.key==="Backspace"&&!(0,s.yl)(o)&&!o.altKey&&!o.shiftKey){if(se&&((S=se.previousElementSibling)===null||S===void 0?void 0:S.getAttribute("data-type"))==="newline"&&(0,_.im)(se,r.sv.element,H).start===1&&se.getAttribute("data-type").indexOf("code-block-")===-1)return H.setStart(se,0),H.extractContents(),se.textContent.trim()!==""?te(r):Ae(r),o.preventDefault(),!0;if(Y&&(0,_.im)(Y,r.sv.element,H).start===0&&Y.previousElementSibling){H.extractContents();var Q=Y.previousElementSibling.lastElementChild;return Q.getAttribute("data-type")==="newline"&&(Q.remove(),Q=Y.previousElementSibling.lastElementChild),Q.getAttribute("data-type")!=="newline"&&(Q.insertAdjacentHTML("afterend",Y.innerHTML),Y.remove()),Y.textContent.trim()===""||!((b=Y.previousElementSibling)===null||b===void 0)&&b.querySelector('[data-type="code-block-open-marker"]')?(Q.getAttribute("data-type")!=="newline"&&(H.selectNodeContents(Q.lastChild),H.collapse(!1)),Ae(r)):te(r),o.preventDefault(),!0}}return!1}(e,n))return}else if(e.currentMode==="wysiwyg"){if(function(r,o){if(r.wysiwyg.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var a=(0,_.zh)(r),h=a.startContainer;if(!hn(o,r,h)||(vn(a,r,o),Hn(a),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,s.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var w=(0,m.F9)(h),S=(0,m.lG)(h,"P");if(En(o,r,S,a)||wn(a,r,S,o)||Tn(r,o,a))return!0;var b=(0,m.fb)(h,"vditor-wysiwyg__block");if(b){if(o.key==="Escape"&&b.children.length===2)return r.wysiwyg.popover.style.display="none",b.firstElementChild.style.display="none",r.wysiwyg.element.blur(),o.preventDefault(),!0;if(!(0,s.yl)(o)&&!o.shiftKey&&o.altKey&&o.key==="Enter"&&b.getAttribute("data-type")==="code-block"){var H=r.wysiwyg.popover.querySelector(".vditor-input");return H.focus(),H.select(),o.preventDefault(),!0}if(b.getAttribute("data-block")==="0"&&(_n(r,o,b.firstElementChild,a)||bt(r,o,a,b.firstElementChild,b)||b.getAttribute("data-type")!=="yaml-front-matter"&&at(r,o,a,b.firstElementChild,b)))return!0}if(An(r,a,o,S))return!0;var B=(0,m.E2)(h,"BLOCKQUOTE");if(B&&!o.shiftKey&&o.altKey&&o.key==="Enter"){(0,s.yl)(o)?a.setStartBefore(B):a.setStartAfter(B),(0,_.Hc)(a);var G=document.createElement("p");return G.setAttribute("data-block","0"),G.innerHTML=`
  42. `,a.insertNode(G),a.collapse(!0),(0,_.Hc)(a),we(r),Te(r),o.preventDefault(),!0}var A,U=(0,C.W)(h);if(U){if(U.tagName==="H6"&&h.textContent.length===a.startOffset&&!(0,s.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"){var z=document.createElement("p");return z.textContent=`
  43. `,z.setAttribute("data-block","0"),h.parentElement.insertAdjacentElement("afterend",z),a.setStart(z,0),(0,_.Hc)(a),we(r),Te(r),o.preventDefault(),!0}var q;if(I("\u2318=",o))return(q=parseInt(U.tagName.substr(1),10)-1)>0&&(Mt(r,"h"+q),we(r)),o.preventDefault(),!0;if(I("\u2318-",o))return(q=parseInt(U.tagName.substr(1),10)+1)<7&&(Mt(r,"h"+q),we(r)),o.preventDefault(),!0;o.key!=="Backspace"||(0,s.yl)(o)||o.shiftKey||o.altKey||U.textContent.length!==1||Pt(r)}if(Cn(r,a,o))return!0;if(o.altKey&&o.key==="Enter"&&!(0,s.yl)(o)&&!o.shiftKey){var F=(0,m.lG)(h,"A"),W=(0,m.a1)(h,"data-type","link-ref"),R=(0,m.a1)(h,"data-type","footnotes-ref");if(F||W||R||U&&U.tagName.length===2){var Y=r.wysiwyg.popover.querySelector("input");Y.focus(),Y.select()}}if(Ie(r,o))return!0;if(I("\u21E7\u2318U",o)&&(A=r.wysiwyg.popover.querySelector('[data-type="up"]'))||I("\u21E7\u2318D",o)&&(A=r.wysiwyg.popover.querySelector('[data-type="down"]')))return A.click(),o.preventDefault(),!0;if(Qt(r,a,o))return!0;if(!(0,s.yl)(o)&&o.shiftKey&&!o.altKey&&o.key==="Enter"&&h.parentElement.tagName!=="LI"&&h.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(h.parentElement.tagName)?a.insertNode(document.createTextNode(`
  44. `+f.g.ZWSP)):a.insertNode(document.createTextNode(`
  45. `)),a.collapse(!1),(0,_.Hc)(a),we(r),Te(r),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,s.yl)(o)&&!o.shiftKey&&!o.altKey&&a.toString()===""){if(xn(r,a,o,S))return!0;if(w){if(w.previousElementSibling&&w.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&w.previousElementSibling.getAttribute("data-block")==="0"&&w.tagName!=="UL"&&w.tagName!=="OL"){var se=(0,_.im)(w,r.wysiwyg.element,a).start;if(se===0&&a.startOffset===0||se===1&&w.innerText.startsWith(f.g.ZWSP))return vt(w.previousElementSibling.lastElementChild,r,!1),w.innerHTML.trim().replace(f.g.ZWSP,"")===""&&(w.remove(),we(r)),o.preventDefault(),!0}var ne=a.startOffset;if(a.toString()===""&&h.nodeType===3&&h.textContent.charAt(ne-2)===`
  46. `&&h.textContent.charAt(ne-1)!==f.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(h.parentElement.tagName))return h.textContent=h.textContent.substring(0,ne-1)+f.g.ZWSP,a.setStart(h,ne),a.collapse(!0),we(r),o.preventDefault(),!0;h.textContent===f.g.ZWSP&&a.startOffset===1&&!h.previousSibling&&function(ae){for(var Q=ae.startContainer.nextSibling;Q&&Q.textContent==="";)Q=Q.nextSibling;return!(!Q||Q.nodeType===3||Q.tagName!=="CODE"&&Q.getAttribute("data-type")!=="math-inline"&&Q.getAttribute("data-type")!=="html-entity"&&Q.getAttribute("data-type")!=="html-inline")}(a)&&(h.textContent=""),w.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(ae){ae.firstElementChild.style.display="inline",ae.lastElementChild.style.display="none"}),w.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(ae){ae.firstElementChild.style.display="inline",ae.lastElementChild.style.display="none"})}}if((0,s.vU)()&&a.startOffset===1&&h.textContent.indexOf(f.g.ZWSP)>-1&&h.previousSibling&&h.previousSibling.nodeType!==3&&h.previousSibling.tagName==="CODE"&&(o.key==="Backspace"||o.key==="ArrowLeft"))return a.selectNodeContents(h.previousSibling),a.collapse(!1),o.preventDefault(),!0;if(Nn(o,w,a))return o.preventDefault(),!0;if(gn(a,o.key),o.key==="ArrowDown"){var le=h.nextSibling;le&&le.nodeType!==3&&le.getAttribute("data-type")==="math-inline"&&a.setStartAfter(le)}return!(!w||!N(w,r,o,a)||(o.preventDefault(),0))}(e,n))return}else if(e.currentMode==="ir"&&function(r,o){if(r.ir.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var a=(0,_.zh)(r),h=a.startContainer;if(!hn(o,r,h)||(vn(a,r,o),Hn(a),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,s.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var w=(0,m.a1)(h,"data-newline","1");if(!(0,s.yl)(o)&&!o.altKey&&!o.shiftKey&&o.key==="Enter"&&w&&a.startOffset<w.textContent.length){var S=w.previousElementSibling;S&&(a.insertNode(document.createTextNode(S.textContent)),a.collapse(!1));var b=w.nextSibling;b&&(a.insertNode(document.createTextNode(b.textContent)),a.collapse(!0))}var H=(0,m.lG)(h,"P");if(En(o,r,H,a)||wn(a,r,H,o)||An(r,a,o,H))return!0;var B=(0,m.fb)(h,"vditor-ir__marker--pre");if(B&&B.tagName==="PRE"){var G=B.firstChild;if(_n(r,o,B,a)||(G.getAttribute("data-type")==="math-block"||G.getAttribute("data-type")==="html-block")&&at(r,o,a,G,B.parentElement)||bt(r,o,a,G,B.parentElement))return!0}var A=(0,m.a1)(h,"data-type","code-block-info");if(A){if(o.key==="Enter"||o.key==="Tab")return a.selectNodeContents(A.nextElementSibling.firstChild),a.collapse(!0),o.preventDefault(),g(r,["hint"]),!0;if(o.key==="Backspace"){var U=(0,_.im)(A,r.ir.element).start;U===1&&a.setStart(h,0),U===2&&(r.hint.recentLanguage="")}if(at(r,o,a,A,A.parentElement))return g(r,["hint"]),!0}var z=(0,m.lG)(h,"TD")||(0,m.lG)(h,"TH");if(o.key.indexOf("Arrow")>-1&&z){var q=yr(z);if(q&&at(r,o,a,z,q))return!0;var F=br(z);if(F&&bt(r,o,a,z,F))return!0}if(Tn(r,o,a)||Cn(r,a,o)||Qt(r,a,o))return!0;var W=(0,C.W)(h);if(W){var R;if(I("\u2318=",o))return(R=W.querySelector(".vditor-ir__marker--heading"))&&R.textContent.trim().length>1&&wt(r,R.textContent.substr(1)),o.preventDefault(),!0;if(I("\u2318-",o))return(R=W.querySelector(".vditor-ir__marker--heading"))&&R.textContent.trim().length<6&&wt(r,R.textContent.trim()+"# "),o.preventDefault(),!0}var Y=(0,m.F9)(h);if(o.key==="Backspace"&&!(0,s.yl)(o)&&!o.shiftKey&&!o.altKey&&a.toString()===""){if(xn(r,a,o,H))return!0;if(Y&&Y.previousElementSibling&&Y.tagName!=="UL"&&Y.tagName!=="OL"&&(Y.previousElementSibling.getAttribute("data-type")==="code-block"||Y.previousElementSibling.getAttribute("data-type")==="math-block")){var se=(0,_.im)(Y,r.ir.element,a).start;if(se===0||se===1&&Y.innerText.startsWith(f.g.ZWSP))return a.selectNodeContents(Y.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),a.collapse(!1),D(a,r),Y.textContent.trim().replace(f.g.ZWSP,"")===""&&(Y.remove(),Je(r)),o.preventDefault(),!0}if(W){var ne=W.firstElementChild.textContent.length;(0,_.im)(W,r.ir.element).start===ne&&(a.setStart(W.firstElementChild.firstChild,ne-1),a.collapse(!0),(0,_.Hc)(a))}}return!((o.key!=="ArrowUp"&&o.key!=="ArrowDown"||!Y||(Y.querySelectorAll(".vditor-ir__node").forEach(function(le){le.contains(h)||le.classList.add("vditor-ir__node--hidden")}),!Nn(o,Y,a)))&&(gn(a,o.key),!Y||!N(Y,r,o,a)||(o.preventDefault(),0)))}(e,n))return;if(e.options.ctrlEnter&&I("\u2318Enter",n))return e.options.ctrlEnter(u(e)),void n.preventDefault();if(I("\u2318Z",n)&&!e.toolbar.elements.undo)return e.undo.undo(e),void n.preventDefault();if(I("\u2318Y",n)&&!e.toolbar.elements.redo)return e.undo.redo(e),void n.preventDefault();if(n.key==="Escape")return e.hint.element.style.display==="block"?e.hint.element.style.display="none":e.options.esc&&!n.isComposing&&e.options.esc(u(e)),void n.preventDefault();if((0,s.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[1-6]$/.test(n.code)){if(e.currentMode==="wysiwyg"){var i=n.code.replace("Digit","H");(0,m.lG)(getSelection().getRangeAt(0).startContainer,i)?Pt(e):Mt(e,i),we(e)}else e.currentMode==="sv"?pn(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" "):e.currentMode==="ir"&&wt(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" ");return n.preventDefault(),!0}if((0,s.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[7-9]$/.test(n.code))return n.code==="Digit7"?tt(e,"wysiwyg",n):n.code==="Digit8"?tt(e,"ir",n):n.code==="Digit9"&&tt(e,"sv",n),!0;e.options.toolbar.find(function(r){return!r.hotkey||r.toolbar?!!r.toolbar&&!!r.toolbar.find(function(o){return!!o.hotkey&&(I(o.hotkey,n)?(e.toolbar.elements[o.name].children[0].dispatchEvent(new CustomEvent((0,s.Le)())),n.preventDefault(),!0):void 0)}):I(r.hotkey,n)?(e.toolbar.elements[r.name].children[0].dispatchEvent(new CustomEvent((0,s.Le)())),n.preventDefault(),!0):void 0})}})},Gt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var i=yt(e[e.currentMode].element);i.trim()?(e.currentMode==="wysiwyg"&&e.options.comment.enable&&((0,m.a1)(n.target,"data-type","footnotes-block")||(0,m.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(i)):e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.wysiwyg.hideComment()})}})},dn=function(e,t){var n=(0,_.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var i=(0,m.a1)(n.startContainer,"data-block","0");i||(i=e.sv.element);var r=e.lute.SpinVditorSVDOM(i.textContent);r="<div data-block='0'>"+r.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
  47. </span></span><span data-type="newline"><br /><span style="display: none">
  48. </span></span></div><div data-block="0"><`)+"</div>",i.isEqualNode(e.sv.element)?i.innerHTML=r:i.outerHTML=r,$(e.sv.element),(0,_.ib)(e.sv.element,n),Te(e)},Tt=function(e,t,n){n===void 0&&(n=!0);var i=e;for(i.nodeType===3&&(i=i.parentElement);i;){if(i.getAttribute("data-type")===t)return i;i=n?i.previousElementSibling:i.nextElementSibling}return!1},un=function(e,t){return O("SpinVditorSVDOM",e,"argument",t.options.debugger),e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
  49. </span></span><span data-type="newline"><br /><span style="display: none">
  50. </span></span></div><div data-block="0"><`)+"</div>",O("SpinVditorSVDOM",e,"result",t.options.debugger),e},dr=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,i=t&&t!=="text"&&t!=="table"&&t!=="heading-marker"&&t!=="newline"&&t!=="yaml-front-matter-open-marker"&&t!=="yaml-front-matter-close-marker"&&t!=="code-block-info"&&t!=="code-block-close-marker"&&t!=="code-block-open-marker"?e.textContent:"",r=!1;for(t==="newline"&&(r=!0);n&&!r;){var o=n.getAttribute("data-type");if(o==="li-marker"||o==="blockquote-marker"||o==="task-marker"||o==="padding"){var a=n.textContent;if(o!=="li-marker"||t!=="code-block-open-marker"&&t!=="code-block-info")if(t==="code-block-close-marker"&&n.nextElementSibling.isSameNode(e)){var h=Tt(e,"code-block-open-marker");h&&h.previousElementSibling&&(n=h.previousElementSibling,i=a+i)}else i=a+i;else i=a.replace(/\S/g," ")+i}else o==="newline"&&(r=!0);n=n.previousElementSibling}return i},Ae=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=u(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},pn=function(e,t){var n=(0,_.zh)(e),i=(0,C.S)(n.startContainer,"SPAN");i&&i.textContent.trim()!==""&&(t=`
  51. `+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},ur=function(e,t,n,i){var r=(0,_.zh)(e),o=t.getAttribute("data-type");e.sv.element.childNodes.length===0&&(e.sv.element.innerHTML=`<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">
  52. </span></span>`,(0,_.ib)(e.sv.element,r));var a=(0,m.F9)(r.startContainer),h=(0,C.S)(r.startContainer,"SPAN");if(a){if(o==="link"){var w=void 0;return w=r.toString()===""?""+n+Lute.Caret+i:""+n+r.toString()+i.replace(")",Lute.Caret+")"),void document.execCommand("insertHTML",!1,w)}if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"||o==="line")return w=void 0,w=r.toString()===""?""+n+Lute.Caret+(o==="code"?"":i):""+n+r.toString()+Lute.Caret+(o==="code"?"":i),o==="table"||o==="code"&&h&&h.textContent!==""?w=`
  53. `+w:o==="line"&&(w=`
  54. `+n+`
  55. `+Lute.Caret),void document.execCommand("insertHTML",!1,w);if((o==="check"||o==="list"||o==="ordered-list"||o==="quote")&&h){var S="* ";o==="check"?S="* [ ] ":o==="ordered-list"?S="1. ":o==="quote"&&(S="> ");var b=Tt(h,"newline");return b?b.insertAdjacentText("afterend",S):a.insertAdjacentText("afterbegin",S),void te(e)}(0,_.ib)(e.sv.element,r),Ae(e)}},mn=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},fn=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},pr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(S){try{w(i.next(S))}catch(b){o(b)}}function h(S){try{w(i.throw(S))}catch(b){o(b)}}function w(S){var b;S.done?r(S.value):(b=S.value,b instanceof n?b:new n(function(H){H(b)})).then(a,h)}w((i=i.apply(e,t||[])).next())})},mr=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(w){return function(S){return function(b){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&b[0]?i.return:b[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,b[1])).done)return r;switch(i=0,r&&(b=[2&b[0],r.value]),b[0]){case 0:case 1:r=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,i=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||b[0]!==6&&b[0]!==2)){a=0;continue}if(b[0]===3&&(!r||b[1]>r[0]&&b[1]<r[3])){a.label=b[1];break}if(b[0]===6&&a.label<r[1]){a.label=r[1],r=b;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(b);break}r[2]&&a.ops.pop(),a.trys.pop();continue}b=t.call(e,a)}catch(H){b=[6,H],i=0}finally{n=r=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([w,S])}}},fr=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},Kt=function(e,t,n){return pr(void 0,void 0,void 0,function(){var i,r,o,a,h,w,S,b,H,B,G,A,U,z;return mr(this,function(q){switch(q.label){case 0:for(i=[],r=e.options.upload.multiple===!0?t.length:1,A=0;A<r;A++)(o=t[A])instanceof DataTransferItem&&(o=o.getAsFile()),i.push(o);return e.options.upload.handler?[4,e.options.upload.handler(i)]:[3,2];case 1:return a=q.sent(),n&&(n.value=""),typeof a=="string"?(e.tip.show(a),[2]):[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(i)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:i=q.sent(),q.label=4;case 4:if(e.options.upload.validate&&typeof(a=e.options.upload.validate(i))=="string")return e.tip.show(a),[2];if(h=mn(e),e.upload.range=(0,_.zh)(e),w=function(F,W){F.tip.hide();for(var R=[],Y="",se="",ne=(F.options.lang,F.options,function(Q,ce){var be=W[ce],Me=!0;be.name||(Y+="<li>"+window.VditorI18n.nameEmpty+"</li>",Me=!1),be.size>F.options.upload.max&&(Y+="<li>"+be.name+" "+window.VditorI18n.over+" "+F.options.upload.max/1024/1024+"M</li>",Me=!1);var Ze=be.name.lastIndexOf("."),je=be.name.substr(Ze),qe=F.options.upload.filename(be.name.substr(0,Ze))+je;F.options.upload.accept&&(F.options.upload.accept.split(",").some(function(_e){var lt=_e.trim();if(lt.indexOf(".")===0){if(je.toLowerCase()===lt.toLowerCase())return!0}else if(be.type.split("/")[0]===lt.split("/")[0])return!0;return!1})||(Y+="<li>"+be.name+" "+window.VditorI18n.fileTypeError+"</li>",Me=!1)),Me&&(R.push(be),se+="<li>"+qe+" "+window.VditorI18n.uploading+"</li>")}),le=W.length,ae=0;ae<le;ae++)ne(0,ae);return F.tip.show("<ul>"+Y+se+"</ul>"),R}(e,i),w.length===0)return n&&(n.value=""),[2];for(S=new FormData,b=e.options.upload.extraData,H=0,B=Object.keys(b);H<B.length;H++)G=B[H],S.append(G,b[G]);for(A=0,U=w.length;A<U;A++)S.append(e.options.upload.fieldName,w[A]);return(z=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&z.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(z.withCredentials=!0),fn(e,z),e.upload.isUploading=!0,h.setAttribute("contenteditable","false"),z.onreadystatechange=function(){if(z.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,h.setAttribute("contenteditable","true"),z.status>=200&&z.status<300)if(e.options.upload.success)e.options.upload.success(h,z.responseText);else{var F=z.responseText;e.options.upload.format&&(F=e.options.upload.format(t,z.responseText)),function(W,R){mn(R).focus();var Y=JSON.parse(W),se="";Y.code===1&&(se=""+Y.msg),Y.data.errFiles&&Y.data.errFiles.length>0&&(se="<ul><li>"+se+"</li>",Y.data.errFiles.forEach(function(le){var ae=le.lastIndexOf("."),Q=R.options.upload.filename(le.substr(0,ae))+le.substr(ae);se+="<li>"+Q+" "+window.VditorI18n.uploadError+"</li>"}),se+="</ul>"),se?R.tip.show(se):R.tip.hide();var ne="";Object.keys(Y.data.succMap).forEach(function(le){var ae=Y.data.succMap[le],Q=le.lastIndexOf("."),ce=le.substr(Q),be=R.options.upload.filename(le.substr(0,Q))+ce;(ce=ce.toLowerCase()).indexOf(".wav")===0||ce.indexOf(".mp3")===0||ce.indexOf(".ogg")===0?R.currentMode==="wysiwyg"?ne+=`<div class="vditor-wysiwyg__block" data-type="html-block"
  56. data-block="0"><pre><code>&lt;audio controls="controls" src="`+ae+'"&gt;&lt;/audio&gt;</code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="'+ae+`"></audio></pre></div>
  57. `:R.currentMode==="ir"?ne+='<audio controls="controls" src="'+ae+`"></audio>
  58. `:ne+="["+be+"]("+ae+`)
  59. `:ce.indexOf(".apng")===0||ce.indexOf(".bmp")===0||ce.indexOf(".gif")===0||ce.indexOf(".ico")===0||ce.indexOf(".cur")===0||ce.indexOf(".jpg")===0||ce.indexOf(".jpeg")===0||ce.indexOf(".jfif")===0||ce.indexOf(".pjp")===0||ce.indexOf(".pjpeg")===0||ce.indexOf(".png")===0||ce.indexOf(".svg")===0||ce.indexOf(".webp")===0?R.currentMode==="wysiwyg"?ne+='<img alt="'+be+'" src="'+ae+`">
  60. `:ne+="!["+be+"]("+ae+`)
  61. `:R.currentMode==="wysiwyg"?ne+='<a href="'+ae+'">'+be+`</a>
  62. `:ne+="["+be+"]("+ae+`)
  63. `}),(0,_.Hc)(R.upload.range),document.execCommand("insertHTML",!1,ne),R.upload.range=getSelection().getRangeAt(0).cloneRange()}(F,e)}else e.options.upload.error?e.options.upload.error(z.responseText):e.tip.show(z.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},z.upload.onprogress=function(F){if(F.lengthComputable){var W=F.loaded/F.total*100;e.upload.element.style.display="block",e.upload.element.style.width=W+"%"}},z.send(S),[2]}})})},_t=function(e,t,n){var i,r=(0,m.F9)(t.startContainer);if(r||(r=e.wysiwyg.element),n&&n.inputType!=="formatItalic"&&n.inputType!=="deleteByDrag"&&n.inputType!=="insertFromDrop"&&n.inputType!=="formatBold"&&n.inputType!=="formatRemove"&&n.inputType!=="formatStrikeThrough"&&n.inputType!=="insertUnorderedList"&&n.inputType!=="insertOrderedList"&&n.inputType!=="formatOutdent"&&n.inputType!=="formatIndent"&&n.inputType!==""||!n){var o=function(W){for(var R=W.previousSibling;R;){if(R.nodeType!==3&&R.tagName==="A"&&!R.previousSibling&&R.innerHTML.replace(f.g.ZWSP,"")===""&&R.nextSibling)return R;R=R.previousSibling}return!1}(t.startContainer);o&&o.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(W){W.remove()}),t.insertNode(document.createElement("wbr")),r.querySelectorAll("[style]").forEach(function(W){W.removeAttribute("style")}),r.querySelectorAll(".vditor-comment").forEach(function(W){W.textContent.trim()===""&&(W.classList.remove("vditor-comment","vditor-comment--focus"),W.removeAttribute("data-cmtids"))}),(i=r.previousElementSibling)===null||i===void 0||i.querySelectorAll(".vditor-comment").forEach(function(W){W.textContent.trim()===""&&(W.classList.remove("vditor-comment","vditor-comment--focus"),W.removeAttribute("data-cmtids"))});var a="";r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.wysiwyg.element);var h,w=r.isEqualNode(e.wysiwyg.element),S=(0,m.a1)(r,"data-type","footnotes-block");if(w)a=r.innerHTML;else{var b=(0,m.O9)(t.startContainer);if(b&&!S){var H=(0,C.S)(t.startContainer,"BLOCKQUOTE");r=H?(0,m.F9)(t.startContainer)||r:b}if(S&&(r=S),a=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var B=r.previousElementSibling,G=r.nextElementSibling;!B||B.tagName!=="UL"&&B.tagName!=="OL"||(a=B.outerHTML+a,B.remove()),!G||G.tagName!=="UL"&&G.tagName!=="OL"||(a+=G.outerHTML,G.remove()),a=a.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}r.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(W){W&&!r.isEqualNode(W)&&(a+=W.outerHTML,W.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(W){W&&!r.isEqualNode(W)&&(a+=W.outerHTML,W.remove())}))}if((a=a.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))==='<p data-block="0">```<wbr></p>'&&e.hint.recentLanguage&&(a='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),O("SpinVditorDOM",a,"argument",e.options.debugger),a=e.lute.SpinVditorDOM(a),O("SpinVditorDOM",a,"result",e.options.debugger),w)r.innerHTML=a;else if(r.outerHTML=a,S){var A=(0,m.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(A){var U=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+A.getAttribute("data-marker")+'"]');U&&U.setAttribute("aria-label",A.textContent.trim().substr(0,24))}}var z,q=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");q.forEach(function(W,R){R===0?h=W:(h.insertAdjacentHTML("beforeend",W.innerHTML),W.remove())}),q.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",q[0]);var F=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");F.forEach(function(W,R){R===0?z=W:(z.insertAdjacentHTML("beforeend",W.innerHTML),W.remove())}),F.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",F[0]),(0,_.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(W){ye(W,e)}),n&&(n.inputType==="deleteContentBackward"||n.inputType==="deleteContentForward")&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}ge(e),we(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},hr=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},vr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(S){try{w(i.next(S))}catch(b){o(b)}}function h(S){try{w(i.throw(S))}catch(b){o(b)}}function w(S){var b;S.done?r(S.value):(b=S.value,b instanceof n?b:new n(function(H){H(b)})).then(a,h)}w((i=i.apply(e,t||[])).next())})},gr=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(w){return function(S){return function(b){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&b[0]?i.return:b[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,b[1])).done)return r;switch(i=0,r&&(b=[2&b[0],r.value]),b[0]){case 0:case 1:r=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,i=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||b[0]!==6&&b[0]!==2)){a=0;continue}if(b[0]===3&&(!r||b[1]>r[0]&&b[1]<r[3])){a.label=b[1];break}if(b[0]===6&&a.label<r[1]){a.label=r[1],r=b;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(b);break}r[2]&&a.ops.pop(),a.trys.pop();continue}b=t.call(e,a)}catch(H){b=[6,H],i=0}finally{n=r=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([w,S])}}},hn=function(e,t,n){if(e.keyCode===229&&e.code===""&&e.key==="Unidentified"&&t.currentMode!=="sv"){var i=(0,m.F9)(n);if(i&&i.textContent.trim()==="")return t[t.currentMode].composingLock=!0,!1}return!0},vn=function(e,t,n){if(!(n.key==="Enter"||n.key==="Tab"||n.key==="Backspace"||n.key.indexOf("Arrow")>-1||(0,s.yl)(n)||n.key==="Escape"||n.shiftKey||n.altKey)){var i=(0,m.lG)(e.startContainer,"P")||(0,m.lG)(e.startContainer,"LI");if(i&&(0,_.im)(i,t[t.currentMode].element,e).start===0){i.nodeValue&&(i.nodeValue=i.nodeValue.replace(/\u2006/g,""));var r=document.createTextNode(f.g.ZWSP);e.insertNode(r),e.setStartAfter(r)}}},gn=function(e,t){if(t==="ArrowDown"||t==="ArrowUp"){var n=(0,m.a1)(e.startContainer,"data-type","math-inline")||(0,m.a1)(e.startContainer,"data-type","html-entity")||(0,m.a1)(e.startContainer,"data-type","html-inline");n&&(t==="ArrowDown"&&e.setStartAfter(n.parentElement),t==="ArrowUp"&&e.setStartBefore(n.parentElement))}},At=function(e,t){var n=(0,_.zh)(e),i=(0,m.F9)(n.startContainer);i&&(i.insertAdjacentHTML(t,'<p data-block="0">'+f.g.ZWSP+`<wbr>
  64. </p>`),(0,_.ib)(e[e.currentMode].element,n),ot(e),pe(e))},yr=function(e){var t=(0,m.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},br=function(e){var t=(0,m.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},yn=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling;return i||(i=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:e.parentElement.parentElement.tagName==="TBODY"&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),i&&(t.selectNodeContents(i),n||t.collapse(!1),(0,_.Hc)(t)),i},bt=function(e,t,n,i,r){var o=(0,_.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowDown"&&i.textContent.trimRight().substr(o.start).indexOf(`
  65. `)===-1||t.key==="ArrowRight"&&o.start>=i.textContent.trimRight().length){var a=r.nextElementSibling;return!a||a&&(a.tagName==="TABLE"||a.getAttribute("data-type"))?(r.insertAdjacentHTML("afterend",'<p data-block="0">'+f.g.ZWSP+"<wbr></p>"),(0,_.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!0),(0,_.Hc)(n)),t.preventDefault(),!0}return!1},at=function(e,t,n,i,r){var o=(0,_.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowUp"&&i.textContent.substr(0,o.start).indexOf(`
  66. `)===-1||(t.key==="ArrowLeft"||t.key==="Backspace"&&n.toString()==="")&&o.start===0){var a=r.previousElementSibling;return!a||a&&(a.tagName==="TABLE"||a.getAttribute("data-type"))?(r.insertAdjacentHTML("beforebegin",'<p data-block="0">'+f.g.ZWSP+"<wbr></p>"),(0,_.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!1),(0,_.Hc)(n)),t.preventDefault(),!0}return!1},Ct=function(e,t,n,i){i===void 0&&(i=!0);var r=(0,m.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(b){b.remove()}),t.insertNode(document.createElement("wbr")),i&&r){for(var o="",a=0;a<r.parentElement.childElementCount;a++){var h=r.parentElement.children[a].querySelector("input");h&&h.remove(),o+='<p data-block="0">'+r.parentElement.children[a].innerHTML.trimLeft()+"</p>"}r.parentElement.insertAdjacentHTML("beforebegin",o),r.parentElement.remove()}else if(r)if(n==="check")r.parentElement.querySelectorAll("li").forEach(function(b){b.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'+(b.textContent.indexOf(" ")===0?"":" ")),b.classList.add("vditor-task")});else{r.querySelector("input")&&r.parentElement.querySelectorAll("li").forEach(function(b){b.querySelector("input").remove(),b.classList.remove("vditor-task")});var w=void 0;n==="list"?(w=document.createElement("ul")).setAttribute("data-marker","*"):(w=document.createElement("ol")).setAttribute("data-marker","1."),w.setAttribute("data-block","0"),w.setAttribute("data-tight",r.parentElement.getAttribute("data-tight")),w.innerHTML=r.parentElement.innerHTML,r.parentElement.parentNode.replaceChild(w,r.parentElement)}else{var S=(0,m.a1)(t.startContainer,"data-block","0");S||(e[e.currentMode].element.querySelector("wbr").remove(),(S=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),n==="check"?(S.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '+S.innerHTML+"</li></ul>"),S.remove()):n==="list"?(S.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'+S.innerHTML+"</li></ul>"),S.remove()):n==="ordered-list"&&(S.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'+S.innerHTML+"</li></ol>"),S.remove())}},bn=function(e,t,n){var i=t.previousElementSibling;if(t&&i){var r=[t];Array.from(n.cloneContents().children).forEach(function(w,S){w.nodeType!==3&&t&&w.textContent.trim()!==""&&t.getAttribute("data-node-id")===w.getAttribute("data-node-id")&&(S!==0&&r.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(w){w.remove()}),n.insertNode(document.createElement("wbr"));var o=i.parentElement,a="";r.forEach(function(w){var S=w.getAttribute("data-marker");S.length!==1&&(S="1"+S.slice(-1)),a+='<li data-node-id="'+w.getAttribute("data-node-id")+'" data-marker="'+S+'">'+w.innerHTML+"</li>",w.remove()}),i.insertAdjacentHTML("beforeend","<"+o.tagName+' data-block="0">'+a+"</"+o.tagName+">"),e.currentMode==="wysiwyg"?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):o.outerHTML=e.lute.SpinVditorIRDOM(o.outerHTML),(0,_.ib)(e[e.currentMode].element,n);var h=(0,m.O9)(n.startContainer);h&&h.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(w){ye(w,e),e.currentMode==="wysiwyg"&&w.previousElementSibling.setAttribute("style","display:none")}),pe(e),ot(e)}else e[e.currentMode].element.focus()},Xt=function(e,t,n,i){var r=(0,m.lG)(t.parentElement,"LI");if(r){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(H){H.remove()}),n.insertNode(document.createElement("wbr"));var o=t.parentElement,a=o.cloneNode(),h=[t];Array.from(n.cloneContents().children).forEach(function(H,B){H.nodeType!==3&&t&&H.textContent.trim()!==""&&t.getAttribute("data-node-id")===H.getAttribute("data-node-id")&&(B!==0&&h.push(t),t=t.nextElementSibling)});var w=!1,S="";o.querySelectorAll("li").forEach(function(H){w&&(S+=H.outerHTML,H.nextElementSibling||H.previousElementSibling?H.remove():H.parentElement.remove()),H.isSameNode(h[h.length-1])&&(w=!0)}),h.reverse().forEach(function(H){r.insertAdjacentElement("afterend",H)}),S&&(a.innerHTML=S,h[0].insertAdjacentElement("beforeend",a)),e.currentMode==="wysiwyg"?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,_.ib)(e[e.currentMode].element,n);var b=(0,m.O9)(n.startContainer);b&&b.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(H){ye(H,e),e.currentMode==="wysiwyg"&&H.previousElementSibling.setAttribute("style","display:none")}),pe(e),ot(e)}else e[e.currentMode].element.focus()},xt=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,i=e.rows[0].cells.length,r=e.rows.length,o=0,a=0;a<r;a++)for(var h=0;h<i;h++)if(e.rows[a].cells[h].isSameNode(n)){o=h;break}for(var w=0;w<r;w++)e.rows[w].cells[o].setAttribute("align",t)},Jt=function(e){var t=e.trimRight().split(`
  67. `).pop();return t!==""&&(t.replace(/ |-/g,"")===""||t.replace(/ |_/g,"")===""||t.replace(/ |\*/g,"")==="")&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&t.trimLeft().indexOf(" ")===-1&&e.trimRight().split(`
  68. `).length>1)&&t.indexOf(" ")!==0&&t.indexOf(" ")!==0},Zt=function(e){var t=e.trimRight().split(`
  69. `);return(e=t.pop()).indexOf(" ")!==0&&e.indexOf(" ")!==0&&(e=e.trimLeft())!==""&&t.length!==0&&(e.replace(/-/g,"")===""||e.replace(/=/g,"")==="")},pe=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),e.currentMode==="wysiwyg"?we(e,t):e.currentMode==="ir"?Je(e,t):e.currentMode==="sv"&&Ae(e,t)},wn=function(e,t,n,i){var r,o=e.startContainer,a=(0,m.lG)(o,"LI");if(a){if(!(0,s.yl)(i)&&!i.altKey&&i.key==="Enter"&&!i.shiftKey&&n&&a.contains(n)&&n.nextElementSibling)return a&&!a.textContent.endsWith(`
  70. `)&&a.insertAdjacentText("beforeend",`
  71. `),e.insertNode(document.createTextNode(`
  72. `)),e.collapse(!1),pe(t),i.preventDefault(),!0;if(!((0,s.yl)(i)||i.shiftKey||i.altKey||i.key!=="Backspace"||a.previousElementSibling||e.toString()!==""||(0,_.im)(a,t[t.currentMode].element,e).start!==0))return a.nextElementSibling?(a.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+a.innerHTML+"</p>"),a.remove()):a.parentElement.outerHTML='<p data-block="0"><wbr>'+a.innerHTML+"</p>",(0,_.ib)(t[t.currentMode].element,e),pe(t),i.preventDefault(),!0;if(!(0,s.yl)(i)&&!i.shiftKey&&!i.altKey&&i.key==="Backspace"&&a.textContent.trim().replace(f.g.ZWSP,"")===""&&e.toString()===""&&((r=a.previousElementSibling)===null||r===void 0?void 0:r.tagName)==="LI")return a.previousElementSibling.insertAdjacentText("beforeend",`
  73. `),e.selectNodeContents(a.previousElementSibling),e.collapse(!1),a.remove(),(0,_.ib)(t[t.currentMode].element,e),pe(t),i.preventDefault(),!0;if(!(0,s.yl)(i)&&!i.altKey&&i.key==="Tab"){var h=!1;if((e.startOffset===0&&(o.nodeType===3&&!o.previousSibling||o.nodeType!==3&&o.nodeName==="LI")||a.classList.contains("vditor-task")&&e.startOffset===1&&o.previousSibling.nodeType!==3&&o.previousSibling.tagName==="INPUT")&&(h=!0),h||e.toString()!=="")return i.shiftKey?Xt(t,a,e,a.parentElement):bn(t,a,e),i.preventDefault(),!0}}return!1},Qt=function(e,t,n){if(e.options.tab&&n.key==="Tab")return n.shiftKey||(t.toString()===""?(t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)):(t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1))),(0,_.Hc)(t),pe(e),n.preventDefault(),!0},En=function(e,t,n,i){if(n){if(!(0,s.yl)(e)&&!e.altKey&&e.key==="Enter"){var r=String.raw(nn||(nn=hr(["",""],["",""])),n.textContent).replace(/\\\|/g,"").trim(),o=r.split("|");if(r.startsWith("|")&&r.endsWith("|")&&o.length>3){var a=o.map(function(){return"---"}).join("|");return a=n.textContent+`
  74. `+a.substring(3,a.length-3)+`
  75. |<wbr>`,n.outerHTML=t.lute.SpinVditorDOM(a),(0,_.ib)(t[t.currentMode].element,i),pe(t),Te(t),e.preventDefault(),!0}if(Jt(n.innerHTML)&&n.previousElementSibling){var h="",w=n.innerHTML.trimRight().split(`
  76. `);return w.length>1&&(w.pop(),h='<p data-block="0">'+w.join(`
  77. `)+"</p>"),n.insertAdjacentHTML("afterend",h+`<hr data-block="0"><p data-block="0"><wbr>
  78. </p>`),n.remove(),(0,_.ib)(t[t.currentMode].element,i),pe(t),Te(t),e.preventDefault(),!0}if(Zt(n.innerHTML))return t.currentMode==="wysiwyg"?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+`<p data-block="0"><wbr>
  79. </p>`):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+`<p data-block="0"><wbr>
  80. </p>`),(0,_.ib)(t[t.currentMode].element,i),pe(t),Te(t),e.preventDefault(),!0}if(i.collapsed&&n.previousElementSibling&&e.key==="Backspace"&&!(0,s.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split(`
  81. `).length>1&&(0,_.im)(n,t[t.currentMode].element,i).start===0){var S=(0,m.DX)(n.previousElementSibling);return S.textContent.endsWith(`
  82. `)||(S.textContent=S.textContent+`
  83. `),S.parentElement.insertAdjacentHTML("beforeend","<wbr>"+n.innerHTML),n.remove(),(0,_.ib)(t[t.currentMode].element,i),!1}return!1}},kn=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';n.tagName==="TH"?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>"+i+"</tr></tbody>"):n.parentElement.insertAdjacentHTML("afterend","<tr>"+i+"</tr>"),pe(e)},Sn=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)n.tagName==="TH"?i+='<th align="'+n.parentElement.children[r].getAttribute("align")+'"> </th>':i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';if(n.tagName==="TH"){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>"+i+"</tr></thead>"),t.insertNode(document.createElement("wbr"));var o=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",o),n.parentElement.parentElement.remove(),(0,_.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>"+i+"</tr>");pe(e)},Ht=function(e,t,n,i){i===void 0&&(i="afterend");for(var r=0,o=n.previousElementSibling;o;)r++,o=o.previousElementSibling;for(var a=0;a<t.rows.length;a++)a===0?t.rows[a].cells[r].insertAdjacentHTML(i,"<th> </th>"):t.rows[a].cells[r].insertAdjacentHTML(i,"<td> </td>");pe(e)},Ln=function(e,t,n){if(n.tagName==="TD"){var i=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(i.previousElementSibling.lastElementChild.lastElementChild),i.childElementCount===1?i.remove():n.parentElement.remove(),t.collapse(!1),(0,_.Hc)(t),pe(e)}},Mn=function(e,t,n,i){for(var r=0,o=i.previousElementSibling;o;)r++,o=o.previousElementSibling;(i.previousElementSibling||i.nextElementSibling)&&(t.selectNodeContents(i.previousElementSibling||i.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var h=n.rows[a].cells;if(h.length===1){n.remove(),ot(e);break}h[r].remove()}(0,_.Hc)(t),pe(e)},Tn=function(e,t,n){var i=n.startContainer,r=(0,m.lG)(i,"TD")||(0,m.lG)(i,"TH");if(r){if(!(0,s.yl)(t)&&!t.altKey&&t.key==="Enter"){r.lastElementChild&&(!r.lastElementChild||r.lastElementChild.isSameNode(r.lastChild)&&r.lastElementChild.tagName==="BR")||r.insertAdjacentHTML("beforeend","<br>");var o=document.createElement("br");return n.insertNode(o),n.setStartAfter(o),pe(e),Te(e),t.preventDefault(),!0}if(t.key==="Tab")return t.shiftKey?(yn(r,n),t.preventDefault(),!0):((b=r.nextElementSibling)||(b=r.parentElement.nextElementSibling?r.parentElement.nextElementSibling.firstElementChild:r.parentElement.parentElement.tagName==="THEAD"&&r.parentElement.parentElement.nextElementSibling?r.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),b&&(n.selectNodeContents(b),(0,_.Hc)(n)),t.preventDefault(),!0);var a=r.parentElement.parentElement.parentElement;if(t.key==="ArrowUp"){if(t.preventDefault(),r.tagName==="TH")return a.previousElementSibling?(n.selectNodeContents(a.previousElementSibling),n.collapse(!1),(0,_.Hc)(n)):At(e,"beforebegin"),!0;for(var h=0,w=r.parentElement;h<w.cells.length&&!w.cells[h].isSameNode(r);h++);var S=w.previousElementSibling;return S||(S=w.parentElement.previousElementSibling.firstChild),n.selectNodeContents(S.cells[h]),n.collapse(!1),(0,_.Hc)(n),!0}if(t.key==="ArrowDown"){var b;if(t.preventDefault(),!(w=r.parentElement).nextElementSibling&&r.tagName==="TD")return a.nextElementSibling?(n.selectNodeContents(a.nextElementSibling),n.collapse(!0),(0,_.Hc)(n)):At(e,"afterend"),!0;for(h=0;h<w.cells.length&&!w.cells[h].isSameNode(r);h++);return(b=w.nextElementSibling)||(b=w.parentElement.nextElementSibling.firstChild),n.selectNodeContents(b.cells[h]),n.collapse(!0),(0,_.Hc)(n),!0}if(e.currentMode==="wysiwyg"&&!(0,s.yl)(t)&&t.key==="Enter"&&!t.shiftKey&&t.altKey){var H=e.wysiwyg.popover.querySelector(".vditor-input");return H.focus(),H.select(),t.preventDefault(),!0}if(!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Backspace"&&n.startOffset===0&&n.toString()==="")return!yn(r,n,!1)&&a&&(a.textContent.trim()===""?(a.outerHTML=`<p data-block="0"><wbr>
  84. </p>`,(0,_.ib)(e[e.currentMode].element,n)):(n.setStartBefore(a),n.collapse(!0)),pe(e)),t.preventDefault(),!0;if(I("\u21E7\u2318F",t))return Sn(e,n,r),t.preventDefault(),!0;if(I("\u2318=",t))return kn(e,n,r),t.preventDefault(),!0;if(I("\u21E7\u2318G",t))return Ht(e,a,r,"beforebegin"),t.preventDefault(),!0;if(I("\u21E7\u2318=",t))return Ht(e,a,r),t.preventDefault(),!0;if(I("\u2318-",t))return Ln(e,n,r),t.preventDefault(),!0;if(I("\u21E7\u2318-",t))return Mn(e,n,a,r),t.preventDefault(),!0;if(I("\u21E7\u2318L",t)){if(e.currentMode==="ir")return xt(a,"left"),pe(e),t.preventDefault(),!0;if(B=e.wysiwyg.popover.querySelector('[data-type="left"]'))return B.click(),t.preventDefault(),!0}if(I("\u21E7\u2318C",t)){if(e.currentMode==="ir")return xt(a,"center"),pe(e),t.preventDefault(),!0;if(B=e.wysiwyg.popover.querySelector('[data-type="center"]'))return B.click(),t.preventDefault(),!0}if(I("\u21E7\u2318R",t)){if(e.currentMode==="ir")return xt(a,"right"),pe(e),t.preventDefault(),!0;var B;if(B=e.wysiwyg.popover.querySelector('[data-type="right"]'))return B.click(),t.preventDefault(),!0}}return!1},_n=function(e,t,n,i){if(n.tagName==="PRE"&&I("\u2318A",t))return i.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&t.key==="Tab"&&!t.shiftKey&&i.toString()==="")return i.insertNode(document.createTextNode(e.options.tab)),i.collapse(!1),pe(e),t.preventDefault(),!0;if(t.key==="Backspace"&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey){var r=(0,_.im)(n,e[e.currentMode].element,i);if((r.start===0||r.start===1&&n.innerText===`
  85. `)&&i.toString()==="")return n.parentElement.outerHTML='<p data-block="0"><wbr>'+n.firstElementChild.innerHTML+"</p>",(0,_.ib)(e[e.currentMode].element,i),pe(e),t.preventDefault(),!0}return!(0,s.yl)(t)&&!t.altKey&&t.key==="Enter"&&(n.firstElementChild.textContent.endsWith(`
  86. `)||n.firstElementChild.insertAdjacentText("beforeend",`
  87. `),i.extractContents(),i.insertNode(document.createTextNode(`
  88. `)),i.collapse(!1),(0,_.Hc)(i),(0,s.vU)()||(e.currentMode==="wysiwyg"?_t(e,i):J(e,i)),Te(e),t.preventDefault(),!0)},An=function(e,t,n,i){var r=t.startContainer,o=(0,m.lG)(r,"BLOCKQUOTE");if(o&&t.toString()===""){if(n.key==="Backspace"&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&(0,_.im)(o,e[e.currentMode].element,t).start===0)return t.insertNode(document.createElement("wbr")),o.outerHTML=o.innerHTML,(0,_.ib)(e[e.currentMode].element,t),pe(e),n.preventDefault(),!0;if(i&&n.key==="Enter"&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&i.parentElement.tagName==="BLOCKQUOTE"){var a=!1;if(i.innerHTML.replace(f.g.ZWSP,"")===`
  89. `||i.innerHTML.replace(f.g.ZWSP,"")===""?(a=!0,i.remove()):i.innerHTML.endsWith(`
  90. `)&&(0,_.im)(i,e[e.currentMode].element,t).start===i.textContent.length-1&&(i.innerHTML=i.innerHTML.substr(0,i.innerHTML.length-2),a=!0),a)return o.insertAdjacentHTML("afterend",'<p data-block="0">'+f.g.ZWSP+`<wbr>
  91. </p>`),(0,_.ib)(e[e.currentMode].element,t),pe(e),n.preventDefault(),!0}var h=(0,m.F9)(r);if(e.currentMode==="wysiwyg"&&h&&I("\u21E7\u2318;",n))return t.insertNode(document.createElement("wbr")),h.outerHTML='<blockquote data-block="0">'+h.outerHTML+"</blockquote>",(0,_.ib)(e.wysiwyg.element,t),we(e),n.preventDefault(),!0;if(bt(e,n,t,o,o)||at(e,n,t,o,o))return!0}return!1},Cn=function(e,t,n){var i=t.startContainer,r=(0,m.fb)(i,"vditor-task");if(r){if(I("\u21E7\u2318J",n)){var o=r.firstElementChild;return o.checked?o.removeAttribute("checked"):o.setAttribute("checked","checked"),pe(e),n.preventDefault(),!0}if(n.key==="Backspace"&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&t.toString()===""&&t.startOffset===1&&(i.nodeType===3&&i.previousSibling&&i.previousSibling.tagName==="INPUT"||i.nodeType!==3)){var a=r.previousElementSibling;return r.querySelector("input").remove(),a?((0,m.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+r.innerHTML.trim()),r.remove()):(r.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+(r.innerHTML.trim()||`
  92. `)+"</p>"),r.nextElementSibling?r.remove():r.parentElement.remove()),(0,_.ib)(e[e.currentMode].element,t),pe(e),n.preventDefault(),!0}if(n.key==="Enter"&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey){if(r.textContent.trim()==="")if((0,m.fb)(r.parentElement,"vditor-task")){var h=(0,m.O9)(i);h&&Xt(e,r,t,h)}else if(r.nextElementSibling){var w="",S="",b=!1;Array.from(r.parentElement.children).forEach(function(A){r.isSameNode(A)?b=!0:b?w+=A.outerHTML:S+=A.outerHTML});var H=r.parentElement.tagName,B=r.parentElement.tagName==="OL"?"":' data-marker="'+r.parentElement.getAttribute("data-marker")+'"',G="";S&&(G=r.parentElement.tagName==="UL"?"":' start="1"',S="<"+H+' data-tight="true"'+B+' data-block="0">'+S+"</"+H+">"),r.parentElement.outerHTML=S+`<p data-block="0"><wbr>
  93. </p><`+H+`
  94. data-tight="true"`+B+' data-block="0"'+G+">"+w+"</"+H+">"}else r.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
  95. </p>`),r.parentElement.querySelectorAll("li").length===1?r.parentElement.remove():r.remove();else i.nodeType!==3&&t.startOffset===0&&i.firstChild.tagName==="INPUT"?t.setStart(i.childNodes[1],1):(t.setEndAfter(r.lastChild),r.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'+r.getAttribute("data-marker")+'"><input type="checkbox"> <wbr></li>'),document.querySelector("wbr").after(t.extractContents()));return(0,_.ib)(e[e.currentMode].element,t),pe(e),Te(e),n.preventDefault(),!0}}return!1},xn=function(e,t,n,i){if(t.startContainer.nodeType!==3){var r=t.startContainer.children[t.startOffset];if(r&&r.tagName==="HR")return t.selectNodeContents(r.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(i){var o=i.previousElementSibling;if(o&&(0,_.im)(i,e[e.currentMode].element,t).start===0&&((0,s.vU)()&&o.tagName==="HR"||o.tagName==="TABLE")){if(o.tagName==="TABLE"){var a=o.lastElementChild.lastElementChild.lastElementChild;a.innerHTML=a.innerHTML.trimLeft()+"<wbr>"+i.textContent.trim(),i.remove()}else o.remove();return(0,_.ib)(e[e.currentMode].element,t),pe(e),n.preventDefault(),!0}}return!1},Hn=function(e){(0,s.vU)()&&e.startContainer.nodeType!==3&&e.startContainer.tagName==="HR"&&e.setStartBefore(e.startContainer)},Nn=function(e,t,n){var i,r;if(!(0,s.vU)())return!1;if(e.key==="ArrowUp"&&t&&((i=t.previousElementSibling)===null||i===void 0?void 0:i.tagName)==="TABLE"){var o=t.previousElementSibling;return n.selectNodeContents(o.rows[o.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!(e.key!=="ArrowDown"||!t||((r=t.nextElementSibling)===null||r===void 0?void 0:r.tagName)!=="TABLE")&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},Nt=function(e,t,n){return vr(void 0,void 0,void 0,function(){var i,r,o,a,h,w,S,b,H,B,G,A,U,z,q,F;return gr(this,function(W){switch(W.label){case 0:return e[e.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(i=t.clipboardData.getData("text/html"),r=t.clipboardData.getData("text/plain"),o=t.clipboardData.files):(i=t.dataTransfer.getData("text/html"),r=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items)),a={},h=function(R,Y){if(!Y)return["",Lute.WalkContinue];var se=R.TokensStr();if(R.__internal_object__.Parent.Type===34&&se&&se.indexOf("file://")===-1&&e.options.upload.linkToImgUrl){var ne=new XMLHttpRequest;ne.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&ne.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(ne.withCredentials=!0),fn(e,ne),ne.setRequestHeader("Content-Type","application/json; charset=utf-8"),ne.onreadystatechange=function(){if(ne.readyState===XMLHttpRequest.DONE){if(ne.status===200){var le=ne.responseText;e.options.upload.linkToImgFormat&&(le=e.options.upload.linkToImgFormat(ne.responseText));var ae=JSON.parse(le);if(ae.code!==0)return void e.tip.show(ae.msg);var Q=ae.data.originalURL;if(e.currentMode==="sv")e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(be){be.textContent===Q&&(be.textContent=ae.data.url)});else{var ce=e[e.currentMode].element.querySelector('img[src="'+Q+'"]');ce.src=ae.data.url,e.currentMode==="ir"&&(ce.previousElementSibling.previousElementSibling.innerHTML=ae.data.url)}pe(e)}else e.tip.show(ne.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(ne.responseText)}},ne.send(JSON.stringify({url:se}))}return e.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'+Lute.EscapeHTMLStr(se)+"</span>",Lute.WalkContinue]:e.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'+Lute.EscapeHTMLStr(se)+"</span>",Lute.WalkContinue]},i.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'+r+'">'+r+"</a>"&&i.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<!--StartFragment--><a href="'+r+'">'+r+"</a><!--EndFragment-->"||(i=""),(w=new DOMParser().parseFromString(i,"text/html")).body&&(i=w.body.innerHTML),i=Lute.Sanitize(i),e.wysiwyg.getComments(e),S=e[e.currentMode].element.scrollHeight,b=function(R,Y,se){se===void 0&&(se="sv");var ne=document.createElement("div");ne.innerHTML=R;var le=!1;ne.childElementCount===1&&ne.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(le=!0);var ae=ne.querySelectorAll("pre");if(ne.childElementCount===1&&ae.length===1&&ae[0].className!=="vditor-wysiwyg"&&ae[0].className!=="vditor-sv"&&(le=!0),R.indexOf(`
  96. <p class="p1">`)===0&&(le=!0),ne.childElementCount===1&&ne.firstElementChild.tagName==="TABLE"&&ne.querySelector(".line-number")&&ne.querySelector(".line-content")&&(le=!0),le){var Q=Y||R;return/\n/.test(Q)||ae.length===1?se==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'+Q.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"<wbr></code></pre></div>":"\n```\n"+Q.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"\n```":se==="wysiwyg"?"<code>"+Q.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</code><wbr>":"`"+Q+"`"}return!1}(i,r,e.currentMode),(H=e.currentMode==="sv"?(0,m.a1)(t.target,"data-type","code-block"):(0,m.lG)(t.target,"CODE"))?(e.currentMode==="sv"?document.execCommand("insertHTML",!1,r.replace(/&/g,"&amp;").replace(/</g,"&lt;")):(B=(0,_.im)(t.target,e[e.currentMode].element),H.parentElement.tagName!=="PRE"&&(r+=f.g.ZWSP),H.textContent=H.textContent.substring(0,B.start)+r+H.textContent.substring(B.end),(0,_.$j)(B.start+r.length,B.start+r.length,H.parentElement),!((F=H.parentElement)===null||F===void 0)&&F.nextElementSibling.classList.contains("vditor-"+e.currentMode+"__preview")&&(H.parentElement.nextElementSibling.innerHTML=H.outerHTML,ye(H.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return b?(n.pasteCode(b),[3,8]):[3,2];case 2:return i.trim()===""?[3,3]:((G=document.createElement("div")).innerHTML=i,G.querySelectorAll("[style]").forEach(function(R){R.removeAttribute("style")}),G.querySelectorAll(".vditor-copy").forEach(function(R){R.remove()}),e.currentMode==="ir"?(a.HTML2VditorIRDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:a}),(0,_.oC)(e.lute.HTML2VditorIRDOM(G.innerHTML),e)):e.currentMode==="wysiwyg"?(a.HTML2VditorDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:a}),(0,_.oC)(e.lute.HTML2VditorDOM(G.innerHTML),e)):(a.Md2VditorSVDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:a}),dn(e,e.lute.HTML2Md(G.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return o.length>0?e.options.upload.url||e.options.upload.handler?[4,Kt(e,o)]:[3,5]:[3,7];case 4:return W.sent(),[3,6];case 5:A=new FileReader,"clipboardData"in t?(o=t.clipboardData.files,U=o[0]):t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items,U=o[0].getAsFile()),U&&U.type.startsWith("image")&&(A.readAsDataURL(U),A.onload=function(){var R="";e.currentMode==="wysiwyg"?R+='<img alt="'+U.name+'" src="'+A.result.toString()+`">
  97. `:R+="!["+U.name+"]("+A.result.toString()+`)
  98. `,document.execCommand("insertHTML",!1,R)}),W.label=6;case 6:return[3,8];case 7:r.trim()!==""&&o.length===0&&((q=(0,_.zh)(e)).toString()!==""&&e.lute.IsValidLinkDest(r)&&(r="["+q.toString()+"]("+r+")"),e.currentMode==="ir"?(a.Md2VditorIRDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:a}),(0,_.oC)(e.lute.Md2VditorIRDOM(r),e)):e.currentMode==="wysiwyg"?(a.Md2VditorDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:a}),(0,_.oC)(e.lute.Md2VditorDOM(r),e)):(a.Md2VditorSVDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:a}),dn(e,r)),e.outline.render(e)),W.label=8;case 8:return e.currentMode!=="sv"&&((z=(0,m.F9)((0,_.zh)(e).startContainer))&&(q=(0,_.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(R){R.remove()}),q.insertNode(document.createElement("wbr")),e.currentMode==="wysiwyg"?z.outerHTML=e.lute.SpinVditorDOM(z.outerHTML):z.outerHTML=e.lute.SpinVditorIRDOM(z.outerHTML),(0,_.ib)(e[e.currentMode].element,q)),e[e.currentMode].element.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(R){ye(R,e)})),e.wysiwyg.triggerRemoveComment(e),pe(e),e[e.currentMode].element.scrollHeight-S>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&Te(e),[2]}})})},On=function(e){e.hint.render(e);var t=(0,_.zh)(e).startContainer,n=(0,m.a1)(t,"data-type","code-block-info");if(n)if(n.textContent.replace(f.g.ZWSP,"")===""&&e.hint.recentLanguage)n.textContent=f.g.ZWSP+e.hint.recentLanguage,(0,_.zh)(e).selectNodeContents(n);else{var i=[],r=n.textContent.substring(0,(0,_.im)(n,e.ir.element).start).replace(f.g.ZWSP,"");(e.options.preview.hljs.langs||f.g.CODE_LANGUAGES).forEach(function(o){o.indexOf(r.toLowerCase())>-1&&i.push({html:o,value:o})}),e.hint.genHTML(i,r,e)}},Je=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&On(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=u(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},wt=function(e,t){var n=(0,_.zh)(e),i=(0,m.F9)(n.startContainer)||n.startContainer;if(i){var r=i.querySelector(".vditor-ir__marker--heading");r?r.innerHTML=t:(i.insertAdjacentText("afterbegin",t),n.selectNodeContents(i),n.collapse(!1)),J(e,n.cloneRange()),ht(e)}},Ot=function(e,t,n){var i=(0,m.a1)(e.startContainer,"data-type",n);if(i){i.firstElementChild.remove(),i.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var r=document.createElement("div");r.innerHTML=t.lute.SpinVditorIRDOM(i.outerHTML),i.outerHTML=r.firstElementChild.innerHTML.trim()}},wr=function(e,t,n,i){var r=(0,_.zh)(e),o=t.getAttribute("data-type"),a=r.startContainer;a.nodeType===3&&(a=a.parentElement);var h=!0;if(t.classList.contains("vditor-menu--current"))if(o==="quote"){var w=(0,m.lG)(a,"BLOCKQUOTE");w&&(r.insertNode(document.createElement("wbr")),w.outerHTML=w.innerHTML.trim()===""?'<p data-block="0">'+w.innerHTML+"</p>":w.innerHTML)}else if(o==="link"){var S=(0,m.a1)(r.startContainer,"data-type","a");if(S){var b=(0,m.fb)(r.startContainer,"vditor-ir__link");b?(r.insertNode(document.createElement("wbr")),S.outerHTML=b.innerHTML):S.outerHTML=S.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else o==="italic"?Ot(r,e,"em"):o==="bold"?Ot(r,e,"strong"):o==="strike"?Ot(r,e,"s"):o==="inline-code"?Ot(r,e,"code"):o!=="check"&&o!=="list"&&o!=="ordered-list"||(Ct(e,r,o),h=!1,t.classList.remove("vditor-menu--current"));else{e.ir.element.childNodes.length===0&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,_.ib)(e.ir.element,r));var H=(0,m.F9)(r.startContainer);if(o==="line"){if(H){var B=`<hr data-block="0"><p data-block="0"><wbr>
  99. </p>`;H.innerHTML.trim()===""?H.outerHTML=B:H.insertAdjacentHTML("afterend",B)}}else if(o==="quote")H&&(r.insertNode(document.createElement("wbr")),H.outerHTML='<blockquote data-block="0">'+H.outerHTML+"</blockquote>",h=!1,t.classList.add("vditor-menu--current"));else if(o==="link"){var G=void 0;G=r.toString()===""?n+"<wbr>"+i:""+n+r.toString()+i.replace(")","<wbr>)"),document.execCommand("insertHTML",!1,G),h=!1,t.classList.add("vditor-menu--current")}else if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"){G=void 0,r.toString()===""?G=n+"<wbr>"+i:(G=o==="code"?n+`
  100. `+r.toString()+"<wbr>"+i:o==="table"?""+n+r.toString()+"<wbr>"+i:""+n+r.toString()+i+"<wbr>",r.deleteContents()),o!=="table"&&o!=="code"||(G=`
  101. `+G+`
  102. `);var A=document.createElement("span");A.innerHTML=G,r.insertNode(A),J(e,r),o==="table"&&(r.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,_.Hc)(r))}else o!=="check"&&o!=="list"&&o!=="ordered-list"||(Ct(e,r,o,!1),h=!1,l(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,_.ib)(e.ir.element,r),Je(e),h&&ht(e)},Er=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(S){try{w(i.next(S))}catch(b){o(b)}}function h(S){try{w(i.throw(S))}catch(b){o(b)}}function w(S){var b;S.done?r(S.value):(b=S.value,b instanceof n?b:new n(function(H){H(b)})).then(a,h)}w((i=i.apply(e,t||[])).next())})},kr=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(w){return function(S){return function(b){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&b[0]?i.return:b[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,b[1])).done)return r;switch(i=0,r&&(b=[2&b[0],r.value]),b[0]){case 0:case 1:r=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,i=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||b[0]!==6&&b[0]!==2)){a=0;continue}if(b[0]===3&&(!r||b[1]>r[0]&&b[1]<r[3])){a.label=b[1];break}if(b[0]===6&&a.label<r[1]){a.label=r[1],r=b;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(b);break}r[2]&&a.ops.pop(),a.trys.pop();continue}b=t.call(e,a)}catch(H){b=[6,H],i=0}finally{n=r=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([w,S])}}},Sr=function(){function e(t){var n=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(i,r){n.element.style.display="none";var o=decodeURIComponent(i.getAttribute("data-value")),a=window.getSelection().getRangeAt(0);if(r.currentMode==="ir"){var h=(0,m.a1)(a.startContainer,"data-type","code-block-info");if(h)return h.textContent=f.g.ZWSP+o.trimRight(),a.selectNodeContents(h),a.collapse(!1),Je(r),h.parentElement.querySelectorAll("code").forEach(function(H){H.className="language-"+o.trimRight()}),ye(h.parentElement.querySelector(".vditor-ir__preview"),r),void(n.recentLanguage=o.trimRight())}if(r.currentMode==="wysiwyg"&&a.startContainer.nodeType!==3){var w=a.startContainer,S=void 0;if((S=w.classList.contains("vditor-input")?w:w.firstElementChild)&&S.classList.contains("vditor-input"))return S.value=o.trimRight(),a.selectNodeContents(S),a.collapse(!1),S.dispatchEvent(new CustomEvent("input",{detail:1})),void(n.recentLanguage=o.trimRight())}if(a.setStart(a.startContainer,n.lastIndex),a.deleteContents(),r.options.hint.parse?r.currentMode==="sv"?(0,_.oC)(r.lute.SpinVditorSVDOM(o),r):r.currentMode==="wysiwyg"?(0,_.oC)(r.lute.SpinVditorDOM(o),r):(0,_.oC)(r.lute.SpinVditorIRDOM(o),r):(0,_.oC)(o,r),n.splitChar===":"&&o.indexOf(":")>-1&&r.currentMode!=="sv"&&a.insertNode(document.createTextNode(" ")),a.collapse(!1),(0,_.Hc)(a),r.currentMode==="wysiwyg")(b=(0,m.fb)(a.startContainer,"vditor-wysiwyg__block"))&&b.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(b.lastElementChild.innerHTML=b.firstElementChild.innerHTML,ye(b.lastElementChild,r));else if(r.currentMode==="ir"){var b;(b=(0,m.fb)(a.startContainer,"vditor-ir__marker--pre"))&&b.nextElementSibling.classList.contains("vditor-ir__preview")&&(b.nextElementSibling.innerHTML=b.innerHTML,ye(b.nextElementSibling,r))}pe(r)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",t.push({key:":"})}return e.prototype.render=function(t){var n=this;if(window.getSelection().focusNode){var i,r=getSelection().getRangeAt(0);i=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(i,t.options.hint.extend);if(o===void 0)this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var a=o===""?t.options.hint.emoji:t.lute.GetEmojis(),h=[];Object.keys(a).forEach(function(w){w.indexOf(o.toLowerCase())===0&&(a[w].indexOf(".")>-1?h.push({html:'<img src="'+a[w]+'" title=":'+w+':"/> :'+w+":",value:":"+w+":"}):h.push({html:'<span class="vditor-hint__emoji">'+a[w]+"</span>"+w,value:a[w]}))}),this.genHTML(h,o,t)}else t.options.hint.extend.forEach(function(w){w.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){return Er(n,void 0,void 0,function(){var S;return kr(this,function(b){switch(b.label){case 0:return S=this.genHTML,[4,w.hint(o)];case 1:return S.apply(this,[b.sent(),o,t]),[2]}})})},t.options.hint.delay))})}},e.prototype.genHTML=function(t,n,i){var r=this;if(t.length!==0){var o=i[i.currentMode].element,a=(0,_.Ny)(o),h=a.left+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0),w=a.top,S="";t.forEach(function(H,B){if(!(B>7)){var G=H.html;if(n!==""){var A=G.lastIndexOf(">")+1,U=G.substr(A),z=U.toLowerCase().indexOf(n.toLowerCase());z>-1&&(U=U.substring(0,z)+"<b>"+U.substring(z,z+n.length)+"</b>"+U.substring(z+n.length),G=G.substr(0,A)+U)}S+='<button type="button" data-value="'+encodeURIComponent(H.value)+` "
  103. `+(B===0?"class='vditor-hint--current'":"")+"> "+G+"</button>"}}),this.element.innerHTML=S;var b=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top=w+(b||22)+"px",this.element.style.left=h+"px",this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(H){H.addEventListener("click",function(B){r.fillEmoji(H,i),B.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top=w-this.element.offsetHeight+"px"),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")}else this.element.style.display="none"},e.prototype.select=function(t,n){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var i=this.element.querySelector(".vditor-hint--current");if(t.key==="ArrowDown")return t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.nextElementSibling?i.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(t.key==="ArrowUp"){if(t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.previousElementSibling)i.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!((0,s.yl)(t)||t.shiftKey||t.altKey||t.key!=="Enter"||t.isComposing)&&(t.preventDefault(),t.stopPropagation(),this.fillEmoji(i,n),!0)},e.prototype.getKey=function(t,n){var i,r=this;if(this.lastIndex=-1,this.splitChar="",n.forEach(function(w){var S=t.lastIndexOf(w.key);r.lastIndex<S&&(r.splitChar=w.key,r.lastIndex=S)}),this.lastIndex===-1)return i;var o=t.split(this.splitChar),a=o[o.length-1];if(o.length>1&&a.trim()===a)if(o.length===2&&o[0]===""&&o[1].length<32)i=o[1];else{var h=o[o.length-2].slice(-1);(0,d.X)(h)===" "&&a.length<32&&(i=a)}return i},e}(),Lr=function(){function e(t){this.composingLock=!1;var n=document.createElement("div");n.className="vditor-ir",n.innerHTML='<pre class="vditor-reset" placeholder="'+t.options.placeholder+`"
  104. contenteditable="true" spellcheck="false"></pre>`,this.element=n.firstElementChild,this.bindEvent(t),Bt(t,this.element),cn(t,this.element),Vt(t,this.element),Ft(t,this.element),Gt(t,this.element),Ut(t,this.element),Wt(t,this.element,this.copy),zt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){var i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=document.createElement("div");r.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorIRDOM2Md(r.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){Nt(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("scroll",function(){g(t,["hint"])}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,s.vU)()||J(t,getSelection().getRangeAt(0).cloneRange()),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop")return n.preventInput?(n.preventInput=!1,void Je(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(n.composingLock||i.data==="\u2018"||i.data==="\u201C"||i.data==="\u300A"||J(t,getSelection().getRangeAt(0).cloneRange(),!1,i))}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT")return i.target.checked?i.target.setAttribute("checked","checked"):i.target.removeAttribute("checked"),n.preventInput=!0,void Je(t);var r=(0,_.zh)(t),o=(0,m.fb)(i.target,"vditor-ir__preview");if(o||(o=(0,m.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,_.Hc)(r),Te(t)),i.target.tagName==="IMG"){var a=i.target.parentElement.querySelector(".vditor-ir__marker--link");a&&(r.selectNode(a),(0,_.Hc)(r))}var h=(0,m.a1)(i.target,"data-type","a");if(!h||h.classList.contains("vditor-ir__node--expand")){if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&r.collapsed){var w=n.element.lastElementChild.getBoundingClientRect();i.y>w.top+w.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(f.g.ZWSP,"")===""?(r.selectNodeContents(n.element.lastElementChild),r.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+f.g.ZWSP+"<wbr></p>"),(0,_.ib)(n.element,r)))}r.toString()===""?D(r,t):setTimeout(function(){D((0,_.zh)(t),t)}),ee(i,t),ht(t)}else t.options.link.click?t.options.link.click(h.querySelector(":scope > .vditor-ir__marker--link")):t.options.link.isOpen&&window.open(h.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,s.yl)(i))if(i.key==="Enter"&&Te(t),ht(t),i.key!=="Backspace"&&i.key!=="Delete"||t.ir.element.innerHTML===""||t.ir.element.childNodes.length!==1||!t.ir.element.firstElementChild||t.ir.element.firstElementChild.tagName!=="P"||t.ir.element.firstElementChild.childElementCount!==0||t.ir.element.textContent!==""&&t.ir.element.textContent!==`
  105. `){var r=(0,_.zh)(t);i.key==="Backspace"?((0,s.vU)()&&r.startContainer.textContent===`
  106. `&&r.startOffset===1&&(r.startContainer.textContent="",D(r,t)),n.element.querySelectorAll(".language-math").forEach(function(a){var h=a.querySelector("br");h&&h.remove()})):i.key.indexOf("Arrow")>-1?(i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||On(t),D(r,t)):i.keyCode===229&&i.code===""&&i.key==="Unidentified"&&D(r,t);var o=(0,m.fb)(r.startContainer,"vditor-ir__preview");if(o){if(i.key==="ArrowUp"||i.key==="ArrowLeft")return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),i.preventDefault(),!0;if(o.tagName==="SPAN"&&(i.key==="ArrowDown"||i.key==="ArrowRight"))return o.parentElement.getAttribute("data-type")==="html-entity"?(o.parentElement.insertAdjacentText("afterend",f.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),i.preventDefault(),!0}}else t.ir.element.innerHTML=""})},e}(),Dn=function(e){return e.currentMode==="sv"?e.lute.Md2HTML(u(e)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},Mr=K(895),In=K(818),Tr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'+t+`</div>
  107. <div class="vditor-outline__content"></div>`}return e.prototype.render=function(t){return t.preview.element.style.display==="block"?(0,In.k)(t.preview.previewElement,this.element.lastElementChild,t):(0,In.k)(t[t.currentMode].element,this.element.lastElementChild,t)},e.prototype.toggle=function(t,n,i){var r;n===void 0&&(n=!0),i===void 0&&(i=!0);var o=(r=t.toolbar.elements.outline)===null||r===void 0?void 0:r.firstElementChild;if(n&&window.innerWidth>=f.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(t),o==null||o.classList.add("vditor-menu--current")):(this.element.style.display="none",o==null||o.classList.remove("vditor-menu--current")),i&&getSelection().rangeCount>0){var a=getSelection().getRangeAt(0);t[t.currentMode].element.contains(a.startContainer)&&(0,_.Hc)(a)}he(t)},e}(),_r=K(554),Ar=function(){function e(t){var n=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",t.options.classes.preview&&this.previewElement.classList.add(t.options.classes.preview),this.previewElement.style.maxWidth=t.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(w){if(w.target.tagName!=="TEXTAREA"){var S=document.createElement("div");S.className="vditor-reset",S.appendChild(getSelection().getRangeAt(0).cloneContents()),n.copyToX(t,S,"default"),w.preventDefault()}}),this.previewElement.addEventListener("click",function(w){var S=(0,m.lG)(w.target,"SPAN");if(S&&(0,m.fb)(S,"vditor-toc")){var b=n.previewElement.querySelector("#"+S.getAttribute("data-target-id"));b&&(n.element.scrollTop=b.offsetTop)}else{if(w.target.tagName==="A")return t.options.link.click?t.options.link.click(w.target):t.options.link.isOpen&&window.open(w.target.getAttribute("href")),void w.preventDefault();w.target.tagName==="IMG"&&(t.options.image.preview?t.options.image.preview(w.target):t.options.image.isPreview&&(0,re.E)(w.target,t.options.lang,t.options.theme))}}),this.element.appendChild(this.previewElement);var i=t.options.preview.actions;if(i.length!==0){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],a=0;a<i.length;a++){var h=i[a];if(typeof h!="object")switch(h){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="\u590D\u5236\u5230\u516C\u4F17\u53F7"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":o.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="\u590D\u5236\u5230\u77E5\u4E4E"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else o.push('<button type="button" data-type="'+h.key+'" class="'+h.className+'"'+(h.tooltip?' aria-label="'+h.tooltip+'"':"")+'">'+h.text+"</button>")}r.innerHTML=o.join(""),r.addEventListener((0,s.Le)(),function(w){var S=(0,C.S)(w.target,"BUTTON");if(S){var b=S.getAttribute("data-type"),H=i.find(function(B){return(B==null?void 0:B.key)===b});H?H.click(b):b!=="mp-wechat"&&b!=="zhihu"?(n.previewElement.style.width=b==="desktop"?"auto":b==="tablet"?"780px":"360px",n.previewElement.scrollWidth>n.previewElement.parentElement.clientWidth&&(n.previewElement.style.width="auto"),n.render(t),r.querySelectorAll("button").forEach(function(B){B.classList.remove("vditor-preview__action--current")}),S.classList.add("vditor-preview__action--current")):n.copyToX(t,n.previewElement.cloneNode(!0),b)}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(t,n){var i=this;if(clearTimeout(this.mdTimeoutId),this.element.style.display!=="none")if(n)this.previewElement.innerHTML=n;else if(u(t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")!==""){var r=new Date().getTime(),o=u(t);this.mdTimeoutId=window.setTimeout(function(){if(t.options.preview.url){var a=new XMLHttpRequest;a.open("POST",t.options.preview.url),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE)if(a.status===200){var w=JSON.parse(a.responseText);if(w.code!==0)return void t.tip.show(w.msg);t.options.preview.transform&&(w.data=t.options.preview.transform(w.data)),i.previewElement.innerHTML=w.data,i.afterRender(t,r)}else{var S=t.lute.Md2HTML(o);t.options.preview.transform&&(S=t.options.preview.transform(S)),i.previewElement.innerHTML=S,i.afterRender(t,r)}},a.send(JSON.stringify({markdownText:o}))}else{var h=t.lute.Md2HTML(o);t.options.preview.transform&&(h=t.options.preview.transform(h)),i.previewElement.innerHTML=h,i.afterRender(t,r)}},t.options.preview.delay)}else this.previewElement.innerHTML="";else this.element.getAttribute("data-type")==="renderPerformance"&&t.tip.hide()},e.prototype.afterRender=function(t,n){t.options.preview.parse&&t.options.preview.parse(this.element);var i=new Date().getTime()-n;new Date().getTime()-n>2600?(t.tip.show(window.VditorI18n.performanceTip.replace("${x}",i.toString())),t.preview.element.setAttribute("data-type","renderPerformance")):t.preview.element.getAttribute("data-type")==="renderPerformance"&&(t.tip.hide(),t.preview.element.removeAttribute("data-type"));var r=t.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,V.O)(t.preview.previewElement,t.options.preview.hljs),(0,fe.s)(t.options.preview.hljs,t.preview.previewElement,t.options.cdn),(0,ve.i)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,Se.K)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ie.P)(t.preview.previewElement,t.options.cdn),(0,me.v)(t.preview.previewElement,t.options.cdn),(0,x.p)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ke.P)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,Pe.B)(t.preview.previewElement,t.options.cdn),(0,j.Q)(t.preview.previewElement,t.options.cdn),t.options.preview.render.media.enable&&(0,_r.Y)(t.preview.previewElement),t.options.customRenders.forEach(function(h){h.render(t.preview.previewElement,t)});var o=t.preview.element,a=t.outline.render(t);a===""&&(a="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(h){h.innerHTML=a,(0,de.H)(h,{cdn:t.options.cdn,math:t.options.preview.math})}),(0,de.H)(t.preview.previewElement,{cdn:t.options.cdn,math:t.options.preview.math})},e.prototype.copyToX=function(t,n,i){i===void 0&&(i="mp-wechat"),i!=="zhihu"?n.querySelectorAll(".katex-html .base").forEach(function(o){o.style.display="initial"}):n.querySelectorAll(".language-math").forEach(function(o){o.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'+o.getAttribute("data-math")+'\\" style="display: block; margin: 0 auto; max-width: 100%;">'}),n.style.backgroundColor="#fff",n.querySelectorAll("code").forEach(function(o){o.style.backgroundImage="none"}),this.element.append(n);var r=n.ownerDocument.createRange();r.selectNode(n),(0,_.Hc)(r),document.execCommand("copy"),n.remove(),t.tip.show(["zhihu","mp-wechat"].includes(i)?"\u5DF2\u590D\u5236\uFF0C\u53EF\u5230"+(i==="zhihu"?"\u77E5\u4E4E":"\u5FAE\u4FE1\u516C\u4F17\u53F7\u5E73\u53F0")+"\u8FDB\u884C\u7C98\u8D34":"\u5DF2\u590D\u5236\u5230\u526A\u5207\u677F")},e}(),Cr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--"+t.options.resize.position,this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(t)}return e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("mousedown",function(i){var r=document,o=i.clientY,a=t.element.offsetHeight,h=63+t.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),n.element.classList.add("vditor-resize--selected"),r.onmousemove=function(w){t.options.resize.position==="top"?t.element.style.height=Math.max(h,a+(o-w.clientY))+"px":t.element.style.height=Math.max(h,a+(w.clientY-o))+"px",t.options.typewriterMode&&(t.sv.element.style.paddingBottom=t.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){t.options.resize.after&&t.options.resize.after(t.element.offsetHeight-a),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,n.element.classList.remove("vditor-resize--selected")}})},e}(),xr=function(){function e(t){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",t.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(t),Bt(t,this.element),Vt(t,this.element),Ft(t,this.element),Gt(t,this.element),Ut(t,this.element),Wt(t,this.element,this.copy),zt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){t.stopPropagation(),t.preventDefault(),t.clipboardData.setData("text/plain",yt(n[n.currentMode].element))},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){Nt(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("scroll",function(){if(t.preview.element.style.display==="block"){var i=n.element.scrollTop,r=n.element.clientHeight,o=n.element.scrollHeight-parseFloat(n.element.style.paddingBottom||"0"),a=t.preview.element;a.scrollTop=i/r>.5?(i+r)*a.scrollHeight/o-r:i*a.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,s.vU)()||te(t,i),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"&&!n.composingLock&&i.data!=="\u2018"&&i.data!=="\u201C"&&i.data!=="\u300A")return n.preventInput?(n.preventInput=!1,void Ae(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void te(t,i)}),this.element.addEventListener("keyup",function(i){i.isComposing||(0,s.yl)(i)||(i.key!=="Backspace"&&i.key!=="Delete"||t.sv.element.innerHTML===""||t.sv.element.childNodes.length!==1||!t.sv.element.firstElementChild||t.sv.element.firstElementChild.tagName!=="DIV"||t.sv.element.firstElementChild.childElementCount!==2||t.sv.element.firstElementChild.textContent!==""&&t.sv.element.textContent!==`
  108. `?i.key==="Enter"&&Te(t):t.sv.element.innerHTML="")})},e}(),jn=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(t,n){var i=this;n===void 0&&(n=6e3),this.element.className="vditor-tip vditor-tip--show",n===0?(this.element.innerHTML='<div class="vditor-tip__content">'+t+`
  109. <div class="vditor-tip__close">X</div></div>`,this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){i.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'+t+"</div>",setTimeout(function(){i.hide()},n)),this.element.removeAttribute("style"),setTimeout(function(){i.element.getBoundingClientRect().top<46&&(i.element.style.position="fixed",i.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),Yt=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),p(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",l(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},Hr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Nr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.preview.mode==="both"&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,s.Le)(),function(o){r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)||(o.preventDefault(),n.currentMode==="sv"&&(n.options.preview.mode==="both"?Yt("editor",n):Yt("both",n)))}),r}return Hr(t,e),t}(Le),Or=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},Rn=K(312),Dr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ir=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],a=document.createElement("div");a.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var h="";return f.g.CODE_THEME.forEach(function(w){h+="<button>"+w+"</button>"}),a.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+h+"</div>",a.addEventListener((0,s.Le)(),function(w){w.target.tagName==="BUTTON"&&(g(n,["subToolbar"]),n.options.preview.hljs.style=w.target.textContent,(0,Rn.Y)(w.target.textContent,n.options.cdn),w.preventDefault(),w.stopPropagation())}),r.element.appendChild(a),k(n,a,o,i.level),r}return Dr(t,e),t}(Le),jr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],a=document.createElement("div");a.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var h="";return Object.keys(n.options.preview.theme.list).forEach(function(w){h+='<button data-type="'+w+'">'+n.options.preview.theme.list[w]+"</button>"}),a.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+h+"</div>",a.addEventListener((0,s.Le)(),function(w){w.target.tagName==="BUTTON"&&(g(n,["subToolbar"]),n.options.preview.theme.current=w.target.getAttribute("data-type"),(0,Z.Z)(n.options.preview.theme.current,n.options.preview.theme.path),w.preventDefault(),w.stopPropagation())}),r.element.appendChild(a),k(n,a,o,i.level),r}return jr(t,e),t}(Le),Pr=function(){function e(t){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(t,"")}return e.prototype.render=function(t,n){var i=n.endsWith(`
  110. `)?n.length-1:n.length;if(t.options.counter.type==="text"&&t[t.currentMode]){var r=t[t.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(o){o.remove()}),i=r.textContent.length}typeof t.options.counter.max=="number"?(i>t.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML=i+"/"+t.options.counter.max):this.element.innerHTML=""+i,this.element.setAttribute("aria-label",t.options.counter.type),t.options.counter.after&&t.options.counter.after(i,{enable:t.options.counter.enable,max:t.options.counter.max,type:t.options.counter.type})},e}(),qr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Br=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].innerHTML=i.icon,r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),o.currentTarget.classList.contains(f.g.CLASS_MENU_DISABLED)||i.click(o,n)}),r}return qr(t,e),t}(Le),Vr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ur=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.firstElementChild.addEventListener((0,s.Le)(),function(o){var a=r.element.firstElementChild;a.classList.contains(f.g.CLASS_MENU_DISABLED)||(o.preventDefault(),a.classList.contains("vditor-menu--current")?(a.classList.remove("vditor-menu--current"),n.devtools.element.style.display="none",he(n)):(a.classList.add("vditor-menu--current"),n.devtools.element.style.display="block",he(n),n.devtools.renderEchart(n)))}),r}return Vr(t,e),t}(Le),Wr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},zr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var a="";return Object.keys(n.options.hint.emoji).forEach(function(h){var w=n.options.hint.emoji[h];w.indexOf(".")>-1?a+='<button data-value=":'+h+': " data-key=":'+h+`:"><img
  111. data-value=":`+h+': " data-key=":'+h+':" class="vditor-emojis__icon" src="'+w+'"/></button>':a+='<button data-value="'+w+` "
  112. data-key="`+h+'"><span class="vditor-emojis__icon">'+w+"</span></button>"}),o.innerHTML='<div class="vditor-emojis" style="max-height: '+(n.options.height==="auto"?"auto":n.options.height-80)+'px">'+a+`</div><div class="vditor-emojis__tail">
  113. <span class="vditor-emojis__tip"></span><span>`+(n.options.hint.emojiTail||"")+`</span>
  114. </div>`,r.element.appendChild(o),k(n,o,r.element.firstElementChild,i.level),r.bindEvent(n),r}return zr(t,e),t.prototype.bindEvent=function(n){var i=this;this.element.lastElementChild.addEventListener((0,s.Le)(),function(r){var o=(0,C.S)(r.target,"BUTTON");if(o){r.preventDefault();var a=o.getAttribute("data-value"),h=(0,_.zh)(n),w=a;if(n.currentMode==="wysiwyg"?w=n.lute.SpinVditorDOM(a):n.currentMode==="ir"&&(w=n.lute.SpinVditorIRDOM(a)),a.indexOf(":")>-1&&n.currentMode!=="sv"){var S=document.createElement("div");S.innerHTML=w,w=S.firstElementChild.firstElementChild.outerHTML+" ",(0,_.oC)(w,n)}else h.extractContents(),h.insertNode(document.createTextNode(a));h.collapse(!1),(0,_.Hc)(h),i.element.lastElementChild.style.display="none",pe(n)}}),this.element.lastElementChild.addEventListener("mouseover",function(r){var o=(0,C.S)(r.target,"BUTTON");o&&(i.element.querySelector(".vditor-emojis__tip").innerHTML=o.getAttribute("data-key"))})},t}(Le),Pn=function(e,t,n){var i=document.createElement("a");"download"in i?(i.download=n,i.style.display="none",i.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(i),i.click(),i.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},Gr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Kr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],a=document.createElement("div");return a.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),a.innerHTML=`<button data-type="markdown">Markdown</button>
  115. <button data-type="pdf">PDF</button>
  116. <button data-type="html">HTML</button>`,a.addEventListener((0,s.Le)(),function(h){var w=h.target;if(w.tagName==="BUTTON"){switch(w.getAttribute("data-type")){case"markdown":(function(S){var b=u(S);Pn(S,b,b.substr(0,10)+".md")})(n);break;case"pdf":(function(S){S.tip.show(window.VditorI18n.generate,3800);var b=document.querySelector("#vditorExportIframe");b.contentDocument.open(),b.contentDocument.write('<link rel="stylesheet" href="'+S.options.cdn+`/dist/index.css"/>
  117. <script src="`+S.options.cdn+`/dist/method.min.js"><\/script>
  118. <div id="preview" style="width: 800px"></div>
  119. <script>
  120. window.addEventListener("message", (e) => {
  121. if(!e.data) {
  122. return;
  123. }
  124. Vditor.preview(document.getElementById('preview'), e.data, {
  125. cdn: "`+S.options.cdn+`",
  126. markdown: {
  127. theme: `+JSON.stringify(S.options.preview.theme)+`
  128. },
  129. hljs: {
  130. style: "`+S.options.preview.hljs.style+`"
  131. }
  132. });
  133. setTimeout(() => {
  134. window.print();
  135. }, 3600);
  136. }, false);
  137. <\/script>`),b.contentDocument.close(),setTimeout(function(){b.contentWindow.postMessage(u(S),"*")},200)})(n);break;case"html":(function(S){var b=Dn(S),H='<html><head><link rel="stylesheet" type="text/css" href="'+S.options.cdn+`/dist/index.css"/>
  138. <script src="`+S.options.cdn+"/dist/js/i18n/"+S.options.lang+`.js"><\/script>
  139. <script src="`+S.options.cdn+`/dist/method.min.js"><\/script></head>
  140. <body><div class="vditor-reset" id="preview">`+b+`</div>
  141. <script>
  142. const previewElement = document.getElementById('preview')
  143. Vditor.setContentTheme('`+S.options.preview.theme.current+"', '"+S.options.preview.theme.path+`');
  144. Vditor.codeRender(previewElement);
  145. Vditor.highlightRender(`+JSON.stringify(S.options.preview.hljs)+", previewElement, '"+S.options.cdn+`');
  146. Vditor.mathRender(previewElement, {
  147. cdn: '`+S.options.cdn+`',
  148. math: `+JSON.stringify(S.options.preview.math)+`,
  149. });
  150. Vditor.mermaidRender(previewElement, '`+S.options.cdn+"', '"+S.options.theme+`');
  151. Vditor.markmapRender(previewElement, '`+S.options.cdn+"', '"+S.options.theme+`');
  152. Vditor.flowchartRender(previewElement, '`+S.options.cdn+`');
  153. Vditor.graphvizRender(previewElement, '`+S.options.cdn+`');
  154. Vditor.chartRender(previewElement, '`+S.options.cdn+"', '"+S.options.theme+`');
  155. Vditor.mindmapRender(previewElement, '`+S.options.cdn+"', '"+S.options.theme+`');
  156. Vditor.abcRender(previewElement, '`+S.options.cdn+`');
  157. `+(S.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"")+`
  158. Vditor.speechRender(previewElement);
  159. <\/script>
  160. <script src="`+S.options.cdn+"/dist/js/icons/"+S.options.icon+'.js"><\/script></body></html>';Pn(S,H,b.substr(0,10)+".html")})(n)}g(n,["subToolbar"]),h.preventDefault(),h.stopPropagation()}}),r.element.appendChild(a),k(n,a,o,i.level),r}return Gr(t,e),t}(Le),Xr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n,i),r}return Xr(t,e),t.prototype._bindEvent=function(n,i){this.element.children[0].addEventListener((0,s.Le)(),function(r){r.preventDefault(),n.element.className.includes("vditor--fullscreen")?(i.level||(this.innerHTML=i.icon),n.element.style.zIndex="",document.body.style.overflow="",n.element.classList.remove("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(o){var a=n.toolbar.elements[o].firstChild;a&&(a.className=a.className.replace("__s","__n"),n.options.toolbar.forEach(function(h){typeof h!="string"&&h.tipPosition&&h.name===a.dataset.type&&(a.className="vditor-tooltipped vditor-tooltipped__"+h.tipPosition)}))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__s","__n"))):(i.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),n.element.style.zIndex=n.options.fullscreen.index.toString(),document.body.style.overflow="hidden",n.element.classList.add("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(o){var a=n.toolbar.elements[o].firstChild;a&&(a.className=a.className.replace("__n","__s"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__n","__s"))),n.devtools&&n.devtools.renderEchart(n),i.click&&i.click(r,n),he(n),oe(n)})},t}(Le),Zr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'+window.VditorI18n.heading1+" "+(0,s.ns)("&lt;\u2325\u23181>")+`</button>
  161. <button data-tag="h2" data-value="## ">`+window.VditorI18n.heading2+" &lt;"+(0,s.ns)("\u2325\u23182")+`></button>
  162. <button data-tag="h3" data-value="### ">`+window.VditorI18n.heading3+" &lt;"+(0,s.ns)("\u2325\u23183")+`></button>
  163. <button data-tag="h4" data-value="#### ">`+window.VditorI18n.heading4+" &lt;"+(0,s.ns)("\u2325\u23184")+`></button>
  164. <button data-tag="h5" data-value="##### ">`+window.VditorI18n.heading5+" &lt;"+(0,s.ns)("\u2325\u23185")+`></button>
  165. <button data-tag="h6" data-value="###### ">`+window.VditorI18n.heading6+" &lt;"+(0,s.ns)("\u2325\u23186")+"></button>",r.element.appendChild(o),r._bindEvent(n,o),r}return Zr(t,e),t.prototype._bindEvent=function(n,i){var r=this.element.children[0];r.addEventListener((0,s.Le)(),function(a){a.preventDefault(),clearTimeout(n.wysiwyg.afterRenderTimeoutId),clearTimeout(n.ir.processTimeoutId),clearTimeout(n.sv.processTimeoutId),r.classList.contains(f.g.CLASS_MENU_DISABLED)||(r.blur(),r.classList.contains("vditor-menu--current")?(n.currentMode==="wysiwyg"?(Pt(n),we(n)):n.currentMode==="ir"&&wt(n,""),r.classList.remove("vditor-menu--current")):(g(n,["subToolbar"]),i.style.display="block"))});for(var o=0;o<6;o++)i.children.item(o).addEventListener((0,s.Le)(),function(a){a.preventDefault(),n.currentMode==="wysiwyg"?(Mt(n,a.target.getAttribute("data-tag")),we(n),r.classList.add("vditor-menu--current")):n.currentMode==="ir"?(wt(n,a.target.getAttribute("data-value")),r.classList.add("vditor-menu--current")):pn(n,a.target.getAttribute("data-value")),i.style.display="none"})},t}(Le),Yr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),$r=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),n.tip.show(`<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">
  166. <div style="margin-top: 14px;flex: 1">
  167. <div>Markdown \u4F7F\u7528\u6307\u5357</div>
  168. <ul style="list-style: none">
  169. <li><a href="https://ld246.com/article/1583308420519" target="_blank">\u8BED\u6CD5\u901F\u67E5\u624B\u518C</a></li>
  170. <li><a href="https://ld246.com/article/1583129520165" target="_blank">\u57FA\u7840\u8BED\u6CD5</a></li>
  171. <li><a href="https://ld246.com/article/1583305480675" target="_blank">\u6269\u5C55\u8BED\u6CD5</a></li>
  172. <li><a href="https://ld246.com/article/1582778815353" target="_blank">\u952E\u76D8\u5FEB\u6377\u952E</a></li>
  173. </ul>
  174. </div>
  175. <div style="margin-top: 14px;flex: 1">
  176. <div>Vditor \u652F\u6301</div>
  177. <ul style="list-style: none">
  178. <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
  179. <li><a href="https://ld246.com/tag/vditor" target="_blank">\u5B98\u65B9\u8BA8\u8BBA\u533A</a></li>
  180. <li><a href="https://ld246.com/article/1549638745630" target="_blank">\u5F00\u53D1\u624B\u518C</a></li>
  181. <li><a href="https://ld246.com/guide/markdown" target="_blank">\u6F14\u793A\u5730\u5740</a></li>
  182. </ul>
  183. </div></div>`,0)}),r}return Yr(t,e),t}(Le),ei=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ti=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var a=(0,_.zh)(n),h=(0,m.lG)(a.startContainer,"LI");h&&bn(n,h,a)}}),r}return ei(t,e),t}(Le),ni=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ri=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),n.tip.show(`<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">
  184. <p style="text-align: center;margin: 14px 0">
  185. <em>\u4E0B\u4E00\u4EE3\u7684 Markdown \u7F16\u8F91\u5668\uFF0C\u4E3A\u672A\u6765\u800C\u6784\u5EFA</em>
  186. </p>
  187. <div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
  188. <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
  189. <div>&nbsp;&nbsp;</div>
  190. <div style="flex: 1;min-width: 250px">
  191. Vditor \u662F\u4E00\u6B3E\u6D4F\u89C8\u5668\u7AEF\u7684 Markdown \u7F16\u8F91\u5668\uFF0C\u652F\u6301\u6240\u89C1\u5373\u6240\u5F97\u3001\u5373\u65F6\u6E32\u67D3\uFF08\u7C7B\u4F3C Typora\uFF09\u548C\u5206\u5C4F\u9884\u89C8\u6A21\u5F0F\u3002
  192. \u5B83\u4F7F\u7528 TypeScript \u5B9E\u73B0\uFF0C\u652F\u6301\u539F\u751F JavaScript \u4EE5\u53CA Vue\u3001React\u3001Angular \u548C Svelte \u7B49\u6846\u67B6\u3002
  193. </div>
  194. </div>
  195. <div style="display: flex;flex-wrap: wrap;">
  196. <ul style="list-style: none;flex: 1;min-width:148px">
  197. <li>
  198. \u9879\u76EE\u5730\u5740\uFF1A<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
  199. </li>
  200. <li>
  201. \u5F00\u6E90\u534F\u8BAE\uFF1AMIT
  202. </li>
  203. </ul>
  204. <ul style="list-style: none;margin-right: 18px">
  205. <li>
  206. \u7EC4\u4EF6\u7248\u672C\uFF1AVditor v`+f.H+" / Lute v"+Lute.Version+`
  207. </li>
  208. <li>
  209. \u8D5E\u52A9\u6350\u8D60\uFF1A<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
  210. </li>
  211. </ul>
  212. </div>
  213. </div>`,0)}),r}return ni(t,e),t}(Le),ii=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),oi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||At(n,"afterend")}),r}return ii(t,e),t}(Le),ai=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),li=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||At(n,"beforebegin")}),r}return ai(t,e),t}(Le),si=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ci=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var a=(0,_.zh)(n),h=(0,m.lG)(a.startContainer,"LI");h&&Xt(n,h,a,h.parentElement)}}),r}return si(t,e),t}(Le),di=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ui=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),n.toolbar.elements.outline.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)||(n.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),n.outline.toggle(n,n.options.outline.enable))}),r}return di(t,e),t}(Le),pi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),mi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return pi(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,s.Le)(),function(r){r.preventDefault();var o=i.element.firstElementChild;if(!o.classList.contains(f.g.CLASS_MENU_DISABLED)){var a=f.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);o.classList.contains("vditor-menu--current")?(o.classList.remove("vditor-menu--current"),n.currentMode==="sv"?(n.sv.element.style.display="block",n.options.preview.mode==="both"?n.preview.element.style.display="block":n.preview.element.style.display="none"):(n[n.currentMode].element.parentElement.style.display="block",n.preview.element.style.display="none"),v(n.toolbar.elements,a),n.outline.render(n)):(L(n.toolbar.elements,a),n.preview.element.style.display="block",n.currentMode==="sv"?n.sv.element.style.display="none":n[n.currentMode].element.parentElement.style.display="none",n.preview.render(n),o.classList.add("vditor-menu--current"),g(n,["subToolbar","hint","popover"]),setTimeout(function(){n.outline.render(n)},n.options.preview.delay+10)),he(n)}})},t}(Le),fi=function(){function e(t){var n;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,typeof AudioContext<"u")n=new AudioContext;else{if(!webkitAudioContext)return;n=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=n.sampleRate;var i=n.createGain();n.createMediaStreamSource(t).connect(i),this.recorder=n.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,i.connect(this.recorder),this.recorder.connect(n.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(t,n){this.leftChannel.push(new Float32Array(t)),this.rightChannel.push(new Float32Array(n)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var t=this.mergeBuffers(this.leftChannel),n=this.mergeBuffers(this.rightChannel),i=new Float32Array(t.length),r=0;r<t.length;++r)i[r]=.5*(t[r]+n[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(i=this.downSampleBuffer(i,this.SAMPLE_RATE));var o=44+2*i.length,a=new ArrayBuffer(o),h=new DataView(a);this.writeUTFBytes(h,0,"RIFF"),h.setUint32(4,o,!0),this.writeUTFBytes(h,8,"WAVE"),this.writeUTFBytes(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,1,!0),h.setUint16(22,1,!0),h.setUint32(24,this.SAMPLE_RATE,!0),h.setUint32(28,2*this.SAMPLE_RATE,!0),h.setUint16(32,2,!0),h.setUint16(34,16,!0);var w=2*i.length;this.writeUTFBytes(h,36,"data"),h.setUint32(40,w,!0);for(var S=i.length,b=44,H=0;H<S;H++)h.setInt16(b,32767*i[H],!0),b+=2;return new Blob([h],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(t,n){if(n===this.DEFAULT_SAMPLE_RATE||n>this.DEFAULT_SAMPLE_RATE)return t;for(var i=this.DEFAULT_SAMPLE_RATE/n,r=Math.round(t.length/i),o=new Float32Array(r),a=0,h=0;a<o.length;){for(var w=Math.round((a+1)*i),S=0,b=0,H=h;H<w&&H<t.length;H++)S+=t[H],b++;o[a]=S/b,a++,h=w}return o},e.prototype.mergeBuffers=function(t){for(var n=new Float32Array(this.recordingLength),i=0,r=t.length,o=0;o<r;++o){var a=t[o];n.set(a,i),i+=a.length}return n},e.prototype.writeUTFBytes=function(t,n,i){for(var r=i.length,o=0;o<r;o++)t.setUint8(n+o,i.charCodeAt(o))},e}(),hi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),vi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return hi(t,e),t.prototype._bindEvent=function(n){var i,r=this;this.element.children[0].addEventListener((0,s.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)){var a=n[n.currentMode].element;if(i)if(i.isRecording){i.stopRecording(),n.tip.hide();var h=new File([i.buildWavFileBlob()],"record"+new Date().getTime()+".wav",{type:"video/webm"});Kt(n,[h]),r.element.children[0].classList.remove("vditor-menu--current")}else n.tip.show(window.VditorI18n.recording),a.setAttribute("contenteditable","false"),i.startRecordingNewWavFile(),r.element.children[0].classList.add("vditor-menu--current");else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(w){(i=new fi(w)).recorder.onaudioprocess=function(S){if(i.isRecording){var b=S.inputBuffer.getChannelData(0),H=S.inputBuffer.getChannelData(1);i.cloneChannelData(b,H)}},i.startRecordingNewWavFile(),n.tip.show(window.VditorI18n.recording),a.setAttribute("contenteditable","false"),r.element.children[0].classList.add("vditor-menu--current")}).catch(function(){n.tip.show(window.VditorI18n["record-tip"])})}})},t}(Le),gi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),yi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)||n.undo.redo(n)}),r}return gi(t,e),t}(Le),bi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),wi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,s.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED)||n.undo.undo(n)}),r}return bi(t,e),t}(Le),Ei=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ki=function(e){function t(n,i){var r=e.call(this,n,i)||this,o='<input type="file"';return n.options.upload.multiple&&(o+=' multiple="multiple"'),n.options.upload.accept&&(o+=' accept="'+n.options.upload.accept+'"'),r.element.children[0].innerHTML=""+(i.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>')+o+">",r._bindEvent(n),r}return Ei(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,s.Le)(),function(r){if(i.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(r){if(i.element.firstElementChild.classList.contains(f.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault();r.target.files.length!==0&&Kt(n,r.target.files,r.target)})},t}(Le),Si=function(){function e(t){var n=this,i=t.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",i.toolbar.forEach(function(r,o){var a=n.genItem(t,r,o);if(n.element.appendChild(a),r.toolbar){var h=document.createElement("div");h.className="vditor-hint vditor-panel--arrow",h.addEventListener((0,s.Le)(),function(w){h.style.display="none"}),r.toolbar.forEach(function(w,S){w.level=2,h.appendChild(n.genItem(t,w,o+S))}),a.appendChild(h),k(t,h,a.children[0])}}),t.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),t.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),t.options.counter.enable&&(t.counter=new Pr(t),this.element.appendChild(t.counter.element))}return e.prototype.genItem=function(t,n,i){var r;switch(n.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new Le(t,n);break;case"emoji":r=new Fr(t,n);break;case"headings":r=new Qr(t,n);break;case"|":r=new Wr;break;case"br":r=new Or;break;case"undo":r=new wi(t,n);break;case"redo":r=new yi(t,n);break;case"help":r=new $r(t,n);break;case"both":r=new Nr(t,n);break;case"preview":r=new mi(t,n);break;case"fullscreen":r=new Jr(t,n);break;case"upload":r=new ki(t,n);break;case"record":r=new vi(t,n);break;case"info":r=new ri(t,n);break;case"edit-mode":r=new cr(t,n);break;case"devtools":r=new Ur(t,n);break;case"outdent":r=new ci(t,n);break;case"indent":r=new ti(t,n);break;case"outline":r=new ui(t,n);break;case"insert-after":r=new oi(t,n);break;case"insert-before":r=new li(t,n);break;case"code-theme":r=new Ir(t,n);break;case"content-theme":r=new Rr(t,n);break;case"export":r=new Kr(t,n);break;default:r=new Br(t,n)}if(r){var o=n.name;return o!=="br"&&o!=="|"||(o+=i),this.elements[o]=r.element,r.element}},e}(),Li=K(471),Mi=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new Li}return e.prototype.clearStack=function(t){this.resetStack(),this.resetIcon(t)},e.prototype.resetIcon=function(t){t.toolbar&&(this[t.currentMode].undoStack.length>1?v(t.toolbar.elements,["undo"]):L(t.toolbar.elements,["undo"]),this[t.currentMode].redoStack.length!==0?v(t.toolbar.elements,["redo"]):L(t.toolbar.elements,["redo"]))},e.prototype.undo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"&&!(this[t.currentMode].undoStack.length<2)){var n=this[t.currentMode].undoStack.pop();n&&(this[t.currentMode].redoStack.push(n),this.renderDiff(n,t),this[t.currentMode].hasUndo=!0,g(t,["hint"]))}},e.prototype.redo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"){var n=this[t.currentMode].redoStack.pop();n&&(this[t.currentMode].undoStack.push(n),this.renderDiff(n,t,!0))}},e.prototype.recordFirstPosition=function(t,n){if(getSelection().rangeCount!==0&&!(this[t.currentMode].undoStack.length!==1||this[t.currentMode].undoStack[0].length===0||this[t.currentMode].redoStack.length>0||(0,s.vU)()&&n.key==="Backspace"||(0,s.G6)())){var i=this.addCaret(t);i.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[t.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[t.currentMode].undoStack[0][0].diffs[0][1]=i,this[t.currentMode].lastText=i)}},e.prototype.addToUndoStack=function(t){var n=this.addCaret(t,!0),i=this.dmp.diff_main(n,this[t.currentMode].lastText,!0),r=this.dmp.patch_make(n,this[t.currentMode].lastText,i);r.length===0&&this[t.currentMode].undoStack.length>0||(this[t.currentMode].lastText=n,this[t.currentMode].undoStack.push(r),this[t.currentMode].undoStack.length>this.stackSize&&this[t.currentMode].undoStack.shift(),this[t.currentMode].hasUndo&&(this[t.currentMode].redoStack=[],this[t.currentMode].hasUndo=!1,L(t.toolbar.elements,["redo"])),this[t.currentMode].undoStack.length>1&&v(t.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(t,n,i){var r;if(i===void 0&&(i=!1),i){var o=this.dmp.patch_deepCopy(t).reverse();o.forEach(function(h){h.diffs.forEach(function(w){w[0]=-w[0]})}),r=this.dmp.patch_apply(o,this[n.currentMode].lastText)[0]}else r=this.dmp.patch_apply(t,this[n.currentMode].lastText)[0];if(this[n.currentMode].lastText=r,n[n.currentMode].element.innerHTML=r,n.currentMode!=="sv"&&n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(h){ye(h,n)}),n[n.currentMode].element.querySelector("wbr"))(0,_.ib)(n[n.currentMode].element,n[n.currentMode].element.ownerDocument.createRange()),Te(n);else{var a=getSelection().getRangeAt(0);a.setEndBefore(n[n.currentMode].element),a.collapse(!1)}ge(n),pe(n,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),ot(n),n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(h){ye(h,n)}),this[n.currentMode].undoStack.length>1?v(n.toolbar.elements,["undo"]):L(n.toolbar.elements,["undo"]),this[n.currentMode].redoStack.length!==0?v(n.toolbar.elements,["redo"]):L(n.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(t,n){var i;if(n===void 0&&(n=!1),getSelection().rangeCount!==0&&!t[t.currentMode].element.querySelector("wbr")){var r=getSelection().getRangeAt(0);if(t[t.currentMode].element.contains(r.startContainer)){i=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}t.ir.element.cloneNode(!0).querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='1']").forEach(function(h){h.firstElementChild&&(h.firstElementChild.classList.contains("language-echarts")||h.firstElementChild.classList.contains("language-plantuml")||h.firstElementChild.classList.contains("language-mindmap")?(h.firstElementChild.removeAttribute("_echarts_instance_"),h.firstElementChild.removeAttribute("data-processed"),h.firstElementChild.innerHTML=h.previousElementSibling.firstElementChild.innerHTML,h.setAttribute("data-render","2")):h.firstElementChild.classList.contains("language-math")&&(h.setAttribute("data-render","2"),h.firstElementChild.textContent=h.firstElementChild.getAttribute("data-math"),h.firstElementChild.removeAttribute("data-math")))});var a=t[t.currentMode].element.innerHTML;return t[t.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(h){h.remove()}),n&&i&&(0,_.Hc)(i),a.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),Ti=K(640),_i=function(){function e(t){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:f.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"\u{1F44D}","-1":"\u{1F44E}",confused:"\u{1F615}",eyes:"\u{1F440}\uFE0F",heart:"\u2764\uFE0F",rocket:"\u{1F680}\uFE0F",smile:"\u{1F604}",tada:"\u{1F389}\uFE0F"},emojiPath:f.g.CDN+"/dist/images/emoji",extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:f.g.HLJS_OPTIONS,markdown:f.g.MARKDOWN_OPTIONS,math:f.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:f.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(n){return n.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=t}return e.prototype.merge=function(){var t,n,i,r,o,a,h,w,S;this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),!((n=(t=this.options.preview)===null||t===void 0?void 0:t.theme)===null||n===void 0)&&n.list&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),!((o=(r=(i=this.options.preview)===null||i===void 0?void 0:i.render)===null||r===void 0?void 0:r.media)===null||o===void 0)&&o.enable&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),!((a=this.options.hint)===null||a===void 0)&&a.emoji&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&(!((w=(h=this.options.preview)===null||h===void 0?void 0:h.theme)===null||w===void 0)&&w.path||(this.defaultOptions.preview.theme.path=this.options.cdn+"/dist/css/content-theme"),!((S=this.options.hint)===null||S===void 0)&&S.emojiPath||(this.defaultOptions.hint.emojiPath=this.options.cdn+"/dist/images/emoji")));var b=(0,Ti.T)(this.defaultOptions,this.options);if(b.cache.enable&&!b.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return b},e.prototype.mergeToolbar=function(t){var n=this,i=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"\u2318E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"\u2318H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"\u2318B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"\u2318I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"\u2318D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"\u2318K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"\u2318L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"\u2318O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"\u2318J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"\u21E7\u2318I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"\u21E7\u2318O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"\u2318;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"\u21E7\u2318H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"\u2318U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"\u2318G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"\u21E7\u2318B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"\u21E7\u2318E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"\u2318M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:` | col2 | col3 |
  214. | --- | --- | --- |
  215. | | | |
  216. | | | |`,tipPosition:"n"},{name:"|"},{hotkey:"\u2318Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"\u2318Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"\u2318'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"\u2318P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return t.forEach(function(o){var a=o;i.forEach(function(h){typeof o=="string"&&h.name===o&&(a=h),typeof o=="object"&&h.name===o.name&&(a=Object.assign({},h,o))}),o.toolbar&&(a.toolbar=n.mergeToolbar(o.toolbar)),r.push(a)}),r},e}(),Ai=function(){function e(t){var n=this;this.composingLock=!1,this.commentIds=[];var i=document.createElement("div");i.className="vditor-wysiwyg",i.innerHTML='<pre class="vditor-reset" placeholder="'+t.options.placeholder+`"
  217. contenteditable="true" spellcheck="false"></pre>
  218. <div class="vditor-panel vditor-panel--none"></div>
  219. <div class="vditor-panel vditor-panel--none">
  220. <button type="button" aria-label="`+window.VditorI18n.comment+`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
  221. <svg><use xlink:href="#vditor-icon-comment"></use></svg>
  222. </button>
  223. </div>`,this.element=i.firstElementChild,this.popover=i.firstElementChild.nextElementSibling,this.selectPopover=i.lastElementChild,this.bindEvent(t),Bt(t,this.element),cn(t,this.element),Vt(t,this.element),Ft(t,this.element),Gt(t,this.element),Ut(t,this.element),Wt(t,this.element,this.copy),zt(t,this.element,this.copy),t.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var r,o,a=Lute.NewNodeID(),h=getSelection().getRangeAt(0),w=h.cloneRange(),S=h.extractContents(),b=!1,H=!1;S.childNodes.forEach(function(A,U){var z=!1;if(A.nodeType===3?z=!0:A.classList.contains("vditor-comment")?A.classList.contains("vditor-comment")&&A.setAttribute("data-cmtids",A.getAttribute("data-cmtids")+" "+a):z=!0,z)if(A.nodeType!==3&&A.getAttribute("data-block")==="0"&&U===0&&w.startOffset>0)A.innerHTML='<span class="vditor-comment" data-cmtids="'+a+'">'+A.innerHTML+"</span>",r=A;else if(A.nodeType!==3&&A.getAttribute("data-block")==="0"&&U===S.childNodes.length-1&&w.endOffset<w.endContainer.textContent.length)A.innerHTML='<span class="vditor-comment" data-cmtids="'+a+'">'+A.innerHTML+"</span>",o=A;else if(A.nodeType!==3&&A.getAttribute("data-block")==="0")U===0?b=!0:U===S.childNodes.length-1&&(H=!0),A.innerHTML='<span class="vditor-comment" data-cmtids="'+a+'">'+A.innerHTML+"</span>";else{var q=document.createElement("span");q.classList.add("vditor-comment"),q.setAttribute("data-cmtids",a),A.parentNode.insertBefore(q,A),q.appendChild(A)}});var B=(0,m.F9)(w.startContainer);B&&(r?(B.insertAdjacentHTML("beforeend",r.innerHTML),r.remove()):B.textContent.trim().replace(f.g.ZWSP,"")===""&&b&&B.remove());var G=(0,m.F9)(w.endContainer);G&&(o?(G.insertAdjacentHTML("afterbegin",o.innerHTML),o.remove()):G.textContent.trim().replace(f.g.ZWSP,"")===""&&H&&G.remove()),h.insertNode(S),t.options.comment.add(a,h.toString(),n.getComments(t,!0)),we(t,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),n.hideComment()})}return e.prototype.getComments=function(t,n){var i=this;if(n===void 0&&(n=!1),t.currentMode!=="wysiwyg"||!t.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(o){i.commentIds=i.commentIds.concat(o.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return n?(this.commentIds.forEach(function(o){r.push({id:o,top:i.element.querySelector('.vditor-comment[data-cmtids="'+o+'"]').offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(t){var n,i,r;if(t.currentMode==="wysiwyg"&&t.options.comment.enable&&t.wysiwyg.commentIds.length>0){var o=JSON.parse(JSON.stringify(this.commentIds));this.getComments(t);var a=(n=o,i=this.commentIds,r=new Set(i),n.filter(function(h){return!r.has(h)}));a.length>0&&t.options.comment.remove(a)}},e.prototype.showComment=function(){var t=(0,_.Ny)(this.element);this.selectPopover.setAttribute("style","left:"+t.left+"px;display:block;top:"+Math.max(-8,t.top-21)+"px")},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(t,n){var i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=(0,m.lG)(i.startContainer,"CODE"),o=(0,m.lG)(i.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var a="";return a=r.parentElement.tagName==="PRE"?i.toString():"`"+i.toString()+"`",t.clipboardData.setData("text/plain",a),void t.clipboardData.setData("text/html","")}var h=(0,m.lG)(i.startContainer,"A"),w=(0,m.lG)(i.endContainer,"A");if(h&&w&&w.isSameNode(h)){var S=h.getAttribute("title")||"";return S&&(S=' "'+S+'"'),t.clipboardData.setData("text/plain","["+i.toString()+"]("+h.getAttribute("href")+S+")"),void t.clipboardData.setData("text/html","")}var b=document.createElement("div");b.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorDOM2Md(b.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(g(t,["hint"]),n.popover.style.display==="block"&&n.selectPopover.style.display==="block"){var i=parseInt(n.popover.getAttribute("data-top"),10);if(t.options.height==="auto"){if(t.options.toolbarConfig.pin){var r=Math.max(i,window.scrollY-t.element.offsetTop-8)+"px";n.popover.style.display==="block"&&(n.popover.style.top=r),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=r)}}else if(t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0){var o=Math.max(window.scrollY-t.element.offsetTop-8,Math.min(i-t.wysiwyg.element.scrollTop,n.element.clientHeight-21))+"px";n.popover.style.display==="block"&&(n.popover.style.top=o),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(g(t,["hint"]),t.options.comment&&t.options.comment.enable&&t.options.comment.scroll&&t.options.comment.scroll(t.wysiwyg.element.scrollTop),n.popover.style.display==="block"){var i=parseInt(n.popover.getAttribute("data-top"),10)-t.wysiwyg.element.scrollTop,r=-8;t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0&&(r=window.scrollY-t.element.offsetTop+r);var o=Math.max(r,Math.min(i,n.element.clientHeight-21))+"px";n.popover.style.top=o,n.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(i){Nt(t,i,{pasteCode:function(r){var o=(0,_.zh)(t),a=document.createElement("template");a.innerHTML=r,o.insertNode(a.content.cloneNode(!0));var h=(0,m.a1)(o.startContainer,"data-block","0");h?h.outerHTML=t.lute.SpinVditorDOM(h.outerHTML):t.wysiwyg.element.innerHTML=t.lute.SpinVditorDOM(t.wysiwyg.element.innerHTML),(0,_.ib)(t.wysiwyg.element,o)}})}),this.element.addEventListener("compositionstart",function(){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){var r=(0,C.W)(getSelection().getRangeAt(0).startContainer);r&&r.textContent===""?ge(t):((0,s.vU)()||_t(t,getSelection().getRangeAt(0).cloneRange(),i),n.composingLock=!1)}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"){if(n.preventInput)return n.preventInput=!1,void we(t);if(n.composingLock||i.data==="\u2018"||i.data==="\u201C"||i.data==="\u300A")we(t);else{var r=getSelection().getRangeAt(0),o=(0,m.F9)(r.startContainer);if(o||(an(t,r),o=(0,m.F9)(r.startContainer)),o){for(var a=(0,_.im)(o,t.wysiwyg.element,r).start,h=!0,w=a-1;w>o.textContent.substr(0,a).lastIndexOf(`
  224. `);w--)if(o.textContent.charAt(w)!==" "&&o.textContent.charAt(w)!==" "){h=!1;break}a===0&&(h=!1);var S=!0;for(w=a-1;w<o.textContent.length;w++)if(o.textContent.charAt(w)!==" "&&o.textContent.charAt(w)!==`
  225. `){S=!1;break}var b=(0,C.W)(getSelection().getRangeAt(0).startContainer);b&&b.textContent===""&&(ge(t),b.remove()),h&&o.getAttribute("data-type")!=="code-block"||S||Zt(o.innerHTML)||Jt(o.innerHTML)&&o.previousElementSibling?typeof t.options.input=="function"&&t.options.input(u(t)):(i.inputType==="insertParagraph"&&n.element.innerHTML==="<p><br></p><p><br></p>"&&o.previousElementSibling.remove(),_t(t,r,i))}}}}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT"){var r=i.target;return r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),n.preventInput=!0,void we(t)}if(i.target.tagName!=="IMG"||i.target.parentElement.classList.contains("vditor-wysiwyg__preview")){var o=(0,m.lG)(i.target,"A");if(o)return t.options.link.click?t.options.link.click(o):t.options.link.isOpen&&window.open(o.getAttribute("href")),void i.preventDefault();var a=(0,_.zh)(t);if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&a.collapsed){var h=n.element.lastElementChild.getBoundingClientRect();i.y>h.top+h.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(f.g.ZWSP,"")===""?(a.selectNodeContents(n.element.lastElementChild),a.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+f.g.ZWSP+"<wbr></p>"),(0,_.ib)(n.element,a)))}et(t);var w=(0,m.fb)(i.target,"vditor-wysiwyg__preview");w||(w=(0,m.fb)((0,_.zh)(t).startContainer,"vditor-wysiwyg__preview")),w&&vt(w,t),ee(i,t)}else i.target.getAttribute("data-type")==="link-ref"?ln(t,i.target):function(S,b){var H=S.target;b.wysiwyg.popover.innerHTML="";var B=function(){H.setAttribute("src",A.value),H.setAttribute("alt",z.value),H.setAttribute("title",F.value),typeof b.options.input=="function"&&b.options.input(u(b))},G=document.createElement("span");G.setAttribute("aria-label",window.VditorI18n.imageURL),G.className="vditor-tooltipped vditor-tooltipped__n";var A=document.createElement("input");G.appendChild(A),A.className="vditor-input",A.setAttribute("placeholder",window.VditorI18n.imageURL),A.value=H.getAttribute("src")||"",A.oninput=function(){B()},A.onkeydown=function(W){Ie(b,W)};var U=document.createElement("span");U.setAttribute("aria-label",window.VditorI18n.alternateText),U.className="vditor-tooltipped vditor-tooltipped__n";var z=document.createElement("input");U.appendChild(z),z.className="vditor-input",z.setAttribute("placeholder",window.VditorI18n.alternateText),z.style.width="52px",z.value=H.getAttribute("alt")||"",z.oninput=function(){B()},z.onkeydown=function(W){Ie(b,W)};var q=document.createElement("span");q.setAttribute("aria-label",window.VditorI18n.title),q.className="vditor-tooltipped vditor-tooltipped__n";var F=document.createElement("input");q.appendChild(F),F.className="vditor-input",F.setAttribute("placeholder",window.VditorI18n.title),F.value=H.getAttribute("title")||"",F.oninput=function(){B()},F.onkeydown=function(W){Ie(b,W)},Ue(H,b),b.wysiwyg.popover.insertAdjacentElement("beforeend",G),b.wysiwyg.popover.insertAdjacentElement("beforeend",U),b.wysiwyg.popover.insertAdjacentElement("beforeend",q),Ve(b,H)}(i,t)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,s.yl)(i)){i.key==="Enter"&&Te(t),i.key!=="Backspace"&&i.key!=="Delete"||t.wysiwyg.element.innerHTML===""||t.wysiwyg.element.childNodes.length!==1||!t.wysiwyg.element.firstElementChild||t.wysiwyg.element.firstElementChild.tagName!=="P"||t.wysiwyg.element.firstElementChild.childElementCount!==0||t.wysiwyg.element.textContent!==""&&t.wysiwyg.element.textContent!==`
  226. `||(t.wysiwyg.element.innerHTML="");var r=(0,_.zh)(t);if(i.key==="Backspace"&&(0,s.vU)()&&r.startContainer.textContent===`
  227. `&&r.startOffset===1&&(r.startContainer.textContent=""),an(t,r),et(t),i.key==="ArrowDown"||i.key==="ArrowRight"||i.key==="Backspace"||i.key==="ArrowLeft"||i.key==="ArrowUp"){i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||t.hint.render(t);var o=(0,m.fb)(r.startContainer,"vditor-wysiwyg__preview");if(!o&&r.startContainer.nodeType!==3&&r.startOffset>0&&(h=r.startContainer).classList.contains("vditor-wysiwyg__block")&&(o=h.lastElementChild),o)if(o.previousElementSibling.style.display!=="none"){var a=o.previousElementSibling;if(a.tagName==="PRE"&&(a=a.firstElementChild),i.key==="ArrowDown"||i.key==="ArrowRight"){var h,w=function(b){for(var H=b;H&&!H.nextSibling;)H=H.parentElement;return H.nextSibling}(h=o.parentElement);if(w&&w.nodeType!==3){var S=w.querySelector(".vditor-wysiwyg__preview");if(S)return void vt(S,t)}if(w.nodeType===3){for(;w.textContent.length===0&&w.nextSibling;)w=w.nextSibling;r.setStart(w,1)}else r.setStart(w.firstChild,0)}else r.selectNodeContents(a),r.collapse(!1)}else i.key==="ArrowDown"||i.key==="ArrowRight"?vt(o,t):vt(o,t,!1)}}})},e}(),Ci=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();const xi=function(e){function t(n,i){var r=e.call(this)||this;if(r.version=f.H,typeof n=="string"){if(i?i.cache?i.cache.id||(i.cache.id="vditor"+n):i.cache={id:"vditor"+n}:i={cache:{id:"vditor"+n}},!document.getElementById(n))return r.showErrorTip("Failed to get element by id: "+n),r;n=document.getElementById(n)}var o=new _i(i).merge();if(o.i18n)window.VditorI18n=o.i18n,r.init(n,o);else{if(!["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(o.lang))throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");var a="vditorI18nScript",h=a+o.lang;document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(w){w.id!==h&&document.head.removeChild(w)}),(0,c.G)(o.cdn+"/dist/js/i18n/"+o.lang+".js",h).then(function(){r.init(n,o)}).catch(function(w){r.showErrorTip("GET "+o.cdn+"/dist/js/i18n/"+o.lang+".js net::ERR_ABORTED 404 (Not Found)")})}return r}return Ci(t,e),t.prototype.showErrorTip=function(n){var i=new jn;document.body.appendChild(i.element),i.show(n,0)},t.prototype.setTheme=function(n,i,r,o){this.vditor.options.theme=n,ue(this.vditor),i&&(this.vditor.options.preview.theme.current=i,(0,Z.Z)(i,o||this.vditor.options.preview.theme.path)),r&&(this.vditor.options.preview.hljs.style=r,(0,Rn.Y)(r,this.vditor.options.cdn))},t.prototype.getValue=function(){return u(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.focus():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.focus():this.vditor.currentMode==="ir"&&this.vditor.ir.element.focus()},t.prototype.blur=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.blur():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.blur():this.vditor.currentMode==="ir"&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){g(this.vditor,["subToolbar","hint","popover"]),L(this.vditor.toolbar.elements,f.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){v(this.vditor.toolbar.elements,f.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return this.vditor.currentMode==="wysiwyg"?yt(this.vditor.wysiwyg.element):this.vditor.currentMode==="sv"?yt(this.vditor.sv.element):this.vditor.currentMode==="ir"?yt(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(n){this.vditor.preview.render(this.vditor,n)},t.prototype.getCursorPosition=function(){return(0,_.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(n){return this.vditor.lute.HTML2Md(n)},t.prototype.exportJSON=function(n){return this.vditor.lute.RenderJSON(n)},t.prototype.getHTML=function(){return Dn(this.vditor)},t.prototype.tip=function(n,i){this.vditor.tip.show(n,i)},t.prototype.setPreviewMode=function(n){Yt(n,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(n){document.execCommand("insertHTML",!1,n)},t.prototype.insertValue=function(n,i){i===void 0&&(i=!0);var r=(0,_.zh)(this.vditor);r.collapse(!0);var o=document.createElement("template");o.innerHTML=n,r.insertNode(o.content.cloneNode(!0)),r.collapse(!1),this.vditor.currentMode==="sv"?(this.vditor.sv.preventInput=!0,i&&te(this.vditor)):this.vditor.currentMode==="wysiwyg"?i&&_t(this.vditor,getSelection().getRangeAt(0)):this.vditor.currentMode==="ir"&&(this.vditor.ir.preventInput=!0,i&&J(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.setValue=function(n,i){var r=this;i===void 0&&(i=!1),this.vditor.currentMode==="sv"?(this.vditor.sv.element.innerHTML="<div data-block='0'>"+this.vditor.lute.SpinVditorSVDOM(n)+"</div>",Ae(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):this.vditor.currentMode==="wysiwyg"?sn(this.vditor,n,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(n),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){ye(o,r.vditor)}),Je(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),n||(g(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),i&&this.clearStack()},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var n=document.getElementById("vditorIconScript");n&&n.remove(),this.clearCache(),Xe(),this.vditor.wysiwyg.unbindListener()},t.prototype.getCommentIds=function(){return this.vditor.currentMode!=="wysiwyg"?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var i=function(r){r.classList.remove("vditor-comment--hover"),n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.unHlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var i=function(r){n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.removeCommentIds=function(n){var i=this;if(this.vditor.currentMode==="wysiwyg"){var r=function(o,a){var h=o.getAttribute("data-cmtids").split(" ");h.find(function(w,S){if(w===a)return h.splice(S,1),!0}),h.length===0?(o.outerHTML=o.innerHTML,(0,_.zh)(i.vditor).collapse(!0)):o.setAttribute("data-cmtids",h.join(" "))};n.forEach(function(o){i.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(a){r(a,o)}),i.vditor.preview.element.style.display!=="none"&&i.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(a){r(a,o)})}),we(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(n,i){var r=this;this.vditor={currentMode:i.mode,element:n,hint:new Sr(i.hint.extend),lute:void 0,options:i,originalInnerHTML:n.innerHTML,outline:new Tr(window.VditorI18n.outline),tip:new jn},this.vditor.sv=new xr(this.vditor),this.vditor.undo=new Mi,this.vditor.wysiwyg=new Ai(this.vditor),this.vditor.ir=new Lr(this.vditor),this.vditor.toolbar=new Si(this.vditor),i.resize.enable&&(this.vditor.resize=new Cr(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new y),(i.upload.url||i.upload.handler)&&(this.vditor.upload=new fr),(0,c.G)(i._lutePath||i.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){r.vditor.lute=(0,Mr.X)({autoSpace:r.vditor.options.preview.markdown.autoSpace,gfmAutoLink:r.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:r.vditor.options.preview.markdown.codeBlockPreview,emojiSite:r.vditor.options.hint.emojiPath,emojis:r.vditor.options.hint.emoji,fixTermTypo:r.vditor.options.preview.markdown.fixTermTypo,footnotes:r.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:r.vditor.options.preview.math.inlineDigit,linkBase:r.vditor.options.preview.markdown.linkBase,linkPrefix:r.vditor.options.preview.markdown.linkPrefix,listStyle:r.vditor.options.preview.markdown.listStyle,mark:r.vditor.options.preview.markdown.mark,mathBlockPreview:r.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:r.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:r.vditor.options.preview.markdown.sanitize,toc:r.vditor.options.preview.markdown.toc}),r.vditor.preview=new Ar(r.vditor),function(o){o.element.innerHTML="",o.element.classList.add("vditor"),o.options.rtl&&o.element.setAttribute("dir","rtl"),ue(o),(0,Z.Z)(o.options.preview.theme.current,o.options.preview.theme.path),typeof o.options.height=="number"?o.element.style.height=o.options.height+"px":o.element.style.height=o.options.height,typeof o.options.minHeight=="number"&&(o.element.style.minHeight=o.options.minHeight+"px"),typeof o.options.width=="number"?o.element.style.width=o.options.width+"px":o.element.style.width=o.options.width,o.element.appendChild(o.toolbar.element);var a=document.createElement("div");if(a.className="vditor-content",o.options.outline.position==="left"&&a.appendChild(o.outline.element),a.appendChild(o.wysiwyg.element.parentElement),a.appendChild(o.sv.element),a.appendChild(o.ir.element.parentElement),a.appendChild(o.preview.element),o.toolbar.elements.devtools&&a.appendChild(o.devtools.element),o.options.outline.position==="right"&&(o.outline.element.classList.add("vditor-outline--right"),a.appendChild(o.outline.element)),o.upload&&a.appendChild(o.upload.element),o.options.resize.enable&&a.appendChild(o.resize.element),a.appendChild(o.hint.element),a.appendChild(o.tip.element),o.element.appendChild(a),a.addEventListener("click",function(){g(o,["subToolbar"])}),o.toolbar.elements.export&&o.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),tt(o,o.options.mode,ar(o)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&window.visualViewport!==void 0){var h=!1,w=function(S){h||(h=!0,requestAnimationFrame(function(){h=!1;var b=o.toolbar.element;b.style.transform="none",b.getBoundingClientRect().top<0&&(b.style.transform="translate(0, "+-b.getBoundingClientRect().top+"px)")}))};window.visualViewport.addEventListener("scroll",w),window.visualViewport.addEventListener("resize",w)}}(r.vditor),i.after&&i.after(),i.icon&&(0,c.J)(i.cdn+"/dist/js/icons/"+i.icon+".js","vditorIconScript")})},t}(M.default)})(),De=De.default})())})(Ce);var Oe=Ce.exports;const xe=Jn(Oe),Re=(Be,Ke="default")=>{const He=Be==="dark";switch(Ke){case"default":return He?"dark":"classic";case"content":return He?"dark":"light";case"code":return He?"dracula":"github"}},St=Zn({inheritAttrs:!1,props:{height:{type:Number,default:360},value:{type:String,default:""}},emits:["change","get","update:value"],setup(Be,{attrs:Ke,emit:He}){const Ne=ut(null),K=ut(null),De=ut(!1),P=Ui(),{getLocale:M}=ji(),{getDarkMode:f}=Qn(),d=ut(Be.value||"");It([()=>f.value,()=>De.value],([l,p])=>{var v;p&&((v=y.getVditor())==null||v.setTheme(Re(l),Re(l,"content"),Re(l,"code")))},{immediate:!0,flush:"post"}),It(()=>Be.value,l=>{var p;l!==d.value&&((p=y.getVditor())==null||p.setValue(l)),d.value=l});const u=Ri(()=>{let l;switch(pt(M)){case"en":l="en_US";break;case"ja":l="ja_JP";break;case"ko":l="ko_KR";break;default:l="zh_CN"}return l});function c(){const l=pt(Ne);if(!l)return;const p=kt(kt({},Ke),Be),v=new xe(l,Gn(kt({theme:Re(f.value),lang:pt(u),mode:"sv",fullscreen:{index:520},preview:{theme:{current:Re(f.value,"content")},hljs:{style:Re(f.value,"code")},actions:[]},input:L=>{d.value=L,He("update:value",L),He("change",L)},after:()=>{Pi(()=>{var L;(L=P==null?void 0:P.redoModalHeight)==null||L.call(P),v.setValue(d.value),K.value=v,De.value=!0,He("get",y)})},blur:()=>{}},p),{cache:{enable:!1}}))}const y={getVditor:()=>K.value};function s(){var p;const l=pt(K);if(l){try{(p=l==null?void 0:l.destroy)==null||p.call(l)}catch(v){}K.value=null,De.value=!1}}return rr(c),Yn(s),$n(s),kt({wrapRef:Ne},y)}}),jt={ref:"wrapRef"};function Rt(Be,Ke,He,Ne,K,De){return er(),tr("div",jt,null,512)}const mt=qi(St,[["render",Rt]]);var Fe={exports:{}};(function(Be,Ke){(function(He,Ne){Be.exports=Ne()})(Xn,()=>(()=>{var He={54:(P,M,f)=>{f.d(M,{g:()=>d});var d=function(){function u(){}return u.ZWSP="\u200B",u.DROP_EDITOR="application/editor",u.MOBILE_WIDTH=520,u.CLASS_MENU_DISABLED="vditor-menu--disabled",u.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],u.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],u.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],u.CDN="https://unpkg.com/vditor@3.10.4",u.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},u.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},u.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},u.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:u.CDN+"/dist/css/content-theme"},u}()},478:(P,M,f)=>{f.d(M,{Q:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var p=c.abcRenderAdapter.getElements(s);p.length>0&&(0,u.G)(l+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){p.forEach(function(v){v.parentElement.classList.contains("vditor-wysiwyg__pre")||v.parentElement.classList.contains("vditor-ir__marker--pre")||v.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(v,c.abcRenderAdapter.getCode(v).trim()),v.style.overflowX="auto",v.setAttribute("data-processed","true"))})})}},156:(P,M,f)=>{f.r(M),f.d(M,{abcRenderAdapter:()=>l,chartRenderAdapter:()=>s,flowchartRenderAdapter:()=>v,graphvizRenderAdapter:()=>p,markmapRenderAdapter:()=>c,mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,mindmapRenderAdapter:()=>y,plantumlRenderAdapter:()=>L});var d={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-math")}},u={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-mermaid")}},c={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-markmap")}},y={getCode:function(E){return E.getAttribute("data-code")},getElements:function(E){return E.querySelectorAll(".language-mindmap")}},s={getCode:function(E){return E.innerText},getElements:function(E){return E.querySelectorAll(".language-echarts")}},l={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-abc")}},p={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-graphviz")}},v={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-flowchart")}},L={getCode:function(E){return E.textContent},getElements:function(E){return E.querySelectorAll(".language-plantuml")}}},314:(P,M,f)=>{f.d(M,{p:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l,p){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var v=c.chartRenderAdapter.getElements(s);v.length>0&&(0,u.G)(l+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var E=c.chartRenderAdapter.getCode(L).trim();if(E)try{if(L.getAttribute("data-processed")==="true")return;var T=JSON.parse(E);echarts.init(L,p==="dark"?"dark":void 0).setOption(T),L.setAttribute("data-processed","true")}catch(g){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+g}}})})}},730:(P,M,f)=>{f.d(M,{O:()=>c});var d=f(51),u=f(54),c=function(y,s){Array.from(y.querySelectorAll("pre > code")).filter(function(l,p){return!l.parentElement.classList.contains("vditor-wysiwyg__pre")&&!l.parentElement.classList.contains("vditor-ir__marker--pre")&&!(l.classList.contains("language-mermaid")||l.classList.contains("language-flowchart")||l.classList.contains("language-echarts")||l.classList.contains("language-mindmap")||l.classList.contains("language-plantuml")||l.classList.contains("language-markmap")||l.classList.contains("language-abc")||l.classList.contains("language-graphviz")||l.classList.contains("language-math"))&&!(l.style.maxHeight.indexOf("px")>-1)&&!(y.classList.contains("vditor-preview")&&p>5)}).forEach(function(l){var p,v,L,E=l.innerText;if(l.classList.contains("highlight-chroma")){var T=l.cloneNode(!0);T.querySelectorAll(".highlight-ln").forEach(function(C){C.remove()}),E=T.innerText}else E.endsWith(`
  228. `)&&(E=E.substr(0,E.length-1));var g='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(g='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var k=document.createElement("div");k.className="vditor-copy",k.innerHTML='<span aria-label="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"\u590D\u5236")+`"
  229. onmouseover="this.setAttribute('aria-label', '`+(((v=window.VditorI18n)===null||v===void 0?void 0:v.copy)||"\u590D\u5236")+`')"
  230. class="vditor-tooltipped vditor-tooltipped__w"
  231. onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"\u5DF2\u590D\u5236")+`');this.previousElementSibling.blur()">`+g+"</span>";var m=document.createElement("textarea");m.value=(0,d.X)(E),k.insertAdjacentElement("afterbegin",m),s&&s.renderMenu&&s.renderMenu(l,k),l.before(k),l.style.maxHeight=window.outerHeight-40+"px",l.insertAdjacentHTML("afterend",'<span style="position: absolute">'+u.g.ZWSP+"</span>")})}},66:(P,M,f)=>{f.d(M,{P:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){l===void 0&&(l=d.g.CDN);var p=c.flowchartRenderAdapter.getElements(s);p.length!==0&&(0,u.G)(l+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){p.forEach(function(v){if(v.getAttribute("data-processed")!=="true"){var L=flowchart.parse(c.flowchartRenderAdapter.getCode(v));v.innerHTML="",L.drawSVG(v),v.setAttribute("data-processed","true")}})})}},218:(P,M,f)=>{f.d(M,{v:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){l===void 0&&(l=d.g.CDN);var p=c.graphvizRenderAdapter.getElements(s);p.length!==0&&(0,u.G)(l+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){p.forEach(function(v){var L=c.graphvizRenderAdapter.getCode(v);if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")&&v.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var E=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),T=(window.URL||window.webkitURL).createObjectURL(E),g=new Worker(T);new Viz({worker:g}).renderSVGElement(L).then(function(k){v.innerHTML=k.outerHTML}).catch(function(k){v.innerHTML="graphviz render error: <br>"+k,v.className="vditor-reset--error"})}catch(k){}v.setAttribute("data-processed","true")}})})}},702:(P,M,f)=>{f.d(M,{s:()=>y});var d=f(54),u=f(526),c=f(578),y=function(s,l,p){l===void 0&&(l=document),p===void 0&&(p=d.g.CDN);var v=s.style;d.g.CODE_THEME.includes(v)||(v="github");var L=document.getElementById("vditorHljsStyle"),E=p+"/dist/js/highlight.js/styles/"+v+".css";L&&L.getAttribute("href")!==E&&L.remove(),(0,c.c)(p+"/dist/js/highlight.js/styles/"+v+".css","vditorHljsStyle"),s.enable!==!1&&l.querySelectorAll("pre > code").length!==0&&(0,u.G)(p+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){l.querySelectorAll("pre > code").forEach(function(T){if(!T.parentElement.classList.contains("vditor-ir__marker--pre")&&!T.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(T.classList.contains("language-mermaid")||T.classList.contains("language-flowchart")||T.classList.contains("language-echarts")||T.classList.contains("language-mindmap")||T.classList.contains("language-plantuml")||T.classList.contains("language-abc")||T.classList.contains("language-graphviz")||T.classList.contains("language-math"))&&(s.defaultLang!==""&&T.className.indexOf("language-")===-1&&T.classList.add("language-"+s.defaultLang),hljs.highlightElement(T),s.lineNumber)){T.classList.add("vditor-linenumber");var g=T.querySelector(".vditor-linenumber__temp");g||((g=document.createElement("div")).className="vditor-linenumber__temp",T.insertAdjacentElement("beforeend",g));var k=getComputedStyle(T).whiteSpace,m=!1;k!=="pre-wrap"&&k!=="pre-line"||(m=!0);var C="",O=T.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(j){var x="";m&&(g.textContent=j||`
  232. `,x=' style="height:'+g.getBoundingClientRect().height+'px"'),C+="<span"+x+"></span>"}),g.style.display="none",C='<span class="vditor-linenumber__rows">'+C+"</span>",T.insertAdjacentHTML("beforeend",C)}})})})})}},563:(P,M,f)=>{f.d(M,{K:()=>l});var d=f(54),u=f(526),c=f(156),y={},s=function(p,v){var L=window.markmap,E=L.Transformer,T=L.Markmap,g=L.deriveOptions,k=(L.globalCSS,new E);p.innerHTML='<svg style="width:100%"></svg>';var m=p.firstChild,C=T.create(m,null),O=function(ie,me){var fe=ie.transform(me),de=Object.keys(fe.features).filter(function(ye){return!y[ye]});de.forEach(function(ye){y[ye]=!0});var ve=ie.getAssets(de),Se=ve.styles,ke=ve.scripts,Pe=window.markmap;return Se&&Pe.loadCSS(Se),ke&&Pe.loadJS(ke),fe}(k,v),j=O.root,x=O.frontmatter,V=g(x==null?void 0:x.markmap);C.setData(j,V),C.fit()},l=function(p,v,L){v===void 0&&(v=d.g.CDN);var E=c.markmapRenderAdapter.getElements(p);E.length!==0&&(0,u.G)(v+"/dist/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){E.forEach(function(T){var g=c.markmapRenderAdapter.getCode(T);if(T.getAttribute("data-processed")!=="true"&&g.trim()!==""){var k=document.createElement("div");k.className="language-markmap",T.parentNode.appendChild(k),s(k,g),T.parentNode.childNodes[0].nodeName=="CODE"&&T.parentNode.removeChild(T.parentNode.childNodes[0])}})})}},466:(P,M,f)=>{f.d(M,{H:()=>l});var d=f(54),u=f(526),c=f(578),y=f(51),s=f(156),l=function(p,v){var L=s.mathRenderAdapter.getElements(p);if(L.length!==0){var E={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(v&&v.math&&(v.math=Object.assign({},E.math,v.math)),(v=Object.assign({},E,v)).math.engine==="KaTeX")(0,c.c)(v.cdn+"/dist/js/katex/katex.min.css?v=0.16.9","vditorKatexStyle"),(0,u.G)(v.cdn+"/dist/js/katex/katex.min.js?v=0.16.9","vditorKatexScript").then(function(){(0,u.G)(v.cdn+"/dist/js/katex/mhchem.min.js?v=0.16.9","vditorKatexChemScript").then(function(){L.forEach(function(g){if(!g.parentElement.classList.contains("vditor-wysiwyg__pre")&&!g.parentElement.classList.contains("vditor-ir__marker--pre")&&!g.getAttribute("data-math")){var k=(0,y.X)(s.mathRenderAdapter.getCode(g));g.setAttribute("data-math",k);try{g.innerHTML=katex.renderToString(k,{displayMode:g.tagName==="DIV",output:"html",macros:v.math.macros})}catch(m){g.innerHTML=m.message,g.className="language-math vditor-reset--error"}g.addEventListener("copy",function(m){m.stopPropagation(),m.preventDefault();var C=m.currentTarget.closest(".language-math");m.clipboardData.setData("text/html",C.innerHTML),m.clipboardData.setData("text/plain",C.getAttribute("data-math"))})}})})});else if(v.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:v.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:v.math.macros}},Object.assign(window.MathJax,v.math.mathJaxOptions)),(0,u.J)(v.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var T=function(g,k){var m=(0,y.X)(g.textContent).trim(),C=window.MathJax.getMetricsFor(g);C.display=g.tagName==="DIV",window.MathJax.tex2svgPromise(m,C).then(function(O){g.innerHTML="",g.setAttribute("data-math",m),g.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var j=O.querySelector('[data-mml-node="merror"]');j&&j.textContent.trim()!==""&&(g.innerHTML=j.textContent.trim(),g.className="vditor-reset--error"),k&&k()})};window.MathJax.startup.promise.then(function(){for(var g=[],k=function(C){var O=L[C];O.parentElement.classList.contains("vditor-wysiwyg__pre")||O.parentElement.classList.contains("vditor-ir__marker--pre")||O.getAttribute("data-math")||!(0,y.X)(O.textContent).trim()||g.push(function(j){C===L.length-1?T(O):T(O,j)})},m=0;m<L.length;m++)k(m);(function(C){if(C.length!==0){var O=0,j=C[C.length-1],x=function(){var V=C[O++];V===j?V():V(x)};x()}})(g)})}}}},554:(P,M,f)=>{f.d(M,{Y:()=>u});var d=f(835),u=function(c){c&&c.querySelectorAll("a").forEach(function(y){var s=y.getAttribute("href");s&&(s.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(l,p){l.insertAdjacentHTML("afterend",'<video controls="controls" src="'+p+'"></video>'),l.remove()}(y,s):s.match(/^.+.(mp3|wav|flac)$/)?function(l,p){l.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+p+'"></audio>'),l.remove()}(y,s):function(l,p){var v=p.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),L=p.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),E=p.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),T=p.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),g=p.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),k=p.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),m=p.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),C=p.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(v&&v[1].length===11)l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+v[1]+(v[2]?"?start="+v[2]:"")+'"></iframe>'),l.remove();else if(L&&L[1])l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+L[1]+'"></iframe>'),l.remove();else if(E&&E[1])l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+E[1]+'"></iframe>'),l.remove();else if(T&&T[1])l.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  233. src="//coub.com/embed/`+T[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),l.remove();else if(g&&g[0])l.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  234. src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(g[0])+'"></iframe>'),l.remove();else if(k&&k[2])l.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  235. src="https://www.dailymotion.com/embed/video/`+k[2]+'"></iframe>'),l.remove();else if(p.indexOf("bilibili.com")>-1&&(p.indexOf("bvid=")>-1||m&&m[1])){var O={bvid:(0,d.o)("bvid",p)||m&&m[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(p.startsWith("http")?p:"https:"+p).search.split("&").forEach(function(V,ie){if(V){ie===0&&(V=V.substr(1));var me=V.split("=");O[me[0]]=me[1]}});var j="https://player.bilibili.com/player.html?",x=Object.keys(O);x.forEach(function(V,ie){j+=V+"="+O[V],ie<x.length-1&&(j+="&")}),l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'+j+'"></iframe>'),l.remove()}else C&&C[1]&&(l.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+C[1]+'"></iframe>'),l.remove())}(y,s))})}},40:(P,M,f)=>{f.d(M,{i:()=>p});var d=f(54),u=f(526),c=f(156),y=f(835),s=function(v,L,E,T){return new(E||(E=Promise))(function(g,k){function m(j){try{O(T.next(j))}catch(x){k(x)}}function C(j){try{O(T.throw(j))}catch(x){k(x)}}function O(j){var x;j.done?g(j.value):(x=j.value,x instanceof E?x:new E(function(V){V(x)})).then(m,C)}O((T=T.apply(v,L||[])).next())})},l=function(v,L){var E,T,g,k,m={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return k={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function C(O){return function(j){return function(x){if(E)throw new TypeError("Generator is already executing.");for(;m;)try{if(E=1,T&&(g=2&x[0]?T.return:x[0]?T.throw||((g=T.return)&&g.call(T),0):T.next)&&!(g=g.call(T,x[1])).done)return g;switch(T=0,g&&(x=[2&x[0],g.value]),x[0]){case 0:case 1:g=x;break;case 4:return m.label++,{value:x[1],done:!1};case 5:m.label++,T=x[1],x=[0];continue;case 7:x=m.ops.pop(),m.trys.pop();continue;default:if(g=m.trys,!((g=g.length>0&&g[g.length-1])||x[0]!==6&&x[0]!==2)){m=0;continue}if(x[0]===3&&(!g||x[1]>g[0]&&x[1]<g[3])){m.label=x[1];break}if(x[0]===6&&m.label<g[1]){m.label=g[1],g=x;break}if(g&&m.label<g[2]){m.label=g[2],m.ops.push(x);break}g[2]&&m.ops.pop(),m.trys.pop();continue}x=L.call(v,m)}catch(V){x=[6,V],T=0}finally{E=g=0}if(5&x[0])throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}([O,j])}}},p=function(v,L,E){L===void 0&&(L=d.g.CDN);var T=c.mermaidRenderAdapter.getElements(v);T.length!==0&&(0,u.G)(L+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var g={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};E==="dark"&&(g.theme="dark"),mermaid.initialize(g),T.forEach(function(k){return s(void 0,void 0,void 0,function(){var m,C,O,j,x;return l(this,function(V){switch(V.label){case 0:if(m=c.mermaidRenderAdapter.getCode(k),k.getAttribute("data-processed")==="true"||m.trim()==="")return[2];C="mermaid"+(0,y.W)(),V.label=1;case 1:return V.trys.push([1,3,,4]),[4,mermaid.render(C,k.textContent)];case 2:return O=V.sent(),k.innerHTML=O.svg,[3,4];case 3:return j=V.sent(),x=document.querySelector("#"+C),k.innerHTML=x.outerHTML+`<br>
  236. <div style="text-align: left"><small>`+j.message.replace(/\n/,"<br>")+"</small></div>",x.parentElement.remove(),[3,4];case 4:return k.setAttribute("data-processed","true"),[2]}})})})})}},749:(P,M,f)=>{f.d(M,{P:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l,p){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var v=c.mindmapRenderAdapter.getElements(s);v.length>0&&(0,u.G)(l+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var E=c.mindmapRenderAdapter.getCode(L);if(E)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(E))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(T,g){var k;return!((k=g==null?void 0:g.data)===null||k===void 0)&&k.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(T){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+T}}})})}},818:(P,M,f)=>{f.d(M,{k:()=>c});var d=f(64),u=f(466),c=function(y,s,l){var p="",v=[];if(Array.from(y.children).forEach(function(g,k){if((0,d.W)(g)){if(l){var m=g.id.lastIndexOf("_");g.id=g.id.substring(0,m===-1?void 0:m)+"_"+k}v.push(g.id),p+=g.outerHTML.replace("<wbr>","")}}),p==="")return s.innerHTML="","";var L=document.createElement("div");if(l)l.lute.SetToC(!0),l.currentMode!=="wysiwyg"||l.preview.element.contains(y)?l.currentMode!=="ir"||l.preview.element.contains(y)?L.innerHTML=l.lute.HTML2VditorDOM("<p>[ToC]</p>"+p):L.innerHTML=l.lute.SpinVditorIRDOM("<p>[ToC]</p>"+p):L.innerHTML=l.lute.SpinVditorDOM("<p>[ToC]</p>"+p),l.lute.SetToC(l.options.preview.markdown.toc);else{s.classList.add("vditor-outline");var E=Lute.New();E.SetToC(!0),L.innerHTML=E.HTML2VditorDOM("<p>[ToC]</p>"+p)}var T=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return T.forEach(function(g,k){if(g.nextElementSibling&&g.nextElementSibling.tagName==="UL"){var m="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(m='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),g.innerHTML=m+"<span>"+g.innerHTML+"</span>"}else g.innerHTML="<svg></svg><span>"+g.innerHTML+"</span>";g.setAttribute("data-target-id",v[k])}),p=L.firstElementChild.innerHTML,T.length===0?(s.innerHTML="",p):(s.innerHTML=p,l&&(0,u.H)(s,{cdn:l.options.cdn,math:l.options.preview.math}),s.firstElementChild.addEventListener("click",function(g){for(var k=g.target;k&&!k.isEqualNode(s);){if(k.classList.contains("vditor-outline__action")){k.classList.contains("vditor-outline__action--close")?(k.classList.remove("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:block")):(k.classList.add("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:none")),g.preventDefault(),g.stopPropagation();break}if(k.getAttribute("data-target-id")){g.preventDefault(),g.stopPropagation();var m=document.getElementById(k.getAttribute("data-target-id"));if(!m)return;if(l)if(l.options.height==="auto"){var C=m.offsetTop+l.element.offsetTop;l.options.toolbarConfig.pin||(C+=l.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,C)}else l.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,l.element.offsetTop),l.preview.element.contains(y)?y.parentElement.scrollTop=m.offsetTop:y.scrollTop=m.offsetTop;else window.scrollTo(window.scrollX,m.offsetTop);break}k=k.parentElement}}),p)}},408:(P,M,f)=>{f.d(M,{B:()=>y});var d=f(54),u=f(526),c=f(156),y=function(s,l){s===void 0&&(s=document),l===void 0&&(l=d.g.CDN);var p=c.plantumlRenderAdapter.getElements(s);p.length!==0&&(0,u.G)(l+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){p.forEach(function(v){if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")){var L=c.plantumlRenderAdapter.getCode(v).trim();if(L)try{v.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'"/>'}catch(E){v.className="vditor-reset--error",v.innerHTML="plantuml render error: <br>"+E}}})})}},895:(P,M,f)=>{f.d(M,{X:()=>d});var d=function(u){var c=Lute.New();return c.PutEmojis(u.emojis),c.SetEmojiSite(u.emojiSite),c.SetHeadingAnchor(u.headingAnchor),c.SetInlineMathAllowDigitAfterOpenMarker(u.inlineMathDigit),c.SetAutoSpace(u.autoSpace),c.SetToC(u.toc),c.SetFootnotes(u.footnotes),c.SetFixTermTypo(u.fixTermTypo),c.SetVditorCodeBlockPreview(u.codeBlockPreview),c.SetVditorMathBlockPreview(u.mathBlockPreview),c.SetSanitize(u.sanitize),c.SetChineseParagraphBeginningSpace(u.paragraphBeginningSpace),c.SetRenderListStyle(u.listStyle),c.SetLinkBase(u.linkBase),c.SetLinkPrefix(u.linkPrefix),c.SetMark(u.mark),c.SetGFMAutoLink(u.gfmAutoLink),u.lazyLoadImage&&c.SetImageLazyLoading(u.lazyLoadImage),c}},863:(P,M,f)=>{f.d(M,{E:()=>d});var d=function(u,c,y){y===void 0&&(y="classic");var s=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(y==="dark"?" vditor--dark":"")+`">
  237. <div class="vditor-img__bar">
  238. <span class="vditor-img__btn" data-deg="0">
  239. <svg><use xlink:href="#vditor-icon-redo"></use></svg>
  240. `+window.VditorI18n.spin+`
  241. </span>
  242. <span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
  243. X &nbsp;`+window.VditorI18n.close+`
  244. </span>
  245. </div>
  246. <div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
  247. <img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+s.left+"px, "+(s.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
  248. </div>
  249. </div>`),document.body.style.overflow="hidden";var l=document.querySelector(".vditor-img img"),p="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-u.naturalHeight)/2+"px, 0)";setTimeout(function(){l.setAttribute("style","transition: transform .3s ease-in-out;transform: "+p),setTimeout(function(){l.parentElement.scrollTo((l.parentElement.scrollWidth-l.parentElement.clientWidth)/2,(l.parentElement.scrollHeight-l.parentElement.clientHeight)/2)},400)});var v=document.querySelector(".vditor-img__btn");v.addEventListener("click",function(){var L=parseInt(v.getAttribute("data-deg"),10)+90;L/90%2==1&&u.naturalWidth>l.parentElement.clientHeight?l.style.transform="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+(u.naturalWidth/2-u.naturalHeight/2)+"px, 0) rotateZ("+L+"deg)":l.style.transform=p+" rotateZ("+L+"deg)",v.setAttribute("data-deg",L.toString()),setTimeout(function(){l.parentElement.scrollTo((l.parentElement.scrollWidth-l.parentElement.clientWidth)/2,(l.parentElement.scrollHeight-l.parentElement.clientHeight)/2)},400)})}},312:(P,M,f)=>{f.d(M,{Y:()=>c});var d=f(54),u=f(578),c=function(y,s){s===void 0&&(s=d.g.CDN),d.g.CODE_THEME.includes(y)||(y="github");var l=document.getElementById("vditorHljsStyle"),p=s+"/dist/js/highlight.js/styles/"+y+".css";l?l.getAttribute("href")!==p&&(l.remove(),(0,u.c)(p,"vditorHljsStyle")):(0,u.c)(p,"vditorHljsStyle")}},227:(P,M,f)=>{f.d(M,{Z:()=>u});var d=f(578),u=function(c,y){if(c&&y){var s=document.getElementById("vditorContentTheme"),l=y+"/"+c+".css";s?s.getAttribute("href")!==l&&(s.remove(),(0,d.c)(l,"vditorContentTheme")):(0,d.c)(l,"vditorContentTheme")}}},526:(P,M,f)=>{f.d(M,{G:()=>u,J:()=>d});var d=function(c,y){if(document.getElementById(y))return!1;var s=new XMLHttpRequest;s.open("GET",c,!1),s.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),s.send("");var l=document.createElement("script");l.type="text/javascript",l.text=s.responseText,l.id=y,document.head.appendChild(l)},u=function(c,y){return new Promise(function(s,l){if(document.getElementById(y))return s(),!1;var p=document.createElement("script");p.src=c,p.async=!0,document.head.appendChild(p),p.onerror=function(v){l(v)},p.onload=function(){if(document.getElementById(y))return p.remove(),s(),!1;p.id=y,s()}})}},578:(P,M,f)=>{f.d(M,{c:()=>d});var d=function(u,c){if(!document.getElementById(c)){var y=document.createElement("link");y.id=c,y.rel="stylesheet",y.type="text/css",y.href=u,document.getElementsByTagName("head")[0].appendChild(y)}}},51:(P,M,f)=>{f.d(M,{X:()=>d});var d=function(u){return u.replace(/\u00a0/g," ")}},835:(P,M,f)=>{f.d(M,{W:()=>d,o:()=>u});var d=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(c){return(parseInt(c,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(c,10)/4).toString(16)})},u=function(c,y){y===void 0&&(y=window.location.search);var s=y.substring(y.indexOf("?")),l=s.indexOf("#");return new URLSearchParams(s.substring(0,l>=0?l:void 0)).get(c)}},827:(P,M,f)=>{f.d(M,{fb:()=>u,lG:()=>d});var d=function(c,y){if(!c)return!1;c.nodeType===3&&(c=c.parentElement);for(var s=c,l=!1;s&&!l&&!s.classList.contains("vditor-reset");)s.nodeName===y?l=!0:s=s.parentElement;return l&&s},u=function(c,y){if(!c)return!1;c.nodeType===3&&(c=c.parentElement);for(var s=c,l=!1;s&&!l&&!s.classList.contains("vditor-reset");)s.classList.contains(y)?l=!0:s=s.parentElement;return l&&s}},64:(P,M,f)=>{f.d(M,{W:()=>d});var d=function(u){var c=function(y,s){if(!y)return!1;y.nodeType===3&&(y=y.parentElement);for(var l=y,p=!1;l&&!p&&!l.classList.contains("vditor-reset");)l.nodeName.indexOf(s)===0?p=!0:l=l.parentElement;return p&&l}(u,"H");return!(!c||c.tagName.length!==2||c.tagName==="HR")&&c}},640:(P,M,f)=>{f.d(M,{T:()=>d});var d=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];for(var y={},s=function(p){for(var v in p)p.hasOwnProperty(v)&&(Object.prototype.toString.call(p[v])==="[object Object]"?y[v]=d(y[v],p[v]):y[v]=p[v])},l=0;l<u.length;l++)s(u[l]);return y}},393:(P,M,f)=>{f.d(M,{Hc:()=>d}),f(54);var d=function(u){var c=window.getSelection();c.removeAllRanges(),c.addRange(u)}}},Ne={};function K(P){var M=Ne[P];if(M!==void 0)return M.exports;var f=Ne[P]={exports:{}};return He[P](f,f.exports,K),f.exports}K.d=(P,M)=>{for(var f in M)K.o(M,f)&&!K.o(P,f)&&Object.defineProperty(P,f,{enumerable:!0,get:M[f]})},K.o=(P,M)=>Object.prototype.hasOwnProperty.call(P,M),K.r=P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})};var De={};return(()=>{K.d(De,{default:()=>ye});var P=K(478),M=K(156),f=K(314),d=K(730),u=K(66),c=K(218),y=K(702),s=function(_){_===void 0&&(_=document);var ge=function(ee){var N=document.createElement("img");N.src=ee.getAttribute("data-src"),N.addEventListener("load",function(){ee.getAttribute("style")||ee.getAttribute("class")||ee.getAttribute("width")||ee.getAttribute("height")||N.naturalHeight>N.naturalWidth&&N.naturalWidth/N.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&N.naturalHeight>window.innerHeight-40&&(ee.style.height=window.innerHeight-40+"px"),ee.src=N.src}),ee.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return _.querySelectorAll("img").forEach(function(ee){ee.getAttribute("data-src")&&ge(ee)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),_.querySelectorAll("img").forEach(function(ee){window.vditorImageIntersectionObserver.observe(ee)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(ee){ee.forEach(function(N){(N.isIntersecting===void 0?N.intersectionRatio!==0:N.isIntersecting)&&N.target.getAttribute("data-src")&&ge(N.target)})}),_.querySelectorAll("img").forEach(function(ee){window.vditorImageIntersectionObserver.observe(ee)}))},l=K(466),p=K(554),v=K(40),L=K(563),E=K(749),T=K(818),g=K(408),k=K(54),m=K(227),C=K(526),O=K(827),j=K(640),x=K(895),V=K(393),ie=function(_,ge){if(ge===void 0&&(ge="zh_CN"),typeof speechSynthesis<"u"&&typeof SpeechSynthesisUtterance<"u"){var ee=function(){var $,te;return speechSynthesis.getVoices().forEach(function(Z){Z.lang===ge.replace("_","-")&&($=Z),Z.default&&(te=Z)}),$||($=te),$},N='<svg><use xlink:href="#vditor-icon-play"></use></svg>',J='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(N='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',J='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var I=document.querySelector(".vditor-speech");I||((I=document.createElement("button")).className="vditor-speech",_.insertAdjacentElement("beforeend",I),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=ee));var D=ee(),re=new SpeechSynthesisUtterance;re.voice=D,re.onend=re.onerror=function(){I.style.display="none",speechSynthesis.cancel(),I.classList.remove("vditor-speech--current"),I.innerHTML=N},_.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function($){var te=$.target;if(te.classList.contains("vditor-speech")||te.parentElement.classList.contains("vditor-speech"))return I.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),I.innerHTML=J):(speechSynthesis.pause(),I.innerHTML=N)):(re.text=I.getAttribute("data-text"),speechSynthesis.speak(re),I.classList.add("vditor-speech--current"),I.innerHTML=J),(0,V.Hc)(window.vditorSpeechRange),void _.focus();if(I.style.display="none",speechSynthesis.cancel(),I.classList.remove("vditor-speech--current"),I.innerHTML=N,getSelection().rangeCount!==0){var Z=getSelection().getRangeAt(0),ue=Z.toString().trim();if(ue){window.vditorSpeechRange=Z.cloneRange();var he=Z.getBoundingClientRect();I.innerHTML=N,I.style.display="block",I.style.top=he.top+he.height+document.querySelector("html").scrollTop-20+"px",window.ontouchstart!==void 0?I.style.left=$.changedTouches[$.changedTouches.length-1].pageX+2+"px":I.style.left=$.clientX+2+"px",I.setAttribute("data-text",ue)}}})}},me=function(_,ge,ee,N){return new(ee||(ee=Promise))(function(J,I){function D(te){try{$(N.next(te))}catch(Z){I(Z)}}function re(te){try{$(N.throw(te))}catch(Z){I(Z)}}function $(te){var Z;te.done?J(te.value):(Z=te.value,Z instanceof ee?Z:new ee(function(ue){ue(Z)})).then(D,re)}$((N=N.apply(_,ge||[])).next())})},fe=function(_,ge){var ee,N,J,I,D={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return I={next:re(0),throw:re(1),return:re(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function re($){return function(te){return function(Z){if(ee)throw new TypeError("Generator is already executing.");for(;D;)try{if(ee=1,N&&(J=2&Z[0]?N.return:Z[0]?N.throw||((J=N.return)&&J.call(N),0):N.next)&&!(J=J.call(N,Z[1])).done)return J;switch(N=0,J&&(Z=[2&Z[0],J.value]),Z[0]){case 0:case 1:J=Z;break;case 4:return D.label++,{value:Z[1],done:!1};case 5:D.label++,N=Z[1],Z=[0];continue;case 7:Z=D.ops.pop(),D.trys.pop();continue;default:if(J=D.trys,!((J=J.length>0&&J[J.length-1])||Z[0]!==6&&Z[0]!==2)){D=0;continue}if(Z[0]===3&&(!J||Z[1]>J[0]&&Z[1]<J[3])){D.label=Z[1];break}if(Z[0]===6&&D.label<J[1]){D.label=J[1],J=Z;break}if(J&&D.label<J[2]){D.label=J[2],D.ops.push(Z);break}J[2]&&D.ops.pop(),D.trys.pop();continue}Z=ge.call(_,D)}catch(ue){Z=[6,ue],N=0}finally{ee=J=0}if(5&Z[0])throw Z[1];return{value:Z[0]?Z[1]:void 0,done:!0}}([$,te])}}},de=function(_){var ge,ee={anchor:0,cdn:k.g.CDN,customEmoji:{},emojiPath:k.g.CDN+"/dist/images/emoji",hljs:k.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:k.g.MARKDOWN_OPTIONS,math:k.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:k.g.THEME_OPTIONS};return _.cdn&&(!((ge=_.theme)===null||ge===void 0)&&ge.path||(ee.theme.path=_.cdn+"/dist/css/content-theme"),_.emojiPath||(ee.emojiPath=_.cdn+"/dist/images/emoji")),(0,j.T)(ee,_)},ve=function(_,ge){var ee=de(ge);return(0,C.G)(ee.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var N=(0,x.X)({autoSpace:ee.markdown.autoSpace,gfmAutoLink:ee.markdown.gfmAutoLink,codeBlockPreview:ee.markdown.codeBlockPreview,emojiSite:ee.emojiPath,emojis:ee.customEmoji,fixTermTypo:ee.markdown.fixTermTypo,footnotes:ee.markdown.footnotes,headingAnchor:ee.anchor!==0,inlineMathDigit:ee.math.inlineDigit,lazyLoadImage:ee.lazyLoadImage,linkBase:ee.markdown.linkBase,linkPrefix:ee.markdown.linkPrefix,listStyle:ee.markdown.listStyle,mark:ee.markdown.mark,mathBlockPreview:ee.markdown.mathBlockPreview,paragraphBeginningSpace:ee.markdown.paragraphBeginningSpace,sanitize:ee.markdown.sanitize,toc:ee.markdown.toc});return ge!=null&&ge.renderers&&N.SetJSRenderers({renderers:{Md2HTML:ge.renderers}}),N.SetHeadingID(!0),N.Md2HTML(_)})},Se=function(_,ge,ee){return me(void 0,void 0,void 0,function(){var N,J,I;return fe(this,function(D){switch(D.label){case 0:return N=de(ee),[4,ve(ge,N)];case 1:if(J=D.sent(),N.transform&&(J=N.transform(J)),_.innerHTML=J,_.classList.add("vditor-reset"),N.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(N.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return I="vditorI18nScript"+N.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function($){$.id!==I&&document.head.removeChild($)}),[4,(0,C.G)(N.cdn+"/dist/js/i18n/"+N.lang+".js",I)];case 3:D.sent(),D.label=4;case 4:return[3,6];case 5:window.VditorI18n=N.i18n,D.label=6;case 6:return N.icon?[4,(0,C.G)(N.cdn+"/dist/js/icons/"+N.icon+".js","vditorIconScript")]:[3,8];case 7:D.sent(),D.label=8;case 8:return(0,m.Z)(N.theme.current,N.theme.path),N.anchor===1&&_.classList.add("vditor-reset--anchor"),(0,d.O)(_,N.hljs),(0,y.s)(N.hljs,_,N.cdn),(0,l.H)(_,{cdn:N.cdn,math:N.math}),(0,v.i)(_,N.cdn,N.mode),(0,L.K)(_,N.cdn,N.mode),(0,u.P)(_,N.cdn),(0,c.v)(_,N.cdn),(0,f.p)(_,N.cdn,N.mode),(0,E.P)(_,N.cdn,N.mode),(0,g.B)(_,N.cdn),(0,P.Q)(_,N.cdn),N.render.media.enable&&(0,p.Y)(_),N.speech.enable&&ie(_),N.anchor!==0&&(re=N.anchor,document.querySelectorAll(".vditor-anchor").forEach(function($){re===1&&$.classList.add("vditor-anchor--left"),$.onclick=function(){var te=$.getAttribute("href").substr(1),Z=document.getElementById("vditorAnchor-"+te).offsetTop;document.querySelector("html").scrollTop=Z}}),window.onhashchange=function(){var $=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));$&&(document.querySelector("html").scrollTop=$.offsetTop)}),N.after&&N.after(),N.lazyLoadImage&&s(_),_.addEventListener("click",function($){var te=(0,O.lG)($.target,"SPAN");if(te&&(0,O.fb)(te,"vditor-toc")){var Z=_.querySelector("#"+te.getAttribute("data-target-id"));Z&&window.scrollTo(window.scrollX,Z.offsetTop)}}),[2]}var re})})},ke=K(863),Pe=K(312);const ye=function(){function _(){}return _.adapterRender=M,_.previewImage=ke.E,_.codeRender=d.O,_.graphvizRender=c.v,_.highlightRender=y.s,_.mathRender=l.H,_.mermaidRender=v.i,_.markmapRender=L.K,_.flowchartRender=u.P,_.chartRender=f.p,_.abcRender=P.Q,_.mindmapRender=E.P,_.plantumlRender=g.B,_.outlineRender=T.k,_.mediaRender=p.Y,_.speechRender=ie,_.lazyLoadImageRender=s,_.md2html=ve,_.preview=Se,_.setCodeTheme=Pe.Y,_.setContentTheme=m.Z,_}()})(),De=De.default})())})(Fe);var ft=Fe.exports;let Lt,tn;Lt=Jn(ft),tn=Zn({__name:"MarkdownViewer",props:{value:{type:String},class:{type:String}},setup(Be){const Ke=Be,He=ut(null),Ne=ut(null),{getDarkMode:K}=Qn();function De(){const M=pt(He);Ne.value=Lt.preview(M,Ke.value,{mode:Re(K.value,"content"),theme:{current:Re(K.value,"content")},hljs:{style:Re(K.value,"code")}})}It(()=>K.value,M=>{Lt.setContentTheme(Re(M,"content")),Lt.setCodeTheme(Re(M,"code")),De()}),It(()=>Ke.value,(M,f)=>{M!==f&&De()});function P(){var f;const M=pt(Ne);if(M){try{(f=M==null?void 0:M.destroy)==null||f.call(M)}catch(d){}Ne.value=null}}return rr(De),Yn(P),$n(P),(M,f)=>(er(),tr("div",{ref_key:"viewerRef",ref:He,id:"markdownViewer",class:Bi(M.$props.class)},null,2))}}),ir=nr(mt),or=nr(tn)}));export{ir as M,Fi as __tla,or as a};