import{$W as W,nX as X,pX as k,rV as f}from"./cli-0.5.4-s7k1f0wc.mjs";import{OY as V,PY as J,RY as K}from"./cli-0.5.4-mn22gk7g.mjs";import{SY as P}from"./cli-0.5.4-5t3jj85n.mjs";import{Nca as U,Oca as O}from"./cli-0.5.4-7grzwf6q.mjs";import{Vma as Q,Zma as L}from"./cli-0.5.4-aacw1src.mjs";import{PassThrough as C}from"stream";function E(q){let b=Z.c(5),{children:w}=q,{exit:z}=W(),B,H;if(b[0]!==z)B=()=>{let D=setTimeout(z,0);return()=>clearTimeout(D)},H=[z],b[0]=z,b[1]=B,b[2]=H;else B=b[1],H=b[2];y.useLayoutEffect(B,H);let G;if(b[3]!==w)G=J(V,{children:w}),b[3]=w,b[4]=G;else G=b[4];return G}function Y(q){let b=q.indexOf(M);if(b===-1)return q;let w=b+M.length,z=q.indexOf(F,w);if(z===-1)return q;return q.slice(w,z)}function g(q,b){return new Promise(async(w)=>{let z="",B=new C;if(b!==void 0)B.columns=b;B.on("data",(G)=>{z+=G.toString()});let H=await X(J(E,{children:q}),{stdout:B,patchConsole:!1});await Promise.race([H.waitUntilExit(),new Promise((G)=>setTimeout(G,3000))]),await w(Y(z))})}async function N(q,b){let w=await g(q,b);return U(w)}var Z,y,M="\x1B[?2026h",F="\x1B[?2026l";var j=L(()=>{O();k();K();Z=Q(f(),1),y=Q(P(),1)});
export{g as Xc,N as Yc,j as Zc};
