import{BF as m,HF as d,Ut as T,Yt as c,yF as P,zF as g}from"./cli-0.5.4-k5fz4zd3.mjs";import"./cli-0.5.4-wbqf44ym.mjs";import"./cli-0.5.4-9ewg9gfs.mjs";import"./cli-0.5.4-we3mspgg.mjs";import"./cli-0.5.4-jzhazry0.mjs";import"./cli-0.5.4-82sw3hrw.mjs";import"./cli-0.5.4-31v143kt.mjs";import"./cli-0.5.4-1cy7wd6s.mjs";import"./cli-0.5.4-5e0pk96f.mjs";import"./cli-0.5.4-z154a7bp.mjs";import"./cli-0.5.4-ng5p0zjs.mjs";import"./cli-0.5.4-5hp7ks3t.mjs";import"./cli-0.5.4-8hdwp78f.mjs";import"./cli-0.5.4-mr9aznxx.mjs";import"./cli-0.5.4-jevfk5q7.mjs";import"./cli-0.5.4-27dzbzdy.mjs";import"./cli-0.5.4-a5bkdqqb.mjs";import"./cli-0.5.4-j2hnw539.mjs";import"./cli-0.5.4-9w59nnw4.mjs";import"./cli-0.5.4-z5d3q8kh.mjs";import"./cli-0.5.4-c0r12dqp.mjs";import"./cli-0.5.4-kqh172jk.mjs";import"./cli-0.5.4-vv4jbgkc.mjs";import{KW as D,MW as X,_W as h,pX as u,rV as S}from"./cli-0.5.4-s7k1f0wc.mjs";import"./cli-0.5.4-0h0yz2k5.mjs";import"./cli-0.5.4-942dm5q1.mjs";import"./cli-0.5.4-rcmp5h4y.mjs";import"./cli-0.5.4-xdcww3x8.mjs";import"./cli-0.5.4-fq32ny1h.mjs";import"./cli-0.5.4-h1m67ngp.mjs";import"./cli-0.5.4-49erze3e.mjs";import"./cli-0.5.4-jytjks37.mjs";import{PY as w,QY as A,RY as _}from"./cli-0.5.4-mn22gk7g.mjs";import{SY as I}from"./cli-0.5.4-5t3jj85n.mjs";import"./cli-0.5.4-5shjmmkz.mjs";import"./cli-0.5.4-zb412kkm.mjs";import"./cli-0.5.4-prfn3sxd.mjs";import"./cli-0.5.4-6xmgebmk.mjs";import"./cli-0.5.4-vjgejcrz.mjs";import"./cli-0.5.4-jqt00ywx.mjs";import"./cli-0.5.4-9e7rkd8e.mjs";import"./cli-0.5.4-jp4wtw87.mjs";import"./cli-0.5.4-hambpq58.mjs";import"./cli-0.5.4-syvgmg9g.mjs";import"./cli-0.5.4-w8ttefr5.mjs";import"./cli-0.5.4-j7kkqxv6.mjs";import"./cli-0.5.4-qrwczx7j.mjs";import"./cli-0.5.4-v2z6p9td.mjs";import{K6 as O,L6 as j}from"./cli-0.5.4-cbq01zg3.mjs";import"./cli-0.5.4-37v5fhf1.mjs";import"./cli-0.5.4-7grzwf6q.mjs";import"./cli-0.5.4-9qmek5dq.mjs";import"./cli-0.5.4-9c6r1fjg.mjs";import"./cli-0.5.4-2dw33ms6.mjs";import"./cli-0.5.4-x1fzfxmm.mjs";import"./cli-0.5.4-e822fzaq.mjs";import"./cli-0.5.4-09dvrzcr.mjs";import"./cli-0.5.4-end8wj9r.mjs";import"./cli-0.5.4-4x206j04.mjs";import"./cli-0.5.4-yd3rd9qt.mjs";import"./cli-0.5.4-sgcaw17t.mjs";import"./cli-0.5.4-jmc3bzbn.mjs";import"./cli-0.5.4-959vxhhb.mjs";import{Vma as C}from"./cli-0.5.4-aacw1src.mjs";j();u();c();d();_();var f=C(S(),1),l=C(I(),1),N=["◐","◓","◑","◒"],b=[{key:"validating",label:"Validating session"},{key:"fetching_logs",label:"Fetching session logs"},{key:"fetching_branch",label:"Getting branch info"},{key:"checking_out",label:"Checking out branch"}];function x(B){let q=f.c(16),{currentStep:y,sessionId:G}=B,[H,E]=h(100),J=Math.floor(E/100)%N.length,K;if(q[0]!==y)K=(Z)=>Z.key===y,q[0]=y,q[1]=K;else K=q[1];let z=b.findIndex(K),F=N[J],L;if(q[2]!==F)L=w(D,{marginBottom:1,children:A(X,{bold:!0,color:"claude",children:[F," Teleporting session…"]})}),q[2]=F,q[3]=L;else L=q[3];let Q;if(q[4]!==G)Q=G&&w(D,{marginBottom:1,children:w(X,{dimColor:!0,children:G})}),q[4]=G,q[5]=Q;else Q=q[5];let U;if(q[6]!==z||q[7]!==J)U=b.map((Z,M)=>{let a=M<z,R=M===z,W=M>z,k,v;if(a)k=O.tick,v="green";else if(R)k=N[J],v="claude";else k=O.circle,v=void 0;return A(D,{flexDirection:"row",children:[w(D,{width:2,children:w(X,{color:v,dimColor:W,children:k})}),w(X,{dimColor:W,bold:R,children:Z.label})]},Z.key)}),q[6]=z,q[7]=J,q[8]=U;else U=q[8];let V;if(q[9]!==U)V=w(D,{flexDirection:"column",marginLeft:2,children:U}),q[9]=U,q[10]=V;else V=q[10];let Y;if(q[11]!==H||q[12]!==L||q[13]!==Q||q[14]!==V)Y=A(D,{ref:H,flexDirection:"column",paddingX:1,paddingY:1,children:[L,Q,V]}),q[11]=H,q[12]=L,q[13]=Q,q[14]=V,q[15]=Y;else Y=q[15];return Y}async function n(B,q){let y=()=>{};function G(){let[K,z]=l.useState("validating");return y=z,w(x,{currentStep:K,sessionId:q})}B.render(w(T,{children:w(G,{})}));let H=await m(q,y);y("checking_out");let{branchName:E,branchError:J}=await g(H.branch);return{messages:P(H.log,J),branchName:E}}export{n as teleportWithProgress,x as TeleportProgress};
