import{JD as A,LD as c,Pt as m,QD as O,RD as u,SD as _,TD as S,Tt as g,km as f,lm as v}from"./cli-0.5.12-zc0qwdy2.mjs";import"./cli-0.5.12-whfz3xsx.mjs";import"./cli-0.5.12-z100r543.mjs";import"./cli-0.5.12-bzab36pn.mjs";import"./cli-0.5.12-pp1549k7.mjs";import"./cli-0.5.12-9mq24qzr.mjs";import"./cli-0.5.12-7repzgzv.mjs";import"./cli-0.5.12-pdqnfqg3.mjs";import"./cli-0.5.12-c2yq69h9.mjs";import"./cli-0.5.12-kez9r81a.mjs";import"./cli-0.5.12-zbcr8cbk.mjs";import"./cli-0.5.12-2wf629mh.mjs";import"./cli-0.5.12-ghtxkxqx.mjs";import"./cli-0.5.12-xg7a0dy4.mjs";import"./cli-0.5.12-s0h788we.mjs";import"./cli-0.5.12-m22yxpb9.mjs";import"./cli-0.5.12-cw1qs4bg.mjs";import"./cli-0.5.12-yq8ds97a.mjs";import"./cli-0.5.12-qew4mzgp.mjs";import"./cli-0.5.12-gwg1e43k.mjs";import"./cli-0.5.12-36swspqa.mjs";import"./cli-0.5.12-4dn79vqp.mjs";import"./cli-0.5.12-f5pfjvdk.mjs";import{WX as C,YX as R,_V as D,rX as K,tX as Z}from"./cli-0.5.12-fqp5s15p.mjs";import"./cli-0.5.12-rc1p9wk6.mjs";import"./cli-0.5.12-x479axrj.mjs";import"./cli-0.5.12-ysy6e9rz.mjs";import"./cli-0.5.12-cqv7z22w.mjs";import"./cli-0.5.12-7cn41yy7.mjs";import"./cli-0.5.12-34cd39ve.mjs";import"./cli-0.5.12-m2gh4ewc.mjs";import{BZ as G,CZ as Y,DZ as M}from"./cli-0.5.12-c6whkxmz.mjs";import"./cli-0.5.12-w3hy6c60.mjs";import"./cli-0.5.12-5d3qcvf5.mjs";import"./cli-0.5.12-f141d2qa.mjs";import"./cli-0.5.12-khvy67r3.mjs";import"./cli-0.5.12-pycnjaeg.mjs";import"./cli-0.5.12-8v5w8znc.mjs";import"./cli-0.5.12-ctqkj6ve.mjs";import"./cli-0.5.12-cbevkwg4.mjs";import"./cli-0.5.12-w00qj83e.mjs";import"./cli-0.5.12-nbcjwzzn.mjs";import"./cli-0.5.12-3t06hwwh.mjs";import"./cli-0.5.12-057c2cp2.mjs";import"./cli-0.5.12-ecgx5n54.mjs";import"./cli-0.5.12-g4wb8mj2.mjs";import"./cli-0.5.12-vp5smcs1.mjs";import"./cli-0.5.12-y2kq7fe8.mjs";import"./cli-0.5.12-7vxpqr5a.mjs";import"./cli-0.5.12-hvtcdcev.mjs";import"./cli-0.5.12-asbn3d19.mjs";import"./cli-0.5.12-k1crwtdc.mjs";import"./cli-0.5.12-2jxq8gnm.mjs";import{Kfa as b,Nfa as B,Pfa as T}from"./cli-0.5.12-p5ps8gf0.mjs";import"./cli-0.5.12-hp0508v9.mjs";import"./cli-0.5.12-tfdwzg37.mjs";import"./cli-0.5.12-60w1a0bs.mjs";import"./cli-0.5.12-c8f4daey.mjs";import"./cli-0.5.12-0qasc0ef.mjs";import"./cli-0.5.12-f8850v2j.mjs";import"./cli-0.5.12-495d826j.mjs";import"./cli-0.5.12-rt0k97yj.mjs";import"./cli-0.5.12-1vyz0tt9.mjs";import{Yna as P}from"./cli-0.5.12-xzeb7mtb.mjs";R();u();g();S();T();c();v();M();var h=P(D(),1);function p(J){let q=h.c(19),{filePath:L,errorDescription:Q,onExit:z,onReset:w}=J,k;if(q[0]!==z||q[1]!==w)k=(y)=>{if(y==="exit")z();else w()},q[0]=z,q[1]=w,q[2]=k;else k=q[2];let F=k,U;if(q[3]!==L)U=Y(Z,{children:["The configuration file at ",G(Z,{bold:!0,children:L})," contains invalid JSON."]}),q[3]=L,q[4]=U;else U=q[4];let V;if(q[5]!==Q)V=G(Z,{children:Q}),q[5]=Q,q[6]=V;else V=q[6];let W;if(q[7]!==U||q[8]!==V)W=Y(K,{flexDirection:"column",gap:1,children:[U,V]}),q[7]=U,q[8]=V,q[9]=W;else W=q[9];let H;if(q[10]===Symbol.for("react.memo_cache_sentinel"))H=G(Z,{bold:!0,children:"Choose an option:"}),q[10]=H;else H=q[10];let I;if(q[11]===Symbol.for("react.memo_cache_sentinel"))I=[{label:"Exit and fix manually",value:"exit"},{label:"Reset with default configuration",value:"reset"}],q[11]=I;else I=q[11];let X;if(q[12]!==F||q[13]!==z)X=Y(K,{flexDirection:"column",children:[H,G(A,{options:I,onChange:F,onCancel:z})]}),q[12]=F,q[13]=z,q[14]=X;else X=q[14];let N;if(q[15]!==z||q[16]!==W||q[17]!==X)N=Y(f,{title:"Configuration Error",color:"error",onCancel:z,children:[W,X]}),q[15]=z,q[16]=W,q[17]=X,q[18]=N;else N=q[18];return N}var d="dark";async function n({error:J}){let q={..._(!1),theme:d};await new Promise(async(L)=>{let{unmount:Q}=await C(G(m,{children:G(O,{children:G(p,{filePath:J.filePath,errorDescription:J.message,onExit:()=>{Q(),L(),process.exit(1)},onReset:()=>{B(J.filePath,b(J.defaultConfig,null,2),{flush:!1,encoding:"utf8"}),Q(),L(),process.exit(0)}})})}),q)})}export{n as showInvalidConfigDialog};
