@henryavila/mdprobe 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 Re,k,yt,bt,K,nt,xt,wt,qe,xe,ce,kt,Ve,ze,Be,Se={},$e=[],Xt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,je=Array.isArray;function H(t,e){for(var n in e)t[n]=e[n];return t}function Ye(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Jt(t,e,n){var i,r,o,a={};for(o in e)o=="key"?i=e[o]:o=="ref"?r=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Re.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return we(t,a,i,r,null)}function we(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++yt,__i:-1,__u:0};return r==null&&k.vnode!=null&&k.vnode(o),o}function z(t){return t.children}function ue(t,e){this.props=t,this.context=e}function ie(t,e){if(e==null)return t.__?ie(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?ie(t):null}function Vt(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=H({},e);o.__v=e.__v+1,k.vnode&&k.vnode(o),Ge(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??ie(e),!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,At(i,o,r),e.__e=e.__=null,o.__e!=n&&St(o)}}function St(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),St(t)}function ot(t){(!t.__d&&(t.__d=!0)&&K.push(t)&&!Ce.__r++||nt!=k.debounceRendering)&&((nt=k.debounceRendering)||xt)(Ce)}function Ce(){try{for(var t,e=1;K.length;)K.length>e&&K.sort(wt),t=K.shift(),e=K.length,Vt(t)}finally{K.length=Ce.__r=0}}function $t(t,e,n,i,r,o,a,l,d,u,h){var c,f,p,_,v,m,g,y=i&&i.__k||$e,$=e.length;for(d=Yt(n,e,y,d,$),c=0;c<$;c++)(p=n.__k[c])!=null&&(f=p.__i!=-1&&y[p.__i]||Se,p.__i=c,m=Ge(t,p,f,r,o,a,l,d,u,h),_=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Ze(f.ref,null,p),h.push(p.ref,p.__c||_,p)),v==null&&_!=null&&(v=_),(g=!!(4&p.__u))||f.__k===p.__k?(d=Ct(p,d,t,g),g&&f.__e&&(f.__e=null)):typeof p.type=="function"&&m!==void 0?d=m:_&&(d=_.nextSibling),p.__u&=-7);return n.__e=v,d}function Yt(t,e,n,i,r){var o,a,l,d,u,h=n.length,c=h,f=0;for(t.__k=new Array(r),o=0;o<r;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=t.__k[o]=we(null,a,null,null,null):je(a)?a=t.__k[o]=we(z,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=t.__k[o]=we(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[o]=a,d=o+f,a.__=t,a.__b=t.__b+1,l=null,(u=a.__i=Gt(a,n,d,c))!=-1&&(c--,(l=n[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(r>h?f--:r<h&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=d&&(u==d-1?f--:u==d+1?f++:(u>d?f--:f++,a.__u|=4))):t.__k[o]=null;if(c)for(o=0;o<h;o++)(l=n[o])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=ie(l)),Tt(l,l));return i}function Ct(t,e,n,i){var r,o;if(typeof t.type=="function"){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=Ct(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=ie(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Gt(t,e,n,i){var r,o,a,l=t.key,d=t.type,u=e[n],h=u!=null&&(2&u.__u)==0;if(u===null&&l==null||h&&l==u.key&&d==u.type)return n;if(i>(h?1:0)){for(r=n-1,o=n+1;r>=0||o<e.length;)if((u=e[a=r>=0?r--:o++])!=null&&(2&u.__u)==0&&l==u.key&&d==u.type)return a}return-1}function it(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Xt.test(e)?n:n+"px"}function ye(t,e,n,i,r){var o,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||it(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||it(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(kt,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n[ce]=i[ce]:(n[ce]=Ve,t.addEventListener(e,o?Be:ze,o)):t.removeEventListener(e,o?Be:ze,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function rt(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[xe]==null)e[xe]=Ve++;else if(e[xe]<n[ce])return;return n(k.event?k.event(e):e)}}}function Ge(t,e,n,i,r,o,a,l,d,u){var h,c,f,p,_,v,m,g,y,$,b,x,S,R,j,I=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(d=!!(32&n.__u),o=[l=e.__e=n.__e]),(h=k.__b)&&h(e);e:if(typeof I=="function")try{if(g=e.props,y=I.prototype&&I.prototype.render,$=(h=I.contextType)&&i[h.__c],b=h?$?$.props.value:h.__:i,n.__c?m=(c=e.__c=n.__c).__=c.__E:(y?e.__c=c=new I(g,b):(e.__c=c=new ue(g,b),c.constructor=I,c.render=Qt),$&&$.sub(c),c.state||(c.state={}),c.__n=i,f=c.__d=!0,c.__h=[],c._sb=[]),y&&c.__s==null&&(c.__s=c.state),y&&I.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=H({},c.__s)),H(c.__s,I.getDerivedStateFromProps(g,c.__s))),p=c.props,_=c.state,c.__v=e,f)y&&I.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),y&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(y&&I.getDerivedStateFromProps==null&&g!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(g,b),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(g,c.__s,b)===!1){e.__v!=n.__v&&(c.props=g,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(U){U&&(U.__=e)}),$e.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&a.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(g,c.__s,b),y&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,_,v)})}if(c.context=b,c.props=g,c.__P=t,c.__e=!1,x=k.__r,S=0,y)c.state=c.__s,c.__d=!1,x&&x(e),h=c.render(c.props,c.state,c.context),$e.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,x&&x(e),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++S<25);c.state=c.__s,c.getChildContext!=null&&(i=H(H({},i),c.getChildContext())),y&&!f&&c.getSnapshotBeforeUpdate!=null&&(v=c.getSnapshotBeforeUpdate(p,_)),R=h!=null&&h.type===z&&h.key==null?Et(h.props.children):h,l=$t(t,je(R)?R:[R],e,n,i,r,o,a,l,d,u),c.base=e.__e,e.__u&=-161,c.__h.length&&a.push(c),m&&(c.__E=c.__=null)}catch(U){if(e.__v=null,d||o!=null)if(U.then){for(e.__u|=d?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,e.__e=l}else{for(j=o.length;j--;)Ye(o[j]);Ke(e)}else e.__e=n.__e,e.__k=n.__k,U.then||Ke(e);k.__e(U,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=Zt(n.__e,e,n,i,r,o,a,d,u);return(h=k.diffed)&&h(e),128&e.__u?void 0:l}function Ke(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Ke))}function At(t,e,n){for(var i=0;i<n.length;i++)Ze(n[i],n[++i],n[++i]);k.__c&&k.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(o){o.call(r)})}catch(o){k.__e(o,r.__v)}})}function Et(t){return typeof t!="object"||t==null||t.__b>0?t:je(t)?t.map(Et):H({},t)}function Zt(t,e,n,i,r,o,a,l,d){var u,h,c,f,p,_,v,m=n.props||Se,g=e.props,y=e.type;if(y=="svg"?r="http://www.w3.org/2000/svg":y=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((p=o[u])&&"setAttribute"in p==!!y&&(y?p.localName==y:p.nodeType==3)){t=p,o[u]=null;break}}if(t==null){if(y==null)return document.createTextNode(g);t=document.createElementNS(r,y,g.is&&g),l&&(k.__m&&k.__m(e,o),l=!1),o=null}if(y==null)m===g||l&&t.data==g||(t.data=g);else{if(o=o&&Re.call(t.childNodes),!l&&o!=null)for(m={},u=0;u<t.attributes.length;u++)m[(p=t.attributes[u]).name]=p.value;for(u in m)p=m[u],u=="dangerouslySetInnerHTML"?c=p:u=="children"||u in g||u=="value"&&"defaultValue"in g||u=="checked"&&"defaultChecked"in g||ye(t,u,null,p,r);for(u in g)p=g[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?h=p:u=="value"?_=p:u=="checked"?v=p:l&&typeof p!="function"||m[u]===p||ye(t,u,p,m[u],r);if(h)l||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),$t(e.type=="template"?t.content:t,je(f)?f:[f],e,n,i,y=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&ie(n,0),l,d),o!=null)for(u=o.length;u--;)Ye(o[u]);l||(u="value",y=="progress"&&_==null?t.removeAttribute("value"):_!=null&&(_!==t[u]||y=="progress"&&!_||y=="option"&&_!=m[u])&&ye(t,u,_,m[u],r),u="checked",v!=null&&v!=t[u]&&ye(t,u,v,m[u],r))}return t}function Ze(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){k.__e(r,n)}}function Tt(t,e,n){var i,r;if(k.unmount&&k.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ze(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){k.__e(o,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Tt(i[r],e,n||typeof t.type!="function");n||Ye(t.__e),t.__c=t.__=t.__e=void 0}function Qt(t,e,n){return this.constructor(t,n)}function en(t,e,n){var i,r,o,a;e==document&&(e=document.documentElement),k.__&&k.__(t,e),r=(i=!1)?null:e.__k,o=[],a=[],Ge(e,t=e.__k=Jt(z,null,[t]),r||Se,Se,e.namespaceURI,r?null:e.firstChild?Re.call(e.childNodes):null,o,r?r.__e:e.firstChild,i,a),At(o,t,a)}Re=$e.slice,k={__e:function(t,e,n,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(t)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(l){t=l}throw t}},yt=0,bt=function(t){return t!=null&&t.constructor===void 0},ue.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=H({},this.state),typeof t=="function"&&(t=t(H({},n),this.props)),t&&H(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ot(this))},ue.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ot(this))},ue.prototype.render=z,K=[],xt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wt=function(t,e){return t.__v.__b-e.__v.__b},Ce.__r=0,qe=Math.random().toString(8),xe="__d"+qe,ce="__a"+qe,kt=/(PointerCapture)$|Capture$/i,Ve=0,ze=rt(!1),Be=rt(!0);var tn=0;function s(t,e,n,i,r,o){e||(e={});var a,l,d=e;if("ref"in d)for(l in d={},e)l=="ref"?a=e[l]:d[l]=e[l];var u={type:t,props:d,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tn,__i:-1,__u:0,__source:r,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(l in a)d[l]===void 0&&(d[l]=a[l]);return k.vnode&&k.vnode(u),u}var pe,A,Oe,at,_e=0,Nt=[],T=k,lt=T.__b,st=T.__r,ct=T.diffed,ut=T.__c,dt=T.unmount,ft=T.__;function Qe(t,e){T.__h&&T.__h(A,t,_e||e),_e=0;var n=A.__H||(A.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function B(t){return _e=1,nn(Pt,t)}function nn(t,e,n){var i=Qe(pe++,2);if(i.t=t,!i.__c&&(i.__=[Pt(void 0,e),function(l){var d=i.__N?i.__N[0]:i.__[0],u=i.t(d,l);d!==u&&(i.__N=[u,i.__[1]],i.__c.setState({}))}],i.__c=A,!A.__f)){var r=function(l,d,u){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,l,d,u);var c=i.__c.props!==l;return h.some(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(c=!0)}}),o&&o.call(this,l,d,u)||c};A.__f=!0;var o=A.shouldComponentUpdate,a=A.componentWillUpdate;A.componentWillUpdate=function(l,d,u){if(this.__e){var h=o;o=void 0,r(l,d,u),o=h}a&&a.call(this,l,d,u)},A.shouldComponentUpdate=r}return i.__N||i.__}function M(t,e){var n=Qe(pe++,3);!T.__s&&Lt(n.__H,e)&&(n.__=t,n.u=e,A.__H.__h.push(n))}function O(t){return _e=5,Me(function(){return{current:t}},[])}function Me(t,e){var n=Qe(pe++,7);return Lt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function on(t,e){return _e=8,Me(function(){return t},e)}function rn(){for(var t;t=Nt.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ke),e.__h.some(Xe),e.__h=[]}catch(n){e.__h=[],T.__e(n,t.__v)}}}T.__b=function(t){A=null,lt&&lt(t)},T.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ft&&ft(t,e)},T.__r=function(t){st&&st(t),pe=0;var e=(A=t.__c).__H;e&&(Oe===A?(e.__h=[],A.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(ke),e.__h.some(Xe),e.__h=[],pe=0)),Oe=A},T.diffed=function(t){ct&&ct(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Nt.push(e)!==1&&at===T.requestAnimationFrame||((at=T.requestAnimationFrame)||an)(rn)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Oe=A=null},T.__c=function(t,e){e.some(function(n){try{n.__h.some(ke),n.__h=n.__h.filter(function(i){return!i.__||Xe(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],T.__e(i,n.__v)}}),ut&&ut(t,e)},T.unmount=function(t){dt&&dt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(i){try{ke(i)}catch(r){e=r}}),n.__H=void 0,e&&T.__e(e,n.__v))};var pt=typeof requestAnimationFrame=="function";function an(t){var e,n=function(){clearTimeout(i),pt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);pt&&(e=requestAnimationFrame(n))}function ke(t){var e=A,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),A=e}function Xe(t){var e=A;t.__c=t.__(),A=e}function Lt(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function Pt(t,e){return typeof e=="function"?e(t):e}var ln=Symbol.for("preact-signals");function De(){if(W>1)W--;else{var t,e=!1;for((function(){var r=Ee;for(Ee=void 0;r!==void 0;)r.S.v===r.v&&(r.S.i=r.i),r=r.o})();de!==void 0;){var n=de;for(de=void 0,Ae++;n!==void 0;){var i=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&jt(n))try{n.c()}catch(r){e||(t=r,e=!0)}n=i}}if(Ae=0,W--,e)throw t}}function sn(t){if(W>0)return t();Je=++cn,W++;try{return t()}finally{De()}}var w=void 0;function It(t){var e=w;w=void 0;try{return t()}finally{w=e}}var de=void 0,W=0,Ae=0,cn=0,Je=0,Ee=void 0,Te=0;function Rt(t){if(w!==void 0){var e=t.n;if(e===void 0||e.t!==w)return e={i:0,S:t,p:w.s,n:void 0,t:w,e:void 0,x:void 0,r:e},w.s!==void 0&&(w.s.n=e),w.s=e,t.n=e,32&w.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=w.s,e.n=void 0,w.s.n=e,w.s=e),e}}function P(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}P.prototype.brand=ln;P.prototype.h=function(){return!0};P.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:It(function(){var i;(i=e.W)==null||i.call(e)}))};P.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,i=t.x;n!==void 0&&(n.x=i,t.e=void 0),i!==void 0&&(i.e=n,t.x=void 0),t===this.t&&(this.t=i,i===void 0&&It(function(){var r;(r=e.Z)==null||r.call(e)}))}};P.prototype.subscribe=function(t){var e=this;return ge(function(){var n=e.value,i=w;w=void 0;try{t(n)}finally{w=i}},{name:"sub"})};P.prototype.valueOf=function(){return this.value};P.prototype.toString=function(){return this.value+""};P.prototype.toJSON=function(){return this.value};P.prototype.peek=function(){var t=w;w=void 0;try{return this.value}finally{w=t}};Object.defineProperty(P.prototype,"value",{get:function(){var t=Rt(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Ae>100)throw new Error("Cycle detected");(function(n){W!==0&&Ae===0&&n.l!==Je&&(n.l=Je,Ee={S:n,v:n.v,i:n.i,o:Ee})})(this),this.v=t,this.i++,Te++,W++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{De()}}}});function E(t,e){return new P(t,e)}function jt(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Mt(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Dt(t){for(var e=t.s,n=void 0;e!==void 0;){var i=e.p;e.i===-1?(e.S.U(e),i!==void 0&&(i.n=e.n),e.n!==void 0&&(e.n.p=i)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=i}t.s=n}function ee(t,e){P.call(this,void 0),this.x=t,this.s=void 0,this.g=Te-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}ee.prototype=new P;ee.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Te))return!0;if(this.g=Te,this.f|=1,this.i>0&&!jt(this))return this.f&=-2,!0;var t=w;try{Mt(this),w=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return w=t,Dt(this),this.f&=-2,!0};ee.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}P.prototype.S.call(this,t)};ee.prototype.U=function(t){if(this.t!==void 0&&(P.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};ee.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(ee.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Rt(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function D(t,e){return new ee(t,e)}function Ut(t){var e=t.m;if(t.m=void 0,typeof e=="function"){W++;var n=w;w=void 0;try{e()}catch(i){throw t.f&=-2,t.f|=8,et(t),i}finally{w=n,De()}}}function et(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Ut(t)}function un(t){if(w!==this)throw new Error("Out-of-order effect");Dt(this),w=t,this.f&=-2,8&this.f&&et(this),De()}function re(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e==null?void 0:e.name}re.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}};re.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ut(this),Mt(this),W++;var t=w;return w=this,un.bind(this,t)};re.prototype.N=function(){2&this.f||(this.f|=2,this.u=de,de=this)};re.prototype.d=function(){this.f|=8,1&this.f||et(this)};re.prototype.dispose=function(){this.d()};function ge(t,e){var n=new re(t,e);try{n.c()}catch(r){throw n.d(),r}var i=n.d.bind(n);return i[Symbol.dispose]=i,i}var qt,be,dn=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,Ot=[];ge(function(){qt=this.N})();function ae(t,e){k[t]=e.bind(null,k[t]||function(){})}function Ne(t){if(be){var e=be;be=void 0,e()}be=t&&t.S()}function Ht(t){var e=this,n=t.data,i=pn(n);i.value=n;var r=Me(function(){for(var l=e,d=e.__v;d=d.__;)if(d.__c){d.__c.__$f|=4;break}var u=D(function(){var p=i.value.value;return p===0?0:p===!0?"":p||""}),h=D(function(){return!Array.isArray(u.value)&&!bt(u.value)}),c=ge(function(){if(this.N=Ft,h.value){var p=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=p)}}),f=e.__$u.d;return e.__$u.d=function(){c(),f.call(this)},[h,u]},[]),o=r[0],a=r[1];return o.value?a.peek():a.value}Ht.displayName="ReactiveTextNode";Object.defineProperties(P.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ht},props:{configurable:!0,get:function(){var t=this;return{data:{get value(){return t.value}}}}},__b:{configurable:!0,value:1}});ae("__b",function(t,e){if(typeof e.type=="string"){var n,i=e.props;for(var r in i)if(r!=="children"){var o=i[r];o instanceof P&&(n||(e.__np=n={}),n[r]=o,i[r]=o.peek())}}t(e)});ae("__r",function(t,e){if(t(e),e.type!==z){Ne();var n,i=e.__c;i&&(i.__$f&=-2,(n=i.__$u)===void 0&&(i.__$u=n=(function(r,o){var a;return ge(function(){a=this},{name:o}),a.c=r,a})(function(){var r;dn&&((r=n.y)==null||r.call(n)),i.__$f|=1,i.setState({})},typeof e.type=="function"?e.type.displayName||e.type.name:""))),Ne(n)}});ae("__e",function(t,e,n,i){Ne(),t(e,n,i)});ae("diffed",function(t,e){Ne();var n;if(typeof e.type=="string"&&(n=e.__e)){var i=e.__np,r=e.props;if(i){var o=n.U;if(o)for(var a in o){var l=o[a];l!==void 0&&!(a in i)&&(l.d(),o[a]=void 0)}else o={},n.U=o;for(var d in i){var u=o[d],h=i[d];u===void 0?(u=fn(n,d,h),o[d]=u):u.o(h,r)}for(var c in i)r[c]=i[c]}}t(e)});function fn(t,e,n,i){var r=e in t&&t.ownerSVGElement===void 0,o=E(n),a=n.peek();return{o:function(l,d){o.value=l,a=l.peek()},d:ge(function(){this.N=Ft;var l=o.value.value;a!==l?(a=void 0,r?t[e]=l:l!=null&&(l!==!1||e[4]==="-")?t.setAttribute(e,l):t.removeAttribute(e)):a=void 0})}}ae("unmount",function(t,e){if(typeof e.type=="string"){var n=e.__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()}}}e.__np=void 0}else{var a=e.__c;if(a){var l=a.__$u;l&&(a.__$u=void 0,l.d())}}t(e)});ae("__h",function(t,e,n,i){(i<3||i===9)&&(e.__$f|=2),t(e,n,i)});ue.prototype.shouldComponentUpdate=function(t,e){if(this.__R)return!0;var n=this.__$u,i=n&&n.s!==void 0;for(var r in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(i||o||4&this.__$f)||1&this.__$f)return!0}else if(!(i||4&this.__$f)||3&this.__$f)return!0;for(var a in t)if(a!=="__source"&&t[a]!==this.props[a])return!0;for(var l in this.props)if(!(l in t))return!0;return!1};function pn(t,e){return Me(function(){return E(t,e)},[])}var _n=function(t){queueMicrotask(function(){queueMicrotask(t)})};function hn(){sn(function(){for(var t;t=Ot.shift();)qt.call(t)})}function Ft(){Ot.push(this)===1&&(k.requestAnimationFrame||_n)(hn)}const q=E([]),Q=E(null),V=E(""),fe=E([]);E(null);const C=E([]),L=E([]),F=E(null),he=E(!1),Le=E(null),Pe=E(null),X=E(localStorage.getItem("mdprobe-left-panel")!=="false"),J=E(localStorage.getItem("mdprobe-right-panel")!=="false"),G=E(localStorage.getItem("mdprobe-theme")||"mocha"),ve=E(!1),me=E({});X.subscribe(t=>localStorage.setItem("mdprobe-left-panel",t));J.subscribe(t=>localStorage.setItem("mdprobe-right-panel",t));const Ie=E("anonymous"),He=E(!1),Z=D(()=>C.value.filter(t=>t.status==="open"));D(()=>C.value.filter(t=>t.status==="resolved"));const Ue=D(()=>{let t=he.value?C.value:C.value.filter(e=>e.status==="open");return Le.value&&(t=t.filter(e=>e.tag===Le.value)),Pe.value&&(t=t.filter(e=>e.author===Pe.value)),t}),oe=D(()=>Ue.value.filter(t=>me.value[t.id]==="orphan")),Fe=D(()=>Ue.value.filter(t=>me.value[t.id]!=="orphan")),vn=D(()=>[...new Set(C.value.map(t=>t.tag))]),mn=D(()=>[...new Set(C.value.map(t=>t.author))]),se=E(2),ne=D(()=>{const t=se.value,e=L.value.filter(r=>r.level===t),n=e.length,i=e.filter(r=>r.status!=="pending").length;return{total:n,reviewed:i}}),_t=2e3,gn=3e4;function yn(){const t=O(null),e=O(_t),n=O(null),i=O(!1),r=O(!1),o=on(()=>{if(i.current)return;const a=location.protocol==="https:"?"wss:":"ws:",l=new WebSocket(`${a}//${location.host}/ws`);t.current=l,l.onopen=()=>{e.current=_t,r.current&&fetch("/api/files").then(d=>d.json()).then(d=>{q.value=d}).catch(()=>{}),r.current=!0},l.onmessage=d=>{let u;try{u=JSON.parse(d.data)}catch{console.warn("mdProbe: received non-JSON WebSocket message");return}switch(u.type){case"update":{const h=document.querySelector(".content-area"),c=h?h.scrollTop:0;V.value=u.html,fe.value=u.toc||[],h&&requestAnimationFrame(()=>{h.scrollTop=c});break}case"file-added":q.value.some(h=>h.path===u.file)||(q.value=[...q.value,{path:u.file,label:u.file.replace(/\.md$/,"")}]);break;case"file-removed":q.value=q.value.filter(h=>h.path!==u.file);break;case"annotations":(!u.file||u.file===Q.value)&&(C.value=u.annotations||[],L.value=u.sections||[]);break;case"drift":ve.value=u.warning||!0,u.anchorStatus&&(me.value=u.anchorStatus);break;case"error":console.warn("mdProbe:",u.message);break}},l.onerror=d=>{console.warn("mdProbe: WebSocket error",d)},l.onclose=()=>{if(t.current=null,i.current)return;const d=e.current;e.current=Math.min(d*2,gn);const u=Math.random()*d*.3;n.current=setTimeout(o,d+u)}},[]);return M(()=>(i.current=!1,o(),()=>{var a;i.current=!0,clearTimeout(n.current),(a=t.current)==null||a.close(),t.current=null}),[o]),t}function bn({onShowHelp:t}={}){M(()=>{function e(n){var r,o;const i=(r=document.activeElement)==null?void 0:r.tagName;if(!(i==="TEXTAREA"||i==="INPUT"||i==="SELECT")&&!((o=document.activeElement)!=null&&o.isContentEditable))switch(n.key){case"[":n.preventDefault(),X.value=!X.value;break;case"]":n.preventDefault(),J.value=!J.value;break;case"\\":{n.preventDefault();const a=X.value&&J.value;X.value=!a,J.value=!a;break}case"j":n.preventDefault(),ht(1);break;case"k":n.preventDefault(),ht(-1);break;case"r":break;case"e":break;case"?":n.preventDefault(),t==null||t();break}}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t])}function ht(t){const e=Ue.value;if(e.length===0)return;const n=F.value,i=e.findIndex(d=>d.id===n);let r;i===-1?r=t>0?0:e.length-1:(r=i+t,r<0&&(r=e.length-1),r>=e.length&&(r=0));const o=e[r];F.value=o.id;const a=document.querySelector(`[data-annotation-id="${o.id}"]`);a==null||a.scrollIntoView({behavior:"smooth",block:"nearest"});const l=document.querySelector(`[data-highlight-id="${o.id}"]`);l==null||l.scrollIntoView({behavior:"smooth",block:"center"})}const xn=[{id:"mocha",label:"Mocha",color:"#1e1e2e"},{id:"macchiato",label:"Macchiato",color:"#24273a"},{id:"frappe",label:"Frappé",color:"#303446"},{id:"latte",label:"Latte",color:"#eff1f5"},{id:"light",label:"Light",color:"#ffffff"}],wn="mdprobe-theme";function kn(){M(()=>(vt(G.value),G.subscribe(n=>{vt(n)})),[]);function t(e){G.value=e}return{theme:G,setTheme:t,themes:xn}}function vt(t){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem(wn,t)}catch{}}const We="";function Sn(){async function t(_){const v=await fetch(`${We}/api/annotations?path=${encodeURIComponent(_)}`);if(!v.ok)throw new Error(`Failed to fetch annotations: ${v.status}`);const m=await v.json();return C.value=m.annotations||[],L.value=m.sections||[],m.sectionLevel!=null&&(se.value=m.sectionLevel),ve.value=m.drift||!1,m.drift&&typeof m.drift=="object"?me.value=m.drift.anchorStatus||{}:me.value={},m}async function e({selectors:_,comment:v,tag:m}){const g=await f("add",{selectors:_,comment:v,tag:m,author:Ie.value});return C.value=g.annotations||C.value,g}async function n(_){const v=await f("resolve",{id:_});C.value=v.annotations||C.value}async function i(_){const v=await f("reopen",{id:_});C.value=v.annotations||C.value}async function r(_,{comment:v,tag:m}){const g=await f("update",{id:_,comment:v,tag:m});C.value=g.annotations||C.value}async function o(_){const v=await f("delete",{id:_});C.value=v.annotations||C.value}async function a(_,v){const m=await f("reply",{id:_,author:Ie.value,comment:v});C.value=m.annotations||C.value}async function l(_){const v=await p("approve",{heading:_});L.value=v.sections||L.value,v.sectionLevel!=null&&(se.value=v.sectionLevel)}async function d(_){const v=await p("reject",{heading:_});L.value=v.sections||L.value,v.sectionLevel!=null&&(se.value=v.sectionLevel)}async function u(){const _=await p("approveAll");L.value=_.sections||L.value}async function h(_){const v=await p("reset",{heading:_});L.value=v.sections||L.value,v.sectionLevel!=null&&(se.value=v.sectionLevel)}async function c(){const _=await p("clearAll");L.value=_.sections||L.value}async function f(_,v){const m=await fetch(`${We}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:Q.value,action:_,data:v})});if(!m.ok)throw new Error(`Annotation ${_} failed: ${m.status}`);return m.json()}async function p(_,v={}){const m=await fetch(`${We}/api/sections`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:Q.value,action:_,...v})});if(!m.ok)throw new Error(`Section ${_} failed: ${m.status}`);return m.json()}return{fetchAnnotations:t,createAnnotation:e,resolveAnnotation:n,reopenAnnotation:i,updateAnnotation:r,deleteAnnotation:o,addReply:a,approveSection:l,rejectSection:d,resetSection:h,approveAllSections:u,clearAllSections:c}}const $n="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js",Cn="https://cdn.jsdelivr.net/npm/katex@0.16/dist/katex.min.css",An="https://cdn.jsdelivr.net/npm/katex@0.16/dist/katex.min.js";let mt=!1,gt=!1;function Wt(t){return new Promise((e,n)=>{if(document.querySelector(`script[src="${t}"]`))return e();const i=document.createElement("script");i.src=t,i.onload=e,i.onerror=n,document.head.appendChild(i)})}function En(t){if(document.querySelector(`link[href="${t}"]`))return;const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.appendChild(e)}function Tn(){const t=O("");M(()=>{if(V.value===t.current)return;t.current=V.value;const e=document.querySelectorAll("pre.mermaid:not([data-processed])");e.length>0&&Nn(e);const n=document.querySelectorAll("[data-math], .math-inline, .math-display");n.length>0&&Ln(n)},[V.value,G.value])}async function Nn(t){try{mt||(await Wt($n),mt=!0);const e=!["latte","light"].includes(G.value);window.mermaid.initialize({startOnLoad:!1,theme:e?"dark":"default"});for(const n of t)n.setAttribute("data-processed","true");await window.mermaid.run({nodes:[...t]})}catch(e){console.warn("mdProbe: Mermaid rendering failed",e)}}async function Ln(t){try{gt||(En(Cn),await Wt(An),gt=!0);for(const e of t){if(e.getAttribute("data-katex-rendered"))continue;const n=e.textContent,i=e.classList.contains("math-display");try{window.katex.render(n,e,{displayMode:i,throwOnError:!1}),e.setAttribute("data-katex-rendered","true")}catch{}}}catch(e){console.warn("mdProbe: KaTeX rendering failed",e)}}function Pn({onFileSelect:t}){const e=!X.value;function n(i){const r=fe.value,o=r[i];if(!o)return 0;const a=o.line;let l=1/0;for(let d=i+1;d<r.length;d++)if(r[d].level<=o.level){l=r[d].line;break}return Z.value.filter(d=>{var h,c;const u=(c=(h=d.selectors)==null?void 0:h.position)==null?void 0:c.startLine;return u!=null&&u>=a&&u<l}).length}return s("aside",{class:`left-panel ${e?"collapsed":""}`,children:e?s("div",{class:"panel-collapsed-indicator",onClick:()=>X.value=!0,children:[s("span",{children:"☰"}),s("span",{class:"shortcut-key",children:"["}),Z.value.length>0&&s("span",{class:"badge",children:Z.value.length})]}):s("div",{class:"panel-content",children:[s("div",{class:"panel-header",style:"padding: 12px; display: flex; justify-content: space-between; align-items: center",children:[s("span",{style:"font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted)",children:"Files & TOC"}),s("button",{class:"btn btn-sm btn-ghost",onClick:()=>X.value=!1,children:"×"})]}),q.value.length>1&&s("div",{class:"file-list-section",children:[s("div",{style:"font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 4px 4px 6px; font-weight: 600",children:"Files"}),q.value.map(i=>{const r=i.path||i,o=i.label||r.replace(".md",""),a=r===Q.value;return s("div",{class:`file-item ${a?"active":""}`,onClick:()=>t(r),children:[s("span",{class:"icon",children:"📄"}),s("span",{children:o})]},r)})]}),s("div",{class:"toc-section",children:[s("div",{style:"font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 4px 4px 6px; font-weight: 600",children:"Sections"}),fe.value.length===0?s("div",{style:"padding: 8px; color: var(--text-muted); font-size: 13px",children:"No sections"}):fe.value.map((i,r)=>{const o=n(r),a=L.value.find(d=>d.heading===i.heading&&d.level===i.level),l=(a==null?void 0:a.status)==="approved"?"dot-approved":(a==null?void 0:a.status)==="rejected"?"dot-rejected":"";return s("div",{class:`toc-item level-${i.level}`,onClick:()=>{const d=document.querySelector(`[data-source-line="${i.line}"]`);d==null||d.scrollIntoView({behavior:"smooth",block:"start"})},children:[l&&s("span",{class:`toc-dot ${l}`}),i.heading,o>0&&s("span",{class:"badge",style:"margin-left: 6px",children:o})]},r)})]})]})})}const In=[{value:"question",label:"Question"},{value:"bug",label:"Bug"},{value:"suggestion",label:"Suggestion"},{value:"nitpick",label:"Nitpick"}];function zt({annotation:t,selectors:e,exact:n,onSave:i,onCancel:r}){const o=!!t,[a,l]=B((t==null?void 0:t.comment)||""),[d,u]=B((t==null?void 0:t.tag)||"question");function h(f){f.preventDefault(),a.trim()&&i(o?{comment:a.trim(),tag:d}:{selectors:e,comment:a.trim(),tag:d})}function c(f){(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&h(f),f.key==="Escape"&&r()}return s("form",{class:"annotation-form",onSubmit:h,onKeyDown:c,onClick:f=>f.stopPropagation(),children:[n&&s("div",{class:"annotation-form__quote",children:n}),s("div",{class:"annotation-form__tags",children:In.map(f=>s("button",{type:"button",class:`tag-pill tag-pill--${f.value}${d===f.value?" tag-pill--active":""}`,onClick:()=>u(f.value),children:f.label},f.value))}),s("textarea",{value:a,onInput:f=>l(f.target.value),placeholder:"Add your comment... (Ctrl+Enter to save)",autoFocus:!0}),s("div",{class:"annotation-form__actions",children:[s("span",{class:"annotation-form__hint",children:"Ctrl+Enter to save · Esc to close"}),s("button",{type:"button",class:"btn btn--ghost",onClick:r,children:"Cancel"}),s("button",{type:"submit",class:"btn btn--primary",disabled:!a.trim(),children:o?"Save":"Annotate"})]})]})}function Rn({replies:t}){return!t||t.length===0?null:s("div",{style:"margin-top: 8px",children:t.map((e,n)=>s("div",{class:"reply",children:[s("div",{class:"author",children:e.author}),s("div",{class:"text",children:e.comment}),s("div",{style:"font-size: 10px; color: var(--text-muted); margin-top: 2px",children:jn(e.created_at)})]},n))})}function jn(t){if(!t)return"";try{const e=new Date(t);return e.toLocaleDateString(void 0,{month:"short",day:"numeric"})+" "+e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return t}}function Mn({annotationOps:t}){const e=!J.value,[n,i]=B(null);function r(o){F.value=o.id;const a=document.querySelector(`[data-highlight-id="${o.id}"]`);a==null||a.scrollIntoView({behavior:"smooth",block:"center"})}return s("aside",{class:`right-panel ${e?"collapsed":""}`,children:e?s("div",{class:"panel-collapsed-indicator",onClick:()=>J.value=!0,children:[s("span",{children:"💬"}),s("span",{class:"shortcut-key",children:"]"}),Z.value.length>0&&s("span",{class:"badge",children:Z.value.length})]}):s("div",{class:"panel-content",children:[s("div",{class:"panel-header",style:"padding: 12px; display: flex; justify-content: space-between; align-items: center",children:[s("span",{style:"font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted)",children:["Annotations (",Z.value.length," open)"]}),s("button",{class:"btn btn-sm btn-ghost",onClick:()=>J.value=!1,children:"×"})]}),s("div",{style:"padding: 0 12px 8px; display: flex; gap: 6px; flex-wrap: wrap",children:[s("select",{class:"filter-select",value:Le.value||"",onChange:o=>Le.value=o.target.value||null,style:"padding: 3px 6px; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-primary); color: var(--text-primary)",children:[s("option",{value:"",children:"All tags"}),vn.value.map(o=>s("option",{value:o,children:o},o))]}),s("select",{value:Pe.value||"",onChange:o=>Pe.value=o.target.value||null,style:"padding: 3px 6px; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-primary); color: var(--text-primary)",children:[s("option",{value:"",children:"All authors"}),mn.value.map(o=>s("option",{value:o,children:o},o))]}),s("label",{style:"display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); cursor: pointer",children:[s("input",{type:"checkbox",checked:he.value,onChange:o=>he.value=o.target.checked}),"Show resolved"]})]}),s("div",{style:"overflow-y: auto; padding: 0 8px; flex: 1",children:Fe.value.length===0&&oe.value.length===0?s("div",{style:"padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px",children:"No annotations"}):s(z,{children:[Fe.value.length===0&&oe.value.length===0&&Ue.value.length>0?s("div",{style:"padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px",children:"No annotations"}):Fe.value.map(o=>s(Bt,{ann:o,isSelected:F.value===o.id,onClick:()=>r(o),annotationOps:t,editingId:n,setEditingId:i},o.id)),ve.value&&oe.value.length>0&&s(Dn,{annotations:oe.value,selectedAnnotationId:F.value,onSelect:o=>{F.value=o.id},annotationOps:t,editingId:n,setEditingId:i})]})})]})})}function Bt({ann:t,isSelected:e,onClick:n,annotationOps:i,editingId:r,setEditingId:o,orphaned:a=!1}){var l,d,u;return s("div",{"data-annotation-id":t.id,class:`annotation-card ${e?"selected":""} ${t.status==="resolved"?"resolved":""} ${a?"orphaned":""}`,onClick:n,children:[s("div",{style:"display: flex; align-items: center; gap: 6px; margin-bottom: 6px",children:[s("span",{class:`tag tag-${t.tag}`,children:t.tag}),s("span",{style:"font-size: 11px; color: var(--text-muted)",children:t.author}),t.status==="resolved"&&s("span",{style:"font-size: 10px; color: var(--status-approved)",children:"✓ resolved"}),a&&s("span",{style:"font-size: 10px; color: var(--tag-bug)",children:"não encontrada"})]}),((d=(l=t.selectors)==null?void 0:l.quote)==null?void 0:d.exact)&&s("div",{class:"quote",children:t.selectors.quote.exact}),s("div",{style:"font-size: 13px; margin-top: 4px",children:t.comment}),e&&s("div",{style:"margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap",children:[t.status==="open"?s("button",{class:"btn btn-sm",onClick:h=>{h.stopPropagation(),i.resolveAnnotation(t.id)},children:"Resolve"}):s("button",{class:"btn btn-sm",onClick:h=>{h.stopPropagation(),i.reopenAnnotation(t.id)},children:"Reopen"}),s("button",{class:"btn btn-sm",onClick:h=>{h.stopPropagation(),o(t.id)},children:"Edit"}),s("button",{class:"btn btn-sm btn-danger",onClick:h=>{h.stopPropagation(),confirm("Delete this annotation?")&&i.deleteAnnotation(t.id)},children:"Delete"})]}),r===t.id&&s(zt,{annotation:t,onSave:h=>{i.updateAnnotation(t.id,h),o(null)},onCancel:()=>o(null)}),((u=t.replies)==null?void 0:u.length)>0&&s(Rn,{replies:t.replies}),e&&s(Un,{annotationId:t.id,onReply:i.addReply})]})}function Dn({annotations:t,selectedAnnotationId:e,onSelect:n,annotationOps:i,editingId:r,setEditingId:o}){const[a,l]=B(!1);return s("div",{class:"orphaned-section",children:[s("div",{class:"orphaned-section-header",onClick:()=>l(d=>!d),children:[s("span",{children:a?"▸":"▾"}),s("span",{children:["Não encontradas (",t.length,")"]})]}),!a&&t.map(d=>s(Bt,{ann:d,isSelected:e===d.id,onClick:()=>n(d),annotationOps:i,editingId:r,setEditingId:o,orphaned:!0},d.id))]})}function Un({annotationId:t,onReply:e}){const[n,i]=B("");function r(o){o.preventDefault(),n.trim()&&(e(t,n.trim()),i(""))}return s("form",{class:"reply-input",onSubmit:r,onClick:o=>o.stopPropagation(),children:[s("input",{type:"text",value:n,onInput:o=>i(o.target.value),placeholder:"Reply..."}),s("button",{type:"submit",class:"btn btn-sm btn-primary",disabled:!n.trim(),children:"Reply"})]})}function qn({x:t,y:e,exact:n,selectors:i,onSave:r,onCancel:o}){const a=O(null),l=O({active:!1,startX:0,startY:0}),d=520,u=440,h=typeof window<"u"?window.innerWidth:800,p=(typeof window<"u"?window.innerHeight:800)-e<u,_=Math.max(16,Math.min(t-d/2,h-d-16)),v=p?Math.max(8,e-u-8):e,[m,g]=B({left:_,top:v});M(()=>{function b(x){x.key==="Escape"&&o()}return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[o]),M(()=>{function b(S){l.current.active&&g({left:S.clientX-l.current.startX,top:S.clientY-l.current.startY})}function x(){l.current.active=!1}return document.addEventListener("mousemove",b),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",x)}},[]);function y(b){b.button===0&&(l.current={active:!0,startX:b.clientX-m.left,startY:b.clientY-m.top},b.preventDefault())}const $={position:"fixed",left:`${m.left}px`,top:`${m.top}px`,width:`${d}px`,zIndex:101};return s("div",{class:"popover popover--enter",ref:a,style:$,children:[s("div",{class:"popover__header",onMouseDown:y,children:[s("span",{class:"popover__title",children:"New Annotation"}),s("button",{type:"button",class:"popover__close",onClick:o,"aria-label":"Close",children:"×"})]}),s(zt,{exact:n,selectors:i,onSave:r,onCancel:o})]})}function On({annotationOps:t}){const e=O(null),[n,i]=B(null);M(()=>{var _,v,m,g,y,$;const f=e.current;if(!f)return;f.querySelectorAll("mark[data-highlight-id]").forEach(b=>{const x=b.parentNode;for(;b.firstChild;)x.insertBefore(b.firstChild,b);x.removeChild(b)});const p=he.value?C.value:C.value.filter(b=>b.status==="open");for(const b of p){const x=(v=(_=b.selectors)==null?void 0:_.position)==null?void 0:v.startLine;if(!x)continue;const S=f.querySelector(`[data-source-line="${x}"]`);if(!S)continue;const R=(g=(m=b.selectors)==null?void 0:m.quote)==null?void 0:g.exact;if(!R)continue;const j=`annotation-highlight tag-${b.tag}${b.status==="resolved"?" resolved":""}${F.value===b.id?" selected":""}`;if(r(S,R,b.id,j))continue;const I=(($=(y=b.selectors)==null?void 0:y.position)==null?void 0:$.endLine)||x;o(f,S,I,R,b.id,j)||x!==I&&a(f,x,I,b.id,j)}},[V.value,C.value,he.value,F.value]),M(()=>{const f=e.current;!f||L.value.length===0||(f.querySelectorAll(".section-approval-injected").forEach(p=>p.remove()),f.querySelectorAll(":is(h1,h2,h3,h4,h5,h6)[data-source-line]").forEach(p=>{const _=p.textContent.trim(),v=L.value.find(S=>S.heading===_);if(!v)return;const m=v.computed||v.status,g=document.createElement("span");g.className="section-approval-injected";const y=document.createElement("button"),$=m==="approved"?" section-status approved":m==="indeterminate"?" section-status indeterminate":"";y.className=`btn btn-sm${$}`,y.textContent=m==="indeterminate"?"─":"✓",y.title=m==="indeterminate"?"Partially approved — click to approve all":"Approve section",y.onclick=S=>{S.stopPropagation(),v.status==="approved"?t.resetSection(_):t.approveSection(_)};const b=document.createElement("button");b.className=`btn btn-sm${m==="rejected"?" section-status rejected":""}`,b.textContent="✗",b.title="Reject section",b.onclick=S=>{S.stopPropagation(),v.status==="rejected"?t.resetSection(_):t.rejectSection(_)};const x=m!=="pending"?m:"";if(x){const S=document.createElement("span");S.className=`section-status-label ${m}`,S.style.cssText="font-size: 10px; margin-left: 4px",S.textContent=x,g.appendChild(S)}g.style.cssText="display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle",g.insertBefore(b,g.firstChild),g.insertBefore(y,g.firstChild),p.appendChild(g)}))},[V.value,L.value]);function r(f,p,_,v){const m=document.createTreeWalker(f,NodeFilter.SHOW_TEXT);let g;for(;g=m.nextNode();){const y=g.textContent.indexOf(p);if(y===-1)continue;const $=document.createRange();$.setStart(g,y),$.setEnd(g,y+p.length);const b=document.createElement("mark");b.setAttribute("data-highlight-id",_),b.className=v;try{$.surroundContents(b)}catch{return!1}return!0}return!1}function o(f,p,_,v,m,g){var U,tt;const y=[],$=document.createTreeWalker(f,NodeFilter.SHOW_TEXT);let b,x=!1;for(;b=$.nextNode();){if(!x&&p.contains(b)&&(x=!0),!x)continue;y.push(b);const N=d(b,f);if(N&&parseInt(N.getAttribute("data-source-line"))>_)break}if(y.length===0)return!1;let S="";const R=[];for(let N=0;N<y.length;N++){if(N>0){const le=(U=y[N-1].parentElement)==null?void 0:U.closest("[data-source-line]"),te=(tt=y[N].parentElement)==null?void 0:tt.closest("[data-source-line]");le!==te&&(S+=`
2
+ `)}const Y=S.length;S+=y[N].textContent,R.push({node:y[N],startInConcat:Y,endInConcat:S.length})}let j=S.indexOf(v);if(j===-1){const N=S.replace(/\s+/g," "),Y=v.replace(/\s+/g," ");if(N.indexOf(Y)===-1)return!1;for(const te of R)l(te.node,0,te.node.textContent.length,m,g);return!0}const I=j+v.length;for(const N of R){const Y=Math.max(j,N.startInConcat),le=Math.min(I,N.endInConcat);if(Y>=le)continue;const te=Y-N.startInConcat,Kt=le-N.startInConcat;l(N.node,te,Kt,m,g)}return!0}function a(f,p,_,v,m){const g=f.querySelectorAll("[data-source-line]");for(const y of g){const $=parseInt(y.getAttribute("data-source-line"));if($<p||$>_)continue;const b=document.createTreeWalker(y,NodeFilter.SHOW_TEXT);let x;for(;x=b.nextNode();)x.textContent.trim()!==""&&l(x,0,x.textContent.length,v,m)}}function l(f,p,_,v,m){if(!(p>=_||p>=f.textContent.length))try{const g=document.createRange();g.setStart(f,p),g.setEnd(f,Math.min(_,f.textContent.length));const y=document.createElement("mark");y.setAttribute("data-highlight-id",v),y.className=m,g.surroundContents(y)}catch{}}function d(f,p){var v;let _=f.nodeType===3?f.parentElement:f;for(;_&&_!==p;){if((v=_.hasAttribute)!=null&&v.call(_,"data-source-line"))return _;_=_.parentElement}return null}function u(f){const p=window.getSelection();if(!p||p.isCollapsed||p.toString().trim()==="")return;const _=p.toString(),v=p.getRangeAt(0),m=v.getBoundingClientRect(),g=h(v.startContainer),y=h(v.endContainer);if(g){const $=parseInt(g.getAttribute("data-source-line")),b=parseInt(g.getAttribute("data-source-col")||"1"),x=y?parseInt(y.getAttribute("data-source-line")):$,S=y?parseInt(y.getAttribute("data-source-col")||"1"):b+_.length;i({x:m.left+m.width/2,y:m.bottom+8,exact:_,selectors:{position:{startLine:$,startColumn:b,endLine:x,endColumn:S},quote:{exact:_,prefix:"",suffix:""}}})}}function h(f){var _;let p=f.nodeType===3?f.parentElement:f;for(;p&&p!==e.current;){if((_=p.hasAttribute)!=null&&_.call(p,"data-source-line"))return p;p=p.parentElement}return null}function c(f){const p=f.target.closest("[data-highlight-id]");p&&(F.value=p.getAttribute("data-highlight-id"))}return s("main",{class:"content-area-wrapper",children:[s("div",{class:"content-area",ref:e,onClick:c,onMouseUp:u,dangerouslySetInnerHTML:{__html:V.value||""}}),n&&s(qn,{x:n.x,y:n.y,exact:n.exact,selectors:n.selectors,onSave:f=>{var p;t.createAnnotation(f),i(null),(p=window.getSelection())==null||p.removeAllRanges()},onCancel:()=>{var f;i(null),(f=window.getSelection())==null||f.removeAllRanges()}})]})}function Hn({themes:t,onSelect:e}){return s("div",{class:"theme-picker",title:"Switch theme",children:t.map(n=>s("button",{class:`theme-swatch ${G.value===n.id?"active":""}`,style:`background: ${n.color}`,onClick:()=>e(n.id),title:n.label,"aria-label":`Switch to ${n.label} theme`},n.id))})}function Fn(){const[t,e]=B(!1);async function n(i){e(!1);const r=Q.value;if(r)try{const o=await fetch(`/api/export?path=${encodeURIComponent(r)}&format=${i}`);if(!o.ok)throw new Error(await o.text());if(i==="report"){const a=await o.text(),l=new Blob([a],{type:"text/markdown"});window.open(URL.createObjectURL(l))}else{const a=await o.blob(),l={inline:".reviewed.md",json:".annotations.json",sarif:".annotations.sarif"}[i],d=document.createElement("a");d.href=URL.createObjectURL(a),d.download=r.replace(".md",l),d.click()}}catch(o){console.error("Export failed:",o),alert(`Export failed: ${o.message}`)}}return s("div",{style:"position: relative",children:[s("button",{class:"btn btn-sm",onClick:()=>e(!t),children:"Export"}),t&&s(z,{children:[s("div",{style:"position: fixed; inset: 0; z-index: 90",onClick:()=>e(!1)}),s("div",{style:"position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 100; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 180px; overflow: hidden",children:[s("button",{class:"export-option",onClick:()=>n("report"),children:"Review Report (.md)"}),s("button",{class:"export-option",onClick:()=>n("inline"),children:"Inline Comments (.md)"}),s("button",{class:"export-option",onClick:()=>n("json"),children:"JSON (.json)"}),s("button",{class:"export-option",onClick:()=>n("sarif"),children:"SARIF (.sarif)"})]})]})]})}function Wn(){const[t,e]=B(!1);yn();const{setTheme:n,themes:i}=kn(),r=Sn();Tn(),bn({onShowHelp:()=>e(a=>!a)}),M(()=>{if(!t)return;function a(l){l.key==="Escape"&&(l.preventDefault(),e(!1))}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t]),M(()=>{fetch("/api/files").then(a=>a.json()).then(a=>{if(q.value=a,a.length===0)return;const l=window.location.pathname;let d=null;if(l&&l!=="/"){const h=l.replace(/^\//,"");d=a.find(c=>{const f=c.path||c;return f===h||f===h.split("/").pop()||c.absPath&&c.absPath.endsWith("/"+h)})}const u=d?d.path||d:a[0].path||a[0];o(u)}),fetch("/api/config").then(a=>a.json()).then(a=>{Ie.value=a.author||"anonymous"}),fetch("/api/review/status").then(a=>a.json()).then(a=>{a.mode==="once"&&(He.value=!0)}).catch(()=>{})},[]);function o(a){Q.value=a,fetch(`/api/file?path=${encodeURIComponent(a)}`).then(l=>l.json()).then(l=>{V.value=l.html,fe.value=l.toc||[]}),r.fetchAnnotations(a)}return s(z,{children:[s("header",{class:"header",children:[s("h1",{children:"mdProbe"}),s("span",{class:"header-file",children:Q.value||"No file selected"}),s("div",{style:"flex: 1"}),ne.value.total>0&&(He.value||ne.value.reviewed>0)&&s("div",{class:"progress-info",children:[s("span",{children:[ne.value.reviewed,"/",ne.value.total," sections reviewed"]}),s("div",{class:"progress-bar",style:"width: 100px",children:s("div",{class:"fill",style:`width: ${ne.value.reviewed/ne.value.total*100}%`})})]}),s(Fn,{}),s(Hn,{themes:i,onSelect:n}),He.value&&s("button",{class:"btn btn-primary btn-sm",onClick:async()=>{try{await fetch("/api/review/finish",{method:"POST"})}catch{}},children:"Finish Review"})]}),ve.value&&s("div",{class:"drift-banner",children:[oe.value.length>0?`Arquivo modificado — ${oe.value.length} anotação(ões) não encontrada(s)`:"Arquivo modificado desde a ultima revisao. Algumas anotacoes podem estar desalinhadas.",s("button",{class:"btn btn-sm",style:"margin-left: 8px",onClick:()=>ve.value=!1,children:"Dismiss"})]}),s(Pn,{onFileSelect:o}),s(On,{annotationOps:r}),s(Mn,{annotationOps:r}),s("footer",{class:"status-bar",children:[s("span",{children:[Z.value.length," open"]}),s("span",{children:["Author: ",Ie.value]}),s("span",{children:"Press ? for shortcuts"})]}),t&&s(z,{children:[s("div",{class:"shortcut-modal overlay",onClick:()=>e(!1)}),s("div",{class:"shortcut-modal",children:[s("h3",{style:"margin-bottom: 12px",children:"Keyboard Shortcuts"}),[["[","Toggle left panel (Files/TOC)"],["]","Toggle right panel (Annotations)"],["\\","Toggle both panels (focus mode)"],["j","Next annotation"],["k","Previous annotation"],["r","Resolve selected annotation"],["e","Edit selected annotation"],["?","Show/hide this help"]].map(([a,l])=>s("div",{class:"shortcut-row",children:[s("span",{children:l}),s("span",{class:"shortcut-key",children:a})]},a)),s("button",{class:"btn btn-sm",style:"margin-top: 12px",onClick:()=>e(!1),children:"Close"})]})]})]})}en(s(Wn,{}),document.getElementById("app"));
@@ -0,0 +1 @@
1
+ [data-theme=mocha]{--bg-primary: #1e1e2e;--bg-secondary: #181825;--bg-tertiary: #313244;--text-primary: #cdd6f4;--text-secondary: #a6adc8;--text-muted: #6c7086;--border: #45475a;--border-subtle: #313244;--accent: #89b4fa;--accent-hover: #74c7ec;--tag-bug: #f38ba8;--tag-question: #89b4fa;--tag-suggestion: #a6e3a1;--tag-nitpick: #f9e2af;--highlight-open: rgba(137, 180, 250, .2);--highlight-resolved: rgba(166, 227, 161, .15);--status-approved: #a6e3a1;--status-rejected: #f38ba8;--status-pending: #45475a;--scrollbar-thumb: #45475a;--scrollbar-track: #1e1e2e}[data-theme=macchiato]{--bg-primary: #24273a;--bg-secondary: #1e2030;--bg-tertiary: #363a4f;--text-primary: #cad3f5;--text-secondary: #a5adcb;--text-muted: #6e738d;--border: #494d64;--border-subtle: #363a4f;--accent: #8aadf4;--accent-hover: #7dc4e4;--tag-bug: #ed8796;--tag-question: #8aadf4;--tag-suggestion: #a6da95;--tag-nitpick: #eed49f;--highlight-open: rgba(138, 173, 244, .2);--highlight-resolved: rgba(166, 218, 149, .15);--status-approved: #a6da95;--status-rejected: #ed8796;--status-pending: #494d64;--scrollbar-thumb: #494d64;--scrollbar-track: #24273a}[data-theme=frappe]{--bg-primary: #303446;--bg-secondary: #292c3c;--bg-tertiary: #414559;--text-primary: #c6d0f5;--text-secondary: #a5adce;--text-muted: #737994;--border: #51576d;--border-subtle: #414559;--accent: #8caaee;--accent-hover: #85c1dc;--tag-bug: #e78284;--tag-question: #8caaee;--tag-suggestion: #a6d189;--tag-nitpick: #e5c890;--highlight-open: rgba(140, 170, 238, .2);--highlight-resolved: rgba(166, 209, 137, .15);--status-approved: #a6d189;--status-rejected: #e78284;--status-pending: #51576d;--scrollbar-thumb: #51576d;--scrollbar-track: #303446}[data-theme=latte]{--bg-primary: #eff1f5;--bg-secondary: #e6e9ef;--bg-tertiary: #ccd0da;--text-primary: #4c4f69;--text-secondary: #5c5f77;--text-muted: #9ca0b0;--border: #bcc0cc;--border-subtle: #ccd0da;--accent: #1e66f5;--accent-hover: #209fb5;--tag-bug: #d20f39;--tag-question: #1e66f5;--tag-suggestion: #40a02b;--tag-nitpick: #df8e1d;--highlight-open: rgba(30, 102, 245, .15);--highlight-resolved: rgba(64, 160, 43, .1);--status-approved: #40a02b;--status-rejected: #d20f39;--status-pending: #ccd0da;--scrollbar-thumb: #bcc0cc;--scrollbar-track: #eff1f5}[data-theme=light]{--bg-primary: #ffffff;--bg-secondary: #f8f9fa;--bg-tertiary: #e9ecef;--text-primary: #212529;--text-secondary: #495057;--text-muted: #adb5bd;--border: #dee2e6;--border-subtle: #e9ecef;--accent: #0d6efd;--accent-hover: #0b5ed7;--tag-bug: #dc3545;--tag-question: #0d6efd;--tag-suggestion: #198754;--tag-nitpick: #fd7e14;--highlight-open: rgba(13, 110, 253, .12);--highlight-resolved: rgba(25, 135, 84, .08);--status-approved: #198754;--status-rejected: #dc3545;--status-pending: #e9ecef;--scrollbar-thumb: #dee2e6;--scrollbar-track: #ffffff}:root{--panel-collapsed-width: 48px;--panel-width: clamp(240px, 18vw, 380px)}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:48px auto 1fr 32px;height:100vh;background:var(--bg-primary);color:var(--text-primary)}.header{grid-row:1;grid-column:1 / -1;display:flex;align-items:center;padding:0 16px;background:var(--bg-secondary);border-bottom:1px solid var(--border);gap:12px;z-index:10}.header h1{font-size:14px;font-weight:600;white-space:nowrap}.left-panel{grid-row:3;width:var(--panel-width);transition:width .2s ease;overflow:hidden;background:var(--bg-secondary);border-right:1px solid var(--border);display:flex;flex-direction:column}.left-panel.collapsed{width:var(--panel-collapsed-width)}.left-panel .panel-collapsed-indicator{display:none;width:var(--panel-collapsed-width);align-items:center;justify-content:center;height:100%;cursor:pointer}.left-panel.collapsed .panel-collapsed-indicator{display:flex;flex-direction:column;gap:8px;font-size:12px;color:var(--text-muted)}.left-panel.collapsed .panel-content{display:none}.right-panel{grid-row:3;width:var(--panel-width);transition:width .2s ease;overflow:hidden;background:var(--bg-secondary);border-left:1px solid var(--border);display:flex;flex-direction:column}.right-panel.collapsed{width:var(--panel-collapsed-width)}.right-panel .panel-collapsed-indicator{display:none;width:var(--panel-collapsed-width);align-items:center;justify-content:center;height:100%;cursor:pointer}.right-panel.collapsed .panel-collapsed-indicator{display:flex;flex-direction:column;gap:8px;font-size:12px;color:var(--text-muted)}.right-panel.collapsed .panel-content{display:none}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 8px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted)}.panel-content{flex:1;overflow:hidden;padding:4px 8px;display:flex;flex-direction:column;min-height:0}.content-area-wrapper{grid-row:3;overflow-y:auto;min-width:0}.content-area{padding:32px clamp(24px,3vw,56px);width:100%;line-height:1.7}.annotation-highlight{background:var(--highlight-open);cursor:pointer;border-radius:2px;padding:0 2px;transition:outline-color .15s}.annotation-highlight.resolved{background:var(--highlight-resolved);opacity:.3}.annotation-highlight.selected{outline:2px solid var(--accent);outline-offset:1px}.tag{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;line-height:1.4}.tag-bug{background:var(--tag-bug);color:#fff}.tag-question{background:var(--tag-question);color:#fff}.tag-suggestion{background:var(--tag-suggestion);color:#fff}.tag-nitpick{background:var(--tag-nitpick);color:#fff}.annotation-card{padding:12px;border-radius:8px;background:var(--bg-tertiary);border:1px solid var(--border-subtle);margin-bottom:8px;cursor:pointer;transition:border-color .15s,box-shadow .15s}.annotation-card:hover{border-color:var(--accent)}.annotation-card.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.annotation-card .meta{display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:12px;color:var(--text-muted)}.annotation-card .quote{font-style:italic;color:var(--text-secondary);border-left:3px solid var(--accent);padding-left:8px;margin:8px 0;font-size:13px}.annotation-card .body{font-size:13px;color:var(--text-primary);line-height:1.5}.section-status{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:500}.section-status.approved{background:var(--status-approved);color:#fff}.section-status.rejected{background:var(--status-rejected);color:#fff}.section-status.pending{background:var(--status-pending);color:var(--text-secondary)}.section-status.indeterminate{background:var(--tag-nitpick);color:var(--bg-primary);opacity:.85}.popover{position:fixed;z-index:101;background:var(--bg-secondary);border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 32px #00000059,0 2px 8px #0003;min-width:320px;display:flex;flex-direction:column}.popover--enter{animation:popover-in .15s ease-out}@keyframes popover-in{0%{opacity:0;transform:translateY(4px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}.popover__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--border);cursor:grab;-webkit-user-select:none;user-select:none;border-radius:10px 10px 0 0}.popover__header:active{cursor:grabbing}.popover__title{font-size:13px;font-weight:600;color:var(--text-primary);letter-spacing:.01em}.popover__close{background:none;border:none;color:var(--text-muted);font-size:18px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:4px;transition:all .15s}.popover__close:hover{background:var(--bg-tertiary);color:var(--text-primary)}.annotation-form{padding:14px}.annotation-form__quote{font-style:italic;color:var(--text-secondary);border-left:3px solid var(--accent);padding:6px 10px;margin-bottom:12px;font-size:13px;line-height:1.5;max-height:80px;overflow-y:auto;background:#89b4fa0d;border-radius:0 4px 4px 0}.annotation-form__tags{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap}.tag-pill{padding:4px 12px;border-radius:20px;border:1px solid transparent;font-size:12px;font-weight:500;cursor:pointer;transition:all .15s;background:var(--bg-tertiary);color:var(--text-secondary);line-height:1.4}.tag-pill:hover{border-color:var(--border)}.tag-pill--active{border-color:currentColor}.tag-pill--question{color:var(--tag-question)}.tag-pill--question.tag-pill--active{background:#89b4fa26}.tag-pill--bug{color:var(--tag-bug)}.tag-pill--bug.tag-pill--active{background:#f38ba826}.tag-pill--suggestion{color:var(--tag-suggestion)}.tag-pill--suggestion.tag-pill--active{background:#a6e3a126}.tag-pill--nitpick{color:var(--tag-nitpick)}.tag-pill--nitpick.tag-pill--active{background:#f9e2af26}.annotation-form textarea{width:100%;min-height:180px;padding:10px;border:1px solid var(--border);border-radius:6px;background:var(--bg-primary);color:var(--text-primary);font-family:inherit;font-size:13px;resize:vertical;line-height:1.5}.annotation-form textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px #89b4fa40}.annotation-form__actions{display:flex;align-items:center;gap:8px;margin-top:10px;justify-content:flex-end}.annotation-form__hint{font-size:11px;color:var(--text-muted);margin-right:auto}.btn{padding:6px 14px;border-radius:6px;border:1px solid var(--border);background:var(--bg-tertiary);color:var(--text-primary);cursor:pointer;font-family:inherit;font-size:13px;font-weight:500;transition:all .15s;line-height:1.4;white-space:nowrap}.btn:hover{background:var(--accent);color:#fff;border-color:var(--accent)}.btn:active{transform:scale(.97)}.btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.btn-primary,.btn--primary{background:var(--accent);color:#fff;border-color:var(--accent)}.btn-primary:hover,.btn--primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}.btn-danger{background:var(--tag-bug);color:#fff;border-color:var(--tag-bug)}.btn-danger:hover{opacity:.9}.btn-sm{padding:3px 8px;font-size:11px}.btn-ghost,.btn--ghost{background:transparent;border-color:transparent;color:var(--text-secondary)}.btn-ghost:hover,.btn--ghost:hover{background:var(--bg-tertiary);color:var(--text-primary);border-color:transparent}.status-bar{grid-row:4;grid-column:1 / -1;display:flex;align-items:center;padding:0 16px;gap:16px;font-size:11px;color:var(--text-muted);background:var(--bg-secondary);border-top:1px solid var(--border);z-index:10}.status-bar .separator{width:1px;height:14px;background:var(--border)}.progress-bar{height:4px;background:var(--bg-tertiary);border-radius:2px;overflow:hidden}.progress-bar .fill{height:100%;background:var(--accent);transition:width .3s ease;border-radius:2px}.toc-item{padding:4px 12px;cursor:pointer;font-size:13px;color:var(--text-secondary);border-radius:4px;transition:background .1s,color .1s;display:flex;align-items:center;gap:4px;line-height:1.4}.toc-item:hover{background:var(--bg-tertiary);color:var(--text-primary)}.toc-item.active{color:var(--accent);background:var(--bg-tertiary)}.toc-item .badge{font-size:10px;background:var(--tag-question);color:#fff;border-radius:8px;padding:1px 5px;margin-left:4px;line-height:1.4}.toc-item.level-2{padding-left:24px}.toc-item.level-3{padding-left:36px}.toc-item.level-4{padding-left:48px}.toc-item.level-5{padding-left:60px}.toc-item.level-6{padding-left:72px}.toc-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.toc-dot.dot-approved{background:var(--status-approved)}.toc-dot.dot-rejected{background:var(--status-rejected)}.section-status-label.approved{color:var(--status-approved)}.section-status-label.rejected{color:var(--status-rejected)}.file-list-section{padding:0 8px 8px;max-height:35%;overflow-y:auto;flex-shrink:0}.toc-section{padding:0 8px;flex:1;overflow-y:auto;min-height:0}.file-item{padding:6px 12px;cursor:pointer;font-size:13px;color:var(--text-secondary);border-radius:4px;display:flex;align-items:center;gap:8px;transition:background .1s,color .1s}.file-item:hover{background:var(--bg-tertiary);color:var(--text-primary)}.file-item.active{background:var(--bg-tertiary);color:var(--accent);font-weight:500}.file-item .icon{font-size:14px;flex-shrink:0}.file-item .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply{padding:8px 12px;border-left:2px solid var(--border);margin-left:12px;margin-top:8px}.reply .author{font-weight:600;font-size:12px;color:var(--text-secondary)}.reply .text{font-size:13px;margin-top:2px;color:var(--text-primary);line-height:1.5}.reply .timestamp{font-size:11px;color:var(--text-muted);margin-left:8px;font-weight:400}.reply-input{display:flex;gap:8px;margin-top:8px;margin-left:12px}.reply-input input{flex:1;padding:6px 8px;border:1px solid var(--border);border-radius:6px;background:var(--bg-primary);color:var(--text-primary);font-family:inherit;font-size:13px}.reply-input input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px #89b4fa40}.content-area h1{font-size:2em;margin:24px 0 16px;border-bottom:1px solid var(--border);padding-bottom:8px;font-weight:700}.content-area h2{font-size:1.5em;margin:20px 0 12px;font-weight:600}.content-area h3{font-size:1.2em;margin:16px 0 8px;font-weight:600}.content-area h4{font-size:1.05em;margin:14px 0 6px;font-weight:600}.content-area p{margin:0 0 12px}.content-area ul,.content-area ol{margin:0 0 12px;padding-left:24px}.content-area li{margin-bottom:4px}.content-area li>ul,.content-area li>ol{margin-bottom:0}.content-area code{background:var(--bg-tertiary);padding:2px 6px;border-radius:3px;font-size:.9em;font-family:SF Mono,Cascadia Code,Fira Code,Consolas,monospace}.content-area pre{background:var(--bg-tertiary);padding:16px;border-radius:8px;overflow-x:auto;margin:0 0 16px;line-height:1.5}.content-area pre code{background:none;padding:0;border-radius:0;font-size:13px}.content-area blockquote{border-left:4px solid var(--accent);padding:8px 16px;margin:0 0 12px;color:var(--text-secondary);background:var(--bg-tertiary);border-radius:0 8px 8px 0}.content-area blockquote p:last-child{margin-bottom:0}.content-area table{border-collapse:collapse;width:100%;margin:0 0 16px}.content-area th,.content-area td{border:1px solid var(--border);padding:8px 12px;text-align:left}.content-area th{background:var(--bg-secondary);font-weight:600}.content-area img{max-width:100%;border-radius:8px}.content-area a{color:var(--accent);text-decoration:none}.content-area a:hover{text-decoration:underline}.content-area hr{border:none;height:1px;background:var(--border);margin:24px 0}.shortcut-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;z-index:199}.shortcut-modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:200;background:var(--bg-secondary);border:1px solid var(--border);border-radius:12px;padding:24px;box-shadow:0 8px 32px #0000004d;min-width:400px;max-width:520px;max-height:80vh;overflow-y:auto}.shortcut-modal h2{font-size:16px;font-weight:600;margin-bottom:16px}.shortcut-group{margin-bottom:16px}.shortcut-group-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted);margin-bottom:8px}.shortcut-row{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid var(--border-subtle);font-size:13px}.shortcut-row:last-child{border-bottom:none}.shortcut-label{color:var(--text-secondary)}.shortcut-key{display:inline-block;padding:2px 8px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:4px;font-family:SF Mono,Cascadia Code,Consolas,monospace;font-size:12px;min-width:24px;text-align:center;line-height:1.5}.theme-picker{display:flex;gap:6px;align-items:center}.theme-swatch{width:24px;height:24px;border-radius:50%;cursor:pointer;border:2px solid transparent;transition:border-color .15s,transform .15s;flex-shrink:0}.theme-swatch:hover,.theme-swatch.active{border-color:var(--accent);transform:scale(1.1)}.export-option{display:block;width:100%;padding:8px 12px;text-align:left;border:none;background:none;color:var(--text-primary);cursor:pointer;font-size:13px;font-family:inherit}.export-option:hover{background:var(--bg-tertiary)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--scrollbar-track)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}*{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track)}.drift-banner{grid-row:2;grid-column:1 / -1;padding:8px 16px;background:var(--tag-question);color:#fff;font-size:13px;display:flex;align-items:center;gap:8px}.drift-banner .dismiss{margin-left:auto;cursor:pointer;opacity:.8;transition:opacity .15s}.drift-banner .dismiss:hover{opacity:1}.orphaned-section{border-top:1px solid var(--border);padding-top:8px;margin-top:8px}.orphaned-section-header{display:flex;align-items:center;gap:6px;cursor:pointer;padding:6px 4px;font-size:12px;font-weight:500;color:var(--tag-bug)}.orphaned-section-header:hover{opacity:.8}.annotation-card.orphaned{opacity:.65;border-left-color:var(--tag-bug);border-left-style:dashed}.annotation-card.orphaned .quote{text-decoration:line-through}.flex{display:flex}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-4{gap:4px}.gap-8{gap:8px}.gap-12{gap:12px}.ml-auto{margin-left:auto}.text-muted{color:var(--text-muted)}.text-sm{font-size:12px}.text-xs{font-size:11px}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.content-area .hljs-keyword,.content-area .hljs-selector-tag,.content-area .hljs-built_in,.content-area .hljs-type{color:var(--tag-bug)}.content-area .hljs-string,.content-area .hljs-attr,.content-area .hljs-symbol,.content-area .hljs-template-tag,.content-area .hljs-template-variable{color:var(--tag-suggestion)}.content-area .hljs-number,.content-area .hljs-literal,.content-area .hljs-regexp{color:var(--tag-nitpick)}.content-area .hljs-title,.content-area .hljs-title.function_,.content-area .hljs-title.class_{color:var(--accent)}.content-area .hljs-comment,.content-area .hljs-doctag{color:var(--text-muted);font-style:italic}.content-area .hljs-variable,.content-area .hljs-variable.language_,.content-area .hljs-params{color:var(--text-primary)}.content-area .hljs-meta,.content-area .hljs-meta .hljs-keyword{color:var(--tag-question)}.content-area .hljs-subst{color:var(--text-secondary)}.content-area .hljs-addition{color:var(--tag-suggestion);background:#a6e3a11a}.content-area .hljs-deletion{color:var(--tag-bug);background:#f38ba81a}.content-area .mermaid{background:var(--bg-tertiary);border:1px dashed var(--border);border-radius:8px;padding:16px;text-align:center;font-family:inherit;white-space:pre-wrap;min-height:60px}.content-area .mermaid svg{max-width:100%}.content-area .math-display{display:block;text-align:center;padding:12px 16px;margin:12px 0;background:var(--bg-tertiary);border-radius:6px;font-family:KaTeX_Main,Times New Roman,serif;font-size:1.1em;overflow-x:auto}.content-area .math-inline{font-family:KaTeX_Main,Times New Roman,serif;padding:1px 4px;background:var(--bg-tertiary);border-radius:3px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
package/dist/index.html CHANGED
@@ -3,15 +3,15 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>mdprobe</title>
6
+ <title>mdProbe</title>
7
7
  <script>
8
8
  (function() {
9
9
  var theme = localStorage.getItem('mdprobe-theme') || 'mocha';
10
10
  document.documentElement.setAttribute('data-theme', theme);
11
11
  })();
12
12
  </script>
13
- <script type="module" crossorigin src="/assets/index-DPysqH1p.js"></script>
14
- <link rel="stylesheet" crossorigin href="/assets/index-nl9v2RuJ.css">
13
+ <script type="module" crossorigin src="/assets/index-DBoxFkN5.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/assets/index-n-EK8VPZ.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryavila/mdprobe",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Markdown viewer + reviewer for terminal/WSL with live reload, persistent annotations, and AI agent integration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,6 +30,8 @@
30
30
  "dev:ui": "vite dev"
31
31
  },
32
32
  "dependencies": {
33
+ "@clack/prompts": "^1.2.0",
34
+ "@modelcontextprotocol/sdk": "^1.29.0",
33
35
  "chokidar": "^4.0.0",
34
36
  "diff-match-patch": "^1.0.5",
35
37
  "highlight.js": "^11.10.0",
@@ -42,7 +44,8 @@
42
44
  "remark-parse": "^11.0.0",
43
45
  "remark-rehype": "^11.0.0",
44
46
  "unified": "^11.0.0",
45
- "ws": "^8.18.0"
47
+ "ws": "^8.18.0",
48
+ "zod": "^4.3.6"
46
49
  },
47
50
  "devDependencies": {
48
51
  "@preact/preset-vite": "^2.9.0",
package/schema.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "mdprobe annotation sidecar",
4
- "description": "Schema for YAML sidecar annotation files used by mdprobe",
3
+ "title": "mdProbe annotation sidecar",
4
+ "description": "Schema for YAML sidecar annotation files used by mdProbe",
5
5
  "type": "object",
6
6
  "required": ["version", "source", "source_hash", "annotations"],
7
7
  "properties": {