plan-review 0.1.1 → 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.
- package/README.md +24 -3
- package/dist/browser/app.js +57 -0
- package/dist/browser/index.html +278 -0
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/server/assets.d.ts +1 -0
- package/dist/server/assets.js +25 -0
- package/dist/server/assets.js.map +1 -0
- package/dist/server/routes.d.ts +8 -0
- package/dist/server/routes.js +43 -0
- package/dist/server/routes.js.map +1 -0
- package/dist/server/server.d.ts +7 -0
- package/dist/server/server.js +21 -0
- package/dist/server/server.js.map +1 -0
- package/dist/transport.d.ts +20 -0
- package/dist/transport.js +30 -0
- package/dist/transport.js.map +1 -0
- package/dist/types.d.ts +6 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# plan-review
|
|
2
2
|
|
|
3
|
-
Interactive CLI for reviewing AI-generated markdown plans. Parses plans into sections, renders them in the terminal, collects your comments, and outputs structured feedback.
|
|
3
|
+
Interactive CLI for reviewing AI-generated markdown plans. Parses plans into sections, renders them in the terminal or browser, collects your comments, and outputs structured feedback.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -11,7 +11,11 @@ npm install -g plan-review
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
+
# Terminal mode (interactive)
|
|
14
15
|
plan-review path/to/plan.md
|
|
16
|
+
|
|
17
|
+
# Browser mode (three-panel review UI)
|
|
18
|
+
plan-review path/to/plan.md --browser
|
|
15
19
|
```
|
|
16
20
|
|
|
17
21
|
### Options
|
|
@@ -20,11 +24,12 @@ plan-review path/to/plan.md
|
|
|
20
24
|
-o, --output <target> Output target: stdout, clipboard, file, claude
|
|
21
25
|
--output-file <path> Custom output file path (with --output file)
|
|
22
26
|
--split-by <strategy> Force split strategy: heading, separator
|
|
27
|
+
--browser Open browser-based review UI
|
|
23
28
|
-V, --version Show version
|
|
24
29
|
-h, --help Show help
|
|
25
30
|
```
|
|
26
31
|
|
|
27
|
-
If `-o` is omitted, you'll be prompted to choose after the review.
|
|
32
|
+
If `-o` is omitted, you'll be prompted to choose after the review. Output targets work with both terminal and browser modes (e.g., `--browser -o clipboard`).
|
|
28
33
|
|
|
29
34
|
### Interactive commands
|
|
30
35
|
|
|
@@ -38,10 +43,26 @@ If `-o` is omitted, you'll be prompted to choose after the review.
|
|
|
38
43
|
| *(enter)* | Skip section |
|
|
39
44
|
| *(any text)* | Add comment on current section |
|
|
40
45
|
|
|
46
|
+
## Review modes
|
|
47
|
+
|
|
48
|
+
### Terminal mode (default)
|
|
49
|
+
|
|
50
|
+
Interactive terminal UI with table of contents, section navigation, and inline commenting.
|
|
51
|
+
|
|
52
|
+
### Browser mode (`--browser`)
|
|
53
|
+
|
|
54
|
+
Opens a three-panel review UI in your browser:
|
|
55
|
+
|
|
56
|
+
- **Left** — Table of contents with section tree and comment indicators
|
|
57
|
+
- **Center** — Rendered markdown content with dependency metadata (plan mode)
|
|
58
|
+
- **Right** — Comment sidebar with add, edit, and delete
|
|
59
|
+
|
|
60
|
+
Add comments on any section, then click "Submit Review" to send your feedback back to the CLI. The server shuts down automatically after submission.
|
|
61
|
+
|
|
41
62
|
## How it works
|
|
42
63
|
|
|
43
64
|
1. **Parses** your markdown — auto-detects plan-style documents (milestones, tasks, dependencies) or falls back to generic heading-based splitting
|
|
44
|
-
2. **Renders**
|
|
65
|
+
2. **Renders** in terminal or browser depending on mode
|
|
45
66
|
3. **Collects** your comments as you review each section
|
|
46
67
|
4. **Outputs** structured markdown with your comments alongside the original content
|
|
47
68
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* bundled with preact */
|
|
2
|
+
"use strict";(()=>{var te,x,Oe,zt,B,He,je,Fe,_e,V,F,Ue,ke,de,ge,It,K={},Y=[],Et=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ne=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function be(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lt(t,e,n){var i,r,s,o={};for(s in e)s=="key"?i=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?te.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return X(t,o,i,r,null)}function X(t,e,n,i,r){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Oe,__i:-1,__u:0};return r==null&&x.vnode!=null&&x.vnode(s),s}function j(t){return t.children}function J(t,e){this.props=t,this.context=e}function O(t,e){if(e==null)return t.__?O(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"?O(t):null}function Dt(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],s=E({},e);s.__v=e.__v+1,x.vnode&&x.vnode(s),xe(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??O(e),!!(32&e.__u),r),s.__v=e.__v,s.__.__k[s.__i]=s,Qe(i,s,r),e.__e=e.__=null,s.__e!=n&&Ze(s)}}function Ze(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}),Ze(t)}function qe(t){(!t.__d&&(t.__d=!0)&&B.push(t)&&!ee.__r++||He!=x.debounceRendering)&&((He=x.debounceRendering)||je)(ee)}function ee(){try{for(var t,e=1;B.length;)B.length>e&&B.sort(Fe),t=B.shift(),e=B.length,Dt(t)}finally{B.length=ee.__r=0}}function Ge(t,e,n,i,r,s,o,l,u,a,p){var c,h,_,g,v,w,d,m=i&&i.__k||Y,C=e.length;for(u=Bt(n,e,m,u,C),c=0;c<C;c++)(_=n.__k[c])!=null&&(h=_.__i!=-1&&m[_.__i]||K,_.__i=c,w=xe(t,_,h,r,s,o,l,u,a,p),g=_.__e,_.ref&&h.ref!=_.ref&&(h.ref&&ve(h.ref,null,_),p.push(_.ref,_.__c||g,_)),v==null&&g!=null&&(v=g),(d=!!(4&_.__u))||h.__k===_.__k?(u=We(_,u,t,d),d&&h.__e&&(h.__e=null)):typeof _.type=="function"&&w!==void 0?u=w:g&&(u=g.nextSibling),_.__u&=-7);return n.__e=v,u}function Bt(t,e,n,i,r){var s,o,l,u,a,p=n.length,c=p,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[s]=X(null,o,null,null,null):ne(o)?o=t.__k[s]=X(j,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=X(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+h,o.__=t,o.__b=t.__b+1,l=null,(a=o.__i=Ht(o,n,u,c))!=-1&&(c--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(r>p?h--:r<p&&h++),typeof o.type!="function"&&(o.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<p;s++)(l=n[s])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=O(l)),Xe(l,l));return i}function We(t,e,n,i){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=We(r[s],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=O(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ht(t,e,n,i){var r,s,o,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(i>(p?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((a=e[o=r>=0?r--:s++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return o}return-1}function Ne(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Et.test(e)?n:n+"px"}function Q(t,e,n,i,r){var s,o;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||Ne(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Ne(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Ue,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n[F]=i[F]:(n[F]=ke,t.addEventListener(e,s?ge:de,s)):t.removeEventListener(e,s?ge:de,s);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 Me(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[V]==null)e[V]=ke++;else if(e[V]<n[F])return;return n(x.event?x.event(e):e)}}}function xe(t,e,n,i,r,s,o,l,u,a){var p,c,h,_,g,v,w,d,m,C,T,I,N,A,fe,P=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),s=[l=e.__e=n.__e]),(p=x.__b)&&p(e);e:if(typeof P=="function")try{if(d=e.props,m=P.prototype&&P.prototype.render,C=(p=P.contextType)&&i[p.__c],T=p?C?C.props.value:p.__:i,n.__c?w=(c=e.__c=n.__c).__=c.__E:(m?e.__c=c=new P(d,T):(e.__c=c=new J(d,T),c.constructor=P,c.render=Nt),C&&C.sub(c),c.state||(c.state={}),c.__n=i,h=c.__d=!0,c.__h=[],c._sb=[]),m&&c.__s==null&&(c.__s=c.state),m&&P.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=E({},c.__s)),E(c.__s,P.getDerivedStateFromProps(d,c.__s))),_=c.props,g=c.state,c.__v=e,h)m&&P.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),m&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(m&&P.getDerivedStateFromProps==null&&d!==_&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(d,T),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(d,c.__s,T)===!1){e.__v!=n.__v&&(c.props=d,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(M){M&&(M.__=e)}),Y.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(d,c.__s,T),m&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(_,g,v)})}if(c.context=T,c.props=d,c.__P=t,c.__e=!1,I=x.__r,N=0,m)c.state=c.__s,c.__d=!1,I&&I(e),p=c.render(c.props,c.state,c.context),Y.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,I&&I(e),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++N<25);c.state=c.__s,c.getChildContext!=null&&(i=E(E({},i),c.getChildContext())),m&&!h&&c.getSnapshotBeforeUpdate!=null&&(v=c.getSnapshotBeforeUpdate(_,g)),A=p!=null&&p.type===j&&p.key==null?Ve(p.props.children):p,l=Ge(t,ne(A)?A:[A],e,n,i,r,s,o,l,u,a),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),w&&(c.__E=c.__=null)}catch(M){if(e.__v=null,u||s!=null)if(M.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,e.__e=l}else{for(fe=s.length;fe--;)be(s[fe]);me(e)}else e.__e=n.__e,e.__k=n.__k,M.then||me(e);x.__e(M,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qt(n.__e,e,n,i,r,s,o,u,a);return(p=x.diffed)&&p(e),128&e.__u?void 0:l}function me(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(me))}function Qe(t,e,n){for(var i=0;i<n.length;i++)ve(n[i],n[++i],n[++i]);x.__c&&x.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){x.__e(s,r.__v)}})}function Ve(t){return typeof t!="object"||t==null||t.__b>0?t:ne(t)?t.map(Ve):E({},t)}function qt(t,e,n,i,r,s,o,l,u){var a,p,c,h,_,g,v,w=n.props||K,d=e.props,m=e.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(a=0;a<s.length;a++)if((_=s[a])&&"setAttribute"in _==!!m&&(m?_.localName==m:_.nodeType==3)){t=_,s[a]=null;break}}if(t==null){if(m==null)return document.createTextNode(d);t=document.createElementNS(r,m,d.is&&d),l&&(x.__m&&x.__m(e,s),l=!1),s=null}if(m==null)w===d||l&&t.data==d||(t.data=d);else{if(s=s&&te.call(t.childNodes),!l&&s!=null)for(w={},a=0;a<t.attributes.length;a++)w[(_=t.attributes[a]).name]=_.value;for(a in w)_=w[a],a=="dangerouslySetInnerHTML"?c=_:a=="children"||a in d||a=="value"&&"defaultValue"in d||a=="checked"&&"defaultChecked"in d||Q(t,a,null,_,r);for(a in d)_=d[a],a=="children"?h=_:a=="dangerouslySetInnerHTML"?p=_:a=="value"?g=_:a=="checked"?v=_:l&&typeof _!="function"||w[a]===_||Q(t,a,_,w[a],r);if(p)l||c&&(p.__html==c.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(c&&(t.innerHTML=""),Ge(e.type=="template"?t.content:t,ne(h)?h:[h],e,n,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:n.__k&&O(n,0),l,u),s!=null)for(a=s.length;a--;)be(s[a]);l||(a="value",m=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[a]||m=="progress"&&!g||m=="option"&&g!=w[a])&&Q(t,a,g,w[a],r),a="checked",v!=null&&v!=t[a]&&Q(t,a,v,w[a],r))}return t}function ve(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){x.__e(r,n)}}function Xe(t,e,n){var i,r;if(x.unmount&&x.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||ve(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){x.__e(s,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Xe(i[r],e,n||typeof t.type!="function");n||be(t.__e),t.__c=t.__=t.__e=void 0}function Nt(t,e,n){return this.constructor(t,n)}function Je(t,e,n){var i,r,s,o;e==document&&(e=document.documentElement),x.__&&x.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],xe(e,t=(!i&&n||e).__k=Lt(j,null,[t]),r||K,K,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?te.call(e.childNodes):null,s,!i&&n?n:r?r.__e:e.firstChild,i,o),Qe(s,t,o)}te=Y.slice,x={__e:function(t,e,n,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),o=r.__d),o)return r.__E=r}catch(l){t=l}throw t}},Oe=0,zt=function(t){return t!=null&&t.constructor===void 0},J.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=E({},this.state),typeof t=="function"&&(t=t(E({},n),this.props)),t&&E(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),qe(this))},J.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qe(this))},J.prototype.render=j,B=[],je=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fe=function(t,e){return t.__v.__b-e.__v.__b},ee.__r=0,_e=Math.random().toString(8),V="__d"+_e,F="__a"+_e,Ue=/(PointerCapture)$|Capture$/i,ke=0,de=Me(!1),ge=Me(!0),It=0;var ie,y,we,Ke,ye=0,ot=[],S=x,Ye=S.__b,et=S.__r,tt=S.diffed,nt=S.__c,rt=S.unmount,it=S.__;function lt(t,e){S.__h&&S.__h(y,t,ye||e),ye=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function $(t){return ye=1,Mt(ct,t)}function Mt(t,e,n){var i=lt(ie++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):ct(void 0,e),function(l){var u=i.__N?i.__N[0]:i.__[0],a=i.t(u,l);u!==a&&(i.__N=[a,i.__[1]],i.__c.setState({}))}],i.__c=y,!y.__f)){var r=function(l,u,a){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!s||s.call(this,l,u,a);var c=i.__c.props!==l;return p.some(function(h){if(h.__N){var _=h.__[0];h.__=h.__N,h.__N=void 0,_!==h.__[0]&&(c=!0)}}),s&&s.call(this,l,u,a)||c};y.__f=!0;var s=y.shouldComponentUpdate,o=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=s;s=void 0,r(l,u,a),s=p}o&&o.call(this,l,u,a)},y.shouldComponentUpdate=r}return i.__N||i.__}function at(t,e){var n=lt(ie++,3);!S.__s&&Ft(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ot(){for(var t;t=ot.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(re),e.__h.some(Se),e.__h=[]}catch(n){e.__h=[],S.__e(n,t.__v)}}}S.__b=function(t){y=null,Ye&&Ye(t)},S.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),it&&it(t,e)},S.__r=function(t){et&&et(t),ie=0;var e=(y=t.__c).__H;e&&(we===y?(e.__h=[],y.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(re),e.__h.some(Se),e.__h=[],ie=0)),we=y},S.diffed=function(t){tt&&tt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ot.push(e)!==1&&Ke===S.requestAnimationFrame||((Ke=S.requestAnimationFrame)||jt)(Ot)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),we=y=null},S.__c=function(t,e){e.some(function(n){try{n.__h.some(re),n.__h=n.__h.filter(function(i){return!i.__||Se(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],S.__e(i,n.__v)}}),nt&&nt(t,e)},S.unmount=function(t){rt&&rt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(i){try{re(i)}catch(r){e=r}}),n.__H=void 0,e&&S.__e(e,n.__v))};var st=typeof requestAnimationFrame=="function";function jt(t){var e,n=function(){clearTimeout(i),st&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);st&&(e=requestAnimationFrame(n))}function re(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function Se(t){var e=y;t.__c=t.__(),y=e}function Ft(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function ct(t,e){return typeof e=="function"?e(t):e}var Ut=0;function f(t,e,n,i,r,s){e||(e={});var o,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?o=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ut,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(l in o)u[l]===void 0&&(u[l]=o[l]);return x.vnode&&x.vnode(a),a}function ut({doc:t,comments:e,activeSection:n,onNavigate:i}){let r=new Set(e.map(o=>o.sectionId));if(t.mode==="plan"){let o=t.sections.filter(l=>l.level===2);return f("nav",{class:"toc-panel",children:o.map(l=>{let u=t.sections.filter(a=>a.parent===l.id);return f("div",{class:"toc-milestone",children:[f("h3",{children:l.heading}),f("ul",{children:u.map(a=>f("li",{class:`toc-item${n===a.id?" active":""}${r.has(a.id)?" commented":""}`,onClick:()=>i(a.id),children:[f("span",{class:"toc-marker",children:r.has(a.id)?"\u2713":"\xA0"}),f("span",{class:"toc-id",children:a.id}),f("span",{class:"toc-heading",children:a.heading})]},a.id))})]},l.id)})})}let s=t.sections.filter(o=>o.level>=2);return f("nav",{class:"toc-panel",children:f("ul",{children:s.map(o=>f("li",{class:`toc-item${n===o.id?" active":""}${r.has(o.id)?" commented":""}`,onClick:()=>i(o.id),children:[f("span",{class:"toc-marker",children:r.has(o.id)?"\u2713":"\xA0"}),f("span",{class:"toc-heading",children:o.heading})]},o.id))})})}function $e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=$e();function gt(t){q=t}var G={exec:()=>null};function b(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(R.caret,"$1"),n=n.replace(r,o),i},getRegex:()=>new RegExp(n,e)};return i}var R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Zt=/^(?:[ \t]*(?:\n|$))+/,Gt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,W=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ae=/(?:[*+-]|\d{1,9}[.)])/,mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,kt=b(mt).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vt=b(mt).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xt=/^[^\n]+/,ze=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jt=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ze).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kt=b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ae).getRegex(),ue="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ie=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yt=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ie).replace("tag",ue).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bt=b(Pe).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex(),en=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bt).getRegex(),Ee={blockquote:en,code:Gt,def:Jt,fences:Wt,heading:Qt,hr:W,html:Yt,lheading:kt,list:Kt,newline:Zt,paragraph:bt,table:G,text:Xt},pt=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex(),tn={...Ee,lheading:Vt,table:pt,paragraph:b(Pe).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex()},nn={...Ee,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ie).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(Pe).replace("hr",W).replace("heading",` *#{1,6} *[^
|
|
3
|
+
]`).replace("lheading",kt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xt=/^( {2,}|\\)\n(?!\s*$)/,on=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pe=/[\p{P}\p{S}]/u,Le=/[\s\p{P}\p{S}]/u,vt=/[^\s\p{P}\p{S}]/u,ln=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Le).getRegex(),wt=/(?!~)[\p{P}\p{S}]/u,an=/(?!~)[\s\p{P}\p{S}]/u,cn=/(?:[^\s\p{P}\p{S}]|~)/u,un=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,yt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,pn=b(yt,"u").replace(/punct/g,pe).getRegex(),hn=b(yt,"u").replace(/punct/g,wt).getRegex(),St="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fn=b(St,"gu").replace(/notPunctSpace/g,vt).replace(/punctSpace/g,Le).replace(/punct/g,pe).getRegex(),_n=b(St,"gu").replace(/notPunctSpace/g,cn).replace(/punctSpace/g,an).replace(/punct/g,wt).getRegex(),dn=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vt).replace(/punctSpace/g,Le).replace(/punct/g,pe).getRegex(),gn=b(/\\(punct)/,"gu").replace(/punct/g,pe).getRegex(),mn=b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),kn=b(Ie).replace("(?:-->|$)","-->").getRegex(),bn=b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",kn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),le=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xn=b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",le).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ct=b(/^!?\[(label)\]\[(ref)\]/).replace("label",le).replace("ref",ze).getRegex(),Tt=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",ze).getRegex(),vn=b("reflink|nolink(?!\\()","g").replace("reflink",Ct).replace("nolink",Tt).getRegex(),De={_backpedal:G,anyPunctuation:gn,autolink:mn,blockSkip:un,br:xt,code:sn,del:G,emStrongLDelim:pn,emStrongRDelimAst:fn,emStrongRDelimUnd:dn,escape:rn,link:xn,nolink:Tt,punctuation:ln,reflink:Ct,reflinkSearch:vn,tag:bn,text:on,url:G},wn={...De,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",le).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le).getRegex()},Ce={...De,emStrongRDelimAst:_n,emStrongLDelim:hn,url:b(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},yn={...Ce,br:b(xt).replace("{2,}","*").getRegex(),text:b(Ce.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},se={normal:Ee,gfm:tn,pedantic:nn},U={normal:De,gfm:Ce,breaks:yn,pedantic:wn},Sn={"&":"&","<":"<",">":">",'"':""","'":"'"},ht=t=>Sn[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,ht)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,ht);return t}function ft(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function _t(t,e){let n=t.replace(R.findPipe,(s,o,l)=>{let u=!1,a=o;for(;--a>=0&&l[a]==="\\";)u=!u;return u?"|":" |"}),i=n.split(R.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(R.slashPipe,"|");return i}function Z(t,e,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i;){let s=t.charAt(i-r-1);if(s===e&&!n)r++;else if(s!==e&&n)r++;else break}return t.slice(0,i-r)}function Cn(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])n++;else if(t[i]===e[1]&&(n--,n<0))return i;return n>0?-2:-1}function dt(t,e,n,i,r){let s=e.href,o=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,u}function Tn(t,e,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
|
|
4
|
+
`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=r.length?s.slice(r.length):s}).join(`
|
|
5
|
+
`)}var ae=class{options;rules;lexer;constructor(t){this.options=t||q}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z(n,`
|
|
6
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=Tn(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let i=Z(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Z(e[0],`
|
|
7
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Z(e[0],`
|
|
8
|
+
`).split(`
|
|
9
|
+
`),i="",r="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let a=l.join(`
|
|
10
|
+
`),p=a.replace(this.rules.other.blockquoteSetextReplace,`
|
|
11
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
12
|
+
${a}`:a,r=r?`${r}
|
|
13
|
+
${p}`:p;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=c,n.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let _=h,g=_.raw+`
|
|
14
|
+
`+n.join(`
|
|
15
|
+
`),v=this.blockquote(g);s[s.length-1]=v,i=i.substring(0,i.length-_.raw.length)+v.raw,r=r.substring(0,r.length-_.text.length)+v.text;break}else if(h?.type==="list"){let _=h,g=_.raw+`
|
|
16
|
+
`+n.join(`
|
|
17
|
+
`),v=this.list(g);s[s.length-1]=v,i=i.substring(0,i.length-h.raw.length)+v.raw,r=r.substring(0,r.length-_.raw.length)+v.raw,n=g.substring(s.at(-1).raw.length).split(`
|
|
18
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let u=!1,a="",p="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;a=e[0],t=t.substring(a.length);let c=e[2].split(`
|
|
19
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,d=>" ".repeat(3*d.length)),h=t.split(`
|
|
20
|
+
`,1)[0],_=!c.trim(),g=0;if(this.options.pedantic?(g=2,p=c.trimStart()):_?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=c.slice(g),g+=e[1].length),_&&this.rules.other.blankLine.test(h)&&(a+=h+`
|
|
21
|
+
`,t=t.substring(h.length+1),u=!0),!u){let d=this.rules.other.nextBulletRegex(g),m=this.rules.other.hrRegex(g),C=this.rules.other.fencesBeginRegex(g),T=this.rules.other.headingBeginRegex(g),I=this.rules.other.htmlBeginRegex(g);for(;t;){let N=t.split(`
|
|
22
|
+
`,1)[0],A;if(h=N,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),C.test(h)||T.test(h)||I.test(h)||d.test(h)||m.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=g||!h.trim())p+=`
|
|
23
|
+
`+A.slice(g);else{if(_||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(c)||T.test(c)||m.test(c))break;p+=`
|
|
24
|
+
`+h}!_&&!h.trim()&&(_=!0),a+=N+`
|
|
25
|
+
`,t=t.substring(N.length+1),c=A.slice(g)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(o=!0));let v=null,w;this.options.gfm&&(v=this.rules.other.listIsTask.exec(p),v&&(w=v[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:a,task:!!v,checked:w,loose:!1,text:p,tokens:[]}),r.raw+=a}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){let a=r.items[u].tokens.filter(c=>c.type==="space"),p=a.length>0&&a.some(c=>this.rules.other.anyLine.test(c.raw));r.loose=p}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:i,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=_t(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
26
|
+
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of r)s.rows.push(_t(o,s.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[u]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
27
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Cn(e[2],"()");if(s===-2)return;if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),dt(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return dt(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...i[0]].length-1,o,l,u=s,a=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(i=p.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(l=[...o].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&s%3&&!((s+l)%3)){a+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+a);let c=[...i[0]][0].length,h=t.slice(0,s+i.index+c+l);if(Math.min(s,l)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let _=h.slice(2,-2);return{type:"strong",raw:h,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,i;return e[2]==="@"?(n=e[1],i="mailto:"+n):(n=e[1],i=n),{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},L=class Te{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||q,this.options.tokenizer=this.options.tokenizer||new ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:R,block:se.normal,inline:U.normal};this.options.pedantic?(n.block=se.pedantic,n.inline=U.pedantic):this.options.gfm&&(n.block=se.gfm,this.options.breaks?n.inline=U.breaks:n.inline=U.gfm),this.tokenizer.rules=n}static get rules(){return{block:se,inline:U}}static lex(e,n){return new Te(n).lex(e)}static lexInline(e,n){return new Te(n).inlineTokens(e)}lex(e){e=e.replace(R.carriageReturn,`
|
|
28
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],i=!1){for(this.options.pedantic&&(e=e.replace(R.tabCharGlobal," ").replace(R.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let o=n.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
|
|
29
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
30
|
+
`+r.raw,o.text+=`
|
|
31
|
+
`+r.text,this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
32
|
+
`+r.raw,o.text+=`
|
|
33
|
+
`+r.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(a=>{u=a.call({lexer:this},l),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let o=n.at(-1);i&&o?.type==="paragraph"?(o.raw+=`
|
|
34
|
+
`+r.raw,o.text+=`
|
|
35
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r),i=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=`
|
|
36
|
+
`+r.raw,o.text+=`
|
|
37
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let i=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(a=>(l=a.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let a=n.at(-1);l.type==="text"&&a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,i,o)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let u=e;if(this.options.extensions?.startInline){let a=1/0,p=e.slice(1),c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},p),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let a=n.at(-1);a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return n}},ce=class{options;parser;constructor(t){this.options=t||q}space(t){return""}code({text:t,lang:e,escaped:n}){let i=(e||"").match(R.notSpaceStart)?.[0],r=t.replace(R.endingNewline,"")+`
|
|
38
|
+
`;return i?'<pre><code class="language-'+z(i)+'">'+(n?r:z(r,!0))+`</code></pre>
|
|
39
|
+
`:"<pre><code>"+(n?r:z(r,!0))+`</code></pre>
|
|
40
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
41
|
+
${this.parser.parse(t)}</blockquote>
|
|
42
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
43
|
+
`}hr(t){return`<hr>
|
|
44
|
+
`}list(t){let e=t.ordered,n=t.start,i="";for(let o=0;o<t.items.length;o++){let l=t.items[o];i+=this.listitem(l)}let r=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
|
|
45
|
+
`+i+"</"+r+`>
|
|
46
|
+
`}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+z(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
47
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
48
|
+
`}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
49
|
+
<thead>
|
|
50
|
+
`+e+`</thead>
|
|
51
|
+
`+i+`</table>
|
|
52
|
+
`}tablerow({text:t}){return`<tr>
|
|
53
|
+
${t}</tr>
|
|
54
|
+
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
55
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let i=this.parser.parseInline(n),r=ft(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+z(e)+'"'),s+=">"+i+"</a>",s}image({href:t,title:e,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=ft(t);if(r===null)return z(n);t=r;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${z(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Be=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},D=class Re{options;renderer;textRenderer;constructor(e){this.options=e||q,this.options.renderer=this.options.renderer||new ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Be}static parse(e,n){return new Re(n).parse(e)}static parseInline(e,n){return new Re(n).parseInline(e)}parse(e,n=!0){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){i+=u||"";continue}}let o=s;switch(o.type){case"space":{i+=this.renderer.space(o);continue}case"hr":{i+=this.renderer.hr(o);continue}case"heading":{i+=this.renderer.heading(o);continue}case"code":{i+=this.renderer.code(o);continue}case"table":{i+=this.renderer.table(o);continue}case"blockquote":{i+=this.renderer.blockquote(o);continue}case"list":{i+=this.renderer.list(o);continue}case"html":{i+=this.renderer.html(o);continue}case"paragraph":{i+=this.renderer.paragraph(o);continue}case"text":{let l=o,u=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],u+=`
|
|
56
|
+
`+this.renderer.text(l);n?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,n=this.renderer){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let o=s;switch(o.type){case"escape":{i+=n.text(o);break}case"html":{i+=n.html(o);break}case"link":{i+=n.link(o);break}case"image":{i+=n.image(o);break}case"strong":{i+=n.strong(o);break}case"em":{i+=n.em(o);break}case"codespan":{i+=n.codespan(o);break}case"br":{i+=n.br(o);break}case"del":{i+=n.del(o);break}case"text":{i+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},oe=class{options;block;constructor(t){this.options=t||q}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?L.lex:L.lexInline}provideParser(){return this.block?D.parse:D.parseInline}},Rn=class{defaults=$e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=D;Renderer=ce;TextRenderer=Be;Lexer=L;Tokenizer=ae;Hooks=oe;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let i of t)switch(n=n.concat(e.call(this,i)),i.type){case"table":{let r=i;for(let s of r.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of r.rows)for(let o of s)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=i;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=i;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(s=>{let o=r[s].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=e.renderers[r.name];s?e.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),n.renderer){let r=this.defaults.renderer||new ce(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new ae(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new oe;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=r[o];oe.passThroughHooks.has(s)?r[o]=a=>{if(this.defaults.async)return Promise.resolve(l.call(r,a)).then(c=>u.call(r,c));let p=l.call(r,a);return u.call(r,p)}:r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),r&&(l=l.concat(r.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return L.lex(t,e??this.defaults)}parser(t,e){return D.parse(t,e??this.defaults)}parseMarkdown(t){return(n,i)=>{let r={...i},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);let l=s.hooks?s.hooks.provideLexer():t?L.lex:L.lexInline,u=s.hooks?s.hooks.provideParser():t?D.parse:D.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(a=>l(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>u(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let a=l(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let p=u(a,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(a){return o(a)}}}onError(t,e){return n=>{if(n.message+=`
|
|
57
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}}},H=new Rn;function k(t,e){return H.parse(t,e)}k.options=k.setOptions=function(t){return H.setOptions(t),k.defaults=H.defaults,gt(k.defaults),k};k.getDefaults=$e;k.defaults=q;k.use=function(...t){return H.use(...t),k.defaults=H.defaults,gt(k.defaults),k};k.walkTokens=function(t,e){return H.walkTokens(t,e)};k.parseInline=H.parseInline;k.Parser=D;k.parser=D.parse;k.Renderer=ce;k.TextRenderer=Be;k.Lexer=L;k.lexer=L.lex;k.Tokenizer=ae;k.Hooks=oe;k.parse=k;var Bn=k.options,Hn=k.setOptions,qn=k.use,Nn=k.walkTokens,Mn=k.parseInline;var On=D.parse,jn=L.lex;function Rt({section:t,mode:e,isActive:n,onComment:i}){let r=e==="plan"?t.level===3:t.level>=2,s=e==="plan"&&t.level===3&&t.dependencies,o=k.parse(t.body);return f("div",{id:`section-${t.id}`,class:`section-view${n?" active":""}`,children:[f("h2",{children:t.heading}),s&&f("div",{class:"section-meta",children:[t.dependencies.dependsOn.length>0&&f("span",{children:["Depends on: ",t.dependencies.dependsOn.join(", ")]}),t.dependencies.blocks.length>0&&f("span",{children:["Blocks: ",t.dependencies.blocks.join(", ")]}),t.relatedFiles&&t.relatedFiles.length>0&&f("span",{children:["Files: ",t.relatedFiles.join(", ")]}),t.verification&&f("span",{children:["Verify: ",t.verification]})]}),f("div",{class:"section-body",dangerouslySetInnerHTML:{__html:o}}),r&&f("button",{class:"add-comment-btn",onClick:i,children:"Add Comment"})]})}function he({sectionId:t,onSubmit:e,onCancel:n,initialText:i=""}){let[r,s]=$(i);return f("div",{class:"comment-input",children:[f("textarea",{placeholder:"Add a comment...",value:r,onInput:l=>s(l.target.value)}),f("div",{class:"comment-input-actions",children:[f("button",{class:"add-btn",onClick:()=>{let l=r.trim();l&&(e(t,l),s(""))},children:"Add"}),f("button",{class:"cancel-btn",onClick:n,children:"Cancel"})]})]})}function $t({comment:t,sectionHeading:e,onEdit:n,onDelete:i}){let[r,s]=$(!1);return r?f(he,{sectionId:t.sectionId,initialText:t.text,onSubmit:(o,l)=>{n(l),s(!1)},onCancel:()=>s(!1)}):f("div",{class:"comment-card",children:[f("div",{class:"comment-section",children:e}),f("div",{class:"comment-text",children:t.text}),f("div",{class:"comment-actions",children:[f("button",{onClick:()=>s(!0),children:"Edit"}),f("button",{class:"delete",onClick:i,children:"Delete"})]})]})}function At({comments:t,sections:e,commentingSection:n,onAdd:i,onEdit:r,onDelete:s,onCancelComment:o}){let l=a=>e.find(p=>p.id===a)?.heading??a,u=new Map;return t.forEach((a,p)=>{let c=u.get(a.sectionId)||[];c.push({comment:a,index:p}),u.set(a.sectionId,c)}),f("aside",{class:"comment-sidebar",children:[f("h2",{children:["Comments (",t.length,")"]}),n&&f("div",{class:"commenting-for",children:[f("h3",{children:["Commenting on: ",l(n)]}),f(he,{sectionId:n,onSubmit:i,onCancel:o})]}),Array.from(u.entries()).map(([a,p])=>f("div",{class:"comment-group",children:[f("h3",{children:l(a)}),p.map(({comment:c,index:h})=>f($t,{comment:c,sectionHeading:"",onEdit:_=>r(h,_),onDelete:()=>s(h)},h))]},a)),t.length===0&&!n&&f("p",{class:"no-comments",children:'No comments yet. Click "Add Comment" on a section to start.'})]})}function Pt(){let[t,e]=$(null),[n,i]=$([]),[r,s]=$(null),[o,l]=$(null),[u,a]=$(!1),[p,c]=$(null);at(()=>{fetch("/api/doc").then(d=>d.json()).then(d=>e(d.document)).catch(d=>c(d.message))},[]);let h=d=>{s(d),document.getElementById(`section-${d}`)?.scrollIntoView({behavior:"smooth"})},_=(d,m)=>{i(C=>[...C,{sectionId:d,text:m,timestamp:new Date}]),l(null)},g=(d,m)=>{i(C=>C.map((T,I)=>I===d?{...T,text:m}:T))},v=d=>{i(m=>m.filter((C,T)=>T!==d))},w=async()=>{try{(await fetch("/api/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n})})).ok&&a(!0)}catch{c("Failed to submit review")}};return u?f("div",{class:"submitted",children:"Review submitted. You can close this tab."}):p?f("div",{class:"loading",children:["Error: ",p]}):t?f("div",{class:"app",children:[f("header",{class:"top-bar",children:[f("h1",{children:t.title}),f("span",{class:"mode-badge",children:t.mode}),f("span",{class:"comment-count",children:[n.length," comment",n.length!==1?"s":""]}),f("button",{class:"submit-btn",onClick:w,disabled:n.length===0,children:"Submit Review"})]}),f("div",{class:"panels",children:[f(ut,{doc:t,comments:n,activeSection:r,onNavigate:h}),f("main",{class:"content-area",children:t.sections.map(d=>f(Rt,{section:d,mode:t.mode,isActive:r===d.id,onComment:()=>l(d.id)},d.id))}),f(At,{comments:n,sections:t.sections,commentingSection:o,onAdd:_,onEdit:g,onDelete:v,onCancelComment:()=>l(null)})]})]}):f("div",{class:"loading",children:"Loading..."})}Je(f(Pt,{}),document.getElementById("app"));})();
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Plan Review</title>
|
|
7
|
+
<style>:root {
|
|
8
|
+
--bg-primary: #1a1a2e;
|
|
9
|
+
--bg-secondary: #16213e;
|
|
10
|
+
--bg-tertiary: #0f3460;
|
|
11
|
+
--text-primary: #e0e0e0;
|
|
12
|
+
--text-secondary: #a0a0a0;
|
|
13
|
+
--accent: #00adb5;
|
|
14
|
+
--accent-hover: #00ccd3;
|
|
15
|
+
--border: #2a2a4a;
|
|
16
|
+
--danger: #e74c3c;
|
|
17
|
+
--success: #2ecc71;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
21
|
+
|
|
22
|
+
body {
|
|
23
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
24
|
+
background: var(--bg-primary);
|
|
25
|
+
color: var(--text-primary);
|
|
26
|
+
line-height: 1.6;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.app {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
height: 100vh;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.top-bar {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: 16px;
|
|
39
|
+
padding: 12px 20px;
|
|
40
|
+
background: var(--bg-secondary);
|
|
41
|
+
border-bottom: 1px solid var(--border);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.top-bar h1 { font-size: 18px; flex: 1; }
|
|
45
|
+
|
|
46
|
+
.mode-badge {
|
|
47
|
+
padding: 2px 8px;
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
background: var(--bg-tertiary);
|
|
51
|
+
color: var(--accent);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.comment-count { font-size: 14px; color: var(--text-secondary); }
|
|
55
|
+
|
|
56
|
+
.submit-btn {
|
|
57
|
+
padding: 8px 16px;
|
|
58
|
+
background: var(--accent);
|
|
59
|
+
color: white;
|
|
60
|
+
border: none;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.submit-btn:hover { background: var(--accent-hover); }
|
|
67
|
+
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
68
|
+
|
|
69
|
+
.panels { display: flex; flex: 1; overflow: hidden; }
|
|
70
|
+
|
|
71
|
+
.toc-panel {
|
|
72
|
+
width: 220px;
|
|
73
|
+
padding: 16px;
|
|
74
|
+
background: var(--bg-secondary);
|
|
75
|
+
border-right: 1px solid var(--border);
|
|
76
|
+
overflow-y: auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.toc-milestone h3 {
|
|
80
|
+
font-size: 13px;
|
|
81
|
+
color: var(--accent);
|
|
82
|
+
margin: 12px 0 4px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.toc-panel ul { list-style: none; }
|
|
86
|
+
|
|
87
|
+
.toc-item {
|
|
88
|
+
display: flex;
|
|
89
|
+
gap: 8px;
|
|
90
|
+
padding: 6px 8px;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
font-size: 13px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.toc-item:hover { background: var(--bg-tertiary); }
|
|
97
|
+
.toc-item.active { background: var(--bg-tertiary); border-left: 2px solid var(--accent); }
|
|
98
|
+
.toc-item.commented .toc-marker { color: var(--success); }
|
|
99
|
+
.toc-id { color: var(--text-secondary); }
|
|
100
|
+
|
|
101
|
+
.content-area { flex: 1; padding: 20px; overflow-y: auto; }
|
|
102
|
+
|
|
103
|
+
.section-view {
|
|
104
|
+
margin-bottom: 24px;
|
|
105
|
+
padding: 16px;
|
|
106
|
+
border: 1px solid var(--border);
|
|
107
|
+
border-radius: 8px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.section-view.active { border-color: var(--accent); }
|
|
111
|
+
.section-view h2 { font-size: 16px; margin-bottom: 12px; }
|
|
112
|
+
|
|
113
|
+
.section-meta {
|
|
114
|
+
margin-bottom: 12px;
|
|
115
|
+
padding: 8px 12px;
|
|
116
|
+
background: var(--bg-secondary);
|
|
117
|
+
border-radius: 4px;
|
|
118
|
+
font-size: 13px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.section-meta span { display: block; color: var(--text-secondary); }
|
|
122
|
+
|
|
123
|
+
.section-body { font-size: 14px; line-height: 1.7; }
|
|
124
|
+
.section-body h1, .section-body h2, .section-body h3 { margin: 16px 0 8px; }
|
|
125
|
+
.section-body code { background: var(--bg-secondary); padding: 2px 6px; border-radius: 3px; font-size: 13px; }
|
|
126
|
+
.section-body pre { background: var(--bg-secondary); padding: 12px; border-radius: 6px; overflow-x: auto; }
|
|
127
|
+
|
|
128
|
+
.add-comment-btn {
|
|
129
|
+
margin-top: 12px;
|
|
130
|
+
padding: 6px 12px;
|
|
131
|
+
background: transparent;
|
|
132
|
+
color: var(--accent);
|
|
133
|
+
border: 1px solid var(--accent);
|
|
134
|
+
border-radius: 4px;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.add-comment-btn:hover { background: var(--accent); color: white; }
|
|
140
|
+
|
|
141
|
+
.comment-sidebar {
|
|
142
|
+
width: 300px;
|
|
143
|
+
padding: 16px;
|
|
144
|
+
background: var(--bg-secondary);
|
|
145
|
+
border-left: 1px solid var(--border);
|
|
146
|
+
overflow-y: auto;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.comment-sidebar h2 { font-size: 16px; margin-bottom: 12px; }
|
|
150
|
+
|
|
151
|
+
.commenting-for h3,
|
|
152
|
+
.comment-group h3 { font-size: 13px; color: var(--accent); margin: 12px 0 8px; }
|
|
153
|
+
|
|
154
|
+
.comment-card {
|
|
155
|
+
padding: 10px;
|
|
156
|
+
margin-bottom: 8px;
|
|
157
|
+
background: var(--bg-primary);
|
|
158
|
+
border-radius: 6px;
|
|
159
|
+
font-size: 13px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.comment-section { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
|
|
163
|
+
.comment-text { margin: 6px 0; white-space: pre-wrap; }
|
|
164
|
+
|
|
165
|
+
.comment-actions { display: flex; gap: 8px; }
|
|
166
|
+
.comment-actions button {
|
|
167
|
+
background: none;
|
|
168
|
+
border: none;
|
|
169
|
+
color: var(--text-secondary);
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
padding: 2px 4px;
|
|
173
|
+
}
|
|
174
|
+
.comment-actions button:hover { color: var(--text-primary); }
|
|
175
|
+
.comment-actions button.delete:hover { color: var(--danger); }
|
|
176
|
+
|
|
177
|
+
.comment-input { margin: 8px 0; }
|
|
178
|
+
.comment-input textarea {
|
|
179
|
+
width: 100%;
|
|
180
|
+
min-height: 80px;
|
|
181
|
+
padding: 8px;
|
|
182
|
+
background: var(--bg-primary);
|
|
183
|
+
color: var(--text-primary);
|
|
184
|
+
border: 1px solid var(--border);
|
|
185
|
+
border-radius: 4px;
|
|
186
|
+
font-family: inherit;
|
|
187
|
+
font-size: 13px;
|
|
188
|
+
resize: vertical;
|
|
189
|
+
}
|
|
190
|
+
.comment-input textarea:focus { outline: none; border-color: var(--accent); }
|
|
191
|
+
|
|
192
|
+
.comment-input-actions { display: flex; gap: 8px; margin-top: 8px; }
|
|
193
|
+
.comment-input-actions button {
|
|
194
|
+
padding: 6px 12px;
|
|
195
|
+
border: none;
|
|
196
|
+
border-radius: 4px;
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
font-size: 13px;
|
|
199
|
+
}
|
|
200
|
+
.comment-input-actions .add-btn { background: var(--accent); color: white; }
|
|
201
|
+
.comment-input-actions .add-btn:hover { background: var(--accent-hover); }
|
|
202
|
+
.comment-input-actions .cancel-btn { background: var(--bg-tertiary); color: var(--text-primary); }
|
|
203
|
+
|
|
204
|
+
.no-comments { color: var(--text-secondary); font-size: 13px; font-style: italic; }
|
|
205
|
+
|
|
206
|
+
.loading, .submitted {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
height: 100vh;
|
|
211
|
+
font-size: 18px;
|
|
212
|
+
}
|
|
213
|
+
.loading { color: var(--text-secondary); }
|
|
214
|
+
.submitted { color: var(--success); }
|
|
215
|
+
</style>
|
|
216
|
+
</head>
|
|
217
|
+
<body>
|
|
218
|
+
<div id="app"></div>
|
|
219
|
+
<script>/* bundled with preact */
|
|
220
|
+
"use strict";(()=>{var te,x,Oe,zt,B,He,je,Fe,_e,V,F,Ue,ke,de,ge,It,K={},Y=[],Et=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ne=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function be(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lt(t,e,n){var i,r,s,o={};for(s in e)s=="key"?i=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?te.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return X(t,o,i,r,null)}function X(t,e,n,i,r){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Oe,__i:-1,__u:0};return r==null&&x.vnode!=null&&x.vnode(s),s}function j(t){return t.children}function J(t,e){this.props=t,this.context=e}function O(t,e){if(e==null)return t.__?O(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"?O(t):null}function Dt(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],s=E({},e);s.__v=e.__v+1,x.vnode&&x.vnode(s),xe(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??O(e),!!(32&e.__u),r),s.__v=e.__v,s.__.__k[s.__i]=s,Qe(i,s,r),e.__e=e.__=null,s.__e!=n&&Ze(s)}}function Ze(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}),Ze(t)}function qe(t){(!t.__d&&(t.__d=!0)&&B.push(t)&&!ee.__r++||He!=x.debounceRendering)&&((He=x.debounceRendering)||je)(ee)}function ee(){try{for(var t,e=1;B.length;)B.length>e&&B.sort(Fe),t=B.shift(),e=B.length,Dt(t)}finally{B.length=ee.__r=0}}function Ge(t,e,n,i,r,s,o,l,u,a,p){var c,h,_,g,v,w,d,m=i&&i.__k||Y,C=e.length;for(u=Bt(n,e,m,u,C),c=0;c<C;c++)(_=n.__k[c])!=null&&(h=_.__i!=-1&&m[_.__i]||K,_.__i=c,w=xe(t,_,h,r,s,o,l,u,a,p),g=_.__e,_.ref&&h.ref!=_.ref&&(h.ref&&ve(h.ref,null,_),p.push(_.ref,_.__c||g,_)),v==null&&g!=null&&(v=g),(d=!!(4&_.__u))||h.__k===_.__k?(u=We(_,u,t,d),d&&h.__e&&(h.__e=null)):typeof _.type=="function"&&w!==void 0?u=w:g&&(u=g.nextSibling),_.__u&=-7);return n.__e=v,u}function Bt(t,e,n,i,r){var s,o,l,u,a,p=n.length,c=p,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[s]=X(null,o,null,null,null):ne(o)?o=t.__k[s]=X(j,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=X(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+h,o.__=t,o.__b=t.__b+1,l=null,(a=o.__i=Ht(o,n,u,c))!=-1&&(c--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(r>p?h--:r<p&&h++),typeof o.type!="function"&&(o.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<p;s++)(l=n[s])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=O(l)),Xe(l,l));return i}function We(t,e,n,i){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=We(r[s],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=O(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ht(t,e,n,i){var r,s,o,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(i>(p?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((a=e[o=r>=0?r--:s++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return o}return-1}function Ne(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Et.test(e)?n:n+"px"}function Q(t,e,n,i,r){var s,o;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||Ne(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Ne(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Ue,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n[F]=i[F]:(n[F]=ke,t.addEventListener(e,s?ge:de,s)):t.removeEventListener(e,s?ge:de,s);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 Me(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[V]==null)e[V]=ke++;else if(e[V]<n[F])return;return n(x.event?x.event(e):e)}}}function xe(t,e,n,i,r,s,o,l,u,a){var p,c,h,_,g,v,w,d,m,C,T,I,N,A,fe,P=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),s=[l=e.__e=n.__e]),(p=x.__b)&&p(e);e:if(typeof P=="function")try{if(d=e.props,m=P.prototype&&P.prototype.render,C=(p=P.contextType)&&i[p.__c],T=p?C?C.props.value:p.__:i,n.__c?w=(c=e.__c=n.__c).__=c.__E:(m?e.__c=c=new P(d,T):(e.__c=c=new J(d,T),c.constructor=P,c.render=Nt),C&&C.sub(c),c.state||(c.state={}),c.__n=i,h=c.__d=!0,c.__h=[],c._sb=[]),m&&c.__s==null&&(c.__s=c.state),m&&P.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=E({},c.__s)),E(c.__s,P.getDerivedStateFromProps(d,c.__s))),_=c.props,g=c.state,c.__v=e,h)m&&P.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),m&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(m&&P.getDerivedStateFromProps==null&&d!==_&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(d,T),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(d,c.__s,T)===!1){e.__v!=n.__v&&(c.props=d,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(M){M&&(M.__=e)}),Y.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(d,c.__s,T),m&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(_,g,v)})}if(c.context=T,c.props=d,c.__P=t,c.__e=!1,I=x.__r,N=0,m)c.state=c.__s,c.__d=!1,I&&I(e),p=c.render(c.props,c.state,c.context),Y.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,I&&I(e),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++N<25);c.state=c.__s,c.getChildContext!=null&&(i=E(E({},i),c.getChildContext())),m&&!h&&c.getSnapshotBeforeUpdate!=null&&(v=c.getSnapshotBeforeUpdate(_,g)),A=p!=null&&p.type===j&&p.key==null?Ve(p.props.children):p,l=Ge(t,ne(A)?A:[A],e,n,i,r,s,o,l,u,a),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),w&&(c.__E=c.__=null)}catch(M){if(e.__v=null,u||s!=null)if(M.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,e.__e=l}else{for(fe=s.length;fe--;)be(s[fe]);me(e)}else e.__e=n.__e,e.__k=n.__k,M.then||me(e);x.__e(M,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qt(n.__e,e,n,i,r,s,o,u,a);return(p=x.diffed)&&p(e),128&e.__u?void 0:l}function me(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(me))}function Qe(t,e,n){for(var i=0;i<n.length;i++)ve(n[i],n[++i],n[++i]);x.__c&&x.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){x.__e(s,r.__v)}})}function Ve(t){return typeof t!="object"||t==null||t.__b>0?t:ne(t)?t.map(Ve):E({},t)}function qt(t,e,n,i,r,s,o,l,u){var a,p,c,h,_,g,v,w=n.props||K,d=e.props,m=e.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(a=0;a<s.length;a++)if((_=s[a])&&"setAttribute"in _==!!m&&(m?_.localName==m:_.nodeType==3)){t=_,s[a]=null;break}}if(t==null){if(m==null)return document.createTextNode(d);t=document.createElementNS(r,m,d.is&&d),l&&(x.__m&&x.__m(e,s),l=!1),s=null}if(m==null)w===d||l&&t.data==d||(t.data=d);else{if(s=s&&te.call(t.childNodes),!l&&s!=null)for(w={},a=0;a<t.attributes.length;a++)w[(_=t.attributes[a]).name]=_.value;for(a in w)_=w[a],a=="dangerouslySetInnerHTML"?c=_:a=="children"||a in d||a=="value"&&"defaultValue"in d||a=="checked"&&"defaultChecked"in d||Q(t,a,null,_,r);for(a in d)_=d[a],a=="children"?h=_:a=="dangerouslySetInnerHTML"?p=_:a=="value"?g=_:a=="checked"?v=_:l&&typeof _!="function"||w[a]===_||Q(t,a,_,w[a],r);if(p)l||c&&(p.__html==c.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(c&&(t.innerHTML=""),Ge(e.type=="template"?t.content:t,ne(h)?h:[h],e,n,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:n.__k&&O(n,0),l,u),s!=null)for(a=s.length;a--;)be(s[a]);l||(a="value",m=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[a]||m=="progress"&&!g||m=="option"&&g!=w[a])&&Q(t,a,g,w[a],r),a="checked",v!=null&&v!=t[a]&&Q(t,a,v,w[a],r))}return t}function ve(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){x.__e(r,n)}}function Xe(t,e,n){var i,r;if(x.unmount&&x.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||ve(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){x.__e(s,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Xe(i[r],e,n||typeof t.type!="function");n||be(t.__e),t.__c=t.__=t.__e=void 0}function Nt(t,e,n){return this.constructor(t,n)}function Je(t,e,n){var i,r,s,o;e==document&&(e=document.documentElement),x.__&&x.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],xe(e,t=(!i&&n||e).__k=Lt(j,null,[t]),r||K,K,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?te.call(e.childNodes):null,s,!i&&n?n:r?r.__e:e.firstChild,i,o),Qe(s,t,o)}te=Y.slice,x={__e:function(t,e,n,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),o=r.__d),o)return r.__E=r}catch(l){t=l}throw t}},Oe=0,zt=function(t){return t!=null&&t.constructor===void 0},J.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=E({},this.state),typeof t=="function"&&(t=t(E({},n),this.props)),t&&E(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),qe(this))},J.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qe(this))},J.prototype.render=j,B=[],je=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fe=function(t,e){return t.__v.__b-e.__v.__b},ee.__r=0,_e=Math.random().toString(8),V="__d"+_e,F="__a"+_e,Ue=/(PointerCapture)$|Capture$/i,ke=0,de=Me(!1),ge=Me(!0),It=0;var ie,y,we,Ke,ye=0,ot=[],S=x,Ye=S.__b,et=S.__r,tt=S.diffed,nt=S.__c,rt=S.unmount,it=S.__;function lt(t,e){S.__h&&S.__h(y,t,ye||e),ye=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function $(t){return ye=1,Mt(ct,t)}function Mt(t,e,n){var i=lt(ie++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):ct(void 0,e),function(l){var u=i.__N?i.__N[0]:i.__[0],a=i.t(u,l);u!==a&&(i.__N=[a,i.__[1]],i.__c.setState({}))}],i.__c=y,!y.__f)){var r=function(l,u,a){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!s||s.call(this,l,u,a);var c=i.__c.props!==l;return p.some(function(h){if(h.__N){var _=h.__[0];h.__=h.__N,h.__N=void 0,_!==h.__[0]&&(c=!0)}}),s&&s.call(this,l,u,a)||c};y.__f=!0;var s=y.shouldComponentUpdate,o=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=s;s=void 0,r(l,u,a),s=p}o&&o.call(this,l,u,a)},y.shouldComponentUpdate=r}return i.__N||i.__}function at(t,e){var n=lt(ie++,3);!S.__s&&Ft(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ot(){for(var t;t=ot.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(re),e.__h.some(Se),e.__h=[]}catch(n){e.__h=[],S.__e(n,t.__v)}}}S.__b=function(t){y=null,Ye&&Ye(t)},S.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),it&&it(t,e)},S.__r=function(t){et&&et(t),ie=0;var e=(y=t.__c).__H;e&&(we===y?(e.__h=[],y.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(re),e.__h.some(Se),e.__h=[],ie=0)),we=y},S.diffed=function(t){tt&&tt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ot.push(e)!==1&&Ke===S.requestAnimationFrame||((Ke=S.requestAnimationFrame)||jt)(Ot)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),we=y=null},S.__c=function(t,e){e.some(function(n){try{n.__h.some(re),n.__h=n.__h.filter(function(i){return!i.__||Se(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],S.__e(i,n.__v)}}),nt&&nt(t,e)},S.unmount=function(t){rt&&rt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(i){try{re(i)}catch(r){e=r}}),n.__H=void 0,e&&S.__e(e,n.__v))};var st=typeof requestAnimationFrame=="function";function jt(t){var e,n=function(){clearTimeout(i),st&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);st&&(e=requestAnimationFrame(n))}function re(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function Se(t){var e=y;t.__c=t.__(),y=e}function Ft(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function ct(t,e){return typeof e=="function"?e(t):e}var Ut=0;function f(t,e,n,i,r,s){e||(e={});var o,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?o=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ut,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(l in o)u[l]===void 0&&(u[l]=o[l]);return x.vnode&&x.vnode(a),a}function ut({doc:t,comments:e,activeSection:n,onNavigate:i}){let r=new Set(e.map(o=>o.sectionId));if(t.mode==="plan"){let o=t.sections.filter(l=>l.level===2);return f("nav",{class:"toc-panel",children:o.map(l=>{let u=t.sections.filter(a=>a.parent===l.id);return f("div",{class:"toc-milestone",children:[f("h3",{children:l.heading}),f("ul",{children:u.map(a=>f("li",{class:`toc-item${n===a.id?" active":""}${r.has(a.id)?" commented":""}`,onClick:()=>i(a.id),children:[f("span",{class:"toc-marker",children:r.has(a.id)?"\u2713":"\xA0"}),f("span",{class:"toc-id",children:a.id}),f("span",{class:"toc-heading",children:a.heading})]},a.id))})]},l.id)})})}let s=t.sections.filter(o=>o.level>=2);return f("nav",{class:"toc-panel",children:f("ul",{children:s.map(o=>f("li",{class:`toc-item${n===o.id?" active":""}${r.has(o.id)?" commented":""}`,onClick:()=>i(o.id),children:[f("span",{class:"toc-marker",children:r.has(o.id)?"\u2713":"\xA0"}),f("span",{class:"toc-heading",children:o.heading})]},o.id))})})}function $e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=$e();function gt(t){q=t}var G={exec:()=>null};function b(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(R.caret,"$1"),n=n.replace(r,o),i},getRegex:()=>new RegExp(n,e)};return i}var R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Zt=/^(?:[ \t]*(?:\n|$))+/,Gt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,W=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ae=/(?:[*+-]|\d{1,9}[.)])/,mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,kt=b(mt).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vt=b(mt).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xt=/^[^\n]+/,ze=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jt=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ze).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kt=b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ae).getRegex(),ue="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ie=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yt=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ie).replace("tag",ue).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bt=b(Pe).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex(),en=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bt).getRegex(),Ee={blockquote:en,code:Gt,def:Jt,fences:Wt,heading:Qt,hr:W,html:Yt,lheading:kt,list:Kt,newline:Zt,paragraph:bt,table:G,text:Xt},pt=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex(),tn={...Ee,lheading:Vt,table:pt,paragraph:b(Pe).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex()},nn={...Ee,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ie).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(Pe).replace("hr",W).replace("heading",` *#{1,6} *[^
|
|
221
|
+
]`).replace("lheading",kt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xt=/^( {2,}|\\)\n(?!\s*$)/,on=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pe=/[\p{P}\p{S}]/u,Le=/[\s\p{P}\p{S}]/u,vt=/[^\s\p{P}\p{S}]/u,ln=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Le).getRegex(),wt=/(?!~)[\p{P}\p{S}]/u,an=/(?!~)[\s\p{P}\p{S}]/u,cn=/(?:[^\s\p{P}\p{S}]|~)/u,un=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,yt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,pn=b(yt,"u").replace(/punct/g,pe).getRegex(),hn=b(yt,"u").replace(/punct/g,wt).getRegex(),St="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fn=b(St,"gu").replace(/notPunctSpace/g,vt).replace(/punctSpace/g,Le).replace(/punct/g,pe).getRegex(),_n=b(St,"gu").replace(/notPunctSpace/g,cn).replace(/punctSpace/g,an).replace(/punct/g,wt).getRegex(),dn=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vt).replace(/punctSpace/g,Le).replace(/punct/g,pe).getRegex(),gn=b(/\\(punct)/,"gu").replace(/punct/g,pe).getRegex(),mn=b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),kn=b(Ie).replace("(?:-->|$)","-->").getRegex(),bn=b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",kn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),le=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xn=b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",le).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ct=b(/^!?\[(label)\]\[(ref)\]/).replace("label",le).replace("ref",ze).getRegex(),Tt=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",ze).getRegex(),vn=b("reflink|nolink(?!\\()","g").replace("reflink",Ct).replace("nolink",Tt).getRegex(),De={_backpedal:G,anyPunctuation:gn,autolink:mn,blockSkip:un,br:xt,code:sn,del:G,emStrongLDelim:pn,emStrongRDelimAst:fn,emStrongRDelimUnd:dn,escape:rn,link:xn,nolink:Tt,punctuation:ln,reflink:Ct,reflinkSearch:vn,tag:bn,text:on,url:G},wn={...De,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",le).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le).getRegex()},Ce={...De,emStrongRDelimAst:_n,emStrongLDelim:hn,url:b(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},yn={...Ce,br:b(xt).replace("{2,}","*").getRegex(),text:b(Ce.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},se={normal:Ee,gfm:tn,pedantic:nn},U={normal:De,gfm:Ce,breaks:yn,pedantic:wn},Sn={"&":"&","<":"<",">":">",'"':""","'":"'"},ht=t=>Sn[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,ht)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,ht);return t}function ft(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function _t(t,e){let n=t.replace(R.findPipe,(s,o,l)=>{let u=!1,a=o;for(;--a>=0&&l[a]==="\\";)u=!u;return u?"|":" |"}),i=n.split(R.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(R.slashPipe,"|");return i}function Z(t,e,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i;){let s=t.charAt(i-r-1);if(s===e&&!n)r++;else if(s!==e&&n)r++;else break}return t.slice(0,i-r)}function Cn(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])n++;else if(t[i]===e[1]&&(n--,n<0))return i;return n>0?-2:-1}function dt(t,e,n,i,r){let s=e.href,o=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,u}function Tn(t,e,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
|
|
222
|
+
`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=r.length?s.slice(r.length):s}).join(`
|
|
223
|
+
`)}var ae=class{options;rules;lexer;constructor(t){this.options=t||q}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z(n,`
|
|
224
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=Tn(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let i=Z(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Z(e[0],`
|
|
225
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Z(e[0],`
|
|
226
|
+
`).split(`
|
|
227
|
+
`),i="",r="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let a=l.join(`
|
|
228
|
+
`),p=a.replace(this.rules.other.blockquoteSetextReplace,`
|
|
229
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
230
|
+
${a}`:a,r=r?`${r}
|
|
231
|
+
${p}`:p;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=c,n.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let _=h,g=_.raw+`
|
|
232
|
+
`+n.join(`
|
|
233
|
+
`),v=this.blockquote(g);s[s.length-1]=v,i=i.substring(0,i.length-_.raw.length)+v.raw,r=r.substring(0,r.length-_.text.length)+v.text;break}else if(h?.type==="list"){let _=h,g=_.raw+`
|
|
234
|
+
`+n.join(`
|
|
235
|
+
`),v=this.list(g);s[s.length-1]=v,i=i.substring(0,i.length-h.raw.length)+v.raw,r=r.substring(0,r.length-_.raw.length)+v.raw,n=g.substring(s.at(-1).raw.length).split(`
|
|
236
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let u=!1,a="",p="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;a=e[0],t=t.substring(a.length);let c=e[2].split(`
|
|
237
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,d=>" ".repeat(3*d.length)),h=t.split(`
|
|
238
|
+
`,1)[0],_=!c.trim(),g=0;if(this.options.pedantic?(g=2,p=c.trimStart()):_?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=c.slice(g),g+=e[1].length),_&&this.rules.other.blankLine.test(h)&&(a+=h+`
|
|
239
|
+
`,t=t.substring(h.length+1),u=!0),!u){let d=this.rules.other.nextBulletRegex(g),m=this.rules.other.hrRegex(g),C=this.rules.other.fencesBeginRegex(g),T=this.rules.other.headingBeginRegex(g),I=this.rules.other.htmlBeginRegex(g);for(;t;){let N=t.split(`
|
|
240
|
+
`,1)[0],A;if(h=N,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),C.test(h)||T.test(h)||I.test(h)||d.test(h)||m.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=g||!h.trim())p+=`
|
|
241
|
+
`+A.slice(g);else{if(_||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(c)||T.test(c)||m.test(c))break;p+=`
|
|
242
|
+
`+h}!_&&!h.trim()&&(_=!0),a+=N+`
|
|
243
|
+
`,t=t.substring(N.length+1),c=A.slice(g)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(o=!0));let v=null,w;this.options.gfm&&(v=this.rules.other.listIsTask.exec(p),v&&(w=v[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:a,task:!!v,checked:w,loose:!1,text:p,tokens:[]}),r.raw+=a}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){let a=r.items[u].tokens.filter(c=>c.type==="space"),p=a.length>0&&a.some(c=>this.rules.other.anyLine.test(c.raw));r.loose=p}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:i,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=_t(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
244
|
+
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of r)s.rows.push(_t(o,s.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[u]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
245
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Cn(e[2],"()");if(s===-2)return;if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),dt(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return dt(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...i[0]].length-1,o,l,u=s,a=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(i=p.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(l=[...o].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&s%3&&!((s+l)%3)){a+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+a);let c=[...i[0]][0].length,h=t.slice(0,s+i.index+c+l);if(Math.min(s,l)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let _=h.slice(2,-2);return{type:"strong",raw:h,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,i;return e[2]==="@"?(n=e[1],i="mailto:"+n):(n=e[1],i=n),{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},L=class Te{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||q,this.options.tokenizer=this.options.tokenizer||new ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:R,block:se.normal,inline:U.normal};this.options.pedantic?(n.block=se.pedantic,n.inline=U.pedantic):this.options.gfm&&(n.block=se.gfm,this.options.breaks?n.inline=U.breaks:n.inline=U.gfm),this.tokenizer.rules=n}static get rules(){return{block:se,inline:U}}static lex(e,n){return new Te(n).lex(e)}static lexInline(e,n){return new Te(n).inlineTokens(e)}lex(e){e=e.replace(R.carriageReturn,`
|
|
246
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],i=!1){for(this.options.pedantic&&(e=e.replace(R.tabCharGlobal," ").replace(R.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let o=n.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
|
|
247
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
248
|
+
`+r.raw,o.text+=`
|
|
249
|
+
`+r.text,this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
250
|
+
`+r.raw,o.text+=`
|
|
251
|
+
`+r.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(a=>{u=a.call({lexer:this},l),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let o=n.at(-1);i&&o?.type==="paragraph"?(o.raw+=`
|
|
252
|
+
`+r.raw,o.text+=`
|
|
253
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r),i=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=`
|
|
254
|
+
`+r.raw,o.text+=`
|
|
255
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let i=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(a=>(l=a.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let a=n.at(-1);l.type==="text"&&a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,i,o)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let u=e;if(this.options.extensions?.startInline){let a=1/0,p=e.slice(1),c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},p),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let a=n.at(-1);a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return n}},ce=class{options;parser;constructor(t){this.options=t||q}space(t){return""}code({text:t,lang:e,escaped:n}){let i=(e||"").match(R.notSpaceStart)?.[0],r=t.replace(R.endingNewline,"")+`
|
|
256
|
+
`;return i?'<pre><code class="language-'+z(i)+'">'+(n?r:z(r,!0))+`</code></pre>
|
|
257
|
+
`:"<pre><code>"+(n?r:z(r,!0))+`</code></pre>
|
|
258
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
259
|
+
${this.parser.parse(t)}</blockquote>
|
|
260
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
261
|
+
`}hr(t){return`<hr>
|
|
262
|
+
`}list(t){let e=t.ordered,n=t.start,i="";for(let o=0;o<t.items.length;o++){let l=t.items[o];i+=this.listitem(l)}let r=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
|
|
263
|
+
`+i+"</"+r+`>
|
|
264
|
+
`}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+z(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
265
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
266
|
+
`}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
267
|
+
<thead>
|
|
268
|
+
`+e+`</thead>
|
|
269
|
+
`+i+`</table>
|
|
270
|
+
`}tablerow({text:t}){return`<tr>
|
|
271
|
+
${t}</tr>
|
|
272
|
+
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
273
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let i=this.parser.parseInline(n),r=ft(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+z(e)+'"'),s+=">"+i+"</a>",s}image({href:t,title:e,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=ft(t);if(r===null)return z(n);t=r;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${z(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Be=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},D=class Re{options;renderer;textRenderer;constructor(e){this.options=e||q,this.options.renderer=this.options.renderer||new ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Be}static parse(e,n){return new Re(n).parse(e)}static parseInline(e,n){return new Re(n).parseInline(e)}parse(e,n=!0){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){i+=u||"";continue}}let o=s;switch(o.type){case"space":{i+=this.renderer.space(o);continue}case"hr":{i+=this.renderer.hr(o);continue}case"heading":{i+=this.renderer.heading(o);continue}case"code":{i+=this.renderer.code(o);continue}case"table":{i+=this.renderer.table(o);continue}case"blockquote":{i+=this.renderer.blockquote(o);continue}case"list":{i+=this.renderer.list(o);continue}case"html":{i+=this.renderer.html(o);continue}case"paragraph":{i+=this.renderer.paragraph(o);continue}case"text":{let l=o,u=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],u+=`
|
|
274
|
+
`+this.renderer.text(l);n?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,n=this.renderer){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let o=s;switch(o.type){case"escape":{i+=n.text(o);break}case"html":{i+=n.html(o);break}case"link":{i+=n.link(o);break}case"image":{i+=n.image(o);break}case"strong":{i+=n.strong(o);break}case"em":{i+=n.em(o);break}case"codespan":{i+=n.codespan(o);break}case"br":{i+=n.br(o);break}case"del":{i+=n.del(o);break}case"text":{i+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},oe=class{options;block;constructor(t){this.options=t||q}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?L.lex:L.lexInline}provideParser(){return this.block?D.parse:D.parseInline}},Rn=class{defaults=$e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=D;Renderer=ce;TextRenderer=Be;Lexer=L;Tokenizer=ae;Hooks=oe;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let i of t)switch(n=n.concat(e.call(this,i)),i.type){case"table":{let r=i;for(let s of r.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of r.rows)for(let o of s)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=i;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=i;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(s=>{let o=r[s].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=e.renderers[r.name];s?e.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),n.renderer){let r=this.defaults.renderer||new ce(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new ae(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new oe;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=r[o];oe.passThroughHooks.has(s)?r[o]=a=>{if(this.defaults.async)return Promise.resolve(l.call(r,a)).then(c=>u.call(r,c));let p=l.call(r,a);return u.call(r,p)}:r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),r&&(l=l.concat(r.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return L.lex(t,e??this.defaults)}parser(t,e){return D.parse(t,e??this.defaults)}parseMarkdown(t){return(n,i)=>{let r={...i},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);let l=s.hooks?s.hooks.provideLexer():t?L.lex:L.lexInline,u=s.hooks?s.hooks.provideParser():t?D.parse:D.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(a=>l(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>u(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let a=l(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let p=u(a,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(a){return o(a)}}}onError(t,e){return n=>{if(n.message+=`
|
|
275
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}}},H=new Rn;function k(t,e){return H.parse(t,e)}k.options=k.setOptions=function(t){return H.setOptions(t),k.defaults=H.defaults,gt(k.defaults),k};k.getDefaults=$e;k.defaults=q;k.use=function(...t){return H.use(...t),k.defaults=H.defaults,gt(k.defaults),k};k.walkTokens=function(t,e){return H.walkTokens(t,e)};k.parseInline=H.parseInline;k.Parser=D;k.parser=D.parse;k.Renderer=ce;k.TextRenderer=Be;k.Lexer=L;k.lexer=L.lex;k.Tokenizer=ae;k.Hooks=oe;k.parse=k;var Bn=k.options,Hn=k.setOptions,qn=k.use,Nn=k.walkTokens,Mn=k.parseInline;var On=D.parse,jn=L.lex;function Rt({section:t,mode:e,isActive:n,onComment:i}){let r=e==="plan"?t.level===3:t.level>=2,s=e==="plan"&&t.level===3&&t.dependencies,o=k.parse(t.body);return f("div",{id:`section-${t.id}`,class:`section-view${n?" active":""}`,children:[f("h2",{children:t.heading}),s&&f("div",{class:"section-meta",children:[t.dependencies.dependsOn.length>0&&f("span",{children:["Depends on: ",t.dependencies.dependsOn.join(", ")]}),t.dependencies.blocks.length>0&&f("span",{children:["Blocks: ",t.dependencies.blocks.join(", ")]}),t.relatedFiles&&t.relatedFiles.length>0&&f("span",{children:["Files: ",t.relatedFiles.join(", ")]}),t.verification&&f("span",{children:["Verify: ",t.verification]})]}),f("div",{class:"section-body",dangerouslySetInnerHTML:{__html:o}}),r&&f("button",{class:"add-comment-btn",onClick:i,children:"Add Comment"})]})}function he({sectionId:t,onSubmit:e,onCancel:n,initialText:i=""}){let[r,s]=$(i);return f("div",{class:"comment-input",children:[f("textarea",{placeholder:"Add a comment...",value:r,onInput:l=>s(l.target.value)}),f("div",{class:"comment-input-actions",children:[f("button",{class:"add-btn",onClick:()=>{let l=r.trim();l&&(e(t,l),s(""))},children:"Add"}),f("button",{class:"cancel-btn",onClick:n,children:"Cancel"})]})]})}function $t({comment:t,sectionHeading:e,onEdit:n,onDelete:i}){let[r,s]=$(!1);return r?f(he,{sectionId:t.sectionId,initialText:t.text,onSubmit:(o,l)=>{n(l),s(!1)},onCancel:()=>s(!1)}):f("div",{class:"comment-card",children:[f("div",{class:"comment-section",children:e}),f("div",{class:"comment-text",children:t.text}),f("div",{class:"comment-actions",children:[f("button",{onClick:()=>s(!0),children:"Edit"}),f("button",{class:"delete",onClick:i,children:"Delete"})]})]})}function At({comments:t,sections:e,commentingSection:n,onAdd:i,onEdit:r,onDelete:s,onCancelComment:o}){let l=a=>e.find(p=>p.id===a)?.heading??a,u=new Map;return t.forEach((a,p)=>{let c=u.get(a.sectionId)||[];c.push({comment:a,index:p}),u.set(a.sectionId,c)}),f("aside",{class:"comment-sidebar",children:[f("h2",{children:["Comments (",t.length,")"]}),n&&f("div",{class:"commenting-for",children:[f("h3",{children:["Commenting on: ",l(n)]}),f(he,{sectionId:n,onSubmit:i,onCancel:o})]}),Array.from(u.entries()).map(([a,p])=>f("div",{class:"comment-group",children:[f("h3",{children:l(a)}),p.map(({comment:c,index:h})=>f($t,{comment:c,sectionHeading:"",onEdit:_=>r(h,_),onDelete:()=>s(h)},h))]},a)),t.length===0&&!n&&f("p",{class:"no-comments",children:'No comments yet. Click "Add Comment" on a section to start.'})]})}function Pt(){let[t,e]=$(null),[n,i]=$([]),[r,s]=$(null),[o,l]=$(null),[u,a]=$(!1),[p,c]=$(null);at(()=>{fetch("/api/doc").then(d=>d.json()).then(d=>e(d.document)).catch(d=>c(d.message))},[]);let h=d=>{s(d),document.getElementById(`section-${d}`)?.scrollIntoView({behavior:"smooth"})},_=(d,m)=>{i(C=>[...C,{sectionId:d,text:m,timestamp:new Date}]),l(null)},g=(d,m)=>{i(C=>C.map((T,I)=>I===d?{...T,text:m}:T))},v=d=>{i(m=>m.filter((C,T)=>T!==d))},w=async()=>{try{(await fetch("/api/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n})})).ok&&a(!0)}catch{c("Failed to submit review")}};return u?f("div",{class:"submitted",children:"Review submitted. You can close this tab."}):p?f("div",{class:"loading",children:["Error: ",p]}):t?f("div",{class:"app",children:[f("header",{class:"top-bar",children:[f("h1",{children:t.title}),f("span",{class:"mode-badge",children:t.mode}),f("span",{class:"comment-count",children:[n.length," comment",n.length!==1?"s":""]}),f("button",{class:"submit-btn",onClick:w,disabled:n.length===0,children:"Submit Review"})]}),f("div",{class:"panels",children:[f(ut,{doc:t,comments:n,activeSection:r,onNavigate:h}),f("main",{class:"content-area",children:t.sections.map(d=>f(Rt,{section:d,mode:t.mode,isActive:r===d.id,onComment:()=>l(d.id)},d.id))}),f(At,{comments:n,sections:t.sections,commentingSection:o,onAdd:_,onEdit:g,onDelete:v,onCancelComment:()=>l(null)})]})]}):f("div",{class:"loading",children:"Loading..."})}Je(f(Pt,{}),document.getElementById("app"));})();
|
|
276
|
+
</script>
|
|
277
|
+
</body>
|
|
278
|
+
</html>
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,8 @@ import { parse } from './parser.js';
|
|
|
8
8
|
import { navigate } from './navigator.js';
|
|
9
9
|
import { formatReview } from './formatter.js';
|
|
10
10
|
import { writeOutput, isClaudeAvailable } from './output.js';
|
|
11
|
+
import { HttpTransport } from './transport.js';
|
|
12
|
+
import { execSync as execSyncCmd } from 'node:child_process';
|
|
11
13
|
const program = new Command();
|
|
12
14
|
program
|
|
13
15
|
.name('plan-review')
|
|
@@ -17,6 +19,7 @@ program
|
|
|
17
19
|
.option('-o, --output <target>', 'Output target: stdout, clipboard, file, claude')
|
|
18
20
|
.option('--output-file <path>', 'Custom output file path (with --output file)')
|
|
19
21
|
.option('--split-by <strategy>', 'Force split strategy: heading, separator')
|
|
22
|
+
.option('--browser', 'Open browser-based review UI')
|
|
20
23
|
.action(async (file, opts) => {
|
|
21
24
|
try {
|
|
22
25
|
await run(file, opts);
|
|
@@ -57,9 +60,29 @@ async function run(file, opts) {
|
|
|
57
60
|
: 'auto';
|
|
58
61
|
const doc = parse(input, splitStrategy);
|
|
59
62
|
console.error(chalk.dim(`Detected mode: ${doc.mode} | ${doc.sections.length} sections`));
|
|
60
|
-
// Navigate (interactive review)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
// Navigate (interactive review or browser)
|
|
64
|
+
let reviewed;
|
|
65
|
+
if (opts.browser) {
|
|
66
|
+
const transport = new HttpTransport();
|
|
67
|
+
transport.sendDocument(doc);
|
|
68
|
+
const reviewPromise = new Promise((resolve) => {
|
|
69
|
+
transport.onReviewSubmit(resolve);
|
|
70
|
+
});
|
|
71
|
+
const { url } = await transport.start(0);
|
|
72
|
+
process.stderr.write(`Review server running at ${url}\n`);
|
|
73
|
+
try {
|
|
74
|
+
execSyncCmd(`open ${url}`, { stdio: 'ignore' });
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
process.stderr.write(`Open ${url} in your browser\n`);
|
|
78
|
+
}
|
|
79
|
+
doc.comments = await reviewPromise;
|
|
80
|
+
await transport.stop();
|
|
81
|
+
reviewed = doc;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
reviewed = await navigate(doc, inputFromStdin);
|
|
85
|
+
}
|
|
63
86
|
// Determine output target after review is complete
|
|
64
87
|
let outputTarget;
|
|
65
88
|
if (opts.output !== undefined) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CAAC,2DAA2D,CAAC;KACxE,OAAO,CAAC,OAAO,CAAC;KAChB,QAAQ,CAAC,QAAQ,EAAE,4CAA4C,CAAC;KAChE,MAAM,CAAC,uBAAuB,EAAE,gDAAgD,CAAC;KACjF,MAAM,CAAC,sBAAsB,EAAE,8CAA8C,CAAC;KAC9E,MAAM,CAAC,uBAAuB,EAAE,0CAA0C,CAAC;KAC3E,MAAM,CAAC,WAAW,EAAE,8BAA8B,CAAC;KACnD,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,IAAmF,EAAE,EAAE;IAC9H,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,KAAK,UAAU,GAAG,CAChB,IAAwB,EACxB,IAAmF;IAEnF,kEAAkE;IAClE,MAAM,YAAY,GAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/E,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,cAAc,GAAG,IAAI,CAAC,MAAsB,CAAC;QACnD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,MAAM,WAAW,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9F,CAAC;QACD,8DAA8D;QAC9D,IAAI,cAAc,KAAK,QAAQ,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACxD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAC;YAC1D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC,CAAC;YACpF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED,gDAAgD;IAChD,MAAM,cAAc,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;IACrD,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ;IACR,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAkB;QACnE,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,WAAoB;YACrD,CAAC,CAAC,MAAe,CAAC;IACpB,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAExC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC;IAEzF,2CAA2C;IAC3C,IAAI,QAAQ,CAAC;IACb,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,IAAI,aAAa,EAAE,CAAC;QACtC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,aAAa,GAAG,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,EAAE;YAC7D,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,GAAG,IAAI,CAAC,CAAC;QAE1D,IAAI,CAAC;YACH,WAAW,CAAC,QAAQ,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,oBAAoB,CAAC,CAAC;QACxD,CAAC;QAED,GAAG,CAAC,QAAQ,GAAG,MAAM,aAAa,CAAC;QACnC,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,QAAQ,GAAG,GAAG,CAAC;IACjB,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IACjD,CAAC;IAED,mDAAmD;IACnD,IAAI,YAA0B,CAAC;IAC/B,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9B,YAAY,GAAG,IAAI,CAAC,MAAsB,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,YAAY,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,CAAC;QACxD,4CAA4C;QAC5C,IAAI,YAAY,KAAK,QAAQ,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAC;YAC1D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC,CAAC;YACpF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC;YACvD,YAAY,GAAG,QAAQ,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACtF,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,cAAuB;IACvD,MAAM,QAAQ,GAAG,cAAc;QAC7B,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC;QACxD,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAElB,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QACnD,EAAE,CAAC,QAAQ,CACT,KAAK,CAAC,IAAI,CAAC,qDAAqD,CAAC,EACjE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CACvC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,KAAK,EAAE,CAAC;IAEX,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG,CAAC;QAAC,KAAK,QAAQ,CAAC,CAAC,OAAO,QAAQ,CAAC;QACzC,KAAK,GAAG,CAAC;QAAC,KAAK,WAAW,CAAC,CAAC,OAAO,WAAW,CAAC;QAC/C,KAAK,GAAG,CAAC;QAAC,KAAK,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC;QACrC,KAAK,GAAG,CAAC;QAAC,KAAK,QAAQ,CAAC,CAAC,OAAO,QAAQ,CAAC;QACzC,OAAO,CAAC,CAAC,OAAO,QAAQ,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,IAAwB;IACzC,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,0BAA0B;IAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACzB,OAAO,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,qCAAqC;IACrC,OAAO,CAAC,IAAI,EAAE,CAAC;IACf,OAAO,EAAE,CAAC,CAAC,cAAc;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAssetHtml(): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
// When running from source (vitest), look for pre-built dist/browser/index.html
|
|
6
|
+
// When running from dist, the sibling ../browser/ path is used
|
|
7
|
+
function resolveHtmlPath() {
|
|
8
|
+
const siblingPath = join(__dirname, '..', 'browser', 'index.html');
|
|
9
|
+
if (existsSync(siblingPath))
|
|
10
|
+
return siblingPath;
|
|
11
|
+
// Fallback: walk up to project root and look in dist/browser/
|
|
12
|
+
const projectRoot = join(__dirname, '..', '..');
|
|
13
|
+
const distPath = join(projectRoot, 'dist', 'browser', 'index.html');
|
|
14
|
+
if (existsSync(distPath))
|
|
15
|
+
return distPath;
|
|
16
|
+
throw new Error(`Browser HTML not found. Run 'npm run build' first.\nLooked in:\n ${siblingPath}\n ${distPath}`);
|
|
17
|
+
}
|
|
18
|
+
let cached = null;
|
|
19
|
+
export function getAssetHtml() {
|
|
20
|
+
if (!cached) {
|
|
21
|
+
cached = readFileSync(resolveHtmlPath(), 'utf-8');
|
|
22
|
+
}
|
|
23
|
+
return cached;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/server/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,gFAAgF;AAChF,+DAA+D;AAC/D,SAAS,eAAe;IACtB,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACnE,IAAI,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,WAAW,CAAC;IAEhD,8DAA8D;IAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACpE,IAAI,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE1C,MAAM,IAAI,KAAK,CAAC,qEAAqE,WAAW,OAAO,QAAQ,EAAE,CAAC,CAAC;AACrH,CAAC;AAED,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC,MAAM,UAAU,YAAY;IAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,YAAY,CAAC,eAAe,EAAE,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import type { PlanDocument, ReviewComment } from '../types.js';
|
|
3
|
+
export interface RouteContext {
|
|
4
|
+
getDocument: () => PlanDocument;
|
|
5
|
+
onSubmit: (comments: ReviewComment[]) => void;
|
|
6
|
+
getAssetHtml: () => string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createRouteHandler(ctx: RouteContext): (req: IncomingMessage, res: ServerResponse) => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export function createRouteHandler(ctx) {
|
|
2
|
+
return (req, res) => {
|
|
3
|
+
const { method, url } = req;
|
|
4
|
+
if (method === 'GET' && url === '/') {
|
|
5
|
+
const html = ctx.getAssetHtml();
|
|
6
|
+
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
7
|
+
res.end(html);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (method === 'GET' && url === '/api/doc') {
|
|
11
|
+
const doc = ctx.getDocument();
|
|
12
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
13
|
+
res.end(JSON.stringify({ document: doc }));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (method === 'POST' && url === '/api/review') {
|
|
17
|
+
let body = '';
|
|
18
|
+
req.on('data', (chunk) => { body += chunk.toString(); });
|
|
19
|
+
req.on('end', () => {
|
|
20
|
+
try {
|
|
21
|
+
const parsed = JSON.parse(body);
|
|
22
|
+
const comments = parsed.comments;
|
|
23
|
+
if (!Array.isArray(comments)) {
|
|
24
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
25
|
+
res.end(JSON.stringify({ error: 'comments must be an array' }));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
ctx.onSubmit(comments);
|
|
29
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
30
|
+
res.end(JSON.stringify({ success: true }));
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
34
|
+
res.end(JSON.stringify({ error: 'Invalid JSON' }));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
40
|
+
res.end('Not Found');
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/server/routes.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,kBAAkB,CAAC,GAAiB;IAClD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAClB,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;QAE5B,IAAI,MAAM,KAAK,KAAK,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;YAChC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,0BAA0B,EAAE,CAAC,CAAC;YACnE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACd,OAAO;QACT,CAAC;QAED,IAAI,MAAM,KAAK,KAAK,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YAC3C,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YAC9B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAC3C,OAAO;QACT,CAAC;QAED,IAAI,MAAM,KAAK,MAAM,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;YAC/C,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,GAAG,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACjE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjB,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBAChC,MAAM,QAAQ,GAAoB,MAAM,CAAC,QAAQ,CAAC;oBAClD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;wBAC7B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;wBAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC,CAAC;wBAChE,OAAO;oBACT,CAAC;oBACD,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;oBACvB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;oBAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC7C,CAAC;gBAAC,MAAM,CAAC;oBACP,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;oBAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;QACrD,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Server } from 'node:http';
|
|
2
|
+
import { type RouteContext } from './routes.js';
|
|
3
|
+
export declare function createReviewServer(ctx: RouteContext): Server;
|
|
4
|
+
export declare function startServer(server: Server, port: number): Promise<{
|
|
5
|
+
url: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function stopServer(server: Server): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
import { createRouteHandler } from './routes.js';
|
|
3
|
+
export function createReviewServer(ctx) {
|
|
4
|
+
return createServer(createRouteHandler(ctx));
|
|
5
|
+
}
|
|
6
|
+
export function startServer(server, port) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
server.on('error', reject);
|
|
9
|
+
server.listen(port, () => {
|
|
10
|
+
const addr = server.address();
|
|
11
|
+
const actualPort = typeof addr === 'object' && addr ? addr.port : port;
|
|
12
|
+
resolve({ url: `http://localhost:${actualPort}` });
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function stopServer(server) {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
server.close((err) => (err ? reject(err) : resolve()));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAqB,MAAM,aAAa,CAAC;AAEpE,MAAM,UAAU,kBAAkB,CAAC,GAAiB;IAClD,OAAO,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,IAAY;IACtD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;YACvB,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,UAAU,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACvE,OAAO,CAAC,EAAE,GAAG,EAAE,oBAAoB,UAAU,EAAE,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PlanDocument, ReviewComment } from './types.js';
|
|
2
|
+
export interface Transport {
|
|
3
|
+
sendDocument(doc: PlanDocument): void;
|
|
4
|
+
onReviewSubmit(handler: (comments: ReviewComment[]) => void): void;
|
|
5
|
+
start(port: number): Promise<{
|
|
6
|
+
url: string;
|
|
7
|
+
}>;
|
|
8
|
+
stop(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare class HttpTransport implements Transport {
|
|
11
|
+
private doc;
|
|
12
|
+
private submitHandler;
|
|
13
|
+
private server;
|
|
14
|
+
sendDocument(doc: PlanDocument): void;
|
|
15
|
+
onReviewSubmit(handler: (comments: ReviewComment[]) => void): void;
|
|
16
|
+
start(port: number): Promise<{
|
|
17
|
+
url: string;
|
|
18
|
+
}>;
|
|
19
|
+
stop(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createReviewServer, startServer, stopServer } from './server/server.js';
|
|
2
|
+
import { getAssetHtml } from './server/assets.js';
|
|
3
|
+
export class HttpTransport {
|
|
4
|
+
doc = null;
|
|
5
|
+
submitHandler = null;
|
|
6
|
+
server = null;
|
|
7
|
+
sendDocument(doc) {
|
|
8
|
+
this.doc = doc;
|
|
9
|
+
}
|
|
10
|
+
onReviewSubmit(handler) {
|
|
11
|
+
this.submitHandler = handler;
|
|
12
|
+
}
|
|
13
|
+
async start(port) {
|
|
14
|
+
if (!this.doc)
|
|
15
|
+
throw new Error('No document set');
|
|
16
|
+
this.server = createReviewServer({
|
|
17
|
+
getDocument: () => this.doc,
|
|
18
|
+
onSubmit: (comments) => this.submitHandler?.(comments),
|
|
19
|
+
getAssetHtml: () => getAssetHtml(),
|
|
20
|
+
});
|
|
21
|
+
return startServer(this.server, port);
|
|
22
|
+
}
|
|
23
|
+
async stop() {
|
|
24
|
+
if (this.server && this.server.listening) {
|
|
25
|
+
await stopServer(this.server);
|
|
26
|
+
this.server = null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASlD,MAAM,OAAO,aAAa;IAChB,GAAG,GAAwB,IAAI,CAAC;IAChC,aAAa,GAAiD,IAAI,CAAC;IACnE,MAAM,GAAkB,IAAI,CAAC;IAErC,YAAY,CAAC,GAAiB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,cAAc,CAAC,OAA4C;QACzD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY;QACtB,IAAI,CAAC,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAElD,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC;YAC/B,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAI;YAC5B,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;YACtD,YAAY,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE;SACnC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACzC,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -22,6 +22,12 @@ export interface ReviewComment {
|
|
|
22
22
|
sectionId: string;
|
|
23
23
|
text: string;
|
|
24
24
|
timestamp: Date;
|
|
25
|
+
anchor?: {
|
|
26
|
+
type: 'section' | 'range';
|
|
27
|
+
startOffset?: number;
|
|
28
|
+
endOffset?: number;
|
|
29
|
+
selectedText?: string;
|
|
30
|
+
};
|
|
25
31
|
}
|
|
26
32
|
export type OutputTarget = 'stdout' | 'clipboard' | 'file' | 'claude';
|
|
27
33
|
export type SplitStrategy = 'heading' | 'separator' | 'auto';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plan-review",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Interactive CLI for reviewing AI-generated markdown plans",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc",
|
|
14
|
+
"build": "tsc && node scripts/build-browser.js",
|
|
15
|
+
"build:browser": "node scripts/build-browser.js",
|
|
16
|
+
"dev:browser": "node scripts/build-browser.js --watch",
|
|
15
17
|
"dev": "tsx src/index.ts",
|
|
16
18
|
"test": "vitest run",
|
|
17
19
|
"test:watch": "vitest",
|
|
@@ -32,8 +34,12 @@
|
|
|
32
34
|
"marked-terminal": "^7.3.0"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
37
|
+
"@testing-library/preact": "^3.2.4",
|
|
38
|
+
"preact": "^10.29.1",
|
|
35
39
|
"@types/node": "^25.6.0",
|
|
36
40
|
"@vitest/coverage-v8": "^4.1.4",
|
|
41
|
+
"esbuild": "^0.28.0",
|
|
42
|
+
"jsdom": "^29.0.2",
|
|
37
43
|
"tsx": "^4.21.0",
|
|
38
44
|
"typescript": "^6.0.2",
|
|
39
45
|
"vitest": "^4.1.4"
|