maxsimcli 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,20 @@
1
+ # [3.10.0](https://github.com/maystudios/maxsimcli/compare/v3.9.0...v3.10.0) (2026-02-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bundle MCP SDK subpath imports into dashboard server.js ([e85ba8a](https://github.com/maystudios/maxsimcli/commit/e85ba8a7253635529d5a7892b13290238b50451d))
7
+
8
+
9
+ ### Features
10
+
11
+ * **33-01:** add MCP SDK and create mcp-server.ts with tool registrations ([14ff308](https://github.com/maystudios/maxsimcli/commit/14ff308ba3d52331c9e1466b5baac321bf8857a6))
12
+ * **33-01:** wire MCP routes and answer endpoint into server.ts ([0deed2c](https://github.com/maystudios/maxsimcli/commit/0deed2c85856012fd13a5e5f2302f4284d963fdc))
13
+ * **33-02:** add StatusBar, pending badge, and MCP server auto-registration ([c0a17ee](https://github.com/maystudios/maxsimcli/commit/c0a17ee57c3c8be705f6789a2a1eb89fec76f1a9))
14
+ * **33-02:** wire MCP events to browser UI and replace mock questions ([addcd98](https://github.com/maystudios/maxsimcli/commit/addcd988b0b48ef1b8ba3fa728156f308e91e729))
15
+ * **33:** complete Hook Bridge — MCP server, browser integration, and build artifacts ([9ab0732](https://github.com/maystudios/maxsimcli/commit/9ab073282f40be7600fe8e595ce195b45edc48f2))
16
+ * add dashboard MCP bridge to all workflow templates ([6a2e0b3](https://github.com/maystudios/maxsimcli/commit/6a2e0b368ef763213bbf3a286b0760e372bcfab9))
17
+
1
18
  # [3.9.0](https://github.com/maystudios/maxsimcli/compare/v3.8.1...v3.9.0) (2026-02-28)
2
19
 
3
20
 
@@ -214,7 +214,7 @@ void main() {
214
214
  * Copyright (c) 2011 Fabrice Bellard
215
215
  */var Pi=0,Ri=0,Qi=0,Wt=0,nn;(t=>{function e(s,r,o,l){return l!==void 0?`#${sl(s)}${sl(r)}${sl(o)}${sl(l)}`:`#${sl(s)}${sl(r)}${sl(o)}`}t.toCss=e;function i(s,r,o,l=255){return(s<<24|r<<16|o<<8|l)>>>0}t.toRgba=i;function n(s,r,o,l){return{css:t.toCss(s,r,o,l),rgba:t.toRgba(s,r,o,l)}}t.toColor=n})(nn||(nn={}));var vae;(t=>{function e(c,u){if(Wt=(u.rgba&255)/255,Wt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Pi=O+Math.round((d-O)*Wt),Ri=_+Math.round((p-_)*Wt),Qi=b+Math.round((g-b)*Wt);let x=nn.toCss(Pi,Ri,Qi),w=nn.toRgba(Pi,Ri,Qi);return{css:x,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=lg.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return nn.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function s(c){let u=(c.rgba|255)>>>0;return[Pi,Ri,Qi]=lg.toChannels(u),{css:nn.toCss(Pi,Ri,Qi),rgba:u}}t.opaque=s;function r(c,u){return Wt=Math.round(u*255),[Pi,Ri,Qi]=lg.toChannels(c.rgba),{css:nn.toCss(Pi,Ri,Qi,Wt),rgba:nn.toRgba(Pi,Ri,Qi,Wt)}}t.opacity=r;function o(c,u){return Wt=c.rgba&255,r(c,Wt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(vae||(vae={}));var Zi;(t=>{let e,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(e=r,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Pi=parseInt(s.slice(1,2).repeat(2),16),Ri=parseInt(s.slice(2,3).repeat(2),16),Qi=parseInt(s.slice(3,4).repeat(2),16),nn.toColor(Pi,Ri,Qi);case 5:return Pi=parseInt(s.slice(1,2).repeat(2),16),Ri=parseInt(s.slice(2,3).repeat(2),16),Qi=parseInt(s.slice(3,4).repeat(2),16),Wt=parseInt(s.slice(4,5).repeat(2),16),nn.toColor(Pi,Ri,Qi,Wt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Pi=parseInt(r[1]),Ri=parseInt(r[2]),Qi=parseInt(r[3]),Wt=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),nn.toColor(Pi,Ri,Qi,Wt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=s,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Pi,Ri,Qi,Wt]=e.getImageData(0,0,1,1).data,Wt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:nn.toRgba(Pi,Ri,Qi,Wt),css:s}}t.toColor=n})(Zi||(Zi={}));var pn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,s,r){let o=n/255,l=s/255,c=r/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(pn||(pn={}));var lg;(t=>{function e(o,l){if(Wt=(l&255)/255,Wt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Pi=p+Math.round((c-p)*Wt),Ri=g+Math.round((u-g)*Wt),Qi=O+Math.round((d-O)*Wt),nn.toRgba(Pi,Ri,Qi)}t.blend=e;function i(o,l,c){let u=pn.relativeLuminance(o>>8),d=pn.relativeLuminance(l>>8);if(ao(u,d)<c){if(d<u){let O=n(o,l,c),_=ao(u,pn.relativeLuminance(O>>8));if(_<c){let b=s(o,l,c),x=ao(u,pn.relativeLuminance(b>>8));return _>x?O:b}return O}let p=s(o,l,c),g=ao(u,pn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=ao(u,pn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function s(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=s;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=r})(lg||(lg={}));function sl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function ao(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var _ae=Object.freeze((()=>{let t=[Zi.toColor("#2e3436"),Zi.toColor("#cc0000"),Zi.toColor("#4e9a06"),Zi.toColor("#c4a000"),Zi.toColor("#3465a4"),Zi.toColor("#75507b"),Zi.toColor("#06989a"),Zi.toColor("#d3d7cf"),Zi.toColor("#555753"),Zi.toColor("#ef2929"),Zi.toColor("#8ae234"),Zi.toColor("#fce94f"),Zi.toColor("#729fcf"),Zi.toColor("#ad7fa8"),Zi.toColor("#34e2e2"),Zi.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],s=e[i/6%6|0],r=e[i%6];t.push({css:nn.toCss(n,s,r),rgba:nn.toRgba(n,s,r)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:nn.toCss(n,n,n),rgba:nn.toRgba(n,n,n)})}return t})());function cQ(t,e,i){return Math.max(e,Math.min(t,i))}function yae(t){switch(t){case"&":return"&amp;";case"<":return"&lt;"}return t}var Nz=class{constructor(t){this._buffer=t}serialize(t,e){let i=this._buffer.getNullCell(),n=this._buffer.getNullCell(),s=i,r=t.start.y,o=t.end.y,l=t.start.x,c=t.end.x;this._beforeSerialize(o-r,r,o);for(let u=r;u<=o;u++){let d=this._buffer.getLine(u);if(d){let p=u===t.start.y?l:0,g=u===t.end.y?c:d.length;for(let O=p;O<g;O++){let _=d.getCell(O,s===i?n:i);if(!_){console.warn(`Can't get cell at row=${u}, col=${O}`);continue}this._nextCell(_,s,u,O),s=_}}this._rowEnd(u,u===o)}return this._afterSerialize(),this._serializeString(e)}_nextCell(t,e,i,n){}_rowEnd(t,e){}_beforeSerialize(t,e,i){}_afterSerialize(){}_serializeString(t){return""}};function jz(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function lo(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function Iz(t,e){return t.isInverse()===e.isInverse()&&t.isBold()===e.isBold()&&t.isUnderline()===e.isUnderline()&&t.isOverline()===e.isOverline()&&t.isBlink()===e.isBlink()&&t.isInvisible()===e.isInvisible()&&t.isItalic()===e.isItalic()&&t.isDim()===e.isDim()&&t.isStrikethrough()===e.isStrikethrough()}var bae=class extends Nz{constructor(t,e){super(t),this._terminal=e,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,e,i){this._allRows=new Array(t),this._lastContentCursorRow=e,this._lastCursorRow=e,this._firstRow=e}_rowEnd(t,e){var n;this._nullCellCount>0&&!lo(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let i="";if(!e){t-this._firstRow>=this._terminal.rows&&((n=this._buffer.getLine(this._cursorStyleRow))==null||n.getCell(this._cursorStyleCol,this._backgroundCell));let s=this._buffer.getLine(t),r=this._buffer.getLine(t+1);if(!r.isWrapped)i=`\r
216
216
  `,this._lastCursorRow=t+1,this._lastCursorCol=0;else{i="";let o=s.getCell(s.length-1,this._thisRowLastChar),l=s.getCell(s.length-2,this._thisRowLastSecondChar),c=r.getCell(0,this._nextRowFirstChar),u=c.getWidth()>1,d=!1;(c.getChars()&&u?this._nullCellCount<=1:this._nullCellCount<=0)&&((o.getChars()||o.getWidth()===0)&&lo(o,c)&&(d=!0),u&&(l.getChars()||l.getWidth()===0)&&lo(o,c)&&lo(l,c)&&(d=!0)),d||(i="-".repeat(this._nullCellCount+1),i+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(i+="\x1B[A",i+=`\x1B[${s.length-this._nullCellCount}C`,i+=`\x1B[${this._nullCellCount}X`,i+=`\x1B[${s.length-this._nullCellCount}D`,i+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=i,this._currentRow="",this._nullCellCount=0}_diffStyle(t,e){let i=[],n=!jz(t,e),s=!lo(t,e),r=!Iz(t,e);if(n||s||r)if(t.isAttributeDefault())e.isAttributeDefault()||i.push(0);else{if(n){let o=t.getFgColor();t.isFgRGB()?i.push(38,2,o>>>16&255,o>>>8&255,o&255):t.isFgPalette()?o>=16?i.push(38,5,o):i.push(o&8?90+(o&7):30+(o&7)):i.push(39)}if(s){let o=t.getBgColor();t.isBgRGB()?i.push(48,2,o>>>16&255,o>>>8&255,o&255):t.isBgPalette()?o>=16?i.push(48,5,o):i.push(o&8?100+(o&7):40+(o&7)):i.push(49)}r&&(t.isInverse()!==e.isInverse()&&i.push(t.isInverse()?7:27),t.isBold()!==e.isBold()&&i.push(t.isBold()?1:22),t.isUnderline()!==e.isUnderline()&&i.push(t.isUnderline()?4:24),t.isOverline()!==e.isOverline()&&i.push(t.isOverline()?53:55),t.isBlink()!==e.isBlink()&&i.push(t.isBlink()?5:25),t.isInvisible()!==e.isInvisible()&&i.push(t.isInvisible()?8:28),t.isItalic()!==e.isItalic()&&i.push(t.isItalic()?3:23),t.isDim()!==e.isDim()&&i.push(t.isDim()?2:22),t.isStrikethrough()!==e.isStrikethrough()&&i.push(t.isStrikethrough()?9:29))}return i}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let s=t.getChars()==="",r=this._diffStyle(t,this._cursorStyle);if(s?!lo(this._cursorStyle,t):r.length>0){this._nullCellCount>0&&(lo(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n,this._currentRow+=`\x1B[${r.join(";")}m`;let o=this._buffer.getLine(i);o!==void 0&&(o.getCell(n,this._cursorStyle),this._cursorStyleRow=i,this._cursorStyleCol=n)}s?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(lo(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n+t.getWidth())}_serializeString(t){let e=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(e=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let i="";for(let r=0;r<e;r++)i+=this._allRows[r],r+1<e&&(i+=this._allRowSeparators[r]);if(!t){let r=this._buffer.baseY+this._buffer.cursorY,o=this._buffer.cursorX,l=r!==this._lastCursorRow||o!==this._lastCursorCol,c=u=>{u>0?i+=`\x1B[${u}C`:u<0&&(i+=`\x1B[${-u}D`)};l&&((u=>{u>0?i+=`\x1B[${u}B`:u<0&&(i+=`\x1B[${-u}A`)})(r-this._lastCursorRow),c(o-this._lastCursorCol))}let n=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(n,this._cursorStyle);return s.length>0&&(i+=`\x1B[${s.join(";")}m`),i}},Sae=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,e,i){let n=e.length,s=i===void 0?n:cQ(i+t.rows,0,n);return this._serializeBufferByRange(t,e,{start:n-s,end:n-1},!1)}_serializeBufferByRange(t,e,i,n){return new bae(e,t).serialize({start:{x:0,y:typeof i.start=="number"?i.start:i.start.line},end:{x:t.cols,y:typeof i.end=="number"?i.end:i.end.line}},n)}_serializeBufferAsHTML(t,e){var l;let i=t.buffer.active,n=new xae(i,t,e),s=e.onlySelection??!1,r=e.range;if(r)return n.serialize({start:{x:r.startCol,y:(r.startLine,r.startLine)},end:{x:t.cols,y:(r.endLine,r.endLine)}});if(!s){let c=i.length,u=e.scrollback,d=u===void 0?c:cQ(u+t.rows,0,c);return n.serialize({start:{x:0,y:c-d},end:{x:t.cols,y:c-1}})}let o=(l=this._terminal)==null?void 0:l.getSelectionPosition();return o!==void 0?n.serialize({start:{x:o.start.x,y:o.start.y},end:{x:o.end.x,y:o.end.y}}):""}_serializeModes(t){let e="",i=t.modes;if(i.applicationCursorKeysMode&&(e+="\x1B[?1h"),i.applicationKeypadMode&&(e+="\x1B[?66h"),i.bracketedPasteMode&&(e+="\x1B[?2004h"),i.insertMode&&(e+="\x1B[4h"),i.originMode&&(e+="\x1B[?6h"),i.reverseWraparoundMode&&(e+="\x1B[?45h"),i.sendFocusMode&&(e+="\x1B[?1004h"),i.wraparoundMode===!1&&(e+="\x1B[?7l"),i.mouseTrackingMode!=="none")switch(i.mouseTrackingMode){case"x10":e+="\x1B[?9h";break;case"vt200":e+="\x1B[?1000h";break;case"drag":e+="\x1B[?1002h";break;case"any":e+="\x1B[?1003h";break}return e}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let e=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let i=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);e+=`\x1B[?1049h\x1B[H${i}`}return t!=null&&t.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},xae=class extends Nz{constructor(t,e,i){super(t),this._terminal=e,this._options=i,this._currentRow="",this._htmlContent="",e._core._themeService?this._ansiColors=e._core._themeService.colors.ansi:this._ansiColors=_ae}_padStart(t,e,i){return e=e>>0,i=i??" ",t.length>e?t:(e-=t.length,e>i.length&&(i+=i.repeat(e/i.length)),i.slice(0,e)+t)}_beforeSerialize(t,e,i){var o,l;this._htmlContent+="<html><body><!--StartFragment--><pre>";let n="#000000",s="#ffffff";(this._options.includeGlobalBackground??!1)&&(n=((o=this._terminal.options.theme)==null?void 0:o.foreground)??"#ffffff",s=((l=this._terminal.options.theme)==null?void 0:l.background)??"#000000");let r=[];r.push("color: "+n+";"),r.push("background-color: "+s+";"),r.push("font-family: "+this._terminal.options.fontFamily+";"),r.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+r.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,e){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,e){let i=e?t.getFgColor():t.getBgColor();if(e?t.isFgRGB():t.isBgRGB())return"#"+[i>>16&255,i>>8&255,i&255].map(n=>this._padStart(n.toString(16),2,"0")).join("");if(e?t.isFgPalette():t.isBgPalette())return this._ansiColors[i].css}_diffStyle(t,e){let i=[],n=!jz(t,e),s=!lo(t,e),r=!Iz(t,e);if(n||s||r){let o=this._getHexColor(t,!0);o&&i.push("color: "+o+";");let l=this._getHexColor(t,!1);return l&&i.push("background-color: "+l+";"),t.isInverse()&&i.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&i.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?i.push("text-decoration: overline underline;"):t.isUnderline()?i.push("text-decoration: underline;"):t.isOverline()&&i.push("text-decoration: overline;"),t.isBlink()&&i.push("text-decoration: blink;"),t.isInvisible()&&i.push("visibility: hidden;"),t.isItalic()&&i.push("font-style: italic;"),t.isDim()&&i.push("opacity: 0.5;"),t.isStrikethrough()&&i.push("text-decoration: line-through;"),i}}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let s=t.getChars()==="",r=this._diffStyle(t,e);r&&(this._currentRow+=r.length===0?"</span><span>":"</span><span style='"+r.join(" ")+"'>"),s?this._currentRow+=" ":this._currentRow+=yae(t.getChars())}_serializeString(){return this._htmlContent}};const wae=10,Cae=2e3;function kae(t={}){const{autoSpawn:e=!1,skipPermissions:i=!1}=t,[n,s]=Z.useState(!1),[r,o]=Z.useState(!1),[l,c]=Z.useState(null),[u,d]=Z.useState(null),p=Z.useRef(null),g=Z.useRef(0),O=Z.useRef(null),_=Z.useRef(!0),b=Z.useRef(null),x=Z.useRef(null),w=Z.useRef(e),k=Z.useRef(i);w.current=e,k.current=i;const T=Z.useCallback(N=>{const q=p.current;q&&q.readyState===WebSocket.OPEN&&q.send(JSON.stringify(N))},[]),A=Z.useCallback(N=>{T({type:"spawn",skipPermissions:N})},[T]),L=Z.useCallback(()=>{T({type:"kill"})},[T]),E=Z.useCallback((N,q)=>{T({type:"resize",cols:N,rows:q})},[T]),z=Z.useCallback(N=>{T({type:"input",data:N})},[T]);return Z.useEffect(()=>{_.current=!0;function N(){if(!_.current)return;const J=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`,U=new WebSocket(J);p.current=U,U.onopen=()=>{_.current&&(s(!0),g.current=0,w.current&&U.send(JSON.stringify({type:"spawn",skipPermissions:k.current})))},U.onclose=()=>{_.current&&(s(!1),p.current=null,g.current<wae&&(g.current++,O.current=setTimeout(N,Cae)))},U.onmessage=R=>{var B,D;if(_.current)try{const j=JSON.parse(R.data);switch(j.type){case"output":(B=b.current)==null||B.call(b,j.data);break;case"scrollback":(D=x.current)==null||D.call(x,j.data);break;case"status":c({pid:j.pid,uptime:j.uptime,cwd:j.cwd,memoryMB:j.memoryMB,isActive:j.isActive,skipPermissions:j.skipPermissions,alive:j.alive});break;case"exit":d(j.code??1);break;case"started":d(null);break;case"unavailable":o(!0);break}}catch{}},U.onerror=()=>{}}return N(),()=>{_.current=!1,O.current!==null&&(clearTimeout(O.current),O.current=null),p.current&&(p.current.onclose=null,p.current.close(),p.current=null)}},[]),{connected:n,unavailable:r,status:l,exitCode:u,send:T,spawn:A,kill:L,resize:E,writeInput:z,onOutput:b,onScrollback:x}}function Tae(t){const e=Math.floor(t/60),i=t%60;return`${e}m ${i}s`}function Aae(t){const e=t.replace(/\\/g,"/").split("/").filter(Boolean);return e.length<=2?t:".../"+e.slice(-2).join("/")}function Eae({status:t,connected:e,exitCode:i,skipPermissions:n,onToggleSkipPermissions:s,onStop:r,onRestart:o}){const l=e&&(t==null?void 0:t.alive),c=e?l?"bg-green-500":"bg-yellow-500":"bg-red-500",u=e?l?`Running (PID ${(t==null?void 0:t.pid)??"?"})`:"Stopped":"Disconnected";return S.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-card px-3 py-1.5 font-mono text-xs text-muted-foreground",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:Fe("inline-block h-2 w-2 rounded-full",c),title:u}),S.jsx("span",{children:u}),t&&l&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-border",children:"|"}),S.jsx("span",{children:Tae(t.uptime)}),S.jsx("span",{className:"text-border",children:"|"}),S.jsx("span",{title:t.cwd,children:Aae(t.cwd)}),S.jsx("span",{className:"text-border",children:"|"}),S.jsxs("span",{children:[t.memoryMB," MB"]})]})]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5",children:[S.jsx("input",{type:"checkbox",checked:n,onChange:s,className:"h-3 w-3 accent-accent"}),S.jsx("span",{children:"Skip Perms"})]}),l&&S.jsx("button",{type:"button",onClick:r,className:"rounded-sm px-2 py-0.5 text-red-400 transition-colors hover:bg-red-500/20",children:"Stop"}),S.jsx("button",{type:"button",onClick:o,className:"rounded-sm px-2 py-0.5 transition-colors hover:bg-accent/20",children:"Restart"})]})]})}const Mae=[{label:"Progress",command:"/maxsim:progress"},{label:"New Project",command:"/maxsim:new-project"},{label:"Discuss",command:"/maxsim:discuss-phase N"},{label:"Plan",command:"/maxsim:plan-phase N"},{label:"Execute",command:"/maxsim:execute-phase N"},{label:"Roadmap",command:"/maxsim:roadmap"},{label:"Verify",command:"/maxsim:verify-work"},{label:"Resume",command:"/maxsim:resume-work"}],Vz="maxsim-quick-commands",Pae=3e4;function Rae(){try{const t=localStorage.getItem(Vz);if(t)return JSON.parse(t)}catch{}return Mae}function Qae(t){localStorage.setItem(Vz,JSON.stringify(t))}function Lae({onSendCommand:t,isActive:e,isAlive:i,unavailable:n=!1}){const[s,r]=Z.useState(!1),[o,l]=Z.useState(Rae),[c,u]=Z.useState(!1),[d,p]=Z.useState(null),g=Z.useRef(null),O=Z.useCallback(async E=>{if(!E.includes(" N"))return E;const z=g.current;if(z&&Date.now()-z.ts<Pae)return E.replace(" N",` ${z.value}`);try{const N=await fetch("/api/state");if(N.ok){const q=await N.json(),J=String(q.currentPhase??"1");return g.current={value:J,ts:Date.now()},E.replace(" N",` ${J}`)}}catch{}return E},[]),_=n||!i,b=Z.useCallback(async E=>{if(_)return;const z=await O(E.command);p({label:E.label,resolved:z})},[_,O]),x=Z.useCallback(()=>{d&&(t(d.resolved+`\r
217
- `),p(null))},[d,t]),w=Z.useCallback(()=>{p(null)},[]);Z.useEffect(()=>{if(!d)return;const E=z=>{z.key==="Enter"?(z.preventDefault(),x()):z.key==="Escape"&&w()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[d,x,w]);const[k,T]=Z.useState([]),A=Z.useCallback(()=>{T([...o]),u(!0)},[o]),L=Z.useCallback(()=>{const E=k.filter(z=>z.label.trim()&&z.command.trim());l(E),Qae(E),u(!1)},[k]);return s?S.jsx("div",{className:"absolute bottom-2 right-2 z-20",children:S.jsx("button",{type:"button",onClick:()=>r(!1),className:"rounded-md bg-card/80 p-1.5 text-xs text-muted-foreground shadow-lg backdrop-blur-sm border border-border hover:text-foreground transition-colors",title:"Show quick actions",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M18 15l-6-6-6 6"})})})}):S.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex flex-col items-end gap-1",children:[d&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-2 text-xs mb-1 backdrop-blur-sm",children:[S.jsxs("p",{className:"text-muted-foreground mb-1.5",children:["Send"," ",S.jsx("span",{className:"font-mono text-foreground",children:d.resolved}),"?"]}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:x,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Confirm"}),S.jsx("button",{type:"button",onClick:w,className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})]})]}),c&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-3 text-xs mb-1 backdrop-blur-sm w-72 max-h-64 overflow-y-auto",children:[S.jsx("p",{className:"text-muted-foreground font-medium mb-2",children:"Quick Commands"}),k.map((E,z)=>S.jsxs("div",{className:"flex gap-1 mb-1",children:[S.jsx("input",{className:"flex-[1] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs text-foreground",value:E.label,onChange:N=>{const q=[...k];q[z]={...q[z],label:N.target.value},T(q)},placeholder:"Label"}),S.jsx("input",{className:"flex-[2] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs font-mono text-foreground",value:E.command,onChange:N=>{const q=[...k];q[z]={...q[z],command:N.target.value},T(q)},placeholder:"Command"}),S.jsx("button",{type:"button",onClick:()=>T(k.filter((N,q)=>q!==z)),className:"text-muted-foreground hover:text-destructive transition-colors px-0.5",title:"Remove",children:"x"})]},z)),S.jsxs("div",{className:"flex justify-between mt-2",children:[S.jsx("button",{type:"button",onClick:()=>T([...k,{label:"",command:""}]),className:"text-muted-foreground hover:text-foreground transition-colors",children:"+ Add"}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Save"})]})]})]}),S.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-card/80 border border-border shadow-lg p-1.5 backdrop-blur-sm",children:[o.map(E=>S.jsx("button",{type:"button",onClick:()=>b(E),disabled:_,className:"rounded-md px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed",title:n?"Terminal unavailable — node-pty not installed":E.command,children:E.label},E.label)),S.jsx("button",{type:"button",onClick:A,className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors ml-0.5",title:"Settings",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[S.jsx("circle",{cx:"12",cy:"12",r:"3"}),S.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.32 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}),S.jsx("button",{type:"button",onClick:()=>r(!0),className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Minimize",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M6 9l6 6 6-6"})})})]})]})}function Dae({onReady:t,writeInputRef:e}){const i=Z.useRef(null),n=Z.useRef(null),s=Z.useRef(null),r=Z.useRef(null),o=Z.useRef(null),[l,c]=Z.useState(!0),{connected:u,unavailable:d,status:p,exitCode:g,writeInput:O,resize:_,spawn:b,kill:x,onOutput:w,onScrollback:k}=kae({autoSpawn:!0,skipPermissions:l});Z.useEffect(()=>(e&&(e.current=O),()=>{e&&(e.current=null)}),[O,e]);const T=Z.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]),A=Z.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]);Z.useEffect(()=>(w.current=T,k.current=A,()=>{w.current=null,k.current=null}),[T,A,w,k]),Z.useEffect(()=>{if(!i.current)return;const N=new Qre({cursorBlink:!0,fontSize:14,lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0"}}),q=new Bre,J=new Sae;N.loadAddon(q),N.loadAddon(J);try{N.loadAddon(new Oae)}catch{}N.open(i.current),q.fit(),n.current=N,s.current=q;const U=N.onData(B=>{O(B)}),R=new ResizeObserver(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s.current&&n.current&&(s.current.fit(),_(n.current.cols,n.current.rows))},100)});return R.observe(i.current),r.current=R,t==null||t(N),()=>{U.dispose(),R.disconnect(),o.current&&clearTimeout(o.current),N.dispose(),n.current=null,s.current=null,r.current=null}},[]);const L=Z.useCallback(()=>{b(l),setTimeout(()=>{var N;return(N=n.current)==null?void 0:N.focus()},100)},[b,l]),E=Z.useCallback(()=>{x()},[x]),z=Z.useCallback(()=>{c(N=>!N)},[]);return S.jsxs("div",{className:"flex h-full w-full flex-col",onWheel:N=>N.stopPropagation(),children:[S.jsxs("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[S.jsx("div",{ref:i,className:"h-full w-full"}),S.jsx(Lae,{onSendCommand:O,isActive:(p==null?void 0:p.isActive)??!1,isAlive:(p==null?void 0:p.alive)??!1,unavailable:d}),d&&S.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-card",children:S.jsxs("div",{className:"max-w-sm text-center",children:[S.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Terminal unavailable"}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:["node-pty is not installed. Run ",S.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm install node-pty"})," in the dashboard directory."]})]})}),!u&&g===null&&S.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/60",children:S.jsxs("div",{className:"flex items-center gap-3 font-mono text-sm text-muted-foreground",children:[S.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[S.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),S.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Reconnecting..."]})}),g!==null&&S.jsxs("div",{className:"absolute inset-x-0 bottom-0 z-10 flex items-center justify-between bg-card/90 px-4 py-2 font-mono text-sm backdrop-blur-sm",children:[S.jsxs("span",{className:"text-muted-foreground",children:["Process exited (code ",g,")"]}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-3 py-1 text-xs text-foreground transition-colors hover:bg-accent-glow",children:"Restart"})]})]}),S.jsx(Eae,{status:p,connected:u,exitCode:g,skipPermissions:l,onToggleSkipPermissions:z,onStop:E,onRestart:L})]})}function Bae(){const[t,e]=Z.useState(!1),i=Z.useCallback(()=>e(n=>!n),[]);return{splitMode:t,toggleSplit:i}}function $ae({splitMode:t,onToggle:e}){return S.jsx("button",{type:"button",onClick:e,title:t?"Full-height mode":"Split-panel mode",className:"absolute right-3 top-2 z-20 flex h-7 w-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:bg-card-hover hover:text-foreground",children:t?S.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"})}):S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),S.jsx("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1.5"})]})})}function zae({mode:t,onToggle:e}){const[i,n]=Z.useState(!1);function s(){n(!0),e(),setTimeout(()=>n(!1),420)}const r=t==="simple",o=r?"Switch to Advanced Mode":"Switch to Simple Mode";return S.jsx("button",{type:"button",onClick:s,title:o,"aria-label":o,className:"flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:S.jsx(vo.span,{animate:{rotate:i?360:0},transition:{duration:.4,ease:"easeInOut"},style:{display:"flex",alignItems:"center",justifyContent:"center"},children:r?S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"6"}),S.jsx("ellipse",{cx:"8",cy:"8",rx:"2.5",ry:"6"}),S.jsx("path",{d:"M2 8h12M3.5 5h9M3.5 11h9",strokeLinecap:"round"})]}):S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1"}),S.jsx("path",{d:"M4 6l2.5 2L4 10M8 10h4",strokeLinecap:"round",strokeLinejoin:"round"})]})})})}function Nae({onChoose:t}){return S.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:[S.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-background/60"}),S.jsxs("div",{className:"relative z-10 border border-border bg-card p-8 max-w-lg w-full mx-4",children:[S.jsx("h2",{className:"font-bold text-lg tracking-tight text-foreground mb-1",children:"Choose Your Dashboard Mode"}),S.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"You can switch between modes at any time from the header toggle."}),S.jsxs("div",{className:"flex gap-4",children:[S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"12",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"8",y:"3",width:"30",height:"6",rx:"1",fill:"#14b8a6",fillOpacity:"0.6"}),S.jsx("rect",{x:"8",y:"18",width:"104",height:"8",rx:"1",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"8",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"62",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Simple Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Clean action cards. No terminal required."})]}),S.jsx("button",{type:"button",onClick:()=>t("simple"),className:"border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Use Simple Mode"})]}),S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"70",fill:"currentColor",fillOpacity:"0.03"}),S.jsx("rect",{x:"0",y:"0",width:"28",height:"70",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"3",y:"3",width:"22",height:"5",rx:"1",fill:"currentColor",fillOpacity:"0.2"}),S.jsx("rect",{x:"3",y:"12",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"3",y:"18",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"30",y:"4",width:"86",height:"28",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"30",y:"36",width:"86",height:"28",rx:"1",fill:"#3b82f6",fillOpacity:"0.1"}),S.jsx("rect",{x:"33",y:"39",width:"12",height:"2",rx:"0.5",fill:"#3b82f6",fillOpacity:"0.5"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Advanced Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Full dashboard with terminal and phase viewer."})]}),S.jsx("button",{type:"button",onClick:()=>t("advanced"),className:"border border-accent bg-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Use Advanced Mode"})]})]})]})]})}function rl(t){var e;return(((e=t==null?void 0:t.phases)==null?void 0:e.length)??0)>0}function hQ(t){var e;return((e=t==null?void 0:t.phases)==null?void 0:e.some(i=>i.disk_status==="partial"||i.disk_status==="planned"||i.disk_status==="discussed"||i.disk_status==="researched"))??!1}const DS=[{id:"plan-new-phase",tab:"plan",title:"Plan New Phase",description:"Create a detailed execution plan for the next phase",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M7 8h6M7 11h4M10 2v4",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:plan-phase",isAvailable:t=>rl(t),unavailableReason:"No phases found in ROADMAP.md — create a project first"},{id:"add-phase",tab:"plan",title:"Add Phase",description:"Insert a new phase into the roadmap",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M10 8v6M7 11h6",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:add-phase",isAvailable:t=>rl(t),unavailableReason:"No project loaded — create a project first"},{id:"discuss-phase",tab:"plan",title:"Discuss Phase",description:"Answer planning questions to define requirements for a phase",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 6a1 1 0 011-1h12a1 1 0 011 1v7a1 1 0 01-1 1H7l-4 3V6z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:discuss-phase",isAvailable:t=>hQ(t),unavailableReason:"No active phase to discuss — plan a phase first"},{id:"init-existing",tab:"plan",title:"Init Existing",description:"Set up MAXSIM planning for an existing project",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 3v10M10 13l-3-3M10 13l3-3",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 17h12",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:init-existing",isAvailable:()=>!0,unavailableReason:""},{id:"new-project",tab:"plan",title:"New Project",description:"Start a brand new MAXSIM project from scratch",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M10 4v12M4 10h12",strokeLinecap:"round"})}),requiresInput:!1,command:"/maxsim:quick",isAvailable:()=>!0,unavailableReason:""},{id:"execute-phase",tab:"execute",title:"Execute Phase",description:"Run the current phase plan and implement the changes",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M6 4l10 6-10 6V4z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:execute-phase",isAvailable:t=>hQ(t),unavailableReason:"No phase is currently planned — plan a phase first"},{id:"verify-work",tab:"execute",title:"Verify Work",description:"Check that completed phase work meets all acceptance criteria",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M4 10l4 4 8-8",strokeLinecap:"round",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:verify-work",isAvailable:t=>rl(t),unavailableReason:"No phases to verify — complete a phase first"},{id:"audit-milestone",tab:"execute",title:"Audit Milestone",description:"Review and archive a completed milestone",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M4 5h12M4 10h8M4 15h10",strokeLinecap:"round"}),S.jsx("circle",{cx:"16",cy:"14",r:"2.5"}),S.jsx("path",{d:"M18 16l1.5 1.5",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:audit-milestone",isAvailable:t=>rl(t),unavailableReason:"No milestone to audit — complete some phases first"},{id:"fix-gaps",tab:"execute",title:"Fix Gaps",description:"Create plans to close verification failures",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 4v6h6",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 10a6 6 0 1012 0",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:plan-phase --gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to fix — complete a verification first"},{id:"find-gaps",tab:"execute",title:"Find Gaps",description:"Identify missing requirements or unverified work",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"9",cy:"9",r:"5"}),S.jsx("path",{d:"M16 16l-3-3",strokeLinecap:"round"}),S.jsx("path",{d:"M9 7v2M9 11h.01",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:verify-work --find-gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to analyze — create some phases first"},{id:"view-roadmap",tab:"execute",title:"View Roadmap",description:"See all phases and their status inline",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 5h14M3 10h14M3 15h8",strokeLinecap:"round"})}),requiresInput:!1,command:"",isAvailable:t=>rl(t),unavailableReason:"No roadmap to display"}];function jae(){var c,u;const{roadmap:t}=Rl(),{setTab:e,setExpanded:i}=oO(),n=(c=t==null?void 0:t.phases)==null?void 0:c.find(d=>d.number===(t==null?void 0:t.current_phase));let s=null;if(n){const d=n.disk_status;d==="empty"||d==="no_directory"||d==="discussed"||d==="researched"?s="plan-new-phase":d==="planned"||d==="partial"?s="execute-phase":d==="complete"&&(s="verify-work")}else(((u=t==null?void 0:t.phases)==null?void 0:u.length)??0)===0&&(s="new-project");if(!s)return null;const r=DS.find(d=>d.id===s);if(!r)return null;const o=n?`Phase ${n.number}: ${n.name}`:"your project";function l(){const d=r.tab;e(d),i(r.id)}return S.jsxs("div",{className:"border border-simple-accent/40 bg-simple-accent/5 p-4 flex items-center justify-between gap-4 mb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"text-xs uppercase tracking-widest text-simple-accent font-mono mb-1",children:"Recommended"}),S.jsxs("p",{className:"text-sm text-foreground",children:[S.jsx("span",{className:"font-medium",children:o})," is ready to"," ",S.jsx("span",{className:"text-simple-accent",children:r.title.toLowerCase()})]})]}),S.jsx("button",{type:"button",onClick:l,className:"shrink-0 border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:r.title})]})}function Iae({action:t,onExecute:e}){const{inputValues:i,setInput:n,reset:s}=oO(),{roadmap:r}=Rl(),o=Z.useRef(null),[l,c]=Z.useState(!1),[u,d]=Z.useState(!1),p=(()=>{var L;if(!t.requiresInput)return"";const A=(L=r==null?void 0:r.phases)==null?void 0:L.find(E=>!E.roadmap_complete&&(E.disk_status==="empty"||E.disk_status==="no_directory"));return A?`Phase ${A.number}: ${A.name}`:""})(),g=i[t.id]??p;Z.useEffect(()=>{const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[g]);function O(){const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)}function _(A){n(t.id,A)}function b(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),w())}function x(){const A=g.trim();return t.command===""?"":A?`${t.command} "${A}"`:t.command}function w(){if(t.requiresInput&&!g.trim()||t.id==="view-roadmap")return;const A=x();A&&e(A)}function k(){u?(s(),d(!1),c(!1)):(d(!0),setTimeout(()=>d(!1),3e3))}const T=t.requiresInput&&!g.trim();return S.jsxs("div",{className:"flex flex-col gap-3 relative",children:[S.jsx("p",{className:"text-xs text-muted-foreground",children:t.requiresInput?"Describe what this phase should accomplish.":"Add optional context (or leave blank to use defaults)."}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 flex gap-2 items-start",children:S.jsx("textarea",{ref:o,value:g,onChange:A=>{_(A.target.value),O()},onKeyDown:b,placeholder:t.requiresInput?"e.g. Phase 31: Simple Mode UI Shell":"Additional context (optional)",rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground placeholder:text-muted-foreground outline-none leading-relaxed"})}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:w,disabled:T,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",T?"border-border text-muted-foreground cursor-not-allowed":"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background"),children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M2 2l8 4-8 4V2z"})}),"Run in Terminal"]}),S.jsxs("div",{className:"relative ml-auto",children:[S.jsx("button",{type:"button",onClick:()=>c(A=>!A),"aria-label":"More options",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[S.jsx("circle",{cx:"4",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"8",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"12",cy:"8",r:"1.2"})]})}),l&&S.jsx("div",{className:"absolute right-0 bottom-8 z-20 border border-border bg-card shadow-lg min-w-max",children:S.jsx("button",{type:"button",onClick:k,className:Fe("flex w-full items-center gap-2 px-4 py-2.5 text-xs text-left transition-colors",u?"text-danger hover:bg-danger/10":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:u?"Click again to confirm reset":"Reset Simple Mode"})})]})]})]})}function Vae({action:t,roadmap:e,onExecute:i}){var g,O;const{expandedCardId:n,setExpanded:s}=oO(),{roadmap:r}=Rl(),o=n===t.id,l=!t.isAvailable(e),c=(g=r==null?void 0:r.phases)==null?void 0:g.find(_=>_.number===(r==null?void 0:r.current_phase));let u=null;if(c){const _=c.disk_status;_==="empty"||_==="no_directory"||_==="discussed"||_==="researched"?u="plan-new-phase":_==="planned"||_==="partial"?u="execute-phase":_==="complete"&&(u="verify-work")}else(((O=r==null?void 0:r.phases)==null?void 0:O.length)??0)===0&&(u="new-project");const d=t.id===u;function p(){l||s(o?null:t.id)}return S.jsxs("div",{className:Fe("bg-card border-0 transition-all duration-200",l?"opacity-50":"cursor-pointer hover:shadow-md hover:-translate-y-px",o&&"ring-1 ring-simple-accent/40"),title:l?t.unavailableReason:void 0,children:[S.jsxs("button",{type:"button",disabled:l,onClick:p,className:"flex w-full items-start gap-3 p-4 text-left","aria-expanded":o,children:[S.jsx("span",{className:Fe("mt-0.5 shrink-0",l?"text-muted-foreground":"text-simple-accent"),children:t.icon}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.title}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:t.description}),d&&!l&&S.jsx("span",{className:"mt-1 inline-block bg-simple-accent/20 border border-simple-accent/40 px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent",children:"Recommended"})]}),S.jsx("svg",{className:Fe("mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",o&&"rotate-180"),viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M2 4l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),S.jsx(xx,{initial:!1,children:o&&S.jsx(vo.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden border-t border-border/60",children:S.jsx("div",{className:"p-4",children:S.jsx(Iae,{action:t,onExecute:i})})},"expanded")})]})}const s1=6;function Xae({onExecute:t}){var T;const{roadmap:e}=Rl(),{activeTab:i,setTab:n}=oO(),s=Z.useRef(i),[r,o]=Z.useState({plan:!1,execute:!1}),l=e??null,c=DS.filter(A=>A.tab==="plan"),u=DS.filter(A=>A.tab==="execute"),d=(((T=e==null?void 0:e.phases)==null?void 0:T.length)??0)===0,p=d?c.filter(A=>A.id==="new-project"||A.id==="init-existing"):c,g=d?[]:u,O=i==="plan"?p:g,_=r[i],b=_?O:O.slice(0,s1),x=O.length>s1&&!_;function w(A){s.current=i,n(A)}const k=i==="plan"&&s.current==="execute"?-1:1;return S.jsxs("div",{className:"flex flex-col gap-0",children:[S.jsx("div",{className:"flex border-b border-border",children:["plan","execute"].map(A=>{const L=A==="plan"?p.length:g.length,E=A==="plan"?"Plan & Discuss":"Execute & Verify";return S.jsxs("button",{type:"button",onClick:()=>w(A),className:Fe("flex-1 py-2.5 text-xs font-mono uppercase tracking-widest transition-colors duration-200 border-b-2",i===A?"border-b-simple-accent text-simple-accent":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[E," (",L,")"]},A)})}),S.jsx("div",{className:"overflow-hidden",children:S.jsx(xx,{mode:"wait",initial:!1,children:S.jsx(vo.div,{initial:{x:k*20,opacity:0},animate:{x:0,opacity:1},exit:{x:k*-20,opacity:0},transition:{duration:.15},children:O.length===0?S.jsx("div",{className:"py-12 text-center",children:S.jsx("p",{className:"text-sm text-muted-foreground",children:"No actions available in this tab."})}):S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"grid grid-cols-2 gap-px bg-border lg:grid-cols-3",children:b.map(A=>S.jsx(Vae,{action:A,roadmap:l,onExecute:t},A.id))}),x&&S.jsxs("button",{type:"button",onClick:()=>o(A=>({...A,[i]:!0})),className:"w-full border-t border-border py-2.5 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:text-foreground hover:bg-card-hover",children:["Show more (",O.length-s1," more)"]})]})},i)})})]})}function Zae(t,e){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const qae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uae={};function uQ(t,e){return(Uae.jsx?Wae:qae).test(t)}const Yae=/[ \t\n\f\r]/g;function Hae(t){return typeof t=="object"?t.type==="text"?fQ(t.value):!1:fQ(t)}function fQ(t){return t.replace(Yae,"")===""}class Cd{constructor(e,i,n){this.normal=i,this.property=e,n&&(this.space=n)}}Cd.prototype.normal={};Cd.prototype.property={};Cd.prototype.space=void 0;function Xz(t,e){const i={},n={};for(const s of t)Object.assign(i,s.property),Object.assign(n,s.normal);return new Cd(i,n,e)}function BS(t){return t.toLowerCase()}class jn{constructor(e,i){this.attribute=i,this.property=e}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let Fae=0;const Xe=zl(),ri=zl(),$S=zl(),de=zl(),wt=zl(),th=zl(),es=zl();function zl(){return 2**++Fae}const zS=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:ri,commaOrSpaceSeparated:es,commaSeparated:th,number:de,overloadedBoolean:$S,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),r1=Object.keys(zS);class Vw extends jn{constructor(e,i,n,s){let r=-1;if(super(e,i),dQ(this,"space",s),typeof n=="number")for(;++r<r1.length;){const o=r1[r];dQ(this,r1[r],(n&zS[o])===zS[o])}}}Vw.prototype.defined=!0;function dQ(t,e,i){i&&(t[e]=i)}function Ah(t){const e={},i={};for(const[n,s]of Object.entries(t.properties)){const r=new Vw(n,t.transform(t.attributes||{},n),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(r.mustUseProperty=!0),e[n]=r,i[BS(n)]=n,i[BS(r.attribute)]=n}return new Cd(e,i,t.space)}const Zz=Ah({properties:{ariaActiveDescendant:null,ariaAtomic:ri,ariaAutoComplete:null,ariaBusy:ri,ariaChecked:ri,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:ri,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:ri,ariaFlowTo:wt,ariaGrabbed:ri,ariaHasPopup:null,ariaHidden:ri,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:de,ariaLive:null,ariaModal:ri,ariaMultiLine:ri,ariaMultiSelectable:ri,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:ri,ariaReadOnly:ri,ariaRelevant:null,ariaRequired:ri,ariaRoleDescription:wt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:ri,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function qz(t,e){return e in t?t[e]:e}function Wz(t,e){return qz(t,e.toLowerCase())}const Gae=Ah({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:th,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:wt,autoFocus:Xe,autoPlay:Xe,blocking:wt,capture:null,charSet:null,checked:Xe,cite:null,className:wt,cols:de,colSpan:null,content:null,contentEditable:ri,controls:Xe,controlsList:wt,coords:de|th,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:$S,draggable:ri,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:wt,height:de,hidden:$S,high:de,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:wt,itemRef:wt,itemScope:Xe,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xe,optimum:de,pattern:null,ping:wt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:wt,required:Xe,reversed:Xe,rows:de,rowSpan:de,sandbox:wt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:ri,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:ri,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:ri,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:Wz}),Kae=Ah({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:es,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:th,g2:th,glyphName:th,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:es,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:es,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:es,rev:es,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:es,requiredFeatures:es,requiredFonts:es,requiredFormats:es,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:es,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:es,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:es,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qz}),Uz=Ah({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Yz=Ah({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Wz}),Hz=Ah({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Jae={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ele=/[A-Z]/g,pQ=/-[a-z]/g,tle=/^data[-\w.:]+$/i;function ile(t,e){const i=BS(e);let n=e,s=jn;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&tle.test(e)){if(e.charAt(4)==="-"){const r=e.slice(5).replace(pQ,sle);n="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=e.slice(4);if(!pQ.test(r)){let o=r.replace(ele,nle);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}s=Vw}return new s(n,e)}function nle(t){return"-"+t.toLowerCase()}function sle(t){return t.charAt(1).toUpperCase()}const rle=Xz([Zz,Gae,Uz,Yz,Hz],"html"),Xw=Xz([Zz,Kae,Uz,Yz,Hz],"svg");function ole(t){return t.join(" ").trim()}var Ac={},o1,mQ;function ale(){if(mQ)return o1;mQ=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,i=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
217
+ `),p(null))},[d,t]),w=Z.useCallback(()=>{p(null)},[]);Z.useEffect(()=>{if(!d)return;const E=z=>{z.key==="Enter"?(z.preventDefault(),x()):z.key==="Escape"&&w()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[d,x,w]);const[k,T]=Z.useState([]),A=Z.useCallback(()=>{T([...o]),u(!0)},[o]),L=Z.useCallback(()=>{const E=k.filter(z=>z.label.trim()&&z.command.trim());l(E),Qae(E),u(!1)},[k]);return s?S.jsx("div",{className:"absolute bottom-2 right-2 z-20",children:S.jsx("button",{type:"button",onClick:()=>r(!1),className:"rounded-md bg-card/80 p-1.5 text-xs text-muted-foreground shadow-lg backdrop-blur-sm border border-border hover:text-foreground transition-colors",title:"Show quick actions",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M18 15l-6-6-6 6"})})})}):S.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex flex-col items-end gap-1",children:[d&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-2 text-xs mb-1 backdrop-blur-sm",children:[S.jsxs("p",{className:"text-muted-foreground mb-1.5",children:["Send"," ",S.jsx("span",{className:"font-mono text-foreground",children:d.resolved}),"?"]}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:x,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Confirm"}),S.jsx("button",{type:"button",onClick:w,className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})]})]}),c&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-3 text-xs mb-1 backdrop-blur-sm w-72 max-h-64 overflow-y-auto",children:[S.jsx("p",{className:"text-muted-foreground font-medium mb-2",children:"Quick Commands"}),k.map((E,z)=>S.jsxs("div",{className:"flex gap-1 mb-1",children:[S.jsx("input",{className:"flex-[1] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs text-foreground",value:E.label,onChange:N=>{const q=[...k];q[z]={...q[z],label:N.target.value},T(q)},placeholder:"Label"}),S.jsx("input",{className:"flex-[2] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs font-mono text-foreground",value:E.command,onChange:N=>{const q=[...k];q[z]={...q[z],command:N.target.value},T(q)},placeholder:"Command"}),S.jsx("button",{type:"button",onClick:()=>T(k.filter((N,q)=>q!==z)),className:"text-muted-foreground hover:text-destructive transition-colors px-0.5",title:"Remove",children:"x"})]},z)),S.jsxs("div",{className:"flex justify-between mt-2",children:[S.jsx("button",{type:"button",onClick:()=>T([...k,{label:"",command:""}]),className:"text-muted-foreground hover:text-foreground transition-colors",children:"+ Add"}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Save"})]})]})]}),S.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-card/80 border border-border shadow-lg p-1.5 backdrop-blur-sm",children:[o.map(E=>S.jsx("button",{type:"button",onClick:()=>b(E),disabled:_,className:"rounded-md px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed",title:n?"Terminal unavailable — node-pty not installed":E.command,children:E.label},E.label)),S.jsx("button",{type:"button",onClick:A,className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors ml-0.5",title:"Settings",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[S.jsx("circle",{cx:"12",cy:"12",r:"3"}),S.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.32 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}),S.jsx("button",{type:"button",onClick:()=>r(!0),className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Minimize",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M6 9l6 6 6-6"})})})]})]})}function Dae({onReady:t,writeInputRef:e}){const i=Z.useRef(null),n=Z.useRef(null),s=Z.useRef(null),r=Z.useRef(null),o=Z.useRef(null),[l,c]=Z.useState(!0),{connected:u,unavailable:d,status:p,exitCode:g,writeInput:O,resize:_,spawn:b,kill:x,onOutput:w,onScrollback:k}=kae({autoSpawn:!0,skipPermissions:l});Z.useEffect(()=>(e&&(e.current=O),()=>{e&&(e.current=null)}),[O,e]);const T=Z.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]),A=Z.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]);Z.useEffect(()=>(w.current=T,k.current=A,()=>{w.current=null,k.current=null}),[T,A,w,k]),Z.useEffect(()=>{if(!i.current)return;const N=new Qre({cursorBlink:!0,fontSize:14,lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0"}}),q=new Bre,J=new Sae;N.loadAddon(q),N.loadAddon(J);try{N.loadAddon(new Oae)}catch{}N.open(i.current),q.fit(),n.current=N,s.current=q;const U=N.onData(B=>{O(B)}),R=new ResizeObserver(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s.current&&n.current&&(s.current.fit(),_(n.current.cols,n.current.rows))},100)});return R.observe(i.current),r.current=R,t==null||t(N),()=>{U.dispose(),R.disconnect(),o.current&&clearTimeout(o.current),N.dispose(),n.current=null,s.current=null,r.current=null}},[]);const L=Z.useCallback(()=>{b(l),setTimeout(()=>{var N;return(N=n.current)==null?void 0:N.focus()},100)},[b,l]),E=Z.useCallback(()=>{x()},[x]),z=Z.useCallback(()=>{c(N=>!N)},[]);return S.jsxs("div",{className:"flex h-full w-full flex-col",onWheel:N=>N.stopPropagation(),children:[S.jsxs("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[S.jsx("div",{ref:i,className:"h-full w-full"}),S.jsx(Lae,{onSendCommand:O,isActive:(p==null?void 0:p.isActive)??!1,isAlive:(p==null?void 0:p.alive)??!1,unavailable:d}),d&&S.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-card",children:S.jsxs("div",{className:"max-w-sm text-center",children:[S.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Terminal unavailable"}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:["node-pty is not installed. Run ",S.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm install node-pty"})," in the dashboard directory."]})]})}),!u&&g===null&&S.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/60",children:S.jsxs("div",{className:"flex items-center gap-3 font-mono text-sm text-muted-foreground",children:[S.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[S.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),S.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Reconnecting..."]})}),g!==null&&S.jsxs("div",{className:"absolute inset-x-0 bottom-0 z-10 flex items-center justify-between bg-card/90 px-4 py-2 font-mono text-sm backdrop-blur-sm",children:[S.jsxs("span",{className:"text-muted-foreground",children:["Process exited (code ",g,")"]}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-3 py-1 text-xs text-foreground transition-colors hover:bg-accent-glow",children:"Restart"})]})]}),S.jsx(Eae,{status:p,connected:u,exitCode:g,skipPermissions:l,onToggleSkipPermissions:z,onStop:E,onRestart:L})]})}function Bae(){const[t,e]=Z.useState(!1),i=Z.useCallback(()=>e(n=>!n),[]);return{splitMode:t,toggleSplit:i}}function $ae({splitMode:t,onToggle:e}){return S.jsx("button",{type:"button",onClick:e,title:t?"Full-height mode":"Split-panel mode",className:"absolute right-3 top-2 z-20 flex h-7 w-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:bg-card-hover hover:text-foreground",children:t?S.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"})}):S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),S.jsx("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1.5"})]})})}function zae({mode:t,onToggle:e}){const[i,n]=Z.useState(!1);function s(){n(!0),e(),setTimeout(()=>n(!1),420)}const r=t==="simple",o=r?"Switch to Advanced Mode":"Switch to Simple Mode";return S.jsx("button",{type:"button",onClick:s,title:o,"aria-label":o,className:"flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:S.jsx(vo.span,{animate:{rotate:i?360:0},transition:{duration:.4,ease:"easeInOut"},style:{display:"flex",alignItems:"center",justifyContent:"center"},children:r?S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"6"}),S.jsx("ellipse",{cx:"8",cy:"8",rx:"2.5",ry:"6"}),S.jsx("path",{d:"M2 8h12M3.5 5h9M3.5 11h9",strokeLinecap:"round"})]}):S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1"}),S.jsx("path",{d:"M4 6l2.5 2L4 10M8 10h4",strokeLinecap:"round",strokeLinejoin:"round"})]})})})}function Nae({onChoose:t}){return S.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:[S.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-background/60"}),S.jsxs("div",{className:"relative z-10 border border-border bg-card p-8 max-w-lg w-full mx-4",children:[S.jsx("h2",{className:"font-bold text-lg tracking-tight text-foreground mb-1",children:"Choose Your Dashboard Mode"}),S.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"You can switch between modes at any time from the header toggle."}),S.jsxs("div",{className:"flex gap-4",children:[S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"12",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"8",y:"3",width:"30",height:"6",rx:"1",fill:"#14b8a6",fillOpacity:"0.6"}),S.jsx("rect",{x:"8",y:"18",width:"104",height:"8",rx:"1",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"8",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"62",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Simple Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Clean action cards. No terminal required."})]}),S.jsx("button",{type:"button",onClick:()=>t("simple"),className:"border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Use Simple Mode"})]}),S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"70",fill:"currentColor",fillOpacity:"0.03"}),S.jsx("rect",{x:"0",y:"0",width:"28",height:"70",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"3",y:"3",width:"22",height:"5",rx:"1",fill:"currentColor",fillOpacity:"0.2"}),S.jsx("rect",{x:"3",y:"12",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"3",y:"18",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"30",y:"4",width:"86",height:"28",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"30",y:"36",width:"86",height:"28",rx:"1",fill:"#3b82f6",fillOpacity:"0.1"}),S.jsx("rect",{x:"33",y:"39",width:"12",height:"2",rx:"0.5",fill:"#3b82f6",fillOpacity:"0.5"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Advanced Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Full dashboard with terminal and phase viewer."})]}),S.jsx("button",{type:"button",onClick:()=>t("advanced"),className:"border border-accent bg-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Use Advanced Mode"})]})]})]})]})}function rl(t){var e;return(((e=t==null?void 0:t.phases)==null?void 0:e.length)??0)>0}function hQ(t){var e;return((e=t==null?void 0:t.phases)==null?void 0:e.some(i=>i.disk_status==="partial"||i.disk_status==="planned"||i.disk_status==="discussed"||i.disk_status==="researched"))??!1}const DS=[{id:"plan-new-phase",tab:"plan",title:"Plan New Phase",description:"Create a detailed execution plan for the next phase",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M7 8h6M7 11h4M10 2v4",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:plan-phase",isAvailable:t=>rl(t),unavailableReason:"No phases found in ROADMAP.md — create a project first"},{id:"add-phase",tab:"plan",title:"Add Phase",description:"Insert a new phase into the roadmap",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M10 8v6M7 11h6",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:add-phase",isAvailable:t=>rl(t),unavailableReason:"No project loaded — create a project first"},{id:"discuss-phase",tab:"plan",title:"Discuss Phase",description:"Answer planning questions to define requirements for a phase",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 6a1 1 0 011-1h12a1 1 0 011 1v7a1 1 0 01-1 1H7l-4 3V6z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:discuss-phase",isAvailable:t=>hQ(t),unavailableReason:"No active phase to discuss — plan a phase first"},{id:"init-existing",tab:"plan",title:"Init Existing",description:"Set up MAXSIM planning for an existing project",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 3v10M10 13l-3-3M10 13l3-3",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 17h12",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:init-existing",isAvailable:()=>!0,unavailableReason:""},{id:"new-project",tab:"plan",title:"New Project",description:"Start a brand new MAXSIM project from scratch",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M10 4v12M4 10h12",strokeLinecap:"round"})}),requiresInput:!1,command:"/maxsim:new-project",isAvailable:()=>!0,unavailableReason:""},{id:"execute-phase",tab:"execute",title:"Execute Phase",description:"Run the current phase plan and implement the changes",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M6 4l10 6-10 6V4z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:execute-phase",isAvailable:t=>hQ(t),unavailableReason:"No phase is currently planned — plan a phase first"},{id:"verify-work",tab:"execute",title:"Verify Work",description:"Check that completed phase work meets all acceptance criteria",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M4 10l4 4 8-8",strokeLinecap:"round",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:verify-work",isAvailable:t=>rl(t),unavailableReason:"No phases to verify — complete a phase first"},{id:"audit-milestone",tab:"execute",title:"Audit Milestone",description:"Review and archive a completed milestone",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M4 5h12M4 10h8M4 15h10",strokeLinecap:"round"}),S.jsx("circle",{cx:"16",cy:"14",r:"2.5"}),S.jsx("path",{d:"M18 16l1.5 1.5",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:audit-milestone",isAvailable:t=>rl(t),unavailableReason:"No milestone to audit — complete some phases first"},{id:"fix-gaps",tab:"execute",title:"Fix Gaps",description:"Create plans to close verification failures",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 4v6h6",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 10a6 6 0 1012 0",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:plan-phase --gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to fix — complete a verification first"},{id:"find-gaps",tab:"execute",title:"Find Gaps",description:"Identify missing requirements or unverified work",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"9",cy:"9",r:"5"}),S.jsx("path",{d:"M16 16l-3-3",strokeLinecap:"round"}),S.jsx("path",{d:"M9 7v2M9 11h.01",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:verify-work --find-gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to analyze — create some phases first"},{id:"view-roadmap",tab:"execute",title:"View Roadmap",description:"See all phases and their status inline",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 5h14M3 10h14M3 15h8",strokeLinecap:"round"})}),requiresInput:!1,command:"",isAvailable:t=>rl(t),unavailableReason:"No roadmap to display"}];function jae(){var c,u;const{roadmap:t}=Rl(),{setTab:e,setExpanded:i}=oO(),n=(c=t==null?void 0:t.phases)==null?void 0:c.find(d=>d.number===(t==null?void 0:t.current_phase));let s=null;if(n){const d=n.disk_status;d==="empty"||d==="no_directory"||d==="discussed"||d==="researched"?s="plan-new-phase":d==="planned"||d==="partial"?s="execute-phase":d==="complete"&&(s="verify-work")}else(((u=t==null?void 0:t.phases)==null?void 0:u.length)??0)===0&&(s="new-project");if(!s)return null;const r=DS.find(d=>d.id===s);if(!r)return null;const o=n?`Phase ${n.number}: ${n.name}`:"your project";function l(){const d=r.tab;e(d),i(r.id)}return S.jsxs("div",{className:"border border-simple-accent/40 bg-simple-accent/5 p-4 flex items-center justify-between gap-4 mb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"text-xs uppercase tracking-widest text-simple-accent font-mono mb-1",children:"Recommended"}),S.jsxs("p",{className:"text-sm text-foreground",children:[S.jsx("span",{className:"font-medium",children:o})," is ready to"," ",S.jsx("span",{className:"text-simple-accent",children:r.title.toLowerCase()})]})]}),S.jsx("button",{type:"button",onClick:l,className:"shrink-0 border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:r.title})]})}function Iae({action:t,onExecute:e}){const{inputValues:i,setInput:n,reset:s}=oO(),{roadmap:r}=Rl(),o=Z.useRef(null),[l,c]=Z.useState(!1),[u,d]=Z.useState(!1),p=(()=>{var L;if(!t.requiresInput)return"";const A=(L=r==null?void 0:r.phases)==null?void 0:L.find(E=>!E.roadmap_complete&&(E.disk_status==="empty"||E.disk_status==="no_directory"));return A?`Phase ${A.number}: ${A.name}`:""})(),g=i[t.id]??p;Z.useEffect(()=>{const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[g]);function O(){const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)}function _(A){n(t.id,A)}function b(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),w())}function x(){const A=g.trim();return t.command===""?"":A?`${t.command} "${A}"`:t.command}function w(){if(t.requiresInput&&!g.trim()||t.id==="view-roadmap")return;const A=x();A&&e(A)}function k(){u?(s(),d(!1),c(!1)):(d(!0),setTimeout(()=>d(!1),3e3))}const T=t.requiresInput&&!g.trim();return S.jsxs("div",{className:"flex flex-col gap-3 relative",children:[S.jsx("p",{className:"text-xs text-muted-foreground",children:t.requiresInput?"Describe what this phase should accomplish.":"Add optional context (or leave blank to use defaults)."}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 flex gap-2 items-start",children:S.jsx("textarea",{ref:o,value:g,onChange:A=>{_(A.target.value),O()},onKeyDown:b,placeholder:t.requiresInput?"e.g. Phase 31: Simple Mode UI Shell":"Additional context (optional)",rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground placeholder:text-muted-foreground outline-none leading-relaxed"})}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:w,disabled:T,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",T?"border-border text-muted-foreground cursor-not-allowed":"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background"),children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M2 2l8 4-8 4V2z"})}),"Run in Terminal"]}),S.jsxs("div",{className:"relative ml-auto",children:[S.jsx("button",{type:"button",onClick:()=>c(A=>!A),"aria-label":"More options",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[S.jsx("circle",{cx:"4",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"8",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"12",cy:"8",r:"1.2"})]})}),l&&S.jsx("div",{className:"absolute right-0 bottom-8 z-20 border border-border bg-card shadow-lg min-w-max",children:S.jsx("button",{type:"button",onClick:k,className:Fe("flex w-full items-center gap-2 px-4 py-2.5 text-xs text-left transition-colors",u?"text-danger hover:bg-danger/10":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:u?"Click again to confirm reset":"Reset Simple Mode"})})]})]})]})}function Vae({action:t,roadmap:e,onExecute:i}){var g,O;const{expandedCardId:n,setExpanded:s}=oO(),{roadmap:r}=Rl(),o=n===t.id,l=!t.isAvailable(e),c=(g=r==null?void 0:r.phases)==null?void 0:g.find(_=>_.number===(r==null?void 0:r.current_phase));let u=null;if(c){const _=c.disk_status;_==="empty"||_==="no_directory"||_==="discussed"||_==="researched"?u="plan-new-phase":_==="planned"||_==="partial"?u="execute-phase":_==="complete"&&(u="verify-work")}else(((O=r==null?void 0:r.phases)==null?void 0:O.length)??0)===0&&(u="new-project");const d=t.id===u;function p(){l||s(o?null:t.id)}return S.jsxs("div",{className:Fe("bg-card border-0 transition-all duration-200",l?"opacity-50":"cursor-pointer hover:shadow-md hover:-translate-y-px",o&&"ring-1 ring-simple-accent/40"),title:l?t.unavailableReason:void 0,children:[S.jsxs("button",{type:"button",disabled:l,onClick:p,className:"flex w-full items-start gap-3 p-4 text-left","aria-expanded":o,children:[S.jsx("span",{className:Fe("mt-0.5 shrink-0",l?"text-muted-foreground":"text-simple-accent"),children:t.icon}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.title}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:t.description}),d&&!l&&S.jsx("span",{className:"mt-1 inline-block bg-simple-accent/20 border border-simple-accent/40 px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent",children:"Recommended"})]}),S.jsx("svg",{className:Fe("mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",o&&"rotate-180"),viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M2 4l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),S.jsx(xx,{initial:!1,children:o&&S.jsx(vo.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden border-t border-border/60",children:S.jsx("div",{className:"p-4",children:S.jsx(Iae,{action:t,onExecute:i})})},"expanded")})]})}const s1=6;function Xae({onExecute:t}){var T;const{roadmap:e}=Rl(),{activeTab:i,setTab:n}=oO(),s=Z.useRef(i),[r,o]=Z.useState({plan:!1,execute:!1}),l=e??null,c=DS.filter(A=>A.tab==="plan"),u=DS.filter(A=>A.tab==="execute"),d=(((T=e==null?void 0:e.phases)==null?void 0:T.length)??0)===0,p=d?c.filter(A=>A.id==="new-project"||A.id==="init-existing"):c,g=d?[]:u,O=i==="plan"?p:g,_=r[i],b=_?O:O.slice(0,s1),x=O.length>s1&&!_;function w(A){s.current=i,n(A)}const k=i==="plan"&&s.current==="execute"?-1:1;return S.jsxs("div",{className:"flex flex-col gap-0",children:[S.jsx("div",{className:"flex border-b border-border",children:["plan","execute"].map(A=>{const L=A==="plan"?p.length:g.length,E=A==="plan"?"Plan & Discuss":"Execute & Verify";return S.jsxs("button",{type:"button",onClick:()=>w(A),className:Fe("flex-1 py-2.5 text-xs font-mono uppercase tracking-widest transition-colors duration-200 border-b-2",i===A?"border-b-simple-accent text-simple-accent":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[E," (",L,")"]},A)})}),S.jsx("div",{className:"overflow-hidden",children:S.jsx(xx,{mode:"wait",initial:!1,children:S.jsx(vo.div,{initial:{x:k*20,opacity:0},animate:{x:0,opacity:1},exit:{x:k*-20,opacity:0},transition:{duration:.15},children:O.length===0?S.jsx("div",{className:"py-12 text-center",children:S.jsx("p",{className:"text-sm text-muted-foreground",children:"No actions available in this tab."})}):S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"grid grid-cols-2 gap-px bg-border lg:grid-cols-3",children:b.map(A=>S.jsx(Vae,{action:A,roadmap:l,onExecute:t},A.id))}),x&&S.jsxs("button",{type:"button",onClick:()=>o(A=>({...A,[i]:!0})),className:"w-full border-t border-border py-2.5 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:text-foreground hover:bg-card-hover",children:["Show more (",O.length-s1," more)"]})]})},i)})})]})}function Zae(t,e){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const qae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uae={};function uQ(t,e){return(Uae.jsx?Wae:qae).test(t)}const Yae=/[ \t\n\f\r]/g;function Hae(t){return typeof t=="object"?t.type==="text"?fQ(t.value):!1:fQ(t)}function fQ(t){return t.replace(Yae,"")===""}class Cd{constructor(e,i,n){this.normal=i,this.property=e,n&&(this.space=n)}}Cd.prototype.normal={};Cd.prototype.property={};Cd.prototype.space=void 0;function Xz(t,e){const i={},n={};for(const s of t)Object.assign(i,s.property),Object.assign(n,s.normal);return new Cd(i,n,e)}function BS(t){return t.toLowerCase()}class jn{constructor(e,i){this.attribute=i,this.property=e}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let Fae=0;const Xe=zl(),ri=zl(),$S=zl(),de=zl(),wt=zl(),th=zl(),es=zl();function zl(){return 2**++Fae}const zS=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:ri,commaOrSpaceSeparated:es,commaSeparated:th,number:de,overloadedBoolean:$S,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),r1=Object.keys(zS);class Vw extends jn{constructor(e,i,n,s){let r=-1;if(super(e,i),dQ(this,"space",s),typeof n=="number")for(;++r<r1.length;){const o=r1[r];dQ(this,r1[r],(n&zS[o])===zS[o])}}}Vw.prototype.defined=!0;function dQ(t,e,i){i&&(t[e]=i)}function Ah(t){const e={},i={};for(const[n,s]of Object.entries(t.properties)){const r=new Vw(n,t.transform(t.attributes||{},n),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(r.mustUseProperty=!0),e[n]=r,i[BS(n)]=n,i[BS(r.attribute)]=n}return new Cd(e,i,t.space)}const Zz=Ah({properties:{ariaActiveDescendant:null,ariaAtomic:ri,ariaAutoComplete:null,ariaBusy:ri,ariaChecked:ri,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:ri,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:ri,ariaFlowTo:wt,ariaGrabbed:ri,ariaHasPopup:null,ariaHidden:ri,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:de,ariaLive:null,ariaModal:ri,ariaMultiLine:ri,ariaMultiSelectable:ri,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:ri,ariaReadOnly:ri,ariaRelevant:null,ariaRequired:ri,ariaRoleDescription:wt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:ri,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function qz(t,e){return e in t?t[e]:e}function Wz(t,e){return qz(t,e.toLowerCase())}const Gae=Ah({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:th,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:wt,autoFocus:Xe,autoPlay:Xe,blocking:wt,capture:null,charSet:null,checked:Xe,cite:null,className:wt,cols:de,colSpan:null,content:null,contentEditable:ri,controls:Xe,controlsList:wt,coords:de|th,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:$S,draggable:ri,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:wt,height:de,hidden:$S,high:de,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:wt,itemRef:wt,itemScope:Xe,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xe,optimum:de,pattern:null,ping:wt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:wt,required:Xe,reversed:Xe,rows:de,rowSpan:de,sandbox:wt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:ri,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:ri,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:ri,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:Wz}),Kae=Ah({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:es,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:th,g2:th,glyphName:th,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:es,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:es,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:es,rev:es,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:es,requiredFeatures:es,requiredFonts:es,requiredFormats:es,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:es,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:es,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:es,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qz}),Uz=Ah({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Yz=Ah({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Wz}),Hz=Ah({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Jae={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ele=/[A-Z]/g,pQ=/-[a-z]/g,tle=/^data[-\w.:]+$/i;function ile(t,e){const i=BS(e);let n=e,s=jn;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&tle.test(e)){if(e.charAt(4)==="-"){const r=e.slice(5).replace(pQ,sle);n="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=e.slice(4);if(!pQ.test(r)){let o=r.replace(ele,nle);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}s=Vw}return new s(n,e)}function nle(t){return"-"+t.toLowerCase()}function sle(t){return t.charAt(1).toUpperCase()}const rle=Xz([Zz,Gae,Uz,Yz,Hz],"html"),Xw=Xz([Zz,Kae,Uz,Yz,Hz],"svg");function ole(t){return t.join(" ").trim()}var Ac={},o1,mQ;function ale(){if(mQ)return o1;mQ=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,i=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
218
218
  `,u="/",d="*",p="",g="comment",O="declaration";function _(x,w){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];w=w||{};var k=1,T=1;function A(D){var j=D.match(e);j&&(k+=j.length);var $=D.lastIndexOf(c);T=~$?D.length-$:T+D.length}function L(){var D={line:k,column:T};return function(j){return j.position=new E(D),q(),j}}function E(D){this.start=D,this.end={line:k,column:T},this.source=w.source}E.prototype.content=x;function z(D){var j=new Error(w.source+":"+k+":"+T+": "+D);if(j.reason=D,j.filename=w.source,j.line=k,j.column=T,j.source=x,!w.silent)throw j}function N(D){var j=D.exec(x);if(j){var $=j[0];return A($),x=x.slice($.length),j}}function q(){N(i)}function J(D){var j;for(D=D||[];j=U();)j!==!1&&D.push(j);return D}function U(){var D=L();if(!(u!=x.charAt(0)||d!=x.charAt(1))){for(var j=2;p!=x.charAt(j)&&(d!=x.charAt(j)||u!=x.charAt(j+1));)++j;if(j+=2,p===x.charAt(j-1))return z("End of comment missing");var $=x.slice(2,j-2);return T+=2,A($),x=x.slice(j),T+=2,D({type:g,comment:$})}}function R(){var D=L(),j=N(n);if(j){if(U(),!N(s))return z("property missing ':'");var $=N(r),X=D({type:O,property:b(j[0].replace(t,p)),value:$?b($[0].replace(t,p)):p});return N(o),X}}function B(){var D=[];J(D);for(var j;j=R();)j!==!1&&(D.push(j),J(D));return D}return q(),B()}function b(x){return x?x.replace(l,p):p}return o1=_,o1}var gQ;function lle(){if(gQ)return Ac;gQ=1;var t=Ac&&Ac.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.default=i;const e=t(ale());function i(n,s){let r=null;if(!n||typeof n!="string")return r;const o=(0,e.default)(n),l=typeof s=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:d}=c;l?s(u,d,c):d&&(r=r||{},r[u]=d)}),r}return Ac}var qu={},OQ;function cle(){if(OQ)return qu;OQ=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,i=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,r=function(u){return!u||i.test(u)||t.test(u)},o=function(u,d){return d.toUpperCase()},l=function(u,d){return"".concat(d,"-")},c=function(u,d){return d===void 0&&(d={}),r(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(s,l):u=u.replace(n,l),u.replace(e,o))};return qu.camelCase=c,qu}var Wu,vQ;function hle(){if(vQ)return Wu;vQ=1;var t=Wu&&Wu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(lle()),i=cle();function n(s,r){var o={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(o[(0,i.camelCase)(l,r)]=c)}),o}return n.default=n,Wu=n,Wu}var ule=hle();const fle=WS(ule),Fz=Gz("end"),Zw=Gz("start");function Gz(t){return e;function e(i){const n=i&&i.position&&i.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function dle(t){const e=Zw(t),i=Fz(t);if(e&&i)return{start:e,end:i}}function Sf(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?_Q(t.position):"start"in t||"end"in t?_Q(t):"line"in t||"column"in t?NS(t):""}function NS(t){return yQ(t&&t.line)+":"+yQ(t&&t.column)}function _Q(t){return NS(t&&t.start)+"-"+NS(t&&t.end)}function yQ(t){return t&&typeof t=="number"?t:1}class ln extends Error{constructor(e,i,n){super(),typeof i=="string"&&(n=i,i=void 0);let s="",r={},o=!1;if(i&&("line"in i&&"column"in i?r={place:i}:"start"in i&&"end"in i?r={place:i}:"type"in i?r={ancestors:[i],place:i.position}:r={...i}),typeof e=="string"?s=e:!r.cause&&e&&(o=!0,s=e.message,r.cause=e),!r.ruleId&&!r.source&&typeof n=="string"){const c=n.indexOf(":");c===-1?r.ruleId=n:(r.source=n.slice(0,c),r.ruleId=n.slice(c+1))}if(!r.place&&r.ancestors&&r.ancestors){const c=r.ancestors[r.ancestors.length-1];c&&(r.place=c.position)}const l=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Sf(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ln.prototype.file="";ln.prototype.name="";ln.prototype.reason="";ln.prototype.message="";ln.prototype.stack="";ln.prototype.column=void 0;ln.prototype.line=void 0;ln.prototype.ancestors=void 0;ln.prototype.cause=void 0;ln.prototype.fatal=void 0;ln.prototype.place=void 0;ln.prototype.ruleId=void 0;ln.prototype.source=void 0;const qw={}.hasOwnProperty,ple=new Map,mle=/[A-Z]/g,gle=new Set(["table","tbody","thead","tfoot","tr"]),Ole=new Set(["td","th"]),Kz="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vle(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=kle(i,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Cle(i,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Xw:rle,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},r=Jz(s,t,void 0);return r&&typeof r!="string"?r:s.create(t,s.Fragment,{children:r||void 0},void 0)}function Jz(t,e,i){if(e.type==="element")return _le(t,e,i);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return yle(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Sle(t,e,i);if(e.type==="mdxjsEsm")return ble(t,e);if(e.type==="root")return xle(t,e,i);if(e.type==="text")return wle(t,e)}function _le(t,e,i){const n=t.schema;let s=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(s=Xw,t.schema=s),t.ancestors.push(e);const r=tN(t,e.tagName,!1),o=Tle(t,e);let l=Uw(t,e);return gle.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Hae(c):!0})),eN(t,o,r,e),Ww(o,l),t.ancestors.pop(),t.schema=n,t.create(e,r,o,i)}function yle(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}rd(t,e.position)}function ble(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rd(t,e.position)}function Sle(t,e,i){const n=t.schema;let s=n;e.name==="svg"&&n.space==="html"&&(s=Xw,t.schema=s),t.ancestors.push(e);const r=e.name===null?t.Fragment:tN(t,e.name,!0),o=Ale(t,e),l=Uw(t,e);return eN(t,o,r,e),Ww(o,l),t.ancestors.pop(),t.schema=n,t.create(e,r,o,i)}function xle(t,e,i){const n={};return Ww(n,Uw(t,e)),t.create(e,t.Fragment,n,i)}function wle(t,e){return e.value}function eN(t,e,i,n){typeof i!="string"&&i!==t.Fragment&&t.passNode&&(e.node=n)}function Ww(t,e){if(e.length>0){const i=e.length>1?e:e[0];i&&(t.children=i)}}function Cle(t,e,i){return n;function n(s,r,o,l){const u=Array.isArray(o.children)?i:e;return l?u(r,o,l):u(r,o)}}function kle(t,e){return i;function i(n,s,r,o){const l=Array.isArray(r.children),c=Zw(n);return e(s,r,o,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function Tle(t,e){const i={};let n,s;for(s in e.properties)if(s!=="children"&&qw.call(e.properties,s)){const r=Ele(t,s,e.properties[s]);if(r){const[o,l]=r;t.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Ole.has(e.tagName)?n=l:i[o]=l}}if(n){const r=i.style||(i.style={});r[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return i}function Ale(t,e){const i={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const r=n.data.estree.body[0];r.type;const o=r.expression;o.type;const l=o.properties[0];l.type,Object.assign(i,t.evaluater.evaluateExpression(l.argument))}else rd(t,e.position);else{const s=n.name;let r;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const l=n.value.data.estree.body[0];l.type,r=t.evaluater.evaluateExpression(l.expression)}else rd(t,e.position);else r=n.value===null?!0:n.value;i[s]=r}return i}function Uw(t,e){const i=[];let n=-1;const s=t.passKeys?new Map:ple;for(;++n<e.children.length;){const r=e.children[n];let o;if(t.passKeys){const c=r.type==="element"?r.tagName:r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement"?r.name:void 0;if(c){const u=s.get(c)||0;o=c+"-"+u,s.set(c,u+1)}}const l=Jz(t,r,o);l!==void 0&&i.push(l)}return i}function Ele(t,e,i){const n=ile(t.schema,e);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=n.commaSeparated?Zae(i):ole(i)),n.property==="style"){let s=typeof i=="object"?i:Mle(t,String(i));return t.stylePropertyNameCase==="css"&&(s=Ple(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&n.space?Jae[n.property]||n.property:n.attribute,i]}}function Mle(t,e){try{return fle(e,{reactCompat:!0})}catch(i){if(t.ignoreInvalidStyle)return{};const n=i,s=new ln("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=Kz+"#cannot-parse-style-attribute",s}}function tN(t,e,i){let n;if(!i)n={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let r=-1,o;for(;++r<s.length;){const l=uQ(s[r])?{type:"Identifier",name:s[r]}:{type:"Literal",value:s[r]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(r&&l.type==="Literal"),optional:!1}:l}n=o}else n=uQ(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const s=n.value;return qw.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(n);rd(t)}function rd(t,e){const i=new ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Kz+"#cannot-handle-mdx-estrees-without-createevaluater",i}function Ple(t){const e={};let i;for(i in t)qw.call(t,i)&&(e[Rle(i)]=t[i]);return e}function Rle(t){let e=t.replace(mle,Qle);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Qle(t){return"-"+t.toLowerCase()}const a1={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Lle={};function Dle(t,e){const i=Lle,n=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return iN(t,n,s)}function iN(t,e,i){if(Ble(t)){if("value"in t)return t.type==="html"&&!i?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return bQ(t.children,e,i)}return Array.isArray(t)?bQ(t,e,i):""}function bQ(t,e,i){const n=[];let s=-1;for(;++s<t.length;)n[s]=iN(t[s],e,i);return n.join("")}function Ble(t){return!!(t&&typeof t=="object")}const SQ=document.createElement("i");function Yw(t){const e="&"+t+";";SQ.innerHTML=e;const i=SQ.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===e?!1:i}function Pr(t,e,i,n){const s=t.length;let r=0,o;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,i=i>0?i:0,n.length<1e4)o=Array.from(n),o.unshift(e,i),t.splice(...o);else for(i&&t.splice(e,i);r<n.length;)o=n.slice(r,r+1e4),o.unshift(e,0),t.splice(...o),r+=1e4,e+=1e4}function ws(t,e){return t.length>0?(Pr(t,t.length,0,e),t):e}const xQ={}.hasOwnProperty;function $le(t){const e={};let i=-1;for(;++i<t.length;)zle(e,t[i]);return e}function zle(t,e){let i;for(i in e){const s=(xQ.call(t,i)?t[i]:void 0)||(t[i]={}),r=e[i];let o;if(r)for(o in r){xQ.call(s,o)||(s[o]=[]);const l=r[o];Nle(s[o],Array.isArray(l)?l:l?[l]:[])}}}function Nle(t,e){let i=-1;const n=[];for(;++i<e.length;)(e[i].add==="after"?t:n).push(e[i]);Pr(t,0,0,n)}function nN(t,e){const i=Number.parseInt(t,e);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function ih(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vr=Qa(/[A-Za-z]/),rs=Qa(/[\dA-Za-z]/),jle=Qa(/[#-'*+\--9=?A-Z^-~]/);function jS(t){return t!==null&&(t<32||t===127)}const IS=Qa(/\d/),Ile=Qa(/[\dA-Fa-f]/),Vle=Qa(/[!-/:-@[-`{-~]/);function $e(t){return t!==null&&t<-2}function Nn(t){return t!==null&&(t<0||t===32)}function lt(t){return t===-2||t===-1||t===32}const Xle=Qa(new RegExp("\\p{P}|\\p{S}","u")),Zle=Qa(/\s/);function Qa(t){return e;function e(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function Eh(t){const e=[];let i=-1,n=0,s=0;for(;++i<t.length;){const r=t.charCodeAt(i);let o="";if(r===37&&rs(t.charCodeAt(i+1))&&rs(t.charCodeAt(i+2)))s=2;else if(r<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(r))||(o=String.fromCharCode(r));else if(r>55295&&r<57344){const l=t.charCodeAt(i+1);r<56320&&l>56319&&l<57344?(o=String.fromCharCode(r,l),s=1):o="�"}else o=String.fromCharCode(r);o&&(e.push(t.slice(n,i),encodeURIComponent(o)),n=i+s+1,o=""),s&&(i+=s,s=0)}return e.join("")+t.slice(n)}function kt(t,e,i,n){const s=n?n-1:Number.POSITIVE_INFINITY;let r=0;return o;function o(c){return lt(c)?(t.enter(i),l(c)):e(c)}function l(c){return lt(c)&&r++<s?(t.consume(c),l):(t.exit(i),e(c))}}const qle={tokenize:Wle};function Wle(t){const e=t.attempt(this.parser.constructs.contentInitial,n,s);let i;return e;function n(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),kt(t,e,"linePrefix")}function s(l){return t.enter("paragraph"),r(l)}function r(l){const c=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=c),i=c,o(l)}function o(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return $e(l)?(t.consume(l),t.exit("chunkText"),r):(t.consume(l),o)}}const Ule={tokenize:Yle},wQ={tokenize:Hle};function Yle(t){const e=this,i=[];let n=0,s,r,o;return l;function l(T){if(n<i.length){const A=i[n];return e.containerState=A[1],t.attempt(A[0].continuation,c,u)(T)}return u(T)}function c(T){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&k();const A=e.events.length;let L=A,E;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){E=e.events[L][1].end;break}w(n);let z=A;for(;z<e.events.length;)e.events[z][1].end={...E},z++;return Pr(e.events,L+1,0,e.events.slice(A)),e.events.length=z,u(T)}return l(T)}function u(T){if(n===i.length){if(!s)return g(T);if(s.currentConstruct&&s.currentConstruct.concrete)return _(T);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(wQ,d,p)(T)}function d(T){return s&&k(),w(n),g(T)}function p(T){return e.parser.lazy[e.now().line]=n!==i.length,o=e.now().offset,_(T)}function g(T){return e.containerState={},t.attempt(wQ,O,_)(T)}function O(T){return n++,i.push([e.currentConstruct,e.containerState]),g(T)}function _(T){if(T===null){s&&k(),w(0),t.consume(T);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:r}),b(T)}function b(T){if(T===null){x(t.exit("chunkFlow"),!0),w(0),t.consume(T);return}return $e(T)?(t.consume(T),x(t.exit("chunkFlow")),n=0,e.interrupt=void 0,l):(t.consume(T),b)}function x(T,A){const L=e.sliceStream(T);if(A&&L.push(null),T.previous=r,r&&(r.next=T),r=T,s.defineSkip(T.start),s.write(L),e.parser.lazy[T.start.line]){let E=s.events.length;for(;E--;)if(s.events[E][1].start.offset<o&&(!s.events[E][1].end||s.events[E][1].end.offset>o))return;const z=e.events.length;let N=z,q,J;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){if(q){J=e.events[N][1].end;break}q=!0}for(w(n),E=z;E<e.events.length;)e.events[E][1].end={...J},E++;Pr(e.events,N+1,0,e.events.slice(z)),e.events.length=E}}function w(T){let A=i.length;for(;A-- >T;){const L=i[A];e.containerState=L[1],L[0].exit.call(e,t)}i.length=T}function k(){s.write([null]),r=void 0,s=void 0,e.containerState._closeFlow=void 0}}function Hle(t,e,i){return kt(t,t.attempt(this.parser.constructs.document,e,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function CQ(t){if(t===null||Nn(t)||Zle(t))return 1;if(Xle(t))return 2}function Hw(t,e,i){const n=[];let s=-1;for(;++s<t.length;){const r=t[s].resolveAll;r&&!n.includes(r)&&(e=r(e,i),n.push(r))}return e}const VS={name:"attention",resolveAll:Fle,tokenize:Gle};function Fle(t,e){let i=-1,n,s,r,o,l,c,u,d;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(n=i;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[n][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;c=t[n][1].end.offset-t[n][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const p={...t[n][1].end},g={...t[i][1].start};kQ(p,-c),kQ(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...t[n][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:g},r={type:c>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[i][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},t[n][1].end={...o.start},t[i][1].start={...l.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=ws(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=ws(u,[["enter",s,e],["enter",o,e],["exit",o,e],["enter",r,e]]),u=ws(u,Hw(e.parser.constructs.insideSpan.null,t.slice(n+1,i),e)),u=ws(u,[["exit",r,e],["enter",l,e],["exit",l,e],["exit",s,e]]),t[i][1].end.offset-t[i][1].start.offset?(d=2,u=ws(u,[["enter",t[i][1],e],["exit",t[i][1],e]])):d=0,Pr(t,n-1,i-n+3,u),i=n+u.length-d-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function Gle(t,e){const i=this.parser.constructs.attentionMarkers.null,n=this.previous,s=CQ(n);let r;return o;function o(c){return r=c,t.enter("attentionSequence"),l(c)}function l(c){if(c===r)return t.consume(c),l;const u=t.exit("attentionSequence"),d=CQ(c),p=!d||d===2&&s||i.includes(c),g=!s||s===2&&d||i.includes(n);return u._open=!!(r===42?p:p&&(s||!g)),u._close=!!(r===42?g:g&&(d||!p)),e(c)}}function kQ(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Kle={name:"autolink",tokenize:Jle};function Jle(t,e,i){let n=0;return s;function s(O){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),r}function r(O){return vr(O)?(t.consume(O),o):O===64?i(O):u(O)}function o(O){return O===43||O===45||O===46||rs(O)?(n=1,l(O)):u(O)}function l(O){return O===58?(t.consume(O),n=0,c):(O===43||O===45||O===46||rs(O))&&n++<32?(t.consume(O),l):(n=0,u(O))}function c(O){return O===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):O===null||O===32||O===60||jS(O)?i(O):(t.consume(O),c)}function u(O){return O===64?(t.consume(O),d):jle(O)?(t.consume(O),u):i(O)}function d(O){return rs(O)?p(O):i(O)}function p(O){return O===46?(t.consume(O),n=0,d):O===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):g(O)}function g(O){if((O===45||rs(O))&&n++<63){const _=O===45?g:p;return t.consume(O),_}return i(O)}}const PO={partial:!0,tokenize:ece};function ece(t,e,i){return n;function n(r){return lt(r)?kt(t,s,"linePrefix")(r):s(r)}function s(r){return r===null||$e(r)?e(r):i(r)}}const sN={continuation:{tokenize:ice},exit:nce,name:"blockQuote",tokenize:tce};function tce(t,e,i){const n=this;return s;function s(o){if(o===62){const l=n.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),r}return i(o)}function r(o){return lt(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function ice(t,e,i){const n=this;return s;function s(o){return lt(o)?kt(t,r,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):r(o)}function r(o){return t.attempt(sN,e,i)(o)}}function nce(t){t.exit("blockQuote")}const rN={name:"characterEscape",tokenize:sce};function sce(t,e,i){return n;function n(r){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(r),t.exit("escapeMarker"),s}function s(r){return Vle(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):i(r)}}const oN={name:"characterReference",tokenize:rce};function rce(t,e,i){const n=this;let s=0,r,o;return l;function l(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),c}function c(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),r=31,o=rs,d(p))}function u(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),r=6,o=Ile,d):(t.enter("characterReferenceValue"),r=7,o=IS,d(p))}function d(p){if(p===59&&s){const g=t.exit("characterReferenceValue");return o===rs&&!Yw(n.sliceSerialize(g))?i(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(p)&&s++<r?(t.consume(p),d):i(p)}}const TQ={partial:!0,tokenize:ace},AQ={concrete:!0,name:"codeFenced",tokenize:oce};function oce(t,e,i){const n=this,s={partial:!0,tokenize:L};let r=0,o=0,l;return c;function c(E){return u(E)}function u(E){const z=n.events[n.events.length-1];return r=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,l=E,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===l?(o++,t.consume(E),d):o<3?i(E):(t.exit("codeFencedFenceSequence"),lt(E)?kt(t,p,"whitespace")(E):p(E))}function p(E){return E===null||$e(E)?(t.exit("codeFencedFence"),n.interrupt?e(E):t.check(TQ,b,A)(E)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(E)):lt(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),kt(t,O,"whitespace")(E)):E===96&&E===l?i(E):(t.consume(E),g)}function O(E){return E===null||$e(E)?p(E):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),_(E))}function _(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(E)):E===96&&E===l?i(E):(t.consume(E),_)}function b(E){return t.attempt(s,A,x)(E)}function x(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),w}function w(E){return r>0&&lt(E)?kt(t,k,"linePrefix",r+1)(E):k(E)}function k(E){return E===null||$e(E)?t.check(TQ,b,A)(E):(t.enter("codeFlowValue"),T(E))}function T(E){return E===null||$e(E)?(t.exit("codeFlowValue"),k(E)):(t.consume(E),T)}function A(E){return t.exit("codeFenced"),e(E)}function L(E,z,N){let q=0;return J;function J(j){return E.enter("lineEnding"),E.consume(j),E.exit("lineEnding"),U}function U(j){return E.enter("codeFencedFence"),lt(j)?kt(E,R,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):R(j)}function R(j){return j===l?(E.enter("codeFencedFenceSequence"),B(j)):N(j)}function B(j){return j===l?(q++,E.consume(j),B):q>=o?(E.exit("codeFencedFenceSequence"),lt(j)?kt(E,D,"whitespace")(j):D(j)):N(j)}function D(j){return j===null||$e(j)?(E.exit("codeFencedFence"),z(j)):N(j)}}}function ace(t,e,i){const n=this;return s;function s(o){return o===null?i(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r)}function r(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}const l1={name:"codeIndented",tokenize:cce},lce={partial:!0,tokenize:hce};function cce(t,e,i){const n=this;return s;function s(u){return t.enter("codeIndented"),kt(t,r,"linePrefix",5)(u)}function r(u){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):i(u)}function o(u){return u===null?c(u):$e(u)?t.attempt(lce,o,c)(u):(t.enter("codeFlowValue"),l(u))}function l(u){return u===null||$e(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),l)}function c(u){return t.exit("codeIndented"),e(u)}}function hce(t,e,i){const n=this;return s;function s(o){return n.parser.lazy[n.now().line]?i(o):$e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):kt(t,r,"linePrefix",5)(o)}function r(o){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):$e(o)?s(o):i(o)}}const uce={name:"codeText",previous:dce,resolve:fce,tokenize:pce};function fce(t){let e=t.length-4,i=3,n,s;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=i;++n<e;)if(t[n][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[e][1].type="codeTextPadding",i+=2,e-=2;break}}for(n=i-1,e++;++n<=e;)s===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(s=n):(n===e||t[n][1].type==="lineEnding")&&(t[s][1].type="codeTextData",n!==s+2&&(t[s][1].end=t[n-1][1].end,t.splice(s+2,n-s-2),e-=n-s-2,n=s+2),s=void 0);return t}function dce(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pce(t,e,i){let n=0,s,r;return o;function o(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),n++,l):(t.exit("codeTextSequence"),c(p))}function c(p){return p===null?i(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),c):p===96?(r=t.enter("codeTextSequence"),s=0,d(p)):$e(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||$e(p)?(t.exit("codeTextData"),c(p)):(t.consume(p),u)}function d(p){return p===96?(t.consume(p),s++,d):s===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(r.type="codeTextData",u(p))}}class mce{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,i){const n=i??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,i,n){const s=i||0;this.setCursor(Math.trunc(e));const r=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return n&&Uu(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Uu(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Uu(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const i=this.left.splice(e,Number.POSITIVE_INFINITY);Uu(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Uu(this.left,i.reverse())}}}function Uu(t,e){let i=0;if(e.length<1e4)t.push(...e);else for(;i<e.length;)t.push(...e.slice(i,i+1e4)),i+=1e4}function aN(t){const e={};let i=-1,n,s,r,o,l,c,u;const d=new mce(t);for(;++i<d.length;){for(;i in e;)i=e[i];if(n=d.get(i),i&&n[1].type==="chunkFlow"&&d.get(i-1)[1].type==="listItemPrefix"&&(c=n[1]._tokenizer.events,r=0,r<c.length&&c[r][1].type==="lineEndingBlank"&&(r+=2),r<c.length&&c[r][1].type==="content"))for(;++r<c.length&&c[r][1].type!=="content";)c[r][1].type==="chunkText"&&(c[r][1]._isInFirstContentOfListItem=!0,r++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,gce(d,i)),i=e[i],u=!0);else if(n[1]._container){for(r=i,s=void 0;r--;)if(o=d.get(r),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=r);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(n[1].end={...d.get(s)[1].start},l=d.slice(s,i),l.unshift(n),d.splice(s,i-s+1,l))}}return Pr(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function gce(t,e){const i=t.get(e)[1],n=t.get(e)[2];let s=e-1;const r=[];let o=i._tokenizer;o||(o=n.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,p,g=-1,O=i,_=0,b=0;const x=[b];for(;O;){for(;t.get(++s)[1]!==O;);r.push(s),O._tokenizer||(d=n.sliceStream(O),O.next||d.push(null),p&&o.defineSkip(O.start),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=O,O=O.next}for(O=i;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(b=g+1,x.push(b),O._tokenizer=void 0,O.previous=void 0,O=O.next);for(o.events=[],O?(O._tokenizer=void 0,O.previous=void 0):x.pop(),g=x.length;g--;){const w=l.slice(x[g],x[g+1]),k=r.pop();c.push([k,k+w.length-1]),t.splice(k,2,w)}for(c.reverse(),g=-1;++g<c.length;)u[_+c[g][0]]=_+c[g][1],_+=c[g][1]-c[g][0]-1;return u}const Oce={resolve:_ce,tokenize:yce},vce={partial:!0,tokenize:bce};function _ce(t){return aN(t),t}function yce(t,e){let i;return n;function n(l){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?r(l):$e(l)?t.check(vce,o,r)(l):(t.consume(l),s)}function r(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function o(l){return t.consume(l),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function bce(t,e,i){const n=this;return s;function s(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),kt(t,r,"linePrefix")}function r(o){if(o===null||$e(o))return i(o);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):t.interrupt(n.parser.constructs.flow,i,e)(o)}}function lN(t,e,i,n,s,r,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return p;function p(w){return w===60?(t.enter(n),t.enter(s),t.enter(r),t.consume(w),t.exit(r),g):w===null||w===32||w===41||jS(w)?i(w):(t.enter(n),t.enter(o),t.enter(l),t.enter("chunkString",{contentType:"string"}),b(w))}function g(w){return w===62?(t.enter(r),t.consume(w),t.exit(r),t.exit(s),t.exit(n),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),O(w))}function O(w){return w===62?(t.exit("chunkString"),t.exit(l),g(w)):w===null||w===60||$e(w)?i(w):(t.consume(w),w===92?_:O)}function _(w){return w===60||w===62||w===92?(t.consume(w),O):O(w)}function b(w){return!d&&(w===null||w===41||Nn(w))?(t.exit("chunkString"),t.exit(l),t.exit(o),t.exit(n),e(w)):d<u&&w===40?(t.consume(w),d++,b):w===41?(t.consume(w),d--,b):w===null||w===32||w===40||jS(w)?i(w):(t.consume(w),w===92?x:b)}function x(w){return w===40||w===41||w===92?(t.consume(w),b):b(w)}}function cN(t,e,i,n,s,r){const o=this;let l=0,c;return u;function u(O){return t.enter(n),t.enter(s),t.consume(O),t.exit(s),t.enter(r),d}function d(O){return l>999||O===null||O===91||O===93&&!c||O===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?i(O):O===93?(t.exit(r),t.enter(s),t.consume(O),t.exit(s),t.exit(n),e):$e(O)?(t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||O===91||O===93||$e(O)||l++>999?(t.exit("chunkString"),d(O)):(t.consume(O),c||(c=!lt(O)),O===92?g:p)}function g(O){return O===91||O===92||O===93?(t.consume(O),l++,p):p(O)}}function hN(t,e,i,n,s,r){let o;return l;function l(g){return g===34||g===39||g===40?(t.enter(n),t.enter(s),t.consume(g),t.exit(s),o=g===40?41:g,c):i(g)}function c(g){return g===o?(t.enter(s),t.consume(g),t.exit(s),t.exit(n),e):(t.enter(r),u(g))}function u(g){return g===o?(t.exit(r),c(o)):g===null?i(g):$e(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),kt(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===o||g===null||$e(g)?(t.exit("chunkString"),u(g)):(t.consume(g),g===92?p:d)}function p(g){return g===o||g===92?(t.consume(g),d):d(g)}}function xf(t,e){let i;return n;function n(s){return $e(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i=!0,n):lt(s)?kt(t,n,i?"linePrefix":"lineSuffix")(s):e(s)}}const Sce={name:"definition",tokenize:wce},xce={partial:!0,tokenize:Cce};function wce(t,e,i){const n=this;let s;return r;function r(O){return t.enter("definition"),o(O)}function o(O){return cN.call(n,t,l,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(O)}function l(O){return s=ih(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),O===58?(t.enter("definitionMarker"),t.consume(O),t.exit("definitionMarker"),c):i(O)}function c(O){return Nn(O)?xf(t,u)(O):u(O)}function u(O){return lN(t,d,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(O)}function d(O){return t.attempt(xce,p,p)(O)}function p(O){return lt(O)?kt(t,g,"whitespace")(O):g(O)}function g(O){return O===null||$e(O)?(t.exit("definition"),n.parser.defined.push(s),e(O)):i(O)}}function Cce(t,e,i){return n;function n(l){return Nn(l)?xf(t,s)(l):i(l)}function s(l){return hN(t,r,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function r(l){return lt(l)?kt(t,o,"whitespace")(l):o(l)}function o(l){return l===null||$e(l)?e(l):i(l)}}const kce={name:"hardBreakEscape",tokenize:Tce};function Tce(t,e,i){return n;function n(r){return t.enter("hardBreakEscape"),t.consume(r),s}function s(r){return $e(r)?(t.exit("hardBreakEscape"),e(r)):i(r)}}const Ace={name:"headingAtx",resolve:Ece,tokenize:Mce};function Ece(t,e){let i=t.length-2,n=3,s,r;return t[n][1].type==="whitespace"&&(n+=2),i-2>n&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(n===i-1||i-4>n&&t[i-2][1].type==="whitespace")&&(i-=n+1===i?2:4),i>n&&(s={type:"atxHeadingText",start:t[n][1].start,end:t[i][1].end},r={type:"chunkText",start:t[n][1].start,end:t[i][1].end,contentType:"text"},Pr(t,n,i-n+1,[["enter",s,e],["enter",r,e],["exit",r,e],["exit",s,e]])),t}function Mce(t,e,i){let n=0;return s;function s(d){return t.enter("atxHeading"),r(d)}function r(d){return t.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&n++<6?(t.consume(d),o):d===null||Nn(d)?(t.exit("atxHeadingSequence"),l(d)):i(d)}function l(d){return d===35?(t.enter("atxHeadingSequence"),c(d)):d===null||$e(d)?(t.exit("atxHeading"),e(d)):lt(d)?kt(t,l,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function c(d){return d===35?(t.consume(d),c):(t.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Nn(d)?(t.exit("atxHeadingText"),l(d)):(t.consume(d),u)}}const Pce=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],EQ=["pre","script","style","textarea"],Rce={concrete:!0,name:"htmlFlow",resolveTo:Dce,tokenize:Bce},Qce={partial:!0,tokenize:zce},Lce={partial:!0,tokenize:$ce};function Dce(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Bce(t,e,i){const n=this;let s,r,o,l,c;return u;function u(Q){return d(Q)}function d(Q){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(Q),p}function p(Q){return Q===33?(t.consume(Q),g):Q===47?(t.consume(Q),r=!0,b):Q===63?(t.consume(Q),s=3,n.interrupt?e:M):vr(Q)?(t.consume(Q),o=String.fromCharCode(Q),x):i(Q)}function g(Q){return Q===45?(t.consume(Q),s=2,O):Q===91?(t.consume(Q),s=5,l=0,_):vr(Q)?(t.consume(Q),s=4,n.interrupt?e:M):i(Q)}function O(Q){return Q===45?(t.consume(Q),n.interrupt?e:M):i(Q)}function _(Q){const ue="CDATA[";return Q===ue.charCodeAt(l++)?(t.consume(Q),l===ue.length?n.interrupt?e:R:_):i(Q)}function b(Q){return vr(Q)?(t.consume(Q),o=String.fromCharCode(Q),x):i(Q)}function x(Q){if(Q===null||Q===47||Q===62||Nn(Q)){const ue=Q===47,he=o.toLowerCase();return!ue&&!r&&EQ.includes(he)?(s=1,n.interrupt?e(Q):R(Q)):Pce.includes(o.toLowerCase())?(s=6,ue?(t.consume(Q),w):n.interrupt?e(Q):R(Q)):(s=7,n.interrupt&&!n.parser.lazy[n.now().line]?i(Q):r?k(Q):T(Q))}return Q===45||rs(Q)?(t.consume(Q),o+=String.fromCharCode(Q),x):i(Q)}function w(Q){return Q===62?(t.consume(Q),n.interrupt?e:R):i(Q)}function k(Q){return lt(Q)?(t.consume(Q),k):J(Q)}function T(Q){return Q===47?(t.consume(Q),J):Q===58||Q===95||vr(Q)?(t.consume(Q),A):lt(Q)?(t.consume(Q),T):J(Q)}function A(Q){return Q===45||Q===46||Q===58||Q===95||rs(Q)?(t.consume(Q),A):L(Q)}function L(Q){return Q===61?(t.consume(Q),E):lt(Q)?(t.consume(Q),L):T(Q)}function E(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?i(Q):Q===34||Q===39?(t.consume(Q),c=Q,z):lt(Q)?(t.consume(Q),E):N(Q)}function z(Q){return Q===c?(t.consume(Q),c=null,q):Q===null||$e(Q)?i(Q):(t.consume(Q),z)}function N(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Nn(Q)?L(Q):(t.consume(Q),N)}function q(Q){return Q===47||Q===62||lt(Q)?T(Q):i(Q)}function J(Q){return Q===62?(t.consume(Q),U):i(Q)}function U(Q){return Q===null||$e(Q)?R(Q):lt(Q)?(t.consume(Q),U):i(Q)}function R(Q){return Q===45&&s===2?(t.consume(Q),$):Q===60&&s===1?(t.consume(Q),X):Q===62&&s===4?(t.consume(Q),I):Q===63&&s===3?(t.consume(Q),M):Q===93&&s===5?(t.consume(Q),F):$e(Q)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Qce,K,B)(Q)):Q===null||$e(Q)?(t.exit("htmlFlowData"),B(Q)):(t.consume(Q),R)}function B(Q){return t.check(Lce,D,K)(Q)}function D(Q){return t.enter("lineEnding"),t.consume(Q),t.exit("lineEnding"),j}function j(Q){return Q===null||$e(Q)?B(Q):(t.enter("htmlFlowData"),R(Q))}function $(Q){return Q===45?(t.consume(Q),M):R(Q)}function X(Q){return Q===47?(t.consume(Q),o="",H):R(Q)}function H(Q){if(Q===62){const ue=o.toLowerCase();return EQ.includes(ue)?(t.consume(Q),I):R(Q)}return vr(Q)&&o.length<8?(t.consume(Q),o+=String.fromCharCode(Q),H):R(Q)}function F(Q){return Q===93?(t.consume(Q),M):R(Q)}function M(Q){return Q===62?(t.consume(Q),I):Q===45&&s===2?(t.consume(Q),M):R(Q)}function I(Q){return Q===null||$e(Q)?(t.exit("htmlFlowData"),K(Q)):(t.consume(Q),I)}function K(Q){return t.exit("htmlFlow"),e(Q)}}function $ce(t,e,i){const n=this;return s;function s(o){return $e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):i(o)}function r(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}function zce(t,e,i){return n;function n(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(PO,e,i)}}const Nce={name:"htmlText",tokenize:jce};function jce(t,e,i){const n=this;let s,r,o;return l;function l(M){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(M),c}function c(M){return M===33?(t.consume(M),u):M===47?(t.consume(M),L):M===63?(t.consume(M),T):vr(M)?(t.consume(M),N):i(M)}function u(M){return M===45?(t.consume(M),d):M===91?(t.consume(M),r=0,_):vr(M)?(t.consume(M),k):i(M)}function d(M){return M===45?(t.consume(M),O):i(M)}function p(M){return M===null?i(M):M===45?(t.consume(M),g):$e(M)?(o=p,X(M)):(t.consume(M),p)}function g(M){return M===45?(t.consume(M),O):p(M)}function O(M){return M===62?$(M):M===45?g(M):p(M)}function _(M){const I="CDATA[";return M===I.charCodeAt(r++)?(t.consume(M),r===I.length?b:_):i(M)}function b(M){return M===null?i(M):M===93?(t.consume(M),x):$e(M)?(o=b,X(M)):(t.consume(M),b)}function x(M){return M===93?(t.consume(M),w):b(M)}function w(M){return M===62?$(M):M===93?(t.consume(M),w):b(M)}function k(M){return M===null||M===62?$(M):$e(M)?(o=k,X(M)):(t.consume(M),k)}function T(M){return M===null?i(M):M===63?(t.consume(M),A):$e(M)?(o=T,X(M)):(t.consume(M),T)}function A(M){return M===62?$(M):T(M)}function L(M){return vr(M)?(t.consume(M),E):i(M)}function E(M){return M===45||rs(M)?(t.consume(M),E):z(M)}function z(M){return $e(M)?(o=z,X(M)):lt(M)?(t.consume(M),z):$(M)}function N(M){return M===45||rs(M)?(t.consume(M),N):M===47||M===62||Nn(M)?q(M):i(M)}function q(M){return M===47?(t.consume(M),$):M===58||M===95||vr(M)?(t.consume(M),J):$e(M)?(o=q,X(M)):lt(M)?(t.consume(M),q):$(M)}function J(M){return M===45||M===46||M===58||M===95||rs(M)?(t.consume(M),J):U(M)}function U(M){return M===61?(t.consume(M),R):$e(M)?(o=U,X(M)):lt(M)?(t.consume(M),U):q(M)}function R(M){return M===null||M===60||M===61||M===62||M===96?i(M):M===34||M===39?(t.consume(M),s=M,B):$e(M)?(o=R,X(M)):lt(M)?(t.consume(M),R):(t.consume(M),D)}function B(M){return M===s?(t.consume(M),s=void 0,j):M===null?i(M):$e(M)?(o=B,X(M)):(t.consume(M),B)}function D(M){return M===null||M===34||M===39||M===60||M===61||M===96?i(M):M===47||M===62||Nn(M)?q(M):(t.consume(M),D)}function j(M){return M===47||M===62||Nn(M)?q(M):i(M)}function $(M){return M===62?(t.consume(M),t.exit("htmlTextData"),t.exit("htmlText"),e):i(M)}function X(M){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),H}function H(M){return lt(M)?kt(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return t.enter("htmlTextData"),o(M)}}const Fw={name:"labelEnd",resolveAll:Zce,resolveTo:qce,tokenize:Wce},Ice={tokenize:Uce},Vce={tokenize:Yce},Xce={tokenize:Hce};function Zce(t){let e=-1;const i=[];for(;++e<t.length;){const n=t[e][1];if(i.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const s=n.type==="labelImage"?4:2;n.type="data",e+=s}}return t.length!==i.length&&Pr(t,0,t.length,i),t}function qce(t,e){let i=t.length,n=0,s,r,o,l;for(;i--;)if(s=t[i][1],r){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(t[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(r=i,s.type!=="labelLink")){n=2;break}}else s.type==="labelEnd"&&(o=i);const c={type:t[r][1].type==="labelLink"?"link":"image",start:{...t[r][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[r][1].start},end:{...t[o][1].end}},d={type:"labelText",start:{...t[r+n+2][1].end},end:{...t[o-2][1].start}};return l=[["enter",c,e],["enter",u,e]],l=ws(l,t.slice(r+1,r+n+3)),l=ws(l,[["enter",d,e]]),l=ws(l,Hw(e.parser.constructs.insideSpan.null,t.slice(r+n+4,o-3),e)),l=ws(l,[["exit",d,e],t[o-2],t[o-1],["exit",u,e]]),l=ws(l,t.slice(o+1)),l=ws(l,[["exit",c,e]]),Pr(t,r,t.length,l),t}function Wce(t,e,i){const n=this;let s=n.events.length,r,o;for(;s--;)if((n.events[s][1].type==="labelImage"||n.events[s][1].type==="labelLink")&&!n.events[s][1]._balanced){r=n.events[s][1];break}return l;function l(g){return r?r._inactive?p(g):(o=n.parser.defined.includes(ih(n.sliceSerialize({start:r.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),c):i(g)}function c(g){return g===40?t.attempt(Ice,d,o?d:p)(g):g===91?t.attempt(Vce,d,o?u:p)(g):o?d(g):p(g)}function u(g){return t.attempt(Xce,d,p)(g)}function d(g){return e(g)}function p(g){return r._balanced=!0,i(g)}}function Uce(t,e,i){return n;function n(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),s}function s(p){return Nn(p)?xf(t,r)(p):r(p)}function r(p){return p===41?d(p):lN(t,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Nn(p)?xf(t,c)(p):d(p)}function l(p){return i(p)}function c(p){return p===34||p===39||p===40?hN(t,u,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function u(p){return Nn(p)?xf(t,d)(p):d(p)}function d(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):i(p)}}function Yce(t,e,i){const n=this;return s;function s(l){return cN.call(n,t,r,o,"reference","referenceMarker","referenceString")(l)}function r(l){return n.parser.defined.includes(ih(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(l):i(l)}function o(l){return i(l)}}function Hce(t,e,i){return n;function n(r){return t.enter("reference"),t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),s}function s(r){return r===93?(t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),t.exit("reference"),e):i(r)}}const Fce={name:"labelStartImage",resolveAll:Fw.resolveAll,tokenize:Gce};function Gce(t,e,i){const n=this;return s;function s(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),r}function r(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),o):i(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(l):e(l)}}const Kce={name:"labelStartLink",resolveAll:Fw.resolveAll,tokenize:Jce};function Jce(t,e,i){const n=this;return s;function s(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),r}function r(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(o):e(o)}}const c1={name:"lineEnding",tokenize:ehe};function ehe(t,e){return i;function i(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),kt(t,e,"linePrefix")}}const cg={name:"thematicBreak",tokenize:the};function the(t,e,i){let n=0,s;return r;function r(u){return t.enter("thematicBreak"),o(u)}function o(u){return s=u,l(u)}function l(u){return u===s?(t.enter("thematicBreakSequence"),c(u)):n>=3&&(u===null||$e(u))?(t.exit("thematicBreak"),e(u)):i(u)}function c(u){return u===s?(t.consume(u),n++,c):(t.exit("thematicBreakSequence"),lt(u)?kt(t,l,"whitespace")(u):l(u))}}const Rn={continuation:{tokenize:rhe},exit:ahe,name:"list",tokenize:she},ihe={partial:!0,tokenize:lhe},nhe={partial:!0,tokenize:ohe};function she(t,e,i){const n=this,s=n.events[n.events.length-1];let r=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(O){const _=n.containerState.type||(O===42||O===43||O===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!n.containerState.marker||O===n.containerState.marker:IS(O)){if(n.containerState.type||(n.containerState.type=_,t.enter(_,{_container:!0})),_==="listUnordered")return t.enter("listItemPrefix"),O===42||O===45?t.check(cg,i,u)(O):u(O);if(!n.interrupt||O===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(O)}return i(O)}function c(O){return IS(O)&&++o<10?(t.consume(O),c):(!n.interrupt||o<2)&&(n.containerState.marker?O===n.containerState.marker:O===41||O===46)?(t.exit("listItemValue"),u(O)):i(O)}function u(O){return t.enter("listItemMarker"),t.consume(O),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||O,t.check(PO,n.interrupt?i:d,t.attempt(ihe,g,p))}function d(O){return n.containerState.initialBlankLine=!0,r++,g(O)}function p(O){return lt(O)?(t.enter("listItemPrefixWhitespace"),t.consume(O),t.exit("listItemPrefixWhitespace"),g):i(O)}function g(O){return n.containerState.size=r+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(O)}}function rhe(t,e,i){const n=this;return n.containerState._closeFlow=void 0,t.check(PO,s,r);function s(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,kt(t,e,"listItemIndent",n.containerState.size+1)(l)}function r(l){return n.containerState.furtherBlankLines||!lt(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(nhe,e,o)(l))}function o(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,kt(t,t.attempt(Rn,e,i),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function ohe(t,e,i){const n=this;return kt(t,s,"listItemIndent",n.containerState.size+1);function s(r){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(r):i(r)}}function ahe(t){t.exit(this.containerState.type)}function lhe(t,e,i){const n=this;return kt(t,s,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(r){const o=n.events[n.events.length-1];return!lt(r)&&o&&o[1].type==="listItemPrefixWhitespace"?e(r):i(r)}}const MQ={name:"setextUnderline",resolveTo:che,tokenize:hhe};function che(t,e){let i=t.length,n,s,r;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){n=i;break}t[i][1].type==="paragraph"&&(s=i)}else t[i][1].type==="content"&&t.splice(i,1),!r&&t[i][1].type==="definition"&&(r=i);const o={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",r?(t.splice(s,0,["enter",o,e]),t.splice(r+1,0,["exit",t[n][1],e]),t[n][1].end={...t[r][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function hhe(t,e,i){const n=this;let s;return r;function r(u){let d=n.events.length,p;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){p=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(t.enter("setextHeadingLine"),s=u,o(u)):i(u)}function o(u){return t.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(t.consume(u),l):(t.exit("setextHeadingLineSequence"),lt(u)?kt(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||$e(u)?(t.exit("setextHeadingLine"),e(u)):i(u)}}const uhe={tokenize:fhe};function fhe(t){const e=this,i=t.attempt(PO,n,t.attempt(this.parser.constructs.flowInitial,s,kt(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Oce,s)),"linePrefix")));return i;function n(r){if(r===null){t.consume(r);return}return t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),e.currentConstruct=void 0,i}function s(r){if(r===null){t.consume(r);return}return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),e.currentConstruct=void 0,i}}const dhe={resolveAll:fN()},phe=uN("string"),mhe=uN("text");function uN(t){return{resolveAll:fN(t==="text"?ghe:void 0),tokenize:e};function e(i){const n=this,s=this.parser.constructs[t],r=i.attempt(s,o,l);return o;function o(d){return u(d)?r(d):l(d)}function l(d){if(d===null){i.consume(d);return}return i.enter("data"),i.consume(d),c}function c(d){return u(d)?(i.exit("data"),r(d)):(i.consume(d),c)}function u(d){if(d===null)return!0;const p=s[d];let g=-1;if(p)for(;++g<p.length;){const O=p[g];if(!O.previous||O.previous.call(n,n.previous))return!0}return!1}}}function fN(t){return e;function e(i,n){let s=-1,r;for(;++s<=i.length;)r===void 0?i[s]&&i[s][1].type==="data"&&(r=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==r+2&&(i[r][1].end=i[s-1][1].end,i.splice(r+2,s-r-2),s=r+2),r=void 0);return t?t(i,n):i}}function ghe(t,e){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const n=t[i-1][1],s=e.sliceStream(n);let r=s.length,o=-1,l=0,c;for(;r--;){const u=s[r];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){r++;break}}if(e._contentTypeTextTrailing&&i===t.length&&(l=0),l){const u={type:i===t.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?o:n.start._bufferIndex+o,_index:n.start._index+r,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(t.splice(i,0,["enter",u,e],["exit",u,e]),i+=2)}i++}return t}const Ohe={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:sN},vhe={91:Sce},_he={[-2]:l1,[-1]:l1,32:l1},yhe={35:Ace,42:cg,45:[MQ,cg],60:Rce,61:MQ,95:cg,96:AQ,126:AQ},bhe={38:oN,92:rN},She={[-5]:c1,[-4]:c1,[-3]:c1,33:Fce,38:oN,42:VS,60:[Kle,Nce],91:Kce,92:[kce,rN],93:Fw,95:VS,96:uce},xhe={null:[VS,dhe]},whe={null:[42,95]},Che={null:[]},khe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:whe,contentInitial:vhe,disable:Che,document:Ohe,flow:yhe,flowInitial:_he,insideSpan:xhe,string:bhe,text:She},Symbol.toStringTag,{value:"Module"}));function The(t,e,i){let n={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},r=[];let o=[],l=[];const c={attempt:z(L),check:z(E),consume:k,enter:T,exit:A,interrupt:z(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:_,parser:t,previous:null,sliceSerialize:g,sliceStream:O,write:p};let d=e.tokenize.call(u,c);return e.resolveAll&&r.push(e),u;function p(U){return o=ws(o,U),x(),o[o.length-1]!==null?[]:(N(e,0),u.events=Hw(r,u.events,u),u.events)}function g(U,R){return Ehe(O(U),R)}function O(U){return Ahe(o,U)}function _(){const{_bufferIndex:U,_index:R,line:B,column:D,offset:j}=n;return{_bufferIndex:U,_index:R,line:B,column:D,offset:j}}function b(U){s[U.line]=U.column,J()}function x(){let U;for(;n._index<o.length;){const R=o[n._index];if(typeof R=="string")for(U=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===U&&n._bufferIndex<R.length;)w(R.charCodeAt(n._bufferIndex));else w(R)}}function w(U){d=d(U)}function k(U){$e(U)?(n.line++,n.column=1,n.offset+=U===-3?2:1,J()):U!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=U}function T(U,R){const B=R||{};return B.type=U,B.start=_(),u.events.push(["enter",B,u]),l.push(B),B}function A(U){const R=l.pop();return R.end=_(),u.events.push(["exit",R,u]),R}function L(U,R){N(U,R.from)}function E(U,R){R.restore()}function z(U,R){return B;function B(D,j,$){let X,H,F,M;return Array.isArray(D)?K(D):"tokenize"in D?K([D]):I(D);function I(fe){return Oe;function Oe(Ce){const ye=Ce!==null&&fe[Ce],nt=Ce!==null&&fe.null,Qt=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(nt)?nt:nt?[nt]:[]];return K(Qt)(Ce)}}function K(fe){return X=fe,H=0,fe.length===0?$:Q(fe[H])}function Q(fe){return Oe;function Oe(Ce){return M=q(),F=fe,fe.partial||(u.currentConstruct=fe),fe.name&&u.parser.constructs.disable.null.includes(fe.name)?he():fe.tokenize.call(R?Object.assign(Object.create(u),R):u,c,ue,he)(Ce)}}function ue(fe){return U(F,M),j}function he(fe){return M.restore(),++H<X.length?Q(X[H]):$}}}function N(U,R){U.resolveAll&&!r.includes(U)&&r.push(U),U.resolve&&Pr(u.events,R,u.events.length-R,U.resolve(u.events.slice(R),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function q(){const U=_(),R=u.previous,B=u.currentConstruct,D=u.events.length,j=Array.from(l);return{from:D,restore:$};function $(){n=U,u.previous=R,u.currentConstruct=B,u.events.length=D,l=j,J()}}function J(){n.line in s&&n.column<2&&(n.column=s[n.line],n.offset+=s[n.line]-1)}}function Ahe(t,e){const i=e.start._index,n=e.start._bufferIndex,s=e.end._index,r=e.end._bufferIndex;let o;if(i===s)o=[t[i].slice(n,r)];else{if(o=t.slice(i,s),n>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(n):o.shift()}r>0&&o.push(t[s].slice(0,r))}return o}function Ehe(t,e){let i=-1;const n=[];let s;for(;++i<t.length;){const r=t[i];let o;if(typeof r=="string")o=r;else switch(r){case-5:{o="\r";break}case-4:{o=`
219
219
  `;break}case-3:{o=`\r
220
220
  `;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&s)continue;o=" ";break}default:o=String.fromCharCode(r)}s=r===-2,n.push(o)}return n.join("")}function Mhe(t){const n={constructs:$le([khe,...(t||{}).extensions||[]]),content:s(qle),defined:[],document:s(Ule),flow:s(uhe),lazy:{},string:s(phe),text:s(mhe)};return n;function s(r){return o;function o(l){return The(n,r,l)}}}function Phe(t){for(;!aN(t););return t}const PQ=/[\0\t\n\r]/g;function Rhe(){let t=1,e="",i=!0,n;return s;function s(r,o,l){const c=[];let u,d,p,g,O;for(r=e+(typeof r=="string"?r.toString():new TextDecoder(o||void 0).decode(r)),p=0,e="",i&&(r.charCodeAt(0)===65279&&p++,i=void 0);p<r.length;){if(PQ.lastIndex=p,u=PQ.exec(r),g=u&&u.index!==void 0?u.index:r.length,O=r.charCodeAt(g),!u){e=r.slice(p);break}if(O===10&&p===g&&n)c.push(-3),n=void 0;else switch(n&&(c.push(-5),n=void 0),p<g&&(c.push(r.slice(p,g)),t+=g-p),O){case 0:{c.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,c.push(-2);t++<d;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:n=!0,t=1}p=g+1}return l&&(n&&c.push(-5),e&&c.push(e),c.push(null)),c}}const Qhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Lhe(t){return t.replace(Qhe,Dhe)}function Dhe(t,e,i){if(e)return e;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),r=s===120||s===88;return nN(i.slice(r?2:1),r?16:10)}return Yw(i)||t}const dN={}.hasOwnProperty;function Bhe(t,e,i){return e&&typeof e=="object"&&(i=e,e=void 0),$he(i)(Phe(Mhe(i).document().write(Rhe()(t,e,!0))))}function $he(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(Dr),autolinkProtocol:q,autolinkEmail:q,atxHeading:r(as),blockQuote:r(nt),characterEscape:q,characterReference:q,codeFenced:r(Qt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(Qt,o),codeText:r(Yt,o),codeTextData:q,data:q,codeFlowValue:q,definition:r(ei),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(Le),hardBreakEscape:r(Co),hardBreakTrailing:r(Co),htmlFlow:r(ko,o),htmlFlowData:q,htmlText:r(ko,o),htmlTextData:q,image:r(La),label:o,link:r(Dr),listItem:r(Mh),listItemValue:g,listOrdered:r(To,p),listUnordered:r(To),paragraph:r(LO),reference:Q,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(as),strong:r(DO),thematicBreak:r(BO)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ye,autolinkProtocol:Ce,blockQuote:c(),characterEscapeValue:J,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:fe,characterReference:Oe,codeFenced:c(x),codeFencedFence:b,codeFencedFenceInfo:O,codeFencedFenceMeta:_,codeFlowValue:J,codeIndented:c(w),codeText:c(j),codeTextData:J,data:J,definition:c(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:T,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(B),htmlFlowData:J,htmlText:c(D),htmlTextData:J,image:c(X),label:F,labelText:H,lineEnding:U,link:c($),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:M,resourceTitleString:I,resource:K,setextHeading:c(N),setextHeadingLineSequence:z,setextHeadingText:E,strong:c(),thematicBreak:c()}};pN(e,(t||{}).mdastExtensions||[]);const i={};return n;function n(oe){let ge={type:"root",children:[]};const De={stack:[ge],tokenStack:[],config:e,enter:l,exit:u,buffer:o,resume:d,data:i},Ue=[];let ht=-1;for(;++ht<oe.length;)if(oe[ht][1].type==="listOrdered"||oe[ht][1].type==="listUnordered")if(oe[ht][0]==="enter")Ue.push(ht);else{const In=Ue.pop();ht=s(oe,In,ht)}for(ht=-1;++ht<oe.length;){const In=e[oe[ht][0]];dN.call(In,oe[ht][1].type)&&In[oe[ht][1].type].call(Object.assign({sliceSerialize:oe[ht][2].sliceSerialize},De),oe[ht][1])}if(De.tokenStack.length>0){const In=De.tokenStack[De.tokenStack.length-1];(In[1]||RQ).call(De,void 0,In[0])}for(ge.position={start:aa(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:aa(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},ht=-1;++ht<e.transforms.length;)ge=e.transforms[ht](ge)||ge;return ge}function s(oe,ge,De){let Ue=ge-1,ht=-1,In=!1,Br,hn,fi,Sn;for(;++Ue<=De;){const _t=oe[Ue];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?ht++:ht--,Sn=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&(Br&&!Sn&&!ht&&!fi&&(fi=Ue),Sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Sn=void 0}if(!ht&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||ht===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if(Br){let Ao=Ue;for(hn=void 0;Ao--;){const Bs=oe[Ao];if(Bs[1].type==="lineEnding"||Bs[1].type==="lineEndingBlank"){if(Bs[0]==="exit")continue;hn&&(oe[hn][1].type="lineEndingBlank",In=!0),Bs[1].type="lineEnding",hn=Ao}else if(!(Bs[1].type==="linePrefix"||Bs[1].type==="blockQuotePrefix"||Bs[1].type==="blockQuotePrefixWhitespace"||Bs[1].type==="blockQuoteMarker"||Bs[1].type==="listItemIndent"))break}fi&&(!hn||fi<hn)&&(Br._spread=!0),Br.end=Object.assign({},hn?oe[hn][1].start:_t[1].end),oe.splice(hn||Ue,0,["exit",Br,_t[2]]),Ue++,De++}if(_t[1].type==="listItemPrefix"){const Ao={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};Br=Ao,oe.splice(Ue,0,["enter",Ao,_t[2]]),Ue++,De++,fi=void 0,Sn=!0}}}return oe[ge][1]._spread=In,De}function r(oe,ge){return De;function De(Ue){l.call(this,oe(Ue),Ue),ge&&ge.call(this,Ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(oe,ge,De){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ge,De||void 0]),oe.position={start:aa(ge.start),end:void 0}}function c(oe){return ge;function ge(De){oe&&oe.call(this,De),u.call(this,De)}}function u(oe,ge){const De=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==oe.type&&(ge?ge.call(this,oe,Ue[0]):(Ue[1]||RQ).call(this,oe,Ue[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Sf({start:oe.start,end:oe.end})+"): it’s not open");De.position.end=aa(oe.end)}function d(){return Dle(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(oe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function O(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=oe}function _(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=oe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/(\r?\n|\r)$/g,"")}function k(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=ih(this.sliceSerialize(oe)).toLowerCase()}function T(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function A(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function L(oe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const De=this.sliceSerialize(oe).length;ge.depth=De}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function z(oe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function q(oe){const De=this.stack[this.stack.length-1].children;let Ue=De[De.length-1];(!Ue||Ue.type!=="text")&&(Ue=cn(),Ue.position={start:aa(oe.start),end:void 0},De.push(Ue)),this.stack.push(Ue)}function J(oe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(oe),ge.position.end=aa(oe.end)}function U(oe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ge.children[ge.children.length-1];De.position.end=aa(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ge.type)&&(q.call(this,oe),J.call(this,oe))}function R(){this.data.atHardBreak=!0}function B(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function D(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function j(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function $(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function X(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function H(oe){const ge=this.sliceSerialize(oe),De=this.stack[this.stack.length-2];De.label=Lhe(ge),De.identifier=ih(ge).toLowerCase()}function F(){const oe=this.stack[this.stack.length-1],ge=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Ue=oe.children;De.children=Ue}else De.alt=ge}function M(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function I(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function K(){this.data.inReference=void 0}function Q(){this.data.referenceType="collapsed"}function ue(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=ih(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function he(oe){this.data.characterReferenceType=oe.type}function fe(oe){const ge=this.sliceSerialize(oe),De=this.data.characterReferenceType;let Ue;De?(Ue=nN(ge,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=Yw(ge);const ht=this.stack[this.stack.length-1];ht.value+=Ue}function Oe(oe){const ge=this.stack.pop();ge.position.end=aa(oe.end)}function Ce(oe){J.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(oe)}function ye(oe){J.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(oe)}function nt(){return{type:"blockquote",children:[]}}function Qt(){return{type:"code",lang:null,meta:null,value:""}}function Yt(){return{type:"inlineCode",value:""}}function ei(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function as(){return{type:"heading",depth:0,children:[]}}function Co(){return{type:"break"}}function ko(){return{type:"html",value:""}}function La(){return{type:"image",title:null,url:"",alt:null}}function Dr(){return{type:"link",title:null,url:"",children:[]}}function To(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Mh(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function LO(){return{type:"paragraph",children:[]}}function DO(){return{type:"strong",children:[]}}function cn(){return{type:"text",value:""}}function BO(){return{type:"thematicBreak"}}}function aa(t){return{line:t.line,column:t.column,offset:t.offset}}function pN(t,e){let i=-1;for(;++i<e.length;){const n=e[i];Array.isArray(n)?pN(t,n):zhe(t,n)}}function zhe(t,e){let i;for(i in e)if(dN.call(e,i))switch(i){case"canContainEols":{const n=e[i];n&&t[i].push(...n);break}case"transforms":{const n=e[i];n&&t[i].push(...n);break}case"enter":case"exit":{const n=e[i];n&&Object.assign(t[i],n);break}}}function RQ(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Sf({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Sf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Sf({start:e.start,end:e.end})+") is still open")}function Nhe(t){const e=this;e.parser=i;function i(n){return Bhe(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function jhe(t,e){const i={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,i),t.applyData(e,i)}function Ihe(t,e){const i={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,i),[t.applyData(e,i),{type:"text",value:`
@@ -228,4 +228,5 @@ void main() {
228
228
  `}),i.push(t[n]);return e&&t.length>0&&i.push({type:"text",value:`
229
229
  `}),i}function jQ(t){let e=0,i=t.charCodeAt(e);for(;i===9||i===32;)e++,i=t.charCodeAt(e);return t.slice(e)}function IQ(t,e){const i=Eue(t,e),n=i.one(t,void 0),s=vue(i),r=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return s&&r.children.push({type:"text",value:`
230
230
  `},s),r}function Lue(t,e){return t&&"run"in t?async function(i,n){const s=IQ(i,{file:n,...e});await t.run(s,n)}:function(i,n){return IQ(i,{file:n,...t||e})}}function VQ(t){if(t)throw t}var h1,XQ;function Due(){if(XQ)return h1;XQ=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},r=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var d=t.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!p)return!1;var g;for(g in u);return typeof g>"u"||t.call(u,g)},o=function(u,d){i&&d.name==="__proto__"?i(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},l=function(u,d){if(d==="__proto__")if(t.call(u,d)){if(n)return n(u,d).value}else return;return u[d]};return h1=function c(){var u,d,p,g,O,_,b=arguments[0],x=1,w=arguments.length,k=!1;for(typeof b=="boolean"&&(k=b,b=arguments[1]||{},x=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});x<w;++x)if(u=arguments[x],u!=null)for(d in u)p=l(b,d),g=l(u,d),b!==g&&(k&&g&&(r(g)||(O=s(g)))?(O?(O=!1,_=p&&s(p)?p:[]):_=p&&r(p)?p:{},o(b,{name:d,newValue:c(k,_,g)})):typeof g<"u"&&o(b,{name:d,newValue:g}));return b},h1}var Bue=Due();const u1=WS(Bue);function ZS(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function $ue(){const t=[],e={run:i,use:n};return e;function i(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(c,...u){const d=t[++r];let p=-1;if(c){o(c);return}for(;++p<s.length;)(u[p]===null||u[p]===void 0)&&(u[p]=s[p]);s=u,d?zue(d,l)(...u):o(null,...u)}}function n(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function zue(t,e){let i;return n;function n(...o){const l=t.length>o.length;let c;l&&o.push(s);try{c=t.apply(this,o)}catch(u){const d=u;if(l&&i)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(r,s):c instanceof Error?s(c):r(c))}function s(o,...l){i||(i=!0,e(o,...l))}function r(o){s(null,o)}}const pr={basename:Nue,dirname:jue,extname:Iue,join:Vue,sep:"/"};function Nue(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');kd(t);let i=0,n=-1,s=t.length,r;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else n<0&&(r=!0,n=s+1);return n<0?"":t.slice(i,n)}if(e===t)return"";let o=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else o<0&&(r=!0,o=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(n=s):(l=-1,n=o));return i===n?n=o:n<0&&(n=t.length),t.slice(i,n)}function jue(t){if(kd(t),t.length===0)return".";let e=-1,i=t.length,n;for(;--i;)if(t.codePointAt(i)===47){if(n){e=i;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Iue(t){kd(t);let e=t.length,i=-1,n=0,s=-1,r=0,o;for(;e--;){const l=t.codePointAt(e);if(l===47){if(o){n=e+1;break}continue}i<0&&(o=!0,i=e+1),l===46?s<0?s=e:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||i<0||r===0||r===1&&s===i-1&&s===n+1?"":t.slice(s,i)}function Vue(...t){let e=-1,i;for(;++e<t.length;)kd(t[e]),t[e]&&(i=i===void 0?t[e]:i+"/"+t[e]);return i===void 0?".":Xue(i)}function Xue(t){kd(t);const e=t.codePointAt(0)===47;let i=Zue(t,!e);return i.length===0&&!e&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),e?"/"+i:i}function Zue(t,e){let i="",n=0,s=-1,r=0,o=-1,l,c;for(;++o<=t.length;){if(o<t.length)l=t.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||r===1))if(s!==o-1&&r===2){if(i.length<2||n!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),s=o,r=0;continue}}else if(i.length>0){i="",n=0,s=o,r=0;continue}}e&&(i=i.length>0?i+"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(s+1,o):i=t.slice(s+1,o),n=o-s-1;s=o,r=0}else l===46&&r>-1?r++:r=-1}return i}function kd(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const que={cwd:Wue};function Wue(){return"/"}function qS(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Uue(t){if(typeof t=="string")t=new URL(t);else if(!qS(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Yue(t)}function Yue(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let i=-1;for(;++i<e.length;)if(e.codePointAt(i)===37&&e.codePointAt(i+1)===50){const n=e.codePointAt(i+2);if(n===70||n===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const f1=["history","path","basename","stem","extname","dirname"];class xN{constructor(e){let i;e?qS(e)?i={path:e}:typeof e=="string"||Hue(e)?i={value:e}:i=e:i={},this.cwd="cwd"in i?"":que.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<f1.length;){const r=f1[n];r in i&&i[r]!==void 0&&i[r]!==null&&(this[r]=r==="history"?[...i[r]]:i[r])}let s;for(s in i)f1.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?pr.basename(this.path):void 0}set basename(e){p1(e,"basename"),d1(e,"basename"),this.path=pr.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?pr.dirname(this.path):void 0}set dirname(e){ZQ(this.basename,"dirname"),this.path=pr.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?pr.extname(this.path):void 0}set extname(e){if(d1(e,"extname"),ZQ(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pr.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){qS(e)&&(e=Uue(e)),p1(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?pr.basename(this.path,this.extname):void 0}set stem(e){p1(e,"stem"),d1(e,"stem"),this.path=pr.join(this.dirname||"",e+(this.extname||""))}fail(e,i,n){const s=this.message(e,i,n);throw s.fatal=!0,s}info(e,i,n){const s=this.message(e,i,n);return s.fatal=void 0,s}message(e,i,n){const s=new ln(e,i,n);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function d1(t,e){if(t&&t.includes(pr.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+pr.sep+"`")}function p1(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ZQ(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Hue(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Fue=(function(t){const n=this.constructor.prototype,s=n[t],r=function(){return s.apply(r,arguments)};return Object.setPrototypeOf(r,n),r}),Gue={}.hasOwnProperty;class tC extends Fue{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$ue()}copy(){const e=new tC;let i=-1;for(;++i<this.attachers.length;){const n=this.attachers[i];e.use(...n)}return e.data(u1(!0,{},this.namespace)),e}data(e,i){return typeof e=="string"?arguments.length===2?(O1("data",this.frozen),this.namespace[e]=i,this):Gue.call(this.namespace,e)&&this.namespace[e]||void 0:e?(O1("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const s=i.call(e,...n);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const i=Lm(e),n=this.parser||this.Parser;return m1("parse",n),n(String(i),i)}process(e,i){const n=this;return this.freeze(),m1("process",this.parser||this.Parser),g1("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(r,o){const l=Lm(e),c=n.parse(l);n.run(c,l,function(d,p,g){if(d||!p||!g)return u(d);const O=p,_=n.stringify(O,g);efe(_)?g.value=_:g.result=_,u(d,g)});function u(d,p){d||!p?o(d):r?r(p):i(void 0,p)}}}processSync(e){let i=!1,n;return this.freeze(),m1("processSync",this.parser||this.Parser),g1("processSync",this.compiler||this.Compiler),this.process(e,s),WQ("processSync","process",i),n;function s(r,o){i=!0,VQ(r),n=o}}run(e,i,n){qQ(e),this.freeze();const s=this.transformers;return!n&&typeof i=="function"&&(n=i,i=void 0),n?r(void 0,n):new Promise(r);function r(o,l){const c=Lm(i);s.run(e,c,u);function u(d,p,g){const O=p||e;d?l(d):o?o(O):n(void 0,O,g)}}}runSync(e,i){let n=!1,s;return this.run(e,i,r),WQ("runSync","run",n),s;function r(o,l){VQ(o),s=l,n=!0}}stringify(e,i){this.freeze();const n=Lm(i),s=this.compiler||this.Compiler;return g1("stringify",s),qQ(e),s(e,n)}use(e,...i){const n=this.attachers,s=this.namespace;if(O1("use",this.frozen),e!=null)if(typeof e=="function")c(e,i);else if(typeof e=="object")Array.isArray(e)?l(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function r(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...p]=u;c(d,p)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(s.settings=u1(!0,s.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const p=u[d];r(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let p=-1,g=-1;for(;++p<n.length;)if(n[p][0]===u){g=p;break}if(g===-1)n.push([u,...d]);else if(d.length>0){let[O,..._]=d;const b=n[g][1];ZS(b)&&ZS(O)&&(O=u1(!0,b,O)),n[g]=[u,O,..._]}}}}const Kue=new tC().freeze();function m1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function g1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function O1(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qQ(t){if(!ZS(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function WQ(t,e,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Lm(t){return Jue(t)?t:new xN(t)}function Jue(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function efe(t){return typeof t=="string"||tfe(t)}function tfe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ife="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UQ=[],YQ={allowDangerousHtml:!0},nfe=/^(https?|ircs?|mailto|xmpp)$/i,sfe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wN(t){const e=rfe(t),i=ofe(t);return afe(e.runSync(e.parse(i),i),t)}function rfe(t){const e=t.rehypePlugins||UQ,i=t.remarkPlugins||UQ,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...YQ}:YQ;return Kue().use(Nhe).use(i).use(Lue,n).use(e)}function ofe(t){const e=t.children||"",i=new xN;return typeof e=="string"&&(i.value=e),i}function afe(t,e){const i=e.allowedElements,n=e.allowElement,s=e.components,r=e.disallowedElements,o=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||lfe;for(const d of sfe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ife+d.id,void 0);return SN(t,u),vle(t,{Fragment:S.Fragment,components:s,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function u(d,p,g){if(d.type==="raw"&&g&&typeof p=="number")return o?g.children.splice(p,1):g.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let O;for(O in a1)if(Object.hasOwn(a1,O)&&Object.hasOwn(d.properties,O)){const _=d.properties[O],b=a1[O];(b===null||b.includes(d.tagName))&&(d.properties[O]=c(String(_||""),O,d))}}if(d.type==="element"){let O=i?!i.includes(d.tagName):r?r.includes(d.tagName):!1;if(!O&&n&&typeof p=="number"&&(O=!n(d,p,g)),O&&g&&typeof p=="number")return l&&d.children?g.children.splice(p,1,...d.children):g.children.splice(p,1),p}}}function lfe(t){const e=t.indexOf(":"),i=t.indexOf("?"),n=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||i!==-1&&e>i||n!==-1&&e>n||nfe.test(t.slice(0,e))?t:""}function cfe({option:t,selected:e,variant:i,onSelect:n,onFocus:s,onBlur:r}){var p;const[o,l]=Z.useState(!1),c=t.description.split(`
231
- `),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return S.jsxs("button",{type:"button",onClick:n,onMouseEnter:s,onMouseLeave:r,onFocus:s,onBlur:r,className:Fe("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[S.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&S.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&S.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),S.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&S.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function hfe({markdown:t,visible:e}){return e?S.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:S.jsx(wN,{children:t})}):null}function ufe({question:t,onSubmit:e}){const[i,n]=Z.useState(null),[s,r]=Z.useState(new Set),[o,l]=Z.useState(""),[c,u]=Z.useState(null),d=Z.useRef(null);Z.useEffect(()=>{const k=d.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[o]),Z.useEffect(()=>{n(null),r(new Set),l(""),u(null)},[t.id]);function p(k){t.multiSelect?r(T=>{const A=new Set(T);return A.has(k)?A.delete(k):A.add(k),A}):n(k)}function g(k){l(k),!t.multiSelect&&k.length>0&&n(null)}function O(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const k=t.options.filter(T=>s.has(T.id)).map(T=>T.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(s),selectedLabels:k,freeText:o.trim()})}else if(i){const k=t.options.find(T=>T.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:k?[k.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?s.size>0||o.trim().length>0:i!==null||o.trim().length>0,x=c?t.options.find(k=>k.id===c):null,w=(x==null?void 0:x.markdown)??"";return S.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[S.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),S.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:S.jsx(wN,{children:t.question})}),t.options.length>0&&S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(k=>{const T=t.multiSelect?s.has(k.id):i===k.id;return S.jsx(cfe,{option:k,selected:T,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(k.id),onFocus:()=>u(k.id),onBlur:()=>u(null)},k.id)})}),S.jsx(hfe,{markdown:w,visible:!!w})]}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:S.jsx("textarea",{ref:d,value:o,onChange:k=>g(k.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),S.jsx("button",{type:"button",onClick:_,disabled:!b,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function ffe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return S.jsx(vo.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),S.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),S.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function dfe(){return S.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[S.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),S.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("div",{className:"h-10 flex-1 bg-muted"}),S.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),S.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function pfe({onAskMore:t,onDoneExecute:e,disabled:i}){return S.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[S.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),S.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function mfe({open:t,onConfirm:e,onCancel:i}){return S.jsx(xx,{children:t&&S.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:S.jsxs(vo.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[S.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),S.jsxs("div",{className:"flex items-center justify-end gap-3",children:[S.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),S.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function gfe({answerCount:t}){return S.jsxs(vo.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[S.jsx("div",{className:"flex justify-center mb-3",children:S.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),S.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),S.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Ofe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:s,askMore:r,doneExecute:o,receiveQuestions:l}=oL(),{onQuestionReceivedRef:c}=Ea();Z.useEffect(()=>(c.current=x=>{l(x)},()=>{c.current=null}),[l,c]);const[u,d]=Z.useState(!1),p=Z.useRef(null);Z.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:S.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),S.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:S.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(x=>S.jsx(ffe,{answer:x},x.questionId)),t==="active"&&e&&S.jsx("div",{ref:p,children:S.jsx(ufe,{question:e,onSubmit:s})}),t==="loading"&&S.jsx(dfe,{}),t==="complete"&&S.jsx(gfe,{answerCount:n})]})}),t!=="complete"&&S.jsx(pfe,{onAskMore:r,onDoneExecute:g,disabled:b}),S.jsx(mfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Ea();return!t&&e===0?null:S.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&S.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&S.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function vfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=oL(),{pendingQuestionCount:s}=Ea(),r=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return r?S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),s>0&&S.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:s})]}),S.jsx("div",{className:"flex-1 min-h-0",children:S.jsx(Ofe,{})})]}):S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:S.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[S.jsx(jae,{}),S.jsx(Xae,{onExecute:o})]})})]})}function _fe(){return S.jsxs("div",{className:"flex flex-col gap-6",children:[S.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[S.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),S.jsxs("div",{className:"flex gap-10",children:[S.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),S.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),S.jsxs("div",{className:"ml-auto flex gap-8",children:[S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[S.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[S.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function yfe({message:t,onRetry:e}){return S.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[S.jsx("p",{className:"font-mono text-sm text-danger",children:t}),S.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function bfe(){const{roadmap:t,state:e,todos:i,loading:n,error:s}=Rl(),{mode:r,setMode:o,initialized:l}=s7(),[c,u]=Z.useState("overview"),[d,p]=Z.useState(null),[g,O]=Z.useState(!1),{splitMode:_,toggleSplit:b}=Bae(),x=Z.useRef(null),w=Z.useCallback(()=>{o(r==="simple"?"advanced":"simple")},[r,o]),k=l?S.jsx(zae,{mode:r,onToggle:w}):null,T=Z.useRef({view:"overview",phaseId:null}),A=Z.useCallback((D,j)=>{D!=="terminal"&&(T.current={view:D,phaseId:D==="phase"&&j?j:null}),u(D),D==="phase"&&j&&p(j),O(!1)},[]),L=Z.useCallback(D=>{var j;(j=x.current)==null||j.call(x,D+"\r"),A("terminal")},[A]),E=Z.useCallback(D=>{u("phase"),p(D)},[]),z=Z.useCallback(()=>{u("overview"),p(null)},[]),N=Z.useCallback(async(D,j)=>{try{const $=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:D,checked:j})});$.ok||console.error("[toggle-phase]",await $.text())}catch($){console.error("[toggle-phase]",$)}},[]),q=((t==null?void 0:t.phases)??[]).map(D=>({number:D.number,name:D.name,goal:D.goal??"",dependsOn:D.depends_on?[D.depends_on]:[],planCount:D.plan_count,summaryCount:D.summary_count,diskStatus:D.disk_status,roadmapComplete:D.roadmap_complete,hasContext:D.has_context,hasResearch:D.has_research})),J=(t==null?void 0:t.current_phase)??null;function U(){if(n)return S.jsx(_fe,{});if(s)return S.jsx(yfe,{message:s,onRetry:()=>window.location.reload()});switch(c){case"overview":return S.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[S.jsx(K9,{roadmap:t,state:e,todos:i}),S.jsx(iZ,{phases:q,currentPhase:J,onPhaseClick:E,onToggleComplete:N})]});case"phase":return d?S.jsx("div",{className:"mx-auto max-w-4xl",children:S.jsx(Ute,{phaseId:d,onBack:z})}):null;case"todos":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Yte,{})});case"blockers":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Gte,{})});case"terminal":return null;default:return null}}const R=c==="terminal",B=r==="simple";return S.jsxs(Kte,{mobileMenuOpen:g,onMobileMenuToggle:()=>O(D=>!D),onMobileMenuClose:()=>O(!1),headerRight:k,simpleMode:B,sidebar:S.jsx("div",{style:{display:B?"none":"contents"},children:S.jsx(wie,{activeView:c,activePhaseId:d,onNavigate:A,logoAction:k})}),children:[l&&r===null&&S.jsx(Nae,{onChoose:o}),B&&l&&S.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:S.jsx(vfe,{onExecute:L})}),S.jsxs("div",{style:{display:B?"none":"contents"},children:[S.jsx("div",{style:{display:R&&!_?"none":"block"},className:R&&_?"h-1/2 min-h-0 overflow-auto border-b border-border p-4 sm:p-6":"flex-1 overflow-y-auto p-4 sm:p-6",children:U()}),S.jsxs("div",{style:{display:R?"flex":"none"},className:`relative min-h-0 flex-col overflow-hidden ${R&&_?"h-1/2":"flex-1"}`,children:[S.jsx($ae,{splitMode:_,onToggle:b}),S.jsx(Dae,{writeInputRef:x})]})]})]})}function Sfe(){return S.jsx(Kj,{children:S.jsx(t7,{children:S.jsx(n7,{children:S.jsx(bfe,{})})})})}const CN=document.getElementById("root");if(!CN)throw new Error("Root element not found");Hj.createRoot(CN).render(S.jsx(Z.StrictMode,{children:S.jsx(Sfe,{})}));
231
+ `),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return S.jsxs("button",{type:"button",onClick:n,onMouseEnter:s,onMouseLeave:r,onFocus:s,onBlur:r,className:Fe("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[S.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&S.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&S.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),S.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&S.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function hfe({markdown:t,visible:e}){return e?S.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:S.jsx(wN,{children:t})}):null}function ufe({question:t,onSubmit:e}){const[i,n]=Z.useState(null),[s,r]=Z.useState(new Set),[o,l]=Z.useState(""),[c,u]=Z.useState(null),d=Z.useRef(null);Z.useEffect(()=>{const k=d.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[o]),Z.useEffect(()=>{n(null),r(new Set),l(""),u(null)},[t.id]);function p(k){t.multiSelect?r(T=>{const A=new Set(T);return A.has(k)?A.delete(k):A.add(k),A}):n(k)}function g(k){l(k),!t.multiSelect&&k.length>0&&n(null)}function O(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const k=t.options.filter(T=>s.has(T.id)).map(T=>T.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(s),selectedLabels:k,freeText:o.trim()})}else if(i){const k=t.options.find(T=>T.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:k?[k.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?s.size>0||o.trim().length>0:i!==null||o.trim().length>0,x=c?t.options.find(k=>k.id===c):null,w=(x==null?void 0:x.markdown)??"";return S.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[S.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),S.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:S.jsx(wN,{children:t.question})}),t.options.length>0&&S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(k=>{const T=t.multiSelect?s.has(k.id):i===k.id;return S.jsx(cfe,{option:k,selected:T,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(k.id),onFocus:()=>u(k.id),onBlur:()=>u(null)},k.id)})}),S.jsx(hfe,{markdown:w,visible:!!w})]}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:S.jsx("textarea",{ref:d,value:o,onChange:k=>g(k.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),S.jsx("button",{type:"button",onClick:_,disabled:!b,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function ffe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return S.jsx(vo.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),S.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),S.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function dfe(){return S.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[S.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),S.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("div",{className:"h-10 flex-1 bg-muted"}),S.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),S.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function pfe({onAskMore:t,onDoneExecute:e,disabled:i}){return S.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[S.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),S.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function mfe({open:t,onConfirm:e,onCancel:i}){return S.jsx(xx,{children:t&&S.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:S.jsxs(vo.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[S.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),S.jsxs("div",{className:"flex items-center justify-end gap-3",children:[S.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),S.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function gfe({answerCount:t}){return S.jsxs(vo.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[S.jsx("div",{className:"flex justify-center mb-3",children:S.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),S.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),S.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Ofe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:s,askMore:r,doneExecute:o,receiveQuestions:l}=oL(),{onQuestionReceivedRef:c}=Ea();Z.useEffect(()=>(c.current=x=>{l(x)},()=>{c.current=null}),[l,c]);const[u,d]=Z.useState(!1),p=Z.useRef(null);Z.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:S.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),S.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:S.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(x=>S.jsx(ffe,{answer:x},x.questionId)),t==="active"&&e&&S.jsx("div",{ref:p,children:S.jsx(ufe,{question:e,onSubmit:s})}),t==="loading"&&S.jsx(dfe,{}),t==="complete"&&S.jsx(gfe,{answerCount:n})]})}),t!=="complete"&&S.jsx(pfe,{onAskMore:r,onDoneExecute:g,disabled:b}),S.jsx(mfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Ea();return!t&&e===0?null:S.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&S.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&S.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function vfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=oL(),{pendingQuestionCount:s}=Ea(),r=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return r?S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),s>0&&S.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:s})]}),S.jsx("div",{className:"flex-1 min-h-0",children:S.jsx(Ofe,{})})]}):S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:S.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[S.jsx(jae,{}),S.jsx(Xae,{onExecute:o})]})})]})}function _fe(){return S.jsxs("div",{className:"flex flex-col gap-6",children:[S.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[S.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),S.jsxs("div",{className:"flex gap-10",children:[S.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),S.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),S.jsxs("div",{className:"ml-auto flex gap-8",children:[S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[S.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[S.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function yfe({message:t,onRetry:e}){return S.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[S.jsx("p",{className:"font-mono text-sm text-danger",children:t}),S.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function bfe(){const{roadmap:t,state:e,todos:i,loading:n,error:s}=Rl(),{mode:r,setMode:o,initialized:l}=s7(),[c,u]=Z.useState("overview"),[d,p]=Z.useState(null),[g,O]=Z.useState(!1),{splitMode:_,toggleSplit:b}=Bae(),x=Z.useRef(null),w=Z.useCallback(()=>{o(r==="simple"?"advanced":"simple")},[r,o]),k=l?S.jsx(zae,{mode:r,onToggle:w}):null,T=Z.useRef({view:"overview",phaseId:null}),A=Z.useCallback((D,j)=>{D!=="terminal"&&(T.current={view:D,phaseId:D==="phase"&&j?j:null}),u(D),D==="phase"&&j&&p(j),O(!1)},[]),L=Z.useCallback(D=>{var j;(j=x.current)==null||j.call(x,D+`
232
+ `),A("terminal")},[A]),E=Z.useCallback(D=>{u("phase"),p(D)},[]),z=Z.useCallback(()=>{u("overview"),p(null)},[]),N=Z.useCallback(async(D,j)=>{try{const $=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:D,checked:j})});$.ok||console.error("[toggle-phase]",await $.text())}catch($){console.error("[toggle-phase]",$)}},[]),q=((t==null?void 0:t.phases)??[]).map(D=>({number:D.number,name:D.name,goal:D.goal??"",dependsOn:D.depends_on?[D.depends_on]:[],planCount:D.plan_count,summaryCount:D.summary_count,diskStatus:D.disk_status,roadmapComplete:D.roadmap_complete,hasContext:D.has_context,hasResearch:D.has_research})),J=(t==null?void 0:t.current_phase)??null;function U(){if(n)return S.jsx(_fe,{});if(s)return S.jsx(yfe,{message:s,onRetry:()=>window.location.reload()});switch(c){case"overview":return S.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[S.jsx(K9,{roadmap:t,state:e,todos:i}),S.jsx(iZ,{phases:q,currentPhase:J,onPhaseClick:E,onToggleComplete:N})]});case"phase":return d?S.jsx("div",{className:"mx-auto max-w-4xl",children:S.jsx(Ute,{phaseId:d,onBack:z})}):null;case"todos":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Yte,{})});case"blockers":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Gte,{})});case"terminal":return null;default:return null}}const R=c==="terminal",B=r==="simple";return S.jsxs(Kte,{mobileMenuOpen:g,onMobileMenuToggle:()=>O(D=>!D),onMobileMenuClose:()=>O(!1),headerRight:k,simpleMode:B,sidebar:S.jsx("div",{style:{display:B?"none":"contents"},children:S.jsx(wie,{activeView:c,activePhaseId:d,onNavigate:A,logoAction:k})}),children:[l&&r===null&&S.jsx(Nae,{onChoose:o}),B&&l&&S.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:S.jsx(vfe,{onExecute:L})}),S.jsxs("div",{style:{display:B?"none":"contents"},children:[S.jsx("div",{style:{display:R&&!_?"none":"block"},className:R&&_?"h-1/2 min-h-0 overflow-auto border-b border-border p-4 sm:p-6":"flex-1 overflow-y-auto p-4 sm:p-6",children:U()}),S.jsxs("div",{style:{display:R?"flex":"none"},className:`relative min-h-0 flex-col overflow-hidden ${R&&_?"h-1/2":"flex-1"}`,children:[S.jsx($ae,{splitMode:_,onToggle:b}),S.jsx(Dae,{writeInputRef:x})]})]})]})}function Sfe(){return S.jsx(Kj,{children:S.jsx(t7,{children:S.jsx(n7,{children:S.jsx(bfe,{})})})})}const CN=document.getElementById("root");if(!CN)throw new Error("Root element not found");Hj.createRoot(CN).render(S.jsx(Z.StrictMode,{children:S.jsx(Sfe,{})}));
@@ -10,7 +10,7 @@
10
10
  href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800;900&family=Geist+Mono:wght@400;500;600;700&display=swap"
11
11
  rel="stylesheet"
12
12
  />
13
- <script type="module" crossorigin src="/assets/index-c2U_AZL9.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-UKqCgb06.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/assets/index-DzJChB-D.css">
15
15
  </head>
16
16
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxsimcli",
3
- "version": "3.10.0",
3
+ "version": "3.10.1",
4
4
  "private": false,
5
5
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code, OpenCode, Gemini and Codex by MayStudios.",
6
6
  "bin": {