@henryavila/mdprobe 0.1.0 → 0.2.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.
@@ -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,z,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 q(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 F(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=q({},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)&&z.push(t)&&!Ce.__r++||nt!=k.debounceRendering)&&((nt=k.debounceRendering)||xt)(Ce)}function Ce(){try{for(var t,e=1;z.length;)z.length>e&&z.sort(wt),t=z.shift(),e=z.length,Vt(t)}finally{z.length=Ce.__r=0}}function $t(t,e,n,i,r,o,a,l,u,d,h){var c,f,p,_,v,m,g,y=i&&i.__k||$e,$=e.length;for(u=Yt(n,e,y,u,$),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,u,d,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?(u=Ct(p,u,t,g),g&&f.__e&&(f.__e=null)):typeof p.type=="function"&&m!==void 0?u=m:_&&(u=_.nextSibling),p.__u&=-7);return n.__e=v,u}function Yt(t,e,n,i,r){var o,a,l,u,d,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(F,{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,u=o+f,a.__=t,a.__b=t.__b+1,l=null,(d=a.__i=Gt(a,n,u,c))!=-1&&(c--,(l=n[d])&&(l.__u|=2)),l==null||l.__v==null?(d==-1&&(r>h?f--:r<h&&f++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?f--:d==u+1?f++:(d>u?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,u=t.type,d=e[n],h=d!=null&&(2&d.__u)==0;if(d===null&&l==null||h&&l==d.key&&u==d.type)return n;if(i>(h?1:0)){for(r=n-1,o=n+1;r>=0||o<e.length;)if((d=e[a=r>=0?r--:o++])!=null&&(2&d.__u)==0&&l==d.key&&u==d.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,u,d){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&&(u=!!(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=q({},c.__s)),q(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=q(q({},i),c.getChildContext())),y&&!f&&c.getSnapshotBeforeUpdate!=null&&(v=c.getSnapshotBeforeUpdate(p,_)),R=h!=null&&h.type===F&&h.key==null?Et(h.props.children):h,l=$t(t,je(R)?R:[R],e,n,i,r,o,a,l,u,d),c.base=e.__e,e.__u&=-161,c.__h.length&&a.push(c),m&&(c.__E=c.__=null)}catch(U){if(e.__v=null,u||o!=null)if(U.then){for(e.__u|=u?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,u,d);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):q({},t)}function Zt(t,e,n,i,r,o,a,l,u){var d,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(d=0;d<o.length;d++)if((p=o[d])&&"setAttribute"in p==!!y&&(y?p.localName==y:p.nodeType==3)){t=p,o[d]=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={},d=0;d<t.attributes.length;d++)m[(p=t.attributes[d]).name]=p.value;for(d in m)p=m[d],d=="dangerouslySetInnerHTML"?c=p:d=="children"||d in g||d=="value"&&"defaultValue"in g||d=="checked"&&"defaultChecked"in g||ye(t,d,null,p,r);for(d in g)p=g[d],d=="children"?f=p:d=="dangerouslySetInnerHTML"?h=p:d=="value"?_=p:d=="checked"?v=p:l&&typeof p!="function"||m[d]===p||ye(t,d,p,m[d],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,u),o!=null)for(d=o.length;d--;)Ye(o[d]);l||(d="value",y=="progress"&&_==null?t.removeAttribute("value"):_!=null&&(_!==t[d]||y=="progress"&&!_||y=="option"&&_!=m[d])&&ye(t,d,_,m[d],r),d="checked",v!=null&&v!=t[d]&&ye(t,d,v,m[d],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(F,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=q({},this.state),typeof t=="function"&&(t=t(q({},n),this.props)),t&&q(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=F,z=[],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,u=e;if("ref"in u)for(l in u={},e)l=="ref"?a=e[l]:u[l]=e[l];var d={type:t,props:u,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)u[l]===void 0&&(u[l]=a[l]);return k.vnode&&k.vnode(d),d}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 W(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 u=i.__N?i.__N[0]:i.__[0],d=i.t(u,l);u!==d&&(i.__N=[d,i.__[1]],i.__c.setState({}))}],i.__c=A,!A.__f)){var r=function(l,u,d){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,u,d);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,u,d)||c};A.__f=!0;var o=A.shouldComponentUpdate,a=A.componentWillUpdate;A.componentWillUpdate=function(l,u,d){if(this.__e){var h=o;o=void 0,r(l,u,d),o=h}a&&a.call(this,l,u,d)},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 K(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(H>1)H--;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,H--,e)throw t}}function sn(t){if(H>0)return t();Je=++cn,H++;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,H=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){H!==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++,H++;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"){H++;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),H++;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,u=e.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=D(function(){var p=i.value.value;return p===0?0:p===!0?"":p||""}),h=D(function(){return!Array.isArray(d.value)&&!bt(d.value)}),c=ge(function(){if(this.N=Ft,h.value){var p=d.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,d]},[]),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!==F){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 u in i){var d=o[u],h=i[u];d===void 0?(d=fn(n,u,h),o[u]=d):d.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,u){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 B=E([]),Q=E(null),V=E(""),fe=E([]);E(null);const C=E([]),L=E([]),O=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=K(null),e=K(_t),n=K(null),i=K(!1),r=on(()=>{if(i.current)return;const o=location.protocol==="https:"?"wss:":"ws:",a=new WebSocket(`${o}//${location.host}/ws`);t.current=a,a.onopen=()=>{e.current=_t},a.onmessage=l=>{let u;try{u=JSON.parse(l.data)}catch{console.warn("mdProbe: received non-JSON WebSocket message");return}switch(u.type){case"update":{const d=document.querySelector(".content-area"),h=d?d.scrollTop:0;V.value=u.html,fe.value=u.toc||[],d&&requestAnimationFrame(()=>{d.scrollTop=h});break}case"file-added":B.value.some(d=>d.path===u.file)||(B.value=[...B.value,{path:u.file,label:u.file.replace(/\.md$/,"")}]);break;case"file-removed":B.value=B.value.filter(d=>d.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}},a.onerror=l=>{console.warn("mdProbe: WebSocket error",l)},a.onclose=()=>{if(t.current=null,i.current)return;const l=e.current;e.current=Math.min(l*2,gn);const u=Math.random()*l*.3;n.current=setTimeout(r,l+u)}},[]);return M(()=>(i.current=!1,r(),()=>{var o;i.current=!0,clearTimeout(n.current),(o=t.current)==null||o.close(),t.current=null}),[r]),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=O.value,i=e.findIndex(u=>u.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];O.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 u(_){const v=await p("reject",{heading:_});L.value=v.sections||L.value,v.sectionLevel!=null&&(se.value=v.sectionLevel)}async function d(){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:u,resetSection:h,approveAllSections:d,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=K("");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 u=i+1;u<r.length;u++)if(r[u].level<=o.level){l=r[u].line;break}return Z.value.filter(u=>{var h,c;const d=(c=(h=u.selectors)==null?void 0:h.position)==null?void 0:c.startLine;return d!=null&&d>=a&&d<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:"×"})]}),B.value.length>1&&s("div",{style:"padding: 0 8px 8px",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"}),B.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",{style:"padding: 0 8px",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(u=>u.heading===i.heading&&u.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 u=document.querySelector(`[data-source-line="${i.line}"]`);u==null||u.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]=W((t==null?void 0:t.comment)||""),[u,d]=W((t==null?void 0:t.tag)||"question");function h(f){f.preventDefault(),a.trim()&&i(o?{comment:a.trim(),tag:u}:{selectors:e,comment:a.trim(),tag:u})}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}${u===f.value?" tag-pill--active":""}`,onClick:()=>d(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]=W(null);function r(o){O.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(F,{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:O.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:O.value,onSelect:o=>{O.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,u,d;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"})]}),((u=(l=t.selectors)==null?void 0:l.quote)==null?void 0:u.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)}),((d=t.replies)==null?void 0:d.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]=W(!1);return s("div",{class:"orphaned-section",children:[s("div",{class:"orphaned-section-header",onClick:()=>l(u=>!u),children:[s("span",{children:a?"▸":"▾"}),s("span",{children:["Não encontradas (",t.length,")"]})]}),!a&&t.map(u=>s(Bt,{ann:u,isSelected:e===u.id,onClick:()=>n(u),annotationOps:i,editingId:r,setEditingId:o,orphaned:!0},u.id))]})}function Un({annotationId:t,onReply:e}){const[n,i]=W("");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=K(null),l=K({active:!1,startX:0,startY:0}),u=520,d=440,h=typeof window<"u"?window.innerWidth:800,p=(typeof window<"u"?window.innerHeight:800)-e<d,_=Math.max(16,Math.min(t-u/2,h-u-16)),v=p?Math.max(8,e-d-8):e,[m,g]=W({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:`${u}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=K(null),[n,i]=W(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":""}${O.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,O.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=u(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 u(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 d(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&&(O.value=p.getAttribute("data-highlight-id"))}return s("main",{class:"content-area-wrapper",children:[s("div",{class:"content-area",ref:e,onClick:c,onMouseUp:d,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]=W(!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],u=document.createElement("a");u.href=URL.createObjectURL(a),u.download=r.replace(".md",l),u.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(F,{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]=W(!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(B.value=a,a.length===0)return;const l=window.location.pathname;let u=null;if(l&&l!=="/"){const h=l.replace(/^\//,"");u=a.find(c=>{const f=c.path||c;return f===h||f===h.split("/").pop()||c.absPath&&c.absPath.endsWith("/"+h)})}const d=u?u.path||u:a[0].path||a[0];o(d)}),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(F,{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(F,{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"));
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-DuVgC81Y.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/assets/index-Cp_TccJA.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.0",
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": {