diff --git a/dist/docsify-kroki.js b/dist/docsify-kroki.js index 82f5d86..3146ef0 100644 --- a/dist/docsify-kroki.js +++ b/dist/docsify-kroki.js @@ -1,9 +1,9 @@ /*! * docsify-kroki - * v1.2.2 + * v1.3.0 * https://github.com/zuisong/docsify-kroki * (c) 2020-2023 zuisong * MIT license */ var r=Uint8Array,n=Uint16Array,t=Int32Array,e=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(r,e){for(var a=new n(31),o=0;o<31;++o)a[o]=e+=1<>1|(21845&g)<<1))>>2|(13107&v)<<2))>>4|(3855&v)<<4,s[g]=((65280&v)>>8|(255&v)<<8)>>1;var v,h=function(r,t,e){for(var a=r.length,o=0,f=new n(t);o>l]=u}else for(i=new n(a),o=0;o>15-r[o]);return i},d=new r(288);for(g=0;g<144;++g)d[g]=8;for(g=144;g<256;++g)d[g]=9;for(g=256;g<280;++g)d[g]=7;for(g=280;g<288;++g)d[g]=8;var w=new r(32);for(g=0;g<32;++g)w[g]=5;var g,y=h(d,9,0);h(d,9,1);var m=h(w,5,0);h(w,5,1);var p=function(r){return(r+7)/8|0},b=function(r,n,t){t<<=7&n;var e=n/8|0;r[e]|=t,r[e+1]|=t>>8},x=function(r,n,t){t<<=7&n;var e=n/8|0;r[e]|=t,r[e+1]|=t>>8,r[e+2]|=t>>16},M=function(t,e){for(var a=[],o=0;od&&(d=i[o].s);var w=new n(d+1),g=k(a[v-1],w,0);if(g>e){o=0;var y=0,m=g-e,p=1<e))break;y+=p-(1<>=m;y>0;){var x=i[o].s;w[x]=0&&y;--o){var M=i[o].s;w[M]==e&&(--w[M],++y)}g=e}return{t:new r(w),l:g}},k=function(r,n,t){return-1==r.s?Math.max(k(r.l,n,t+1),k(r.r,n,t+1)):n[r.s]=t},$=function(r){for(var t=r.length;t&&!r[--t];);for(var e=new n(++t),a=0,o=r[0],f=1,i=function(r){e[a++]=r},c=1;c<=t;++c)if(r[c]==o&&c!=t)++f;else{if(!o&&f>2){for(;f>138;f-=138)i(32754);f>2&&(i(f>10?f-11<<5|28690:f-3<<5|12305),f=0)}else if(f>3){for(i(o),--f;f>6;f-=6)i(8304);f>2&&(i(f-3<<5|8208),f=0)}for(;f--;)i(o);f=1,o=r[c]}return{c:e.subarray(0,a),n:t}},A=function(r,n){for(var t=0,e=0;e>8,r[a+2]=255^r[a],r[a+3]=255^r[a+1];for(var o=0;o4&&!O[o[_-1]];--_);var B,F,G,J,K=g+5<<3,Q=A(c,d)+A(l,w)+u,V=A(c,z)+A(l,P)+u+14+3*_+A(L,O)+2*L[16]+3*L[17]+7*L[18];if(v>=0&&K<=Q&&K<=V)return T(t,p,r.subarray(v,v+g));if(b(t,p,1+(V15&&(b(t,p,rr[N]>>5&127),p+=rr[N]>>12)}}}else B=y,F=d,G=m,J=w;for(N=0;N255){x(t,p,B[(nr=tr>>18&31)+257]),p+=F[nr+257],nr>7&&(b(t,p,tr>>23&31),p+=e[nr]);var er=31&tr;x(t,p,G[er]),p+=J[er],er>3&&(x(t,p,tr>>5&8191),p+=a[er])}else x(t,p,B[tr]),p+=F[tr]}return x(t,p,B[256]),p+F[256]},C=new t([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),E=new r(0),P=function(o,f,i,c,s,v){var h=v.z||o.length,d=new r(c+h+5*(1+Math.ceil(h/7e3))+s),w=d.subarray(c,d.length-s),g=v.l,y=7&(v.r||0);if(f){y&&(w[0]=v.r>>3);for(var m=C[f-1],b=m>>13,x=8191&m,M=(1<7e3||H>24576)&&(_>423||!g)){y=z(o,w,0,S,q,I,j,H,N,D-N,y),H=U=j=0,N=D;for(var B=0;B<286;++B)q[B]=0;for(B=0;B<30;++B)I[B]=0}var F=2,G=0,J=x,K=O-R&32767;if(_>2&&W==P(D-K))for(var Q=Math.min(b,_)-1,V=Math.min(32767,D),X=Math.min(258,_);K<=V&&--J&&O!=R;){if(o[D+F]==o[D+F-K]){for(var Y=0;YF){if(F=Y,G=K,Y>Q)break;var Z=Math.min(K,Y-2),rr=0;for(B=0;Brr&&(rr=tr,R=nr)}}}K+=(O=R)-(R=k[O])&32767}if(G){S[H++]=268435456|l[F]<<18|u[G];var er=31&l[F],ar=31&u[G];j+=e[er]+a[ar],++q[257+er],++I[ar],L=D+F,++U}else S[H++]=o[D],++q[o[D]]}}for(D=Math.max(D,L);D=h&&(w[y/8|0]=g,or=h),y=T(w,y+1,o.subarray(D,or))}v.i=h}return function(n,t,e){(null==t||t<0)&&(t=0),(null==e||e>n.length)&&(e=n.length);var a=new r(e-t);return a.set(n.subarray(t,e)),a}(d,0,c+p(y)+s)};!function(){for(var r=new Int32Array(256),n=0;n<256;++n){for(var t=n,e=9;--e;)t=(1&t&&-306674912)^t>>>1;r[n]=t}}();var S=function(){var r=1,n=0;return{p:function(t){for(var e=r,a=n,o=0|t.length,f=0;f!=o;){for(var i=Math.min(f+2655,o);f>16),a=(65535&a)+15*(a>>16)}r=e,n=a},d:function(){return(255&(r%=65521))<<24|(65280&r)<<8|(255&(n%=65521))<<8|n>>8}}},q=function(n,t,e,a,o){if(!o&&(o={l:1},t.dictionary)){var f=t.dictionary.subarray(-32768),i=new r(f.length+n.length);i.set(f),i.set(n,f.length),n=i,o.w=f.length}return P(n,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+t.mem,e,a,o)},I=function(r,n,t){for(;t;++n)r[n]=t,t>>>=8},U=function(r,n){var t=n.level,e=0==t?0:t<6?1:9==t?3:2;if(r[0]=120,r[1]=e<<6|(n.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,n.dictionary){var a=S();a.p(n.dictionary),I(r,2,a.d())}};typeof TextEncoder<"u"&&new TextEncoder;var j=typeof TextDecoder<"u"&&new TextDecoder;try{j.decode(E,{stream:!0}),1}catch{}async function D(r){return await function(r,n){n||(n={});var t=S();t.p(r);var e=q(r,n,n.dictionary?6:2,4);return U(e,n),I(e,e.length-4,t.d()),e}(r,{level:9})}async function H(r){const n=function(r){return(new TextEncoder).encode(r)}(r),t=D(n);return function(r){const n=[];for(let t=0;tbtoa(encodeURI(r)),N="image/svg+xml";async function W(r,n,t){const e=`${t+n}/svg/`,a=await H(r),o=e+btoa(a).replace(/\+/g,"-").replace(/\//g,"_"),f=o.length<4e3?o:await async function(r,n,t){const e=`${t+n}/svg/`,a=await fetch(e,{method:"POST",body:r}),o=await a.text();return`data:${N};base64,${L(o)}`}(r,n,t);return``}function O(r,n){const t=document.createElement(r);return t.innerHTML=n,t}const R={langs:["actdiag","blockdiag","bpmn","bytefield","c4plantuml","d2","dbml","ditaa","erd","excalidraw","graphviz","mermaid","nomnoml","nwdiag","packetdiag","pikchr","plantuml","rackdiag","seqdiag","structurizr","svgbob","symbolator","tikz","vega","vegalite","wavedrom","wireviz"],serverPath:"//kroki.io/"};window.$docsify=window.$docsify||{},window.$docsify.plugins=(window.$docsify.plugins||[]).concat(((r,n)=>{r.afterEach(((r,t)=>{var e;(async function(r,n){const t=O("div",r),e=[];for(const r of n.langs){const a=Array.from(t.querySelectorAll(`pre[data-lang="${r}"]`));for(const t of a){const a=W(t.textContent,r,n.serverPath).then((n=>{var e;const a=O("p",n);a.dataset.lang=r,a.style.maxWidth="inherit",null==(e=t.parentNode)||e.replaceChild(a,t)}));e.push(a)}const o=Array.from(t.querySelectorAll(`img[alt="kroki-${r}"]`));for(const t of o){const a=t,o=t.parentNode,f=a.getAttribute("src");if(!f)continue;const i=fetch(f).then((r=>r.text())).then((t=>W(t,r,n.serverPath))).then((n=>{const e=O("p",n);e.dataset.lang=r,e.style.maxWidth="inherit",null==o||o.replaceChild(e,t)}));e.push(i)}}for(const r of e)await r.catch((r=>console.error(r)));return t.innerHTML})(r,{...R,...(null==(e=null==n?void 0:n.config)?void 0:e.kroki)||{}}).then(t)}))})); -//# sourceMappingURL=https://unpkg.com/docsify-kroki@1.2.2/dist/docsify-kroki.js.map +//# sourceMappingURL=https://unpkg.com/docsify-kroki@1.3.0/dist/docsify-kroki.js.map diff --git a/package.json b/package.json index bf9bc4a..62e4e43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docsify-kroki", - "version": "1.2.2", + "version": "1.3.0", "description": "kroki plugin of docsify", "main": "dist/docsify-kroki.js", "scripts": {