import{n as e}from"./chunk-DR8-3Aex.js";import{E as t,F as n,Rn as r,T as i,b as a,g as o,h as s,ot as c,t as l,tt as u,w as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{lo as m,oo as h}from"./paths-Ci1iwL5Y.js";import{By as g,DT as _,OT as v,SE as y,_m as b,aS as x,dm as S,fC as C,fm as w,gm as T,hm as E,kT as D,lC as O,uC as k,wE as A}from"./loadAgentsDir-C_wFhytF.js";import{t as j}from"./useKeybinding-DPOUuymz.js";import{t as M}from"./useTerminalSize-Du-EamDN.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";function F({onThemeSelect:e,showIntroText:r=!1,helpText:l=``,showHelpTextBelow:p=!1,hideEscToCancel:h=!1,skipExitHandling:g=!1,onCancel:_}){let[b]=i(),w=t(),{columns:D}=n(),O=E(),A=O===null?T(b):null,{setPreviewTheme:j,savePreview:M,cancelPreview:P}=d(),F=k(e=>e.settings.syntaxHighlightingDisabled)??!1,L=C();c(`ThemePicker`);let R=v(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);u(`theme:toggleSyntaxHighlighting`,()=>{if(O===null){let e=!F;m(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(g?()=>{}:void 0),B=[...[],{label:`Dark mode`,value:`dark`},{label:`Light mode`,value:`light`},{label:`Dark mode (colorblind-friendly)`,value:`dark-daltonized`},{label:`Light mode (colorblind-friendly)`,value:`light-daltonized`},{label:`Dark mode (ANSI colors only)`,value:`dark-ansi`},{label:`Light mode (ANSI colors only)`,value:`light-ansi`}],V=(0,I.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,I.jsxs)(f,{flexDirection:`column`,gap:1,children:[r?(0,I.jsx)(a,{children:`Let's get started.`}):(0,I.jsx)(a,{bold:!0,color:`permission`,children:`Theme`}),(0,I.jsxs)(f,{flexDirection:`column`,children:[(0,I.jsx)(a,{bold:!0,children:`Choose the text style that looks best with your terminal`}),l&&!p&&(0,I.jsx)(a,{dimColor:!0,children:l})]}),(0,I.jsx)(x,{options:B,onFocus:e=>{j(e)},onChange:t=>{M(),e(t)},onCancel:g?()=>{P(),_?.()}:async()=>{P(),await y(0)},visibleOptionCount:B.length,defaultValue:w,defaultFocusValue:w})]}),(0,I.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,I.jsx)(f,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,I.jsx)(S,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`-  console.log("Hello, World!");`,`+  console.log("Hello, Claude!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:D})}),(0,I.jsxs)(a,{dimColor:!0,children:[` `,O===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:F?`Syntax highlighting disabled (${R} to enable)`:A?`Syntax theme: ${A.theme}${A.source?` (from ${A.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return r?V:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(f,{flexDirection:`column`,children:V}),(0,I.jsxs)(f,{marginTop:1,children:[p&&l&&(0,I.jsx)(f,{marginLeft:3,children:(0,I.jsx)(a,{dimColor:!0,children:l})}),!h&&(0,I.jsx)(f,{children:(0,I.jsx)(a,{dimColor:!0,italic:!0,children:z.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,I.jsxs)(s,{children:[(0,I.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,I.jsx)(o,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var I,L=e((()=>{r(),P(),M(),l(),D(),j(),_(),O(),A(),h(),g(),b(),w(),I=p()}));export{L as n,F as t};