@hardikg/mdview 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +8 -10
- package/bin/mdview.mjs +123 -44
- package/dist/client/assets/{arc-DjKPIdc5.js → arc-ycQp8V_W.js} +1 -1
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-_OLcSJC-.js → architectureDiagram-3BPJPVTR-CGT8FovT.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-BxHKbhSj.js → blockDiagram-GPEHLZMM-N8A4M5KF.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-DiBLe7ZZ.js → c4Diagram-AAUBKEIU-GOIrZjrm.js} +1 -1
- package/dist/client/assets/channel-DsJAWOzB.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-4B03UoyK.js → chunk-2J33WTMH-DMiX8NYo.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-Dw7jUHGw.js → chunk-4BX2VUAB-BXnUK3rw.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-AZdo8c-x.js → chunk-55IACEB6-BkF4Ba-V.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-g0GurlcS.js → chunk-727SXJPM-DKPIb06m.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-eqTzq7th.js → chunk-AQP2D5EJ-BFOc87IV.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-D4omRKrC.js → chunk-FMBD7UC4-IM3YKAF3.js} +1 -1
- package/dist/client/assets/{chunk-ND2GUHAM-mVdFtWqM.js → chunk-ND2GUHAM-UF3KQYdE.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-CyPMaN41.js → chunk-QZHKN3VN-OHnkQvdC.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-BD7T43t0.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BD7T43t0.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-BjlwoH6Y.js → cose-bilkent-S5V4N54A-D0XjEe4_.js} +1 -1
- package/dist/client/assets/{dagre-BM42HDAG-DBF5W9Tk.js → dagre-BM42HDAG-1wR5aSmA.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-D9gwS4tw.js → diagram-2AECGRRQ-B8L1OTOq.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-DTpIgGjI.js → diagram-5GNKFQAL-BPGoGDNx.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-ByLH9Z83.js → diagram-KO2AKTUF-Zu0g_DOV.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-Dkd4KfnW.js → diagram-LMA3HP47-bPbOm4sL.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-C-mJW1Tv.js → diagram-OG6HWLK6-DWW4aJ4C.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-DmyZPB5P.js → erDiagram-TEJ5UH35-CUsMs05D.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-D6RrsDb6.js → flowDiagram-I6XJVG4X-DZCURXAw.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-CP_O3OdU.js → ganttDiagram-6RSMTGT7-CzMfUd_H.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-DZgdWY-6.js → gitGraphDiagram-PVQCEYII-Du_KX2ik.js} +1 -1
- package/dist/client/assets/index-BCdIdRge.js +2 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-BAp5orio.js → infoDiagram-5YYISTIA-D81JEsUe.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-DgqFJxLz.js → ishikawaDiagram-YF4QCWOH-DwkHFgb8.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-BFlCgna7.js → journeyDiagram-JHISSGLW-nEajRNFZ.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-Ck0sh2an.js → kanban-definition-UN3LZRKU-Dvn5P58B.js} +1 -1
- package/dist/client/assets/{linear-CfOau-eX.js → linear-BYNRmGYt.js} +1 -1
- package/dist/client/assets/{mermaid.core-BUwfPdjt.js → mermaid.core-BJg17JjK.js} +4 -4
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-tpaiyCEI.js → mindmap-definition-RKZ34NQL-WIFgsLLz.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-DaNIMGBH.js → pieDiagram-4H26LBE5-DMgTQVGJ.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-BUZRyB7p.js → quadrantDiagram-W4KKPZXB-B0Gh1bMy.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-D70DEVyJ.js → requirementDiagram-4Y6WPE33-DcIINxfV.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-DckSl4S7.js → sankeyDiagram-5OEKKPKP-CDnHepHs.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-If3g75AG.js → sequenceDiagram-3UESZ5HK-D7MMEHjm.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-C-83rolJ.js → stateDiagram-AJRCARHV-Dvdvjjk8.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-I2g3TqMC.js +1 -0
- package/dist/client/assets/{timeline-definition-PNZ67QCA-DIFKx0ow.js → timeline-definition-PNZ67QCA-DYWt9asA.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-BGLU5r80.js → vennDiagram-CIIHVFJN-Bt0VUni_.js} +1 -1
- package/dist/client/assets/{wardley-L42UT6IY-qocA9kr0.js → wardley-L42UT6IY-DVy2v9KS.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CWhmOVum.js → wardleyDiagram-YWT4CUSO-Ch7IIKOr.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-D2Sc4Taz.js → xychartDiagram-2RQKCTM6-Byds5kce.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/channel-oDRyuYVi.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-Dn5QR1VE.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-Dn5QR1VE.js +0 -1
- package/dist/client/assets/index-DFYTyxkU.js +0 -2
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BeI0-mGo.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();var Be,E,Hn,Mn,q,Xt,Nn,Rn,et,be,se,Fn,Ht,ut,dt,Pe={},Ie=[],Di=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ze=Array.isArray;function W(e,t){for(var n in t)e[n]=t[n];return e}function Mt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ki(e,t,n){var i,r,o,a={};for(o in t)o=="key"?i=t[o]:o=="ref"?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Be.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return ke(e,a,i,r,null)}function ke(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Hn,__i:-1,__u:0};return r==null&&E.vnode!=null&&E.vnode(o),o}function Z(e){return e.children}function ce(e,t){this.props=e,this.context=t}function re(e,t){if(t==null)return e.__?re(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?re(e):null}function Ui(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],r=[],o=W({},t);o.__v=t.__v+1,E.vnode&&E.vnode(o),Nt(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,n??re(t),!!(32&t.__u),r),o.__v=t.__v,o.__.__k[o.__i]=o,Un(i,o,r),t.__e=t.__=null,o.__e!=n&&On(o)}}function On(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),On(e)}function Yt(e){(!e.__d&&(e.__d=!0)&&q.push(e)&&!He.__r++||Xt!=E.debounceRendering)&&((Xt=E.debounceRendering)||Nn)(He)}function He(){try{for(var e,t=1;q.length;)q.length>t&&q.sort(Rn),e=q.shift(),t=q.length,Ui(e)}finally{q.length=He.__r=0}}function Dn(e,t,n,i,r,o,a,s,d,c,h){var u,f,_,p,b,k,y,m=i&&i.__k||Ie,I=t.length;for(d=Wi(n,t,m,d,I),u=0;u<I;u++)(_=n.__k[u])!=null&&(f=_.__i!=-1&&m[_.__i]||Pe,_.__i=u,k=Nt(e,_,f,r,o,a,s,d,c,h),p=_.__e,_.ref&&f.ref!=_.ref&&(f.ref&&Rt(f.ref,null,_),h.push(_.ref,_.__c||p,_)),b==null&&p!=null&&(b=p),(y=!!(4&_.__u))||f.__k===_.__k?(d=Kn(_,d,e,y),y&&f.__e&&(f.__e=null)):typeof _.type=="function"&&k!==void 0?d=k:p&&(d=p.nextSibling),_.__u&=-7);return n.__e=b,d}function Wi(e,t,n,i,r){var o,a,s,d,c,h=n.length,u=h,f=0;for(e.__k=new Array(r),o=0;o<r;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[o]=ke(null,a,null,null,null):ze(a)?a=e.__k[o]=ke(Z,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[o]=ke(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,d=o+f,a.__=e,a.__b=e.__b+1,s=null,(c=a.__i=Bi(a,n,d,u))!=-1&&(u--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(r>h?f--:r<h&&f++),typeof a.type!="function"&&(a.__u|=4)):c!=d&&(c==d-1?f--:c==d+1?f++:(c>d?f--:f++,a.__u|=4))):e.__k[o]=null;if(u)for(o=0;o<h;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==i&&(i=re(s)),Bn(s,s));return i}function Kn(e,t,n,i){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Kn(r[o],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=re(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Bi(e,t,n,i){var r,o,a,s=e.key,d=e.type,c=t[n],h=c!=null&&(2&c.__u)==0;if(c===null&&s==null||h&&s==c.key&&d==c.type)return n;if(i>(h?1:0)){for(r=n-1,o=n+1;r>=0||o<t.length;)if((c=t[a=r>=0?r--:o++])!=null&&(2&c.__u)==0&&s==c.key&&d==c.type)return a}return-1}function Qt(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Di.test(t)?n:n+"px"}function ge(e,t,n,i,r){var o,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Qt(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||Qt(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Fn,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n[se]=i[se]:(n[se]=Ht,e.addEventListener(t,o?dt:ut,o)):e.removeEventListener(t,o?dt:ut,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Zt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[be]==null)t[be]=Ht++;else if(t[be]<n[se])return;return n(E.event?E.event(t):t)}}}function Nt(e,t,n,i,r,o,a,s,d,c){var h,u,f,_,p,b,k,y,m,I,M,F,w,x,O,v=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(d=!!(32&n.__u),o=[s=t.__e=n.__e]),(h=E.__b)&&h(t);e:if(typeof v=="function")try{if(y=t.props,m=v.prototype&&v.prototype.render,I=(h=v.contextType)&&i[h.__c],M=h?I?I.props.value:h.__:i,n.__c?k=(u=t.__c=n.__c).__=u.__E:(m?t.__c=u=new v(y,M):(t.__c=u=new ce(y,M),u.constructor=v,u.render=Vi),I&&I.sub(u),u.state||(u.state={}),u.__n=i,f=u.__d=!0,u.__h=[],u._sb=[]),m&&u.__s==null&&(u.__s=u.state),m&&v.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=W({},u.__s)),W(u.__s,v.getDerivedStateFromProps(y,u.__s))),_=u.props,p=u.state,u.__v=t,f)m&&v.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),m&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(m&&v.getDerivedStateFromProps==null&&y!==_&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(y,M),t.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(y,u.__s,M)===!1){t.__v!=n.__v&&(u.props=y,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(A){A&&(A.__=t)}),Ie.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&a.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(y,u.__s,M),m&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(_,p,b)})}if(u.context=M,u.props=y,u.__P=e,u.__e=!1,F=E.__r,w=0,m)u.state=u.__s,u.__d=!1,F&&F(t),h=u.render(u.props,u.state,u.context),Ie.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,F&&F(t),h=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++w<25);u.state=u.__s,u.getChildContext!=null&&(i=W(W({},i),u.getChildContext())),m&&!f&&u.getSnapshotBeforeUpdate!=null&&(b=u.getSnapshotBeforeUpdate(_,p)),x=h!=null&&h.type===Z&&h.key==null?Wn(h.props.children):h,s=Dn(e,ze(x)?x:[x],t,n,i,r,o,a,s,d,c),u.base=t.__e,t.__u&=-161,u.__h.length&&a.push(u),k&&(u.__E=u.__=null)}catch(A){if(t.__v=null,d||o!=null)if(A.then){for(t.__u|=d?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(O=o.length;O--;)Mt(o[O]);ht(t)}else t.__e=n.__e,t.__k=n.__k,A.then||ht(t);E.__e(A,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=zi(n.__e,t,n,i,r,o,a,d,c);return(h=E.diffed)&&h(t),128&t.__u?void 0:s}function ht(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ht))}function Un(e,t,n){for(var i=0;i<n.length;i++)Rt(n[i],n[++i],n[++i]);E.__c&&E.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){E.__e(o,r.__v)}})}function Wn(e){return typeof e!="object"||e==null||e.__b>0?e:ze(e)?e.map(Wn):W({},e)}function zi(e,t,n,i,r,o,a,s,d){var c,h,u,f,_,p,b,k=n.props||Pe,y=t.props,m=t.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((_=o[c])&&"setAttribute"in _==!!m&&(m?_.localName==m:_.nodeType==3)){e=_,o[c]=null;break}}if(e==null){if(m==null)return document.createTextNode(y);e=document.createElementNS(r,m,y.is&&y),s&&(E.__m&&E.__m(t,o),s=!1),o=null}if(m==null)k===y||s&&e.data==y||(e.data=y);else{if(o=o&&Be.call(e.childNodes),!s&&o!=null)for(k={},c=0;c<e.attributes.length;c++)k[(_=e.attributes[c]).name]=_.value;for(c in k)_=k[c],c=="dangerouslySetInnerHTML"?u=_:c=="children"||c in y||c=="value"&&"defaultValue"in y||c=="checked"&&"defaultChecked"in y||ge(e,c,null,_,r);for(c in y)_=y[c],c=="children"?f=_:c=="dangerouslySetInnerHTML"?h=_:c=="value"?p=_:c=="checked"?b=_:s&&typeof _!="function"||k[c]===_||ge(e,c,_,k[c],r);if(h)s||u&&(h.__html==u.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(u&&(e.innerHTML=""),Dn(t.type=="template"?e.content:e,ze(f)?f:[f],t,n,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&re(n,0),s,d),o!=null)for(c=o.length;c--;)Mt(o[c]);s||(c="value",m=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[c]||m=="progress"&&!p||m=="option"&&p!=k[c])&&ge(e,c,p,k[c],r),c="checked",b!=null&&b!=e[c]&&ge(e,c,b,k[c],r))}return e}function Rt(e,t,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(r){E.__e(r,n)}}function Bn(e,t,n){var i,r;if(E.unmount&&E.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Rt(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){E.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Bn(i[r],t,n||typeof e.type!="function");n||Mt(e.__e),e.__c=e.__=e.__e=void 0}function Vi(e,t,n){return this.constructor(e,n)}function qi(e,t,n){var i,r,o,a;t==document&&(t=document.documentElement),E.__&&E.__(e,t),r=(i=!1)?null:t.__k,o=[],a=[],Nt(t,e=t.__k=Ki(Z,null,[e]),r||Pe,Pe,t.namespaceURI,r?null:t.firstChild?Be.call(t.childNodes):null,o,r?r.__e:t.firstChild,i,a),Un(o,e,a)}Be=Ie.slice,E={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(s){e=s}throw e}},Hn=0,Mn=function(e){return e!=null&&e.constructor===void 0},ce.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=W({},this.state),typeof e=="function"&&(e=e(W({},n),this.props)),e&&W(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Yt(this))},ce.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Yt(this))},ce.prototype.render=Z,q=[],Nn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Rn=function(e,t){return e.__v.__b-t.__v.__b},He.__r=0,et=Math.random().toString(8),be="__d"+et,se="__a"+et,Fn=/(PointerCapture)$|Capture$/i,Ht=0,ut=Zt(!1),dt=Zt(!0);var ji=0;function l(e,t,n,i,r,o){t||(t={});var a,s,d=t;if("ref"in d)for(s in d={},t)s=="ref"?a=t[s]:d[s]=t[s];var c={type:e,props:d,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ji,__i:-1,__u:0,__source:r,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)d[s]===void 0&&(d[s]=a[s]);return E.vnode&&E.vnode(c),c}var fe,$,tt,en,pe=0,zn=[],L=E,tn=L.__b,nn=L.__r,rn=L.diffed,on=L.__c,ln=L.unmount,an=L.__;function Ft(e,t){L.__h&&L.__h($,e,pe||t),pe=0;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function B(e){return pe=1,Ji(jn,e)}function Ji(e,t,n){var i=Ft(fe++,2);if(i.t=e,!i.__c&&(i.__=[jn(void 0,t),function(s){var d=i.__N?i.__N[0]:i.__[0],c=i.t(d,s);d!==c&&(i.__N=[c,i.__[1]],i.__c.setState({}))}],i.__c=$,!$.__f)){var r=function(s,d,c){if(!i.__c.__H)return!0;var h=i.__c.__H.__.filter(function(f){return f.__c});if(h.every(function(f){return!f.__N}))return!o||o.call(this,s,d,c);var u=i.__c.props!==s;return h.some(function(f){if(f.__N){var _=f.__[0];f.__=f.__N,f.__N=void 0,_!==f.__[0]&&(u=!0)}}),o&&o.call(this,s,d,c)||u};$.__f=!0;var o=$.shouldComponentUpdate,a=$.componentWillUpdate;$.componentWillUpdate=function(s,d,c){if(this.__e){var h=o;o=void 0,r(s,d,c),o=h}a&&a.call(this,s,d,c)},$.shouldComponentUpdate=r}return i.__N||i.__}function g(e,t){var n=Ft(fe++,3);!L.__s&&qn(n.__H,t)&&(n.__=e,n.u=t,$.__H.__h.push(n))}function K(e){return pe=5,D(function(){return{current:e}},[])}function D(e,t){var n=Ft(fe++,7);return qn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Vn(e,t){return pe=8,D(function(){return e},t)}function Gi(){for(var e;e=zn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(xe),t.__h.some(ft),t.__h=[]}catch(n){t.__h=[],L.__e(n,e.__v)}}}L.__b=function(e){$=null,tn&&tn(e)},L.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),an&&an(e,t)},L.__r=function(e){nn&&nn(e),fe=0;var t=($=e.__c).__H;t&&(tt===$?(t.__h=[],$.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(xe),t.__h.some(ft),t.__h=[],fe=0)),tt=$},L.diffed=function(e){rn&&rn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zn.push(t)!==1&&en===L.requestAnimationFrame||((en=L.requestAnimationFrame)||Xi)(Gi)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),tt=$=null},L.__c=function(e,t){t.some(function(n){try{n.__h.some(xe),n.__h=n.__h.filter(function(i){return!i.__||ft(i)})}catch(i){t.some(function(r){r.__h&&(r.__h=[])}),t=[],L.__e(i,n.__v)}}),on&&on(e,t)},L.unmount=function(e){ln&&ln(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(i){try{xe(i)}catch(r){t=r}}),n.__H=void 0,t&&L.__e(t,n.__v))};var sn=typeof requestAnimationFrame=="function";function Xi(e){var t,n=function(){clearTimeout(i),sn&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);sn&&(t=requestAnimationFrame(n))}function xe(e){var t=$,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$=t}function ft(e){var t=$;e.__c=e.__(),$=t}function qn(e,t){return!e||e.length!==t.length||t.some(function(n,i){return n!==e[i]})}function jn(e,t){return typeof t=="function"?t(e):t}var Yi=Symbol.for("preact-signals");function Ot(){if(Y>1)Y--;else{var e,t=!1;for((function(){var r=Ne;for(Ne=void 0;r!==void 0;)r.S.v===r.v&&(r.S.i=r.i),r=r.o})();ue!==void 0;){var n=ue;for(ue=void 0,Me++;n!==void 0;){var i=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Xn(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=i}}if(Me=0,Y--,t)throw e}}var S=void 0;function Jn(e){var t=S;S=void 0;try{return e()}finally{S=t}}var ue=void 0,Y=0,Me=0,cn=0,Ne=void 0,Re=0;function Gn(e){if(S!==void 0){var t=e.n;if(t===void 0||t.t!==S)return t={i:0,S:e,p:S.s,n:void 0,t:S,e:void 0,x:void 0,r:t},S.s!==void 0&&(S.s.n=t),S.s=t,e.n=t,32&S.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=S.s,t.n=void 0,S.s.n=t,S.s=t),t}}function H(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}H.prototype.brand=Yi;H.prototype.h=function(){return!0};H.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Jn(function(){var i;(i=t.W)==null||i.call(t)}))};H.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,i=e.x;n!==void 0&&(n.x=i,e.e=void 0),i!==void 0&&(i.e=n,e.x=void 0),e===this.t&&(this.t=i,i===void 0&&Jn(function(){var r;(r=t.Z)==null||r.call(t)}))}};H.prototype.subscribe=function(e){var t=this;return Ve(function(){var n=t.value,i=S;S=void 0;try{e(n)}finally{S=i}},{name:"sub"})};H.prototype.valueOf=function(){return this.value};H.prototype.toString=function(){return this.value+""};H.prototype.toJSON=function(){return this.value};H.prototype.peek=function(){var e=S;S=void 0;try{return this.value}finally{S=e}};Object.defineProperty(H.prototype,"value",{get:function(){var e=Gn(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Me>100)throw new Error("Cycle detected");(function(n){Y!==0&&Me===0&&n.l!==cn&&(n.l=cn,Ne={S:n,v:n.v,i:n.i,o:Ne})})(this),this.v=e,this.i++,Re++,Y++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ot()}}}});function T(e,t){return new H(e,t)}function Xn(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Yn(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Qn(e){for(var t=e.s,n=void 0;t!==void 0;){var i=t.p;t.i===-1?(t.S.U(t),i!==void 0&&(i.n=t.n),t.n!==void 0&&(t.n.p=i)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=i}e.s=n}function ee(e,t){H.call(this,void 0),this.x=e,this.s=void 0,this.g=Re-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}ee.prototype=new H;ee.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Re))return!0;if(this.g=Re,this.f|=1,this.i>0&&!Xn(this))return this.f&=-2,!0;var e=S;try{Yn(this),S=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return S=e,Qn(this),this.f&=-2,!0};ee.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}H.prototype.S.call(this,e)};ee.prototype.U=function(e){if(this.t!==void 0&&(H.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};ee.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(ee.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Gn(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Zn(e,t){return new ee(e,t)}function ei(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Y++;var n=S;S=void 0;try{t()}catch(i){throw e.f&=-2,e.f|=8,Dt(e),i}finally{S=n,Ot()}}}function Dt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ei(e)}function Qi(e){if(S!==this)throw new Error("Out-of-order effect");Qn(this),S=e,this.f&=-2,8&this.f&&Dt(this),Ot()}function le(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t==null?void 0:t.name}le.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};le.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ei(this),Yn(this),Y++;var e=S;return S=this,Qi.bind(this,e)};le.prototype.N=function(){2&this.f||(this.f|=2,this.u=ue,ue=this)};le.prototype.d=function(){this.f|=8,1&this.f||Dt(this)};le.prototype.dispose=function(){this.d()};function Ve(e,t){var n=new le(e,t);try{n.c()}catch(r){throw n.d(),r}var i=n.d.bind(n);return i[Symbol.dispose]=i,i}var ye;function ae(e,t){E[e]=t.bind(null,E[e]||function(){})}function Fe(e){if(ye){var t=ye;ye=void 0,t()}ye=e&&e.S()}function ti(e){var t=this,n=e.data,i=V(n);i.value=n;var r=D(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a,s=t.__$u.S(),d=r.value;s(),Mn(d)||((a=t.base)==null?void 0:a.nodeType)!==3?(t.__$f|=1,t.setState({})):t.base.data=d},Zn(function(){var a=i.value.value;return a===0?0:a===!0?"":a||""})},[]);return r.value}ti.displayName="_st";Object.defineProperties(H.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ti},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ae("__b",function(e,t){if(typeof t.type=="string"){var n,i=t.props;for(var r in i)if(r!=="children"){var o=i[r];o instanceof H&&(n||(t.__np=n={}),n[r]=o,i[r]=o.peek())}}e(t)});ae("__r",function(e,t){e(t),Fe();var n,i=t.__c;i&&(i.__$f&=-2,(n=i.__$u)===void 0&&(i.__$u=n=(function(r){var o;return Ve(function(){o=this}),o.c=function(){i.__$f|=1,i.setState({})},o})())),Fe(n)});ae("__e",function(e,t,n,i){Fe(),e(t,n,i)});ae("diffed",function(e,t){Fe();var n;if(typeof t.type=="string"&&(n=t.__e)){var i=t.__np,r=t.props;if(i){var o=n.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in i)&&(s.d(),o[a]=void 0)}else n.U=o={};for(var d in i){var c=o[d],h=i[d];c===void 0?(c=Zi(n,d,h,r),o[d]=c):c.o(h,r)}}}e(t)});function Zi(e,t,n,i){var r=t in e&&e.ownerSVGElement===void 0,o=T(n);return{o:function(a,s){o.value=a,i=s},d:Ve(function(){var a=o.value.value;i[t]!==a&&(i[t]=a,r?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}ae("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var i=n.U;if(i){n.U=void 0;for(var r in i){var o=i[r];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});ae("__h",function(e,t,n,i){(i<3||i===9)&&(t.__$f|=2),e(t,n,i)});ce.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,i=n&&n.s!==void 0;for(var r in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(i||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(i||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function V(e){return D(function(){return T(e)},[])}const qe=T(!1);function er(){qe.value=!0}function Se(){qe.value=!1}const oe=T(null),pt=T(null);async function ni(){const e=await fetch("/api/tree");if(!e.ok)return;const t=await e.json();oe.value=t,pt.value=t.config??null}function tr(){return g(()=>{ni()},[]),oe.value}function ii(e){const t=[];function n(i){for(const r of i)r.type==="file"&&r.isMarkdown?t.push({relPath:r.relPath,name:r.name}):r.type==="dir"&&r.children&&n(r.children)}return n(e),t}function nr(e,t){if(!t)return{...e,score:0,matchRanges:[]};const n=t.toLowerCase(),i=e.relPath.toLowerCase(),o=e.name.toLowerCase().indexOf(n);if(o!==-1){const h=e.relPath.length-e.name.length+o;return{...e,score:1e3-h-e.relPath.length,matchRanges:[[h,h+n.length]]}}const a=i.indexOf(n);if(a!==-1)return{...e,score:500-a-e.relPath.length,matchRanges:[[a,a+n.length]]};const s=[];let d=0,c=-1;for(let h=0;h<i.length&&d<n.length;h++)i[h]===n[d]?(c===-1&&(c=h),d++):c!==-1&&(s.push([c,c+1]),c=-1);return c!==-1&&s.push([c,d-(n.length-1)+c]),d===n.length?{...e,score:100-e.relPath.length,matchRanges:s}:null}function ir(e,t,n=50){const i=[];for(const r of e){const o=nr(r,t);o&&i.push(o)}return i.sort((r,o)=>o.score-r.score),i.slice(0,n)}function rr(e,t){if(t.length===0)return e;const n=[];let i=0;for(const[r,o]of t)r>i&&n.push(e.slice(i,r)),n.push({mark:e.slice(r,o)}),i=o;return i<e.length&&n.push(e.slice(i)),n.map((r,o)=>typeof r=="string"?l("span",{children:r},o):l("mark",{class:"palette-match",children:r.mark},o))}function or({currentPath:e,onSelect:t}){const n=qe.value,i=oe.value,[r,o]=B(""),[a,s]=B(0),d=K(null),c=K(null),h=D(()=>i?ii(i.tree):[],[i]),u=D(()=>n?r.trim()?ir(h,r.trim()):h.slice(0,50).map(p=>({...p,score:0,matchRanges:[]})):[],[h,r,n]);if(g(()=>{n&&(o(""),s(0),requestAnimationFrame(()=>{var p,b;(p=d.current)==null||p.focus(),(b=d.current)==null||b.select()}))},[n]),g(()=>{a>=u.length&&s(Math.max(0,u.length-1))},[u.length,a]),g(()=>{if(!n||!c.current)return;const p=c.current.children[a];p==null||p.scrollIntoView({block:"nearest"})},[a,n]),!n)return null;function f(p){const b=u[p];b&&(t(b.relPath),Se())}function _(p){p.key==="Escape"?(p.preventDefault(),Se()):p.key==="ArrowDown"||p.ctrlKey&&p.key==="n"?(p.preventDefault(),s(b=>u.length===0?0:(b+1)%u.length)):p.key==="ArrowUp"||p.ctrlKey&&p.key==="p"?(p.preventDefault(),s(b=>u.length===0?0:(b-1+u.length)%u.length)):p.key==="Enter"&&(p.preventDefault(),f(a))}return l("div",{class:"palette-overlay",role:"dialog","aria-modal":"true","aria-label":"Switch file",onClick:Se,children:l("div",{class:"palette",onClick:p=>p.stopPropagation(),children:[l("div",{class:"palette-input-wrap",children:[l("span",{class:"palette-prefix","aria-hidden":!0,children:"⌘P"}),l("input",{ref:d,type:"text",class:"palette-input",placeholder:"Switch file…",value:r,onInput:p=>{o(p.target.value),s(0)},onKeyDown:_,"aria-label":"Find file"})]}),l("ul",{class:"palette-list",ref:c,role:"listbox",children:[u.length===0&&l("li",{class:"palette-empty",children:"No files match"}),u.map((p,b)=>{const k=b===a,y=e===p.relPath,m=p.relPath.lastIndexOf("/"),I=m>=0?p.relPath.slice(0,m+1):"",M=m>=0?p.relPath.slice(m+1):p.relPath;return l("li",{class:`palette-item${k?" is-active":""}${y?" is-current":""}`,role:"option","aria-selected":k,onMouseEnter:()=>s(b),onClick:()=>f(b),children:[l("span",{class:"palette-item-name",children:p.matchRanges.length>0?rr(p.relPath,p.matchRanges):l(Z,{children:[I&&l("span",{class:"palette-dir",children:I}),l("span",{children:M})]})}),y&&l("span",{class:"palette-tag",children:"current"})]},p.relPath)})]}),l("div",{class:"palette-foot",children:[l("span",{children:[l("kbd",{children:"↑"}),l("kbd",{children:"↓"})," navigate"]}),l("span",{children:[l("kbd",{children:"Enter"})," open"]}),l("span",{children:[l("kbd",{children:"Esc"})," close"]})]})]})})}function lr(e,t=Date.now()){const n=Math.max(0,t-e),i=Math.round(n/1e3);if(i<30)return"just now";if(i<90)return"1 minute ago";const r=Math.round(i/60);if(r<60)return`${r} minutes ago`;const o=Math.round(r/60);if(o<24)return o===1?"1 hour ago":`${o} hours ago`;const a=Math.round(o/24);return a<30?a===1?"yesterday":`${a} days ago`:new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ar(e){return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}const U=T(null);T([]);const _e=T(null);let ri=0;function sr(e,t=600){U.value=e,_e.value=e,ri=performance.now()+t}function cr(e,t,n,i){if(e.length===0)return null;if(t<=0)return e[0].id;if(t+n>=i-1)return e[e.length-1].id;const r=16,o=6;let a=e[0].id;for(const s of e)if(s.top-r<=t+o)a=s.id;else break;return a}const ur=.35;function dr(e,t,n,i){if(e.length===0)return null;if(t<=0)return e[0].id;if(t+n>=i-1)return e[e.length-1].id;const r=t+n*ur;let o=e[0].id;for(const a of e)if(a.top<=r)o=a.id;else break;return o}function hr(e){g(()=>{if(!e)return;let t=0,n=[],i=[];function r(){const c=e.getBoundingClientRect(),h=e.scrollTop;n=Array.from(e.querySelectorAll(".markdown-content :is(h1,h2,h3,h4,h5,h6)[id]")),i=n.map(u=>{const f=u.getBoundingClientRect();return{id:u.id,top:f.top-c.top+h}})}function o(){if(performance.now()<ri)return;const c=e,h=c.scrollTop,u=c.clientHeight,f=c.scrollHeight,_=cr(i,h,u,f);_!==U.value&&(U.value=_);const p=dr(i,h,u,f);p!==_e.value&&(_e.value=p)}function a(){cancelAnimationFrame(t),t=requestAnimationFrame(o)}r(),o();const s=new ResizeObserver(()=>{r(),o()});s.observe(e);const d=new MutationObserver(()=>{r(),o()});return d.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden"]}),e.addEventListener("scroll",a,{passive:!0}),()=>{cancelAnimationFrame(t),s.disconnect(),d.disconnect(),e.removeEventListener("scroll",a)}},[e])}let un=!1;function fr(e){try{return localStorage.getItem(e)}catch(t){return un||(un=!0,console.warn("[mdview] localStorage read blocked; falling back to defaults. Theme/UI prefs will not persist across reloads.",t)),null}}function pr(e,t){try{localStorage.setItem(e,t)}catch{}}function Kt(e,t,n){const i=fr(e),r=i!==null?n.parse(i):null,o=T(r??t);return{signal:o,set(a){o.value=a,pr(e,n.serialize(a))}}}function G(e,t){return Kt(e,t,{parse:n=>n==="1"?!0:n==="0"?!1:null,serialize:n=>n?"1":"0"})}function je(e,t,n){const i=r=>Math.min(n.max,Math.max(n.min,r));return Kt(e,t,{parse:r=>{const o=Number(r);return Number.isFinite(o)?i(o):null},serialize:r=>String(i(r))})}function oi(e,t,n){return Kt(e,t,{parse:i=>n.includes(i)?i:null,serialize:i=>i})}const _t=G("mdview-tree-collapsed",!1),vt=G("mdview-outline-collapsed",!1),mt=G("mdview-focus-mode",!1),gt=G("mdview-minimap",!1),yt=G("mdview-wide-layout",!1),wt=mt.signal,bt=gt.signal,li=yt.signal;function ai(){mt.set(!mt.signal.value)}function si(){gt.set(!gt.signal.value)}function ci(){yt.set(!yt.signal.value)}const ui=264,di=280,Oe=180,De=480,dn=140,Ut=je("mdview-tree-width",ui,{min:Oe,max:De}),Wt=je("mdview-outline-width",di,{min:Oe,max:De}),_r=_t.signal,vr=vt.signal,hn=Ut.signal,fn=Wt.signal;function Ee(){_t.set(!_t.signal.value)}function Ce(){vt.set(!vt.signal.value)}function mr(e){Ut.set(e)}function gr(e){Wt.set(e)}function yr(){Ut.set(ui)}function wr(){Wt.set(di)}const br=225;function hi(e){let t=0;for(const n of e)t+=1+hi(n.children);return t}function kr(e,t){const n=document.createElement("div");n.innerHTML=e;const i=(n.textContent??"").trim(),r=i.length===0?0:i.split(/\s+/).filter(Boolean).length,o=Math.max(1,Math.round(r/br)),a=hi(t);return{words:r,readingMinutes:o,headings:a}}function xr(e){const t=e.words.toLocaleString(),n=e.headings;return`${e.readingMinutes} min read · ${t} word${e.words===1?"":"s"} · ${n} heading${n===1?"":"s"}`}const kt="is-dimmed",xt="is-focused",pn=new Set(["H1","H2","H3","H4","H5","H6"]);function _n(e){return Number(e.tagName[1])}function fi(e){e.querySelectorAll(`.${kt}, .${xt}`).forEach(t=>{t.classList.remove(kt,xt)})}function Sr(e,t){if(fi(e),!t)return;const n=e.querySelector(`#${CSS.escape(t)}`);if(!n||!pn.has(n.tagName))return;const i=_n(n),r=n.closest(".markdown-content")??e,o=Array.from(r.children),a=o.indexOf(n);if(a<0)return;let s=o.length;for(let d=a+1;d<o.length;d++){const c=o[d];if(pn.has(c.tagName)&&_n(c)<=i){s=d;break}}for(let d=0;d<o.length;d++){const c=o[d];d>=a&&d<s?c.classList.add(xt):c.classList.add(kt)}}function Er(e){fi(e)}async function Cr(e,t,n){for(const i of n)try{await i.run(e,t)}catch(r){console.error(`[mdview] wire "${i.name}" failed:`,r)}}function pi(){return new URLSearchParams(window.location.search).get("file")}function $r(e,t=""){const n=`?file=${encodeURIComponent(e)}${t}`;history.pushState({file:e},"",n)}const Je=T(pi());function nt(e){Je.value=e}function Lr(){g(()=>{const t=()=>nt(pi());return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[]);const e=Vn((t,n="")=>{nt(t),$r(t,n)},[]);return{currentPath:Je.value,setCurrentPath:nt,navigate:e}}const St=new Set(["H1","H2","H3","H4","H5","H6"]),Bt="section-toggle",Tr="section-heading-collapsed",it="data-section-collapsed-by",N=new Set;let vn,R=null,mn=!1;function gn(e){return Number(e.tagName[1])}function zt(e){return!!e&&St.has(e.tagName)}function _i(e,t){const n=e[t];if(!n||!St.has(n.tagName))return null;const i=gn(n);for(let r=t+1;r<e.length;r++){const o=e[r];if(St.has(o.tagName)&&gn(o)<=i)return r}return e.length}function Vt(e){return Array.from(e.children)}function vi(e){return Vt(e).filter(t=>zt(t)&&!!t.id)}function me(e,t,n){const i=Vt(e),r=i.indexOf(t);if(r<0)return;const o=_i(i,r);if(o===null)return;const a=t.querySelector(`button.${Bt}`);a&&(a.setAttribute("aria-expanded",n?"false":"true"),a.setAttribute("aria-label",n?"Expand section":"Collapse section"),a.title=n?"Expand section":"Collapse section"),t.classList.toggle(Tr,n);for(let s=r+1;s<o;s++){const d=i[s];n?d.hasAttribute("hidden")||(d.setAttribute("hidden",""),d.setAttribute(it,t.id)):d.getAttribute(it)===t.id&&(d.removeAttribute("hidden"),d.removeAttribute(it))}}function Ar(e,t){const n=t.id,i=!N.has(n);i?N.add(n):N.delete(n),me(e,t,i)}function qt(e,t){for(const n of vi(e))t?N.add(n.id):N.delete(n.id),me(e,n,t)}function Pr(){R&&qt(R,!1)}function Ir(){R&&qt(R,!0)}function Et(e){if(!R||N.size===0||!e||!R.contains(e))return;const t=Vt(R);for(let n=0;n<t.length;n++){const i=t[n];if(!zt(i)||!i.id||!N.has(i.id))continue;const r=_i(t,n);if(r!==null)for(let o=n+1;o<r;o++){const a=t[o];if(a===e||a.contains(e)){N.delete(i.id),me(R,i,!1);break}}}}function rt(e){e&&Et(document.getElementById(e))}function Hr(e,t){const n=document.createElement("button");return n.type="button",n.className=Bt,n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label","Collapse section"),n.title="Collapse section",n.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),Ar(e,t)}),n}let de=null;function Mr(){R&&de===null&&(de=[...N],qt(R,!1))}function Nr(){if(!(!R||!de)){for(const e of de){N.add(e);const t=document.getElementById(e);t&&zt(t)&&R.contains(t)&&me(R,t,!0)}de=null}}function Rr(){mn||(window.addEventListener("beforeprint",Mr),window.addEventListener("afterprint",Nr),mn=!0)}const Fr={name:"collapsible-sections",run:e=>{R=e;const t=Je.value;t!==vn&&(N.clear(),vn=t);const n=vi(e);for(const r of n)r.querySelector(`button.${Bt}`)||r.insertBefore(Hr(e,r),r.firstChild);const i=new Set(n.map(r=>r.id));for(const r of[...N])i.has(r)||N.delete(r);for(const r of n)me(e,r,N.has(r.id));Rr()}};function Or(e){e.querySelectorAll("pre").forEach(n=>{var o;if(n.closest(".mermaid-block")||(o=n.parentElement)!=null&&o.classList.contains("pre-wrap"))return;const i=document.createElement("div");i.className="pre-wrap",n.replaceWith(i),i.appendChild(n);const r=document.createElement("button");r.type="button",r.className="copy-btn",r.textContent="Copy",r.setAttribute("aria-label","Copy code to clipboard"),r.addEventListener("click",async a=>{a.stopPropagation();const s=n.querySelector("code"),d=((s==null?void 0:s.textContent)??n.textContent??"").replace(/\s+$/,"");try{await navigator.clipboard.writeText(d),r.textContent="Copied",r.classList.add("is-copied")}catch{r.textContent="Failed"}window.setTimeout(()=>{r.textContent="Copy",r.classList.remove("is-copied")},1600)}),i.appendChild(r)})}function Dr(e){e.querySelectorAll("a[href]").forEach(n=>{if(n.dataset.externalProcessed==="1"||n.hasAttribute("data-internal-link"))return;const i=n.getAttribute("href")??"";if(/^https?:\/\//i.test(i)&&!n.classList.contains("heading-anchor")){if(n.target="_blank",n.rel="noopener noreferrer",n.classList.add("is-external"),!n.querySelector(".external-icon")){const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("class","external-icon"),r.setAttribute("viewBox","0 0 12 12"),r.setAttribute("width","11"),r.setAttribute("height","11"),r.setAttribute("aria-hidden","true"),r.innerHTML='<path fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5h5v5M9.5 2.5L4 8M2.5 5.2v4.3h4.3"/>',n.appendChild(r)}n.dataset.externalProcessed="1"}})}const Ge=T(null);function yn(e,t){Ge.value={src:e,alt:t}}function $e(){Ge.value=null}function Kr(e){e.querySelectorAll(".markdown-content img").forEach(n=>{n.dataset.lightboxWired!=="1"&&(n.closest(".mermaid-block")||(n.dataset.lightboxWired="1",n.classList.add("img-zoomable"),n.setAttribute("tabindex","0"),n.setAttribute("role","button"),n.setAttribute("aria-label",`Open ${n.alt||"image"} fullscreen`),n.addEventListener("click",()=>{yn(n.src,n.alt)}),n.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),yn(n.src,n.alt))})))})}const Ur="modulepreload",Wr=function(e){return"/"+e},wn={},jt=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){let a=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),d=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=a(n.map(c=>{if(c=Wr(c),c in wn)return;wn[c]=!0;const h=c.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=h?"stylesheet":Ur,h||(f.as="script"),f.crossOrigin="",f.href=c,d&&f.setAttribute("nonce",d),document.head.appendChild(f),h)return new Promise((_,p)=>{f.addEventListener("load",_),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return r.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};let ot=null,bn=!1;function Br(){return ot||(ot=jt(()=>import("./katex-DkKDou_j.js"),[])),ot}async function zr(){if(bn)return;bn=!0;const e=(await jt(async()=>{const{default:n}=await import("./katex.min-DBnXG_UH.js");return{default:n}},[])).default,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)}async function Vr(e){const t=e.querySelectorAll("span.math-inline:not([data-rendered])"),n=e.querySelectorAll("div.math-block:not([data-rendered])");if(t.length===0&&n.length===0)return;const[i]=await Promise.all([Br(),zr()]),r=i.default;for(const o of t){const a=decodeURIComponent(o.dataset.source??"");try{r.render(a,o,{displayMode:!1,throwOnError:!1})}catch(s){o.textContent=`[math error: ${s.message}]`}o.dataset.rendered="true"}for(const o of n){const a=decodeURIComponent(o.dataset.source??"");try{r.render(a,o,{displayMode:!0,throwOnError:!1})}catch(s){o.textContent=`[math error: ${s.message}]`}o.dataset.rendered="true"}}const qr=/\.(md|markdown|mdx)$/i;function kn(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function jr(e){return!!(e.target&&e.target!==""&&e.target!=="_self"||e.hasAttribute("download"))}function Jr(e,t){e.addEventListener("click",n=>{const i=n.target.closest("a");if(!i)return;const r=i.matches("[data-internal-link]")?i.getAttribute("data-internal-link"):null;if(r!==null){if(kn(n))return;n.preventDefault();const c=r??"",h=c.indexOf("#"),u=h>=0?c.slice(0,h):c,f=h>=0?c.slice(h):"";t(u,f);return}if(kn(n)||jr(i))return;const o=i.href;if(!o)return;let a;try{a=new URL(o)}catch{return}if(a.origin!==window.location.origin||!qr.test(a.pathname))return;n.preventDefault();let s;try{s=decodeURIComponent(a.pathname)}catch{s=a.pathname}const d=s.replace(/^\/+/,"");t(d,a.hash)})}const Gr=["light","dark"],Ct=window.matchMedia("(prefers-color-scheme: dark)");function Xr(){try{const e=localStorage.getItem("mdview-theme");if(e==="light"||e==="dark")return e}catch{}return null}const mi=Xr(),gi=oi("mdview-theme",mi??(Ct.matches?"dark":"light"),Gr),Q=gi.signal,yi=T(mi!==null);function Yr(e){gi.set(e),yi.value=!0}function wi(){Yr(Q.value==="dark"?"light":"dark")}function Qr(){return g(()=>{const e=t=>{yi.value||(Q.value=t.matches?"dark":"light")};return Ct.addEventListener("change",e),()=>Ct.removeEventListener("change",e)},[]),g(()=>{document.documentElement.dataset.theme=Q.value}),Q.value}let lt=null,Zr=0,$t=null;function eo(){return lt||(lt=jt(()=>import("./mermaid.core-BUwfPdjt.js").then(e=>e.bn),[])),lt}function to(){return Q.value==="dark"?"dark":"default"}async function bi(e){const t=e.querySelectorAll(".mermaid-block");if(t.length===0)return;const i=(await eo()).default,r=to();if($t!==r){i.initialize({startOnLoad:!1,theme:r,securityLevel:"strict"}),$t=r;for(const o of Array.from(t))delete o.dataset.rendered}await Promise.all(Array.from(t).map(o=>no(i,o)))}async function no(e,t){if(t.dataset.rendered)return;const n=decodeURIComponent(t.dataset.source??""),i=`mermaid-${++Zr}`;try{if(!await e.parse(n,{suppressErrors:!0})){xn(t,"syntax error");return}const{svg:o}=await e.render(i,n);t.innerHTML=o,t.dataset.rendered="true"}catch(r){xn(t,r.message)}finally{io(i)}}function xn(e,t){const n=document.createElement("pre");n.className="mermaid-error",n.textContent=`Mermaid: ${t}`,e.replaceChildren(n),e.dataset.rendered="true"}function io(e){for(const t of[e,`d${e}`]){const n=document.getElementById(t);n&&n.parentElement===document.body&&n.remove()}}Ve(()=>{if(Q.value,$t===null)return;const e=document.querySelector(".markdown-content");e&&bi(e)});function ro(e){e.querySelectorAll(".markdown-content :is(h1,h2,h3,h4,h5,h6)[id]").forEach(n=>{if(n.querySelector(".heading-anchor"))return;const i=document.createElement("a");i.className="heading-anchor",i.href=`#${n.id}`,i.setAttribute("aria-label",`Copy link to ${n.textContent??""}`),i.title="Copy link to this section",i.textContent="#",i.addEventListener("click",async r=>{r.preventDefault();const a=new URLSearchParams(window.location.search).get("file"),s=`${window.location.origin}${window.location.pathname}${a?`?file=${encodeURIComponent(a)}`:""}#${n.id}`;try{await navigator.clipboard.writeText(s),i.textContent="✓",i.classList.add("is-copied")}catch{i.textContent="!"}window.setTimeout(()=>{i.textContent="#",i.classList.remove("is-copied")},1500)}),n.appendChild(i)})}const oo=[Fr,{name:"mermaid",run:e=>bi(e)},{name:"math",run:e=>Vr(e)},{name:"internal-links",run:(e,t)=>Jr(e,t.onInternalNavigate)},{name:"copy-buttons",run:e=>Or(e)},{name:"permalinks",run:e=>ro(e)},{name:"external-links",run:e=>Dr(e)},{name:"image-lightbox",run:e=>Kr(e)}];function lo({file:e,onInternalNavigate:t}){const n=K(null),i=D(()=>kr(e.html,e.outline),[e]);return g(()=>{n.current&&(n.current.innerHTML=e.html,Cr(n.current,{onInternalNavigate:t},oo))},[e]),g(()=>{n.current&&(wt.value?Sr(n.current,_e.value):Er(n.current))},[wt.value,_e.value,e]),l("article",{class:"markdown-body",children:[e.frontmatter&&Object.keys(e.frontmatter).length>0&&l("details",{class:"frontmatter-block",children:[l("summary",{children:"frontmatter"}),l("pre",{children:l("code",{children:JSON.stringify(e.frontmatter,null,2)})})]}),i.words>0&&l("div",{class:"doc-stats","aria-label":"Document statistics",children:[l("span",{children:xr(i)}),e.lastModified>0&&l(Z,{children:[l("span",{class:"doc-stats-sep","aria-hidden":!0,children:"·"}),l("span",{class:"doc-stats-updated",title:ar(e.lastModified),children:["Updated ",lr(e.lastModified)]})]})]}),l("div",{ref:n,class:"markdown-content"})]})}function ao(){return l("div",{class:"skeleton","aria-hidden":"true",children:[l("div",{class:"skeleton__h1"}),l("div",{class:"skeleton__meta"}),l("div",{class:"skeleton__line",style:{width:"94%"}}),l("div",{class:"skeleton__line",style:{width:"88%"}}),l("div",{class:"skeleton__line",style:{width:"76%"}}),l("div",{class:"skeleton__h2"}),l("div",{class:"skeleton__line",style:{width:"92%"}}),l("div",{class:"skeleton__line",style:{width:"84%"}}),l("div",{class:"skeleton__code"}),l("div",{class:"skeleton__line",style:{width:"90%"}}),l("div",{class:"skeleton__line",style:{width:"70%"}})]})}const so=["node_modules","dist","build","out","target","coverage","vendor","__pycache__","venv","Pods","DerivedData","_build"],P=e=>({width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":1.6,"stroke-linecap":"round","stroke-linejoin":"round"});function ki({size:e=14,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:l("polyline",{points:"9 6 15 12 9 18"})})}function co({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:l("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"})})}function uo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v1H3V7z"}),l("path",{d:"M3 9h18l-2 8a2 2 0 0 1-2 1.5H6A2 2 0 0 1 4 17L3 9z"})]})}function ho({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9l-6-6z"}),l("polyline",{points:"14 3 14 9 20 9"})]})}function fo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9l-6-6z"}),l("polyline",{points:"14 3 14 9 20 9"}),l("path",{d:"M8 14l2 2 2-3 2 3 2-2"})]})}function po({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("circle",{cx:"12",cy:"12",r:"4"}),l("line",{x1:"12",y1:"2",x2:"12",y2:"5"}),l("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),l("line",{x1:"2",y1:"12",x2:"5",y2:"12"}),l("line",{x1:"19",y1:"12",x2:"22",y2:"12"}),l("line",{x1:"4.5",y1:"4.5",x2:"6.6",y2:"6.6"}),l("line",{x1:"17.4",y1:"17.4",x2:"19.5",y2:"19.5"}),l("line",{x1:"4.5",y1:"19.5",x2:"6.6",y2:"17.4"}),l("line",{x1:"17.4",y1:"6.6",x2:"19.5",y2:"4.5"})]})}function _o({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:l("path",{d:"M21 13.5A8.5 8.5 0 0 1 10.5 3a7 7 0 1 0 10.5 10.5z"})})}function vo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),l("line",{x1:"9",y1:"4",x2:"9",y2:"20"}),l("polyline",{points:"15 9 12 12 15 15"})]})}function mo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),l("line",{x1:"9",y1:"4",x2:"9",y2:"20"}),l("polyline",{points:"13 9 16 12 13 15"})]})}function go({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),l("line",{x1:"15",y1:"4",x2:"15",y2:"20"}),l("polyline",{points:"9 9 12 12 9 15"})]})}function yo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),l("line",{x1:"15",y1:"4",x2:"15",y2:"20"}),l("polyline",{points:"11 9 8 12 11 15"})]})}function wo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("rect",{x:"2",y:"6",width:"20",height:"13",rx:"2"}),l("line",{x1:"6",y1:"10",x2:"6.01",y2:"10"}),l("line",{x1:"10",y1:"10",x2:"10.01",y2:"10"}),l("line",{x1:"14",y1:"10",x2:"14.01",y2:"10"}),l("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"}),l("line",{x1:"6",y1:"14",x2:"6.01",y2:"14"}),l("line",{x1:"18",y1:"14",x2:"18.01",y2:"14"}),l("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}function bo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("circle",{cx:"12",cy:"12",r:"3"}),l("circle",{cx:"12",cy:"12",r:"9"})]})}function ko({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"}),l("line",{x1:"8",y1:"7",x2:"14",y2:"7"}),l("line",{x1:"8",y1:"11",x2:"16",y2:"11"}),l("line",{x1:"8",y1:"15",x2:"12",y2:"15"}),l("line",{x1:"8",y1:"19",x2:"14",y2:"19"})]})}function xo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("circle",{cx:"12",cy:"12",r:"3"}),l("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.6-1.1 1.7 1.7 0 0 0-.3-1.9l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.9.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.9-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.9V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"})]})}function xi({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:l("polyline",{points:"20 6 9 17 4 12"})})}function So({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("polyline",{points:"4 9 4 4 9 4"}),l("polyline",{points:"20 9 20 4 15 4"}),l("polyline",{points:"4 15 4 20 9 20"}),l("polyline",{points:"20 15 20 20 15 20"})]})}function Eo({size:e=16,class:t}){return l("svg",{...P(e),class:t,"aria-hidden":!0,children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("line",{x1:"12",y1:"11",x2:"12",y2:"16"}),l("line",{x1:"12",y1:"8",x2:"12",y2:"8"})]})}const Co=["Hidden from the tree to keep the watcher under the OS file-watch limit:","• dotfiles / dotdirs (.git, .next, .venv, …)",`• built-in heavy dirs: ${so.join(", ")}`,"","Add your own in ~/.config/mdview/config.json:",'{ "ignore": ["my-build-dir"] }',"","Restart mdview after editing."].join(`
|
|
2
|
-
`);function $o({tree:e,currentPath:t,onSelect:n,onCollapse:i}){return l("div",{class:"pane-content",children:[l("div",{class:"pane-head",children:[l("span",{class:"pane-head-title",children:["Files",l("span",{class:"pane-head-info",role:"button",tabIndex:0,"aria-label":"Why some folders aren't shown","data-tooltip":Co,"data-tooltip-multiline":!0,"data-tooltip-align":"left",children:l(Eo,{size:11})})]}),l("button",{class:"pane-head-btn","aria-label":"Hide file tree","data-tooltip":"Hide file tree (⌘B)","data-tooltip-align":"right",onClick:i,children:l(vo,{size:14})})]}),l("ul",{class:"tree",role:"tree",children:e.map(r=>l(Si,{node:r,currentPath:t,onSelect:n,depth:0},r.relPath))})]})}function Si({node:e,currentPath:t,onSelect:n,depth:i}){const r=(t==null?void 0:t.startsWith(e.relPath+"/"))??!1,[o,a]=B(r);g(()=>{r&&a(!0)},[t]);const s=`${10+i*14}px`;if(e.type==="dir")return l("li",{class:"tree-li tree-li-dir",role:"treeitem","aria-expanded":o,children:[l("button",{class:`tree-item tree-dir ${o?"is-open":""}`,style:{paddingLeft:s},onClick:()=>a(f=>!f),children:[l("span",{class:`chev ${o?"open":""}`,"aria-hidden":!0,children:l(ki,{size:12})}),l("span",{class:"tree-icon","aria-hidden":!0,children:o?l(uo,{size:15}):l(co,{size:15})}),l("span",{class:"name",children:e.name})]}),o&&e.children&&e.children.length>0&&l("ul",{class:"tree-children",style:{paddingLeft:`${10+i*14+7}px`},children:e.children.map(f=>l(Si,{node:f,currentPath:t,onSelect:n,depth:i+1},f.relPath))})]});const d=e.isMarkdown??!1,c=t===e.relPath,h=`tree-item tree-file ${d?"":"is-disabled"} ${c?"is-current":""}`,u=d?`/?file=${encodeURIComponent(e.relPath)}`:void 0;return l("li",{class:"tree-li tree-li-file",role:"treeitem",children:d?l("a",{class:h,style:{paddingLeft:s},href:u,title:e.name,onClick:f=>{f.metaKey||f.ctrlKey||f.shiftKey||f.altKey||(f.preventDefault(),n(e.relPath))},children:[l("span",{class:"tree-icon","aria-hidden":!0,children:l(fo,{size:14})}),l("span",{class:"name",children:e.name})]}):l("span",{class:h,style:{paddingLeft:s},title:e.name,children:[l("span",{class:"tree-icon","aria-hidden":!0,children:l(ho,{size:14})}),l("span",{class:"name",children:e.name})]})})}const Xe=T(!1);function Ei(){Xe.value=!0}function Le(){Xe.value=!1}function Ci(e,t,n=[]){for(const i of e){const r=[...n,i];if(i.id===t)return r;const o=Ci(i.children,t,r);if(o)return o}return null}function Sn(e){return e.trim().toLowerCase()}function Lo({outline:e,fileName:t,onJump:n}){var o;const i=U.value;let r=i?Ci(e,i)??[]:[];return t&&r.length>0&&((o=r[0])==null?void 0:o.level)===1&&Sn(r[0].text)===Sn(t)&&(r=r.slice(1)),l("nav",{class:"breadcrumbs","aria-label":"Current section",children:[t&&l("button",{type:"button",class:"bc-item bc-root",onClick:()=>n(null),title:"Scroll to top",children:t}),r.map((a,s)=>{const d=s===r.length-1;return l("span",{class:"bc-step",children:[l("span",{class:"bc-sep","aria-hidden":!0,children:"›"}),l("button",{type:"button",class:`bc-item${d?" is-current":""}`,onClick:()=>n(a.id),"aria-current":d?"location":void 0,children:a.text})]},a.id)})]})}const Jt=["classic","paper","nord","solarized","high-contrast"],$i="mdview-palette";function To(){try{const e=localStorage.getItem($i);if(e&&Jt.includes(e))return e}catch{}return null}const Li=To(),Ti=oi($i,Li??"classic",Jt),Te=Ti.signal,Ai=T(Li!==null);function Ao(e){Ti.set(e),Ai.value=!0}function Po(){return g(()=>{var e;!Ai.value&&((e=pt.value)!=null&&e.palette)&&(Te.value=pt.value.palette)}),g(()=>{document.documentElement.dataset.palette=Te.value}),Te.value}const Io={classic:"Classic",paper:"Paper",nord:"Nord",solarized:"Solarized","high-contrast":"High contrast"};function at({icon:e,label:t,shortcut:n,on:i,onToggle:r}){return l("button",{class:`view-menu-row${i?" is-on":""}`,role:"menuitemcheckbox","aria-checked":i,onClick:r,children:[l("span",{class:"view-menu-icon","aria-hidden":!0,children:e}),l("span",{class:"view-menu-label",children:t}),n&&l("span",{class:"view-menu-kbd","aria-hidden":!0,children:n}),l("span",{class:"view-menu-check","aria-hidden":!0,children:i?l(xi,{size:14}):null})]})}function Ho(){const[e,t]=B(!1),n=K(null);g(()=>{if(!e)return;function s(c){var h;(h=n.current)!=null&&h.contains(c.target)||t(!1)}function d(c){c.key==="Escape"&&t(!1)}return document.addEventListener("mousedown",s),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",d)}},[e]);const i=wt.value,r=bt.value,o=li.value,a=Te.value;return l("div",{class:"view-menu",ref:n,children:[l("button",{class:`icon-btn${e?" is-active":""}`,"aria-label":"View settings","data-tooltip":"View settings","aria-haspopup":"menu","aria-expanded":e,onClick:()=>t(s=>!s),children:l(xo,{})}),e&&l("div",{class:"view-menu-popover",role:"menu","aria-label":"View settings",children:[l("div",{class:"view-menu-section",children:[l(at,{icon:l(bo,{size:14}),label:"Focus mode",shortcut:"f",on:i,onToggle:ai}),l(at,{icon:l(ko,{size:14}),label:"Minimap",shortcut:"m",on:r,onToggle:si}),l(at,{icon:l(So,{size:14}),label:"Wide layout",on:o,onToggle:ci})]}),l("div",{class:"view-menu-divider"}),l("div",{class:"view-menu-section",children:[l("div",{class:"view-menu-heading",children:"Palette"}),Jt.map(s=>l("button",{role:"menuitemradio","aria-checked":a===s,class:`view-menu-row view-menu-palette${a===s?" is-on":""}`,onClick:()=>Ao(s),children:[l("span",{class:`palette-swatch palette-swatch-${s}`,"aria-hidden":!0}),l("span",{class:"view-menu-label",children:Io[s]}),l("span",{class:"view-menu-check","aria-hidden":!0,children:a===s?l(xi,{size:14}):null})]},s))]})]})]})}function Mo({outline:e,fileName:t,onJumpHeading:n}){const i=Q.value,r=i==="dark"?"Switch to light (⌘\\)":"Switch to dark (⌘\\)";return l("div",{class:"header-inner",children:[l("div",{class:"header-left",children:l("span",{class:"brand",children:"mdview"})}),l("div",{class:"header-center",children:l(Lo,{outline:e,fileName:t,onJump:n})}),l("div",{class:"header-right",children:[l(Ho,{}),l("button",{class:"icon-btn theme-btn","aria-label":r,"data-tooltip":r,onClick:wi,children:i==="dark"?l(po,{}):l(_o,{})}),l("button",{class:"icon-btn","aria-label":"Keyboard shortcuts","data-tooltip":"Shortcuts (?)","data-tooltip-align":"right",onClick:Ei,children:l(wo,{})})]})]})}function No(){const e=Ge.value;return g(()=>{if(!e)return;function t(i){i.key==="Escape"&&$e()}window.addEventListener("keydown",t);const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",t),document.body.style.overflow=n}},[e]),e?l("div",{class:"lightbox-overlay",role:"dialog","aria-modal":"true","aria-label":e.alt||"Image preview",onClick:$e,children:[l("button",{type:"button",class:"lightbox-close","aria-label":"Close image preview",onClick:t=>{t.stopPropagation(),$e()},children:"×"}),l("img",{class:"lightbox-img",src:e.src,alt:e.alt,onClick:t=>t.stopPropagation()})]}):null}const ve=T(null);function Ro(e){ve.value=e}function Ye(e){const t=[];for(const n of e)t.push({id:n.id,level:n.level}),t.push(...Ye(n.children));return t}function En(e,t,n){var a,s;const i=Ye(e);if(i.length===0)return null;if(!t)return n===1?((a=i[0])==null?void 0:a.id)??null:((s=i[i.length-1])==null?void 0:s.id)??null;const r=i.findIndex(d=>d.id===t);if(r<0)return null;const o=i[r].level;if(n===1){for(let d=r+1;d<i.length;d++)if(i[d].level===o)return i[d].id}else for(let d=r-1;d>=0;d--)if(i[d].level===o)return i[d].id;return null}function Fo(e,t){if(!e)return[];const n=Ye(t),i=e.scrollHeight;if(i===0)return[];const r=[],o=e.getBoundingClientRect();for(const{id:a,level:s}of n){const d=e.querySelector(`#${CSS.escape(a)}`);if(!d)continue;const u=(d.getBoundingClientRect().top-o.top+e.scrollTop)/i;r.push({id:a,level:s,ratio:Math.max(0,Math.min(1,u))})}return r}function Oo({outline:e}){const t=ve.value,[n,i]=B([]),[r,o]=B({top:0,height:0}),a=K(null);g(()=>{if(!t)return;const c=()=>i(Fo(t,e));c();const h=new ResizeObserver(c);return h.observe(t),()=>h.disconnect()},[t,e]),g(()=>{if(!t)return;const c=()=>{const h=t.scrollHeight||1;o({top:t.scrollTop/h,height:t.clientHeight/h})};return c(),t.addEventListener("scroll",c,{passive:!0}),()=>t.removeEventListener("scroll",c)},[t]);function s(c){const h=a.current;if(!h||!t)return;const u=h.getBoundingClientRect(),f=Math.max(0,Math.min(1,(c-u.top)/u.height));t.scrollTo({top:f*t.scrollHeight,behavior:"smooth"})}if(!t||n.length===0)return null;const d=U.value;return l("div",{ref:a,class:"minimap",role:"navigation","aria-label":"Document minimap",onClick:c=>s(c.clientY),children:[n.map(c=>l("div",{class:`minimap-bar minimap-level-${c.level}${d===c.id?" is-active":""}`,style:{top:`${(c.ratio*100).toFixed(2)}%`},title:c.id},c.id)),l("div",{class:"minimap-viewport",style:{top:`${(r.top*100).toFixed(2)}%`,height:`${(r.height*100).toFixed(2)}%`}})]})}const J=1,ie=6,Ke=je("mdview-outline-min-level",J,{min:J,max:ie}),Ue=je("mdview-outline-max-level",ie,{min:J,max:ie}),Pi=Ke.signal,Ii=Ue.signal;function Do(e){Ke.set(e),e>Ue.signal.value&&Ue.set(e)}function Ko(e){Ue.set(e),e<Ke.signal.value&&Ke.set(e)}const Uo=Zn(()=>{const e=Pi.value,t=Ii.value,n=new Set;for(let i=e;i<=t;i++)n.add(i);return n});function Hi(e,t){const n=[];for(const i of e){const r=Hi(i.children,t);t.has(i.level)?n.push({...i,children:r}):n.push(...r)}return n}function Wo({nodes:e,onJump:t,onCollapse:n}){const i=Uo.value,r=Pi.value,o=Ii.value,a=D(()=>Hi(e,i),[e,i]),s=r===o?`H${r}`:`H${r}–H${o}`,d=ie-J,c=(r-J)/d*100,h=100-(o-J)/d*100;return l("nav",{class:"outline","aria-label":"Document outline",children:[l("div",{class:"outline-head",children:[l("button",{class:"pane-head-btn","aria-label":"Hide outline","data-tooltip":"Hide outline (⌘.)","data-tooltip-align":"left",onClick:n,children:l(go,{size:14})}),l("span",{class:"outline-title",children:"On this page"}),l("div",{class:"outline-depth","data-tooltip":`Show ${s}`,"data-tooltip-align":"right",children:[l("span",{class:"outline-depth-label","aria-hidden":!0,children:s}),l("div",{class:"outline-depth-range",role:"group","aria-label":"Heading depth range",children:[l("div",{class:"outline-depth-track","aria-hidden":!0,children:l("div",{class:"outline-depth-track-fill",style:`left:${c}%;right:${h}%`})}),l("input",{type:"range",class:"outline-depth-slider outline-depth-slider-min",min:J,max:ie,step:1,value:r,"aria-label":`Minimum heading level (currently H${r})`,onInput:u=>{const f=Number(u.currentTarget.value);Number.isFinite(f)&&Do(f)}}),l("input",{type:"range",class:"outline-depth-slider outline-depth-slider-max",min:J,max:ie,step:1,value:o,"aria-label":`Maximum heading level (currently H${o})`,onInput:u=>{const f=Number(u.currentTarget.value);Number.isFinite(f)&&Ko(f)}})]})]})]}),a.length===0?l("div",{class:"outline-empty",children:e.length===0?"No headings":"All levels hidden"}):l("ul",{children:a.map(u=>l(Mi,{node:u,onJump:t,depth:0},u.id))})]})}function Mi({node:e,onJump:t,depth:n}){const[i,r]=B(!1),o=e.children.length>0,a=U.value===e.id,s=Math.min(n,5);return l("li",{class:`outline-li depth-${s}`,children:[l("div",{class:`outline-row ${a?"is-active":""}`,children:[o?l("button",{class:`outline-toggle ${i?"":"open"}`,"aria-label":i?"Expand section":"Collapse section",onClick:d=>{d.stopPropagation(),r(c=>!c)},children:l(ki,{size:11})}):l("span",{class:"outline-toggle is-spacer","aria-hidden":!0}),l("button",{class:"outline-link",onClick:()=>t(e.id),title:e.text,children:e.text})]}),o&&!i&&l("ul",{class:"outline-children",children:e.children.map(d=>l(Mi,{node:d,onJump:t,depth:n+1},d.id))})]})}function Bo({scroller:e,trigger:t}){const[n,i]=B(0);return g(()=>{if(!e)return;let r=0;function o(){if(!e)return;const s=e.scrollHeight-e.clientHeight;if(s<=0){i(0);return}const d=Math.max(0,Math.min(1,e.scrollTop/s));i(d)}function a(){cancelAnimationFrame(r),r=requestAnimationFrame(o)}return e.addEventListener("scroll",a,{passive:!0}),o(),()=>{cancelAnimationFrame(r),e.removeEventListener("scroll",a)}},[e,t]),l("div",{class:"reading-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n*100),"aria-label":"Reading progress",children:l("div",{class:"reading-progress__bar",style:{width:`${n*100}%`}})})}function Cn(e){const t=K(null),n=K(e);return n.current=e,g(()=>{const i=t.current;if(!i)return;let r=null;function o(d){if(!r)return;const{side:c,onResize:h,min:u,max:f}=n.current,_=d.clientX-r.startX,p=c==="left"?r.startWidth+_:r.startWidth-_;h(Math.min(f,Math.max(u,p)))}function a(){if(!r)return;const{collapseAt:d,onCollapse:c,getCurrent:h}=n.current,u=h(),f=t.current;try{f==null||f.releasePointerCapture(r.pointerId)}catch{}r=null,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",a),u<d&&c()}function s(d){r={startX:d.clientX,startWidth:n.current.getCurrent(),pointerId:d.pointerId};try{i.setPointerCapture(d.pointerId)}catch{}document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",o),window.addEventListener("pointerup",a),d.preventDefault()}return i.addEventListener("pointerdown",s),()=>{if(i.removeEventListener("pointerdown",s),window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",a),r){try{i.releasePointerCapture(r.pointerId)}catch{}document.body.style.cursor="",document.body.style.userSelect=""}}},[]),l("div",{ref:t,class:`resizer resizer-${e.side}`,role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel})}const Qe=T(!1),Gt=T("doc"),Lt=G("mdview-search-case",!1),Tt=G("mdview-search-word",!1),At=G("mdview-search-regex",!1),zo=Lt.signal,Vo=Tt.signal,qo=At.signal;function jo(){Lt.set(!Lt.signal.value)}function Jo(){Tt.set(!Tt.signal.value)}function Go(){At.set(!At.signal.value)}function st(e="doc"){Gt.value=e,Qe.value=!0}function he(){Qe.value=!1}function Xo(e){Gt.value=e}function $n(e,t){let n=null,i=null;const r=((...o)=>{i=o,n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null;const a=i;i=null,a&&e(...a)},t)});return r.cancel=()=>{n!==null&&(clearTimeout(n),n=null),i=null},r.flush=()=>{if(n===null)return;clearTimeout(n),n=null;const o=i;i=null,o&&e(...o)},r}async function Yo(e,t,n){const i=new URLSearchParams({q:e});t.caseSensitive&&i.set("case","1"),t.wholeWord&&i.set("word","1"),t.regex&&i.set("regex","1");const r=await fetch(`/api/search?${i.toString()}`,{signal:n});if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.json()}const Qo={caseSensitive:!1,wholeWord:!1,regex:!1};function Zo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function el(e,t){if(!e)return{test:()=>null,matchAll:()=>[],matchAllWithBudget:()=>({matches:[],truncated:!1}),query:e,valid:!0};let n;if(t.regex)try{n=new RegExp(e,t.caseSensitive?"g":"gi")}catch{return{test:()=>null,matchAll:()=>[],matchAllWithBudget:()=>({matches:[],truncated:!1}),query:e,valid:!1}}else{let i=Zo(e);t.wholeWord&&(i=`\\b${i}\\b`),n=new RegExp(i,t.caseSensitive?"g":"gi")}return{query:e,valid:!0,test(i){return n.lastIndex=0,n.exec(i)},matchAll(i){n.lastIndex=0;const r=[];let o;for(;(o=n.exec(i))!==null;){if(o[0].length===0){n.lastIndex++;continue}r.push({index:o.index,length:o[0].length})}return r},matchAllWithBudget(i,r){n.lastIndex=0;const o=[],a=performance.now()+r;let s;for(;(s=n.exec(i))!==null;){if(s[0].length===0){n.lastIndex++;continue}if(o.push({index:s.index,length:s[0].length}),performance.now()>a)return{matches:o,truncated:!0}}return{matches:o,truncated:!1}}}}const Ze="search-hit",Pt="is-active";function we(e){e.querySelectorAll(`mark.${Ze}`).forEach(n=>{const i=n.parentNode;if(i){for(;n.firstChild;)i.insertBefore(n.firstChild,n);i.removeChild(n),i.normalize()}})}function tl(e){let t=e.parentNode;for(;t;){if(t instanceof HTMLElement&&t.tagName==="MARK"&&t.classList.contains(Ze))return!0;t=t.parentNode}return!1}function nl(e,t,n=Qo){if(!t)return[];const i=el(t,n);if(!i.valid)return[];const r=[],o=e.querySelector(".markdown-content")??e,a=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode(d){if(!d.nodeValue||tl(d))return NodeFilter.FILTER_REJECT;const c=d.parentElement;return!c||c.closest(".heading-anchor, .copy-btn, .external-icon, .search-bar")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let s=a.nextNode();for(;s;){const d=s.nodeValue??"";for(const c of i.matchAll(d))r.push({node:s,start:c.index,end:c.index+c.length});s=a.nextNode()}return r}function il(e,t){const n=[],i=new Map;e.forEach(o=>{const a=i.get(o.node)??[];a.push(o),i.set(o.node,a)});const r=new Map;return e.forEach((o,a)=>{r.set(o,a)}),i.forEach((o,a)=>{var h;o.sort((u,f)=>u.start-f.start);let s=0;const d=a.parentNode;if(!d)return;const c=document.createDocumentFragment();o.forEach(u=>{u.start>s&&c.appendChild(document.createTextNode(a.nodeValue.slice(s,u.start)));const f=document.createElement("mark");f.className=Ze;const _=r.get(u);_===t&&f.classList.add(Pt),f.dataset.hit=String(_),f.textContent=a.nodeValue.slice(u.start,u.end),c.appendChild(f),n.push(f),s=u.end}),s<(((h=a.nodeValue)==null?void 0:h.length)??0)&&c.appendChild(document.createTextNode(a.nodeValue.slice(s))),d.replaceChild(c,a)}),n}function rl(e,t){const n=e.querySelectorAll(`mark.${Ze}`);let i=null;return n.forEach(r=>{Number(r.dataset.hit??-1)===t?(r.classList.add(Pt),i=r):r.classList.remove(Pt)}),i}const ol=250,ll=150;function al({scroller:e,fileTrigger:t,onOpenFile:n}){const[i,r]=B(""),o=Gt.value,a=zo.value,s=Vo.value,d=qo.value,c=K(null),h=V([]),u=V(0),f=V(0),_=V(null),p=V(!1),b=V(null),k=V(0);g(()=>{var v,A;(v=c.current)==null||v.focus(),(A=c.current)==null||A.select()},[]);const y=D(()=>$n((v,A,X)=>{we(v);const te=nl(v,A,X);h.value=te,u.value=0,te.length>0?(il(te,0),f.value=v.querySelectorAll("mark.search-hit").length,requestAnimationFrame(()=>{const z=v.querySelector("mark.search-hit.is-active");z&&(Et(z),z.scrollIntoView({behavior:"smooth",block:"center"}))})):f.value=0},ll),[]);g(()=>{if(o==="doc"&&e){if(!i.trim()){y.cancel(),we(e),h.value=[],u.value=0,f.value=0;return}return y(e,i,{caseSensitive:a,wholeWord:s,regex:d}),()=>y.cancel()}},[i,o,e,t,a,s,d]),g(()=>{if(o!=="doc"||!e||h.value.length===0)return;const v=rl(e,u.value);v&&(Et(v),v.scrollIntoView({behavior:"smooth",block:"center"}))},[u.value,o,e,h.value.length]);const m=K(null),I=D(()=>$n((v,A)=>{var te;(te=m.current)==null||te.abort();const X=new AbortController;m.current=X,(async()=>{try{const z=await Yo(v,A,X.signal);if(X.signal.aborted)return;_.value=z,b.value=null,k.value=0}catch(z){if(z.name==="AbortError")return;b.value=z.message}finally{m.current===X&&(m.current=null),X.signal.aborted||(p.value=!1)}})()},ol),[]);g(()=>{var v;if(o==="folder"){if(!i.trim()){I.cancel(),(v=m.current)==null||v.abort(),m.current=null,_.value=null,b.value=null,p.value=!1;return}return p.value=!0,I(i.trim(),{caseSensitive:a,wholeWord:s,regex:d}),()=>{var A;I.cancel(),(A=m.current)==null||A.abort(),m.current=null}}},[i,o,a,s,d]),g(()=>()=>{e&&we(e)},[e]),g(()=>{o!=="doc"&&e&&we(e)},[o,e]);function M(){if(o==="doc"){if(h.value.length===0)return;u.value=(u.value+1)%h.value.length}else{const v=ct(_.value);if(v.length===0)return;k.value=(k.value+1)%v.length}}function F(){if(o==="doc"){if(h.value.length===0)return;u.value=(u.value-1+h.value.length)%h.value.length}else{const v=ct(_.value);if(v.length===0)return;k.value=(k.value-1+v.length)%v.length}}function w(){const A=ct(_.value)[k.value];A&&(n(A.relPath),he())}function x(v){v!==o&&Xo(v)}function O(v){v.key==="Escape"?(v.preventDefault(),he()):v.key==="Tab"?(v.preventDefault(),x(o==="doc"?"folder":"doc")):v.key==="Enter"?(v.preventDefault(),o==="doc"?v.shiftKey?F():M():w()):v.key==="ArrowDown"?(v.preventDefault(),M()):v.key==="ArrowUp"&&(v.preventDefault(),F())}return l("div",{class:"search-bar",role:"search","aria-label":"Find",children:[l("div",{class:"search-scope",role:"tablist","aria-label":"Search scope",children:[l("button",{type:"button",role:"tab","aria-selected":o==="doc",class:`scope-pill${o==="doc"?" is-active":""}`,"data-tooltip":"Search in document (Tab)","data-tooltip-side":"top",onClick:()=>x("doc"),tabIndex:-1,children:"Doc"}),l("button",{type:"button",role:"tab","aria-selected":o==="folder",class:`scope-pill${o==="folder"?" is-active":""}`,"data-tooltip":"Search across folder (⇧⌘F)","data-tooltip-side":"top",onClick:()=>x("folder"),tabIndex:-1,children:"Folder"})]}),l("input",{ref:c,type:"search",class:"search-input",placeholder:o==="doc"?"Find in document":"Find in folder",value:i,onInput:v=>r(v.target.value),onKeyDown:O,"aria-label":"Search query"}),l("div",{class:"search-options",role:"group","aria-label":"Search options",children:[l("button",{type:"button",class:`search-opt${a?" is-on":""}`,"aria-pressed":a,title:"Match case",onClick:jo,tabIndex:-1,children:"Aa"}),l("button",{type:"button",class:`search-opt${s?" is-on":""}`,"aria-pressed":s,title:"Whole word",onClick:Jo,tabIndex:-1,children:"ab"}),l("button",{type:"button",class:`search-opt${d?" is-on":""}`,"aria-pressed":d,title:"Regular expression",onClick:Go,tabIndex:-1,children:".*"})]}),l("span",{class:"search-count","aria-live":"polite",children:cl(o,i.trim(),u.value,f.value,p.value,_.value)}),l("button",{type:"button",class:"search-btn",onClick:F,"aria-label":"Previous match",title:"Previous (↑ / Shift+Enter)",children:"↑"}),l("button",{type:"button",class:"search-btn",onClick:M,"aria-label":"Next match",title:"Next (↓ / Enter)",children:"↓"}),l("button",{type:"button",class:"search-btn search-close",onClick:he,"aria-label":"Close search",title:"Close (Esc)",children:"×"}),o==="folder"&&l(ul,{state:_.value,loading:p.value,error:b.value,query:i.trim(),activeIndex:k.value,onHover:v=>k.value=v,onPick:v=>{k.value=v,w()}})]})}function ct(e){if(!e)return[];const t=[];for(const n of e.results)for(const i of n.hits)t.push({relPath:n.relPath,fileTotal:n.total,fileTruncated:n.truncated,hit:i});return t}function sl(e){if(e.results.length===0)return"No matches";const t=e.results.reduce((r,o)=>r+o.total,0),n=e.results.length===1?"file":"files",i=e.truncated?"+":"";return`${t}${i} hits in ${e.results.length} ${n}`}function cl(e,t,n,i,r,o){return e==="doc"?t?i===0?"No matches":`${Math.min(n+1,i)} / ${i}`:"":r?"…":o?sl(o):""}function ul({state:e,loading:t,error:n,query:i,activeIndex:r,onHover:o,onPick:a}){if(!i)return null;if(t&&!e)return l("div",{class:"search-results",children:l("div",{class:"search-empty",children:"Searching…"})});if(n)return l("div",{class:"search-results",children:l("div",{class:"search-empty",children:["Error: ",n]})});if(!e||e.results.length===0)return l("div",{class:"search-results",children:l("div",{class:"search-empty",children:"No matches"})});let s=0;return l("div",{class:"search-results",children:[e.results.map(d=>l("section",{class:"search-file-group",children:[l("header",{class:"search-file-head",children:[l("span",{class:"search-file-path",children:d.relPath}),l("span",{class:"search-file-count",children:[d.total,d.truncated?"+":""," hits"]})]}),l("ul",{children:d.hits.map(c=>{const h=s++;return l("li",{class:`search-hit-row${h===r?" is-active":""}`,onMouseEnter:()=>o(h),onClick:()=>a(h),children:[l("span",{class:"search-hit-line",children:["L",c.line]}),l("span",{class:"search-hit-snippet",children:dl(c.snippet,c.highlight)})]},`${d.relPath}:${c.line}:${c.col}`)})})]},d.relPath)),e.truncated&&l("div",{class:"search-empty",children:"More results truncated — refine your query."})]})}function dl(e,t){const[n,i]=t;return l(Z,{children:[l("span",{children:e.slice(0,n)}),l("mark",{class:"search-hit",children:e.slice(n,i)}),l("span",{children:e.slice(i)})]})}const hl=typeof navigator<"u"&&/mac/i.test(navigator.platform||navigator.userAgent),ne=hl?"⌘":"Ctrl";function C(e){return e.metaKey||e.ctrlKey}function Ln(e,t){const n=Ye(e.outline).map(r=>r.id);if(n.length===0)return;const i=U.value;if(t===1){const r=i?n.indexOf(i):-1,o=n[Math.min(r+1,n.length-1)];o&&e.onJumpHeading(o)}else{const r=i?n.indexOf(i):n.length,o=n[Math.max(r-1,0)];o&&e.onJumpHeading(o)}}function Tn(e){var a;const t=oe.value;if(!t)return null;const n=ii(t.tree);if(n.length===0)return null;const i=Je.value,r=i?n.findIndex(s=>s.relPath===i):-1;if(r<0)return((a=n[0])==null?void 0:a.relPath)??null;const o=r+e;return o<0||o>=n.length?null:n[o].relPath}function An(e){const t=ve.value;t&&t.scrollBy({top:e*(t.clientHeight/2),behavior:"smooth"})}let Ae=0;const fl=600,Ni=[{id:"palette",group:"Find",label:"Switch file (quick switcher)",displayKeys:[ne,"P"],whenTyping:"allow",match:e=>C(e)&&e.key.toLowerCase()==="p",run:()=>er()},{id:"search-doc-meta",group:"Find",label:"Open in-doc search",displayKeys:[ne,"F"],whenTyping:"allow",match:e=>C(e)&&!e.shiftKey&&e.key.toLowerCase()==="f",run:()=>st("doc")},{id:"search-folder-meta",group:"Find",label:"Open folder-wide search",displayKeys:[ne,"⇧","F"],whenTyping:"allow",match:e=>C(e)&&e.shiftKey&&e.key.toLowerCase()==="f",run:()=>st("folder")},{id:"search-doc-slash",group:"Find",label:"Open search (no modifier)",displayKeys:["/"],whenTyping:"block",match:e=>!C(e)&&e.key==="/",run:()=>st("doc")},{id:"shortcuts-panel",group:"View",label:"Show shortcuts panel",displayKeys:["?"],whenTyping:"block",match:e=>!C(e)&&e.key==="?",run:()=>Ei()},{id:"toggle-tree",group:"View",label:"Toggle file tree",displayKeys:[ne,"B"],whenTyping:"allow",match:e=>C(e)&&e.key.toLowerCase()==="b",run:()=>Ee()},{id:"toggle-outline",group:"View",label:"Toggle outline",displayKeys:[ne,"."],whenTyping:"allow",match:e=>C(e)&&e.key===".",run:()=>Ce()},{id:"toggle-theme",group:"View",label:"Toggle theme",displayKeys:[ne,"\\"],whenTyping:"allow",match:e=>C(e)&&e.key==="\\",run:()=>wi()},{id:"toggle-focus",group:"View",label:"Toggle focus mode",displayKeys:["f"],whenTyping:"block",match:e=>!C(e)&&!e.shiftKey&&e.key==="f",run:()=>ai()},{id:"toggle-minimap",group:"View",label:"Toggle minimap",displayKeys:["m"],whenTyping:"block",match:e=>!C(e)&&!e.shiftKey&&e.key==="m",run:()=>si()},{id:"toggle-wide-layout",group:"View",label:"Toggle wide layout",displayKeys:["w"],whenTyping:"block",match:e=>!C(e)&&!e.shiftKey&&e.key==="w",run:()=>ci()},{id:"expand-all-sections",group:"View",label:"Expand all sections",displayKeys:["e"],whenTyping:"block",match:e=>!C(e)&&!e.shiftKey&&e.key==="e",run:()=>Pr()},{id:"collapse-all-sections",group:"View",label:"Collapse all sections",displayKeys:["⇧","E"],whenTyping:"block",match:e=>!C(e)&&e.shiftKey&&e.key==="E",run:()=>Ir()},{id:"next-heading",group:"Navigation",label:"Next heading",displayKeys:["j"],whenTyping:"block",match:e=>!C(e)&&e.key==="j",run:e=>Ln(e,1)},{id:"prev-heading",group:"Navigation",label:"Previous heading",displayKeys:["k"],whenTyping:"block",match:e=>!C(e)&&e.key==="k",run:e=>Ln(e,-1)},{id:"doc-top",group:"Navigation",label:"Top of document (gg)",displayKeys:["g","g"],whenTyping:"block",match:e=>{if(C(e)||e.shiftKey||e.key!=="g")return!1;const t=performance.now();return t-Ae<fl?(Ae=0,!0):(Ae=t,!1)},run:()=>{const e=ve.value;e&&e.scrollTo({top:0,behavior:"smooth"})}},{id:"doc-bottom",group:"Navigation",label:"Bottom of document",displayKeys:["⇧","G"],whenTyping:"block",match:e=>!C(e)&&e.shiftKey&&e.key==="G",run:()=>{const e=ve.value;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},{id:"next-file",group:"Navigation",label:"Next file",displayKeys:["⇧","L"],whenTyping:"block",match:e=>!C(e)&&e.shiftKey&&e.key==="L",run:e=>{const t=Tn(1);t&&e.navigate(t)}},{id:"prev-file",group:"Navigation",label:"Previous file",displayKeys:["⇧","H"],whenTyping:"block",match:e=>!C(e)&&e.shiftKey&&e.key==="H",run:e=>{const t=Tn(-1);t&&e.navigate(t)}},{id:"next-same-level",group:"Navigation",label:"Next heading at same level",displayKeys:["]"],whenTyping:"block",match:e=>!C(e)&&e.key==="]",run:e=>{const t=En(e.outline,U.value,1);t&&e.onJumpHeading(t)}},{id:"prev-same-level",group:"Navigation",label:"Previous heading at same level",displayKeys:["["],whenTyping:"block",match:e=>!C(e)&&e.key==="[",run:e=>{const t=En(e.outline,U.value,-1);t&&e.onJumpHeading(t)}},{id:"half-page-down",group:"Navigation",label:"Half page down",displayKeys:["Ctrl","D"],whenTyping:"block",match:e=>e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.key.toLowerCase()==="d",run:()=>An(1)},{id:"half-page-up",group:"Navigation",label:"Half page up",displayKeys:["Ctrl","U"],whenTyping:"block",match:e=>e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.key.toLowerCase()==="u",run:()=>An(-1)}],pl=[{id:"esc-close",group:"Navigation",label:"Close search / lightbox / panel",displayKeys:["Esc"],match:()=>!1,run:()=>{}},{id:"enter-next",group:"Find",label:"Next match (in search)",displayKeys:["Enter"],match:()=>!1,run:()=>{}},{id:"shift-enter-prev",group:"Find",label:"Previous match (in search)",displayKeys:["⇧","Enter"],match:()=>!1,run:()=>{}}];function Pn(e){e.key!=="g"&&(Ae=0)}const In=["Navigation","Find","View"];function _l(e){var n;const t=new Map;for(const i of In)t.set(i,[]);for(const i of e)(n=t.get(i.group))==null||n.push(i);return In.map(i=>({heading:i,items:t.get(i)??[]}))}function vl(){const e=Xe.value,t=D(()=>_l([...Ni,...pl]),[]);return g(()=>{if(!e)return;function n(i){i.key==="Escape"&&Le()}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e]),e?l("div",{class:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",onClick:Le,children:l("div",{class:"shortcuts-panel",onClick:n=>n.stopPropagation(),children:[l("div",{class:"shortcuts-head",children:[l("span",{class:"shortcuts-eyebrow",children:"Keyboard shortcuts"}),l("button",{type:"button",class:"shortcuts-close","aria-label":"Close shortcuts panel",onClick:Le,children:"×"})]}),l("div",{class:"shortcuts-body",children:t.filter(n=>n.items.length>0).map(n=>l("section",{class:"shortcuts-group",children:[l("h3",{class:"shortcuts-group-title",children:n.heading}),l("ul",{children:n.items.map(i=>l("li",{children:[l("span",{class:"shortcut-label",children:i.label}),l("span",{class:"shortcut-keys",children:i.displayKeys.map((r,o)=>l("span",{children:[o>0&&l("span",{class:"shortcut-plus","aria-hidden":!0,children:"+"}),l("kbd",{children:r})]},`${r}-${o}`))})]},i.id))})]},n.heading))}),l("div",{class:"shortcuts-foot",children:["Press ",l("kbd",{children:"Esc"})," or click outside to close"]})]})}):null}const ml=4;function gl(e,t){const n=ml;g(()=>{const i=e.current;if(!i)return;function r(o){o.altKey&&(o.preventDefault(),i.scrollBy({top:o.deltaY*n,left:o.deltaX*n,behavior:"auto"}))}return i.addEventListener("wheel",r,{passive:!1}),()=>{i.removeEventListener("wheel",r)}},[e,n])}const j=T(null),We=T(null),It=T(!1);async function Ri(e){It.value=!0,We.value=null;try{const t=e?`/api/file?path=${encodeURIComponent(e)}`:"/api/file",n=await fetch(t);if(!n.ok){const i=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(i.error??`HTTP ${n.status}`)}j.value=await n.json()}catch(t){We.value=t.message,j.value=null}finally{It.value=!1}}function yl(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||e.isContentEditable}function wl(e){return e.key!=="Escape"?!1:Ge.value?($e(),e.preventDefault(),!0):qe.value?(Se(),e.preventDefault(),!0):Xe.value?(Le(),e.preventDefault(),!0):Qe.value?(he(),e.preventDefault(),!0):!1}function bl(e){g(()=>{const t={outline:e.outline,onJumpHeading:e.onJumpHeading,navigate:e.navigate};function n(i){if(wl(i))return;const r=yl(i.target);for(const o of Ni)if(!(r&&o.whenTyping==="block")&&o.match(i)){i.preventDefault(),o.run(t),Pn(i);return}Pn(i)}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e.outline,e.onJumpHeading,e.navigate])}function kl(e){g(()=>{const t=new EventSource("/api/watch"),n=i=>{try{const r=JSON.parse(i.data);e(r)}catch{}};return t.addEventListener("change",n),t.addEventListener("add",n),t.addEventListener("unlink",n),t.addEventListener("config",n),()=>t.close()},[e])}function xl({currentPath:e,scrollerRef:t}){const n=Vn(i=>{var r;if(i.kind==="change"&&i.relPath===e){const o=((r=t.current)==null?void 0:r.scrollTop)??0;Ri(e).then(()=>{requestAnimationFrame(()=>{t.current&&(t.current.scrollTop=o)})});return}(i.kind==="add"||i.kind==="unlink"||i.kind==="config")&&ni()},[e,t]);kl(n)}function Fi(e){for(const t of e){if(t.type==="file"&&t.isMarkdown)return t.relPath;if(t.type==="dir"&&t.children){const n=Fi(t.children);if(n)return n}}return null}function Sl(){var F;Qr(),Po();const e=tr(),{currentPath:t,setCurrentPath:n,navigate:i}=Lr(),r=K(null),o=_r.value,a=vr.value,s=hn.value,d=fn.value,c=li.value;g(()=>{const w=oe.value;if(w){if(w.root.rootKind==="file"){n(w.root.rootRelPath);return}if(t===null){const x=Fi(w.tree);x&&n(x)}}},[e,t]),g(()=>{Ri(t)},[t]),g(()=>{he()},[t]),g(()=>{const w=j.value;let x=null;if(w){if(w.title)x=w.title;else if(t){const O=t.lastIndexOf("/");x=O>=0?t.slice(O+1):t}}document.title=x?`${x} | mdview`:"mdview"},[j.value,t]),g(()=>{if(!j.value||!r.current)return;const w=window.location.hash.slice(1);w?requestAnimationFrame(()=>{rt(w);const x=document.getElementById(w);x==null||x.scrollIntoView({behavior:"auto",block:"start"})}):r.current.scrollTop=0},[j.value]),hr(r.current),g(()=>{Ro(r.current)},[r.current]),g(()=>{c?document.documentElement.dataset.wide="1":delete document.documentElement.dataset.wide},[c]),xl({currentPath:t,scrollerRef:r}),bl({outline:((F=j.value)==null?void 0:F.outline)??[],onJumpHeading:w=>f(w),navigate:w=>i(w)}),gl(r);const h=w=>i(w),u=(w,x)=>{if(i(w,x),x){const O=x.slice(1);requestAnimationFrame(()=>{var v;rt(O),(v=document.getElementById(O))==null||v.scrollIntoView({behavior:"smooth"})})}},f=w=>{var x;history.replaceState(history.state,"",`#${w}`),sr(w),rt(w),(x=document.getElementById(w))==null||x.scrollIntoView({behavior:"smooth"})},_=w=>{var x;if(w===null){history.replaceState(history.state,"",window.location.pathname+window.location.search),U.value=null,(x=r.current)==null||x.scrollTo({top:0,behavior:"smooth"});return}f(w)},p=j.value,b=oe.value,k=bt.value,y=["app-shell",o?"tree-collapsed":"",a?"outline-collapsed":"",k?"has-minimap":""].filter(Boolean).join(" "),m=`--tree-width:${s}px;--outline-width:${d}px`,I=()=>{yr(),o||Ee()},M=()=>{wr(),a||Ce()};return l("div",{class:y,style:m,children:[l("aside",{class:"pane-tree","aria-label":"File tree",children:o?l("button",{class:"rail-btn","aria-label":"Expand file tree",title:"Expand file tree",onClick:Ee,children:[l(mo,{size:15}),l("span",{class:"rail-label",children:"FILES"})]}):b&&l($o,{tree:b.tree,currentPath:t,onSelect:h,onCollapse:Ee})}),!o&&l(Cn,{side:"left",ariaLabel:"Resize file tree",getCurrent:()=>hn.value,onResize:mr,collapseAt:dn,onCollapse:I,min:Oe,max:De}),l("header",{class:"pane-header",children:[l(Mo,{outline:(p==null?void 0:p.outline)??[],fileName:(p==null?void 0:p.title)??null,onJumpHeading:_}),l(Bo,{scroller:r.current,trigger:p})]}),l("main",{class:"pane-main",ref:r,children:[Qe.value&&l(al,{scroller:r.current,fileTrigger:p,onOpenFile:h}),It.value&&!p&&l(ao,{}),We.value&&l("div",{class:"status status-error",children:["Error: ",We.value]}),p&&l(lo,{file:p,onInternalNavigate:u}),p&&bt.value&&l(Oo,{outline:p.outline})]}),l(No,{}),l(vl,{}),l(or,{currentPath:t,onSelect:h}),!a&&l(Cn,{side:"right",ariaLabel:"Resize outline",getCurrent:()=>fn.value,onResize:gr,collapseAt:dn,onCollapse:M,min:Oe,max:De}),l("aside",{class:"pane-outline","aria-label":"Outline",children:a?l("button",{class:"rail-btn","aria-label":"Expand outline",title:"Expand outline",onClick:Ce,children:[l(yo,{size:15}),l("span",{class:"rail-label",children:"OUTLINE"})]}):p&&l(Wo,{nodes:p.outline,onJump:f,onCollapse:Ce})})]})}const Oi=document.getElementById("app");if(!Oi)throw new Error("Missing #app");qi(l(Sl,{}),Oi);export{jt as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e,b as r,a,S as s}from"./chunk-AQP2D5EJ-eqTzq7th.js";import{_ as i}from"./mermaid.core-BUwfPdjt.js";import"./chunk-55IACEB6-AZdo8c-x.js";import"./chunk-2J33WTMH-4B03UoyK.js";import"./index-DFYTyxkU.js";var p={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{p as diagram};
|