import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,p as i,t as a,tt as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{t as l}from"./useKeybinding-DPOUuymz.js";import{t as u}from"./lib-Cf16LgKj.js";function d({onDone:e}){let[t,n]=(0,m.useState)(`ios`),[a,c]=(0,m.useState)({ios:``,android:``}),{url:l}=g[t],u=a[t];(0,m.useEffect)(()=>{async function e(){let[e,t]=await Promise.all([(0,p.toString)(g.ios.url,{type:`utf8`,errorCorrectionLevel:`L`}),(0,p.toString)(g.android.url,{type:`utf8`,errorCorrectionLevel:`L`})]);c({ios:e,android:t})}e().catch(()=>{})},[]),o(`confirm:no`,(0,m.useCallback)(()=>{e()},[e]),{context:`Confirmation`});function d(t){if(t.key===`q`||t.ctrl&&t.key===`c`){t.preventDefault(),e();return}(t.key===`tab`||t.key===`left`||t.key===`right`)&&(t.preventDefault(),n(e=>e===`ios`?`android`:`ios`))}let f=u.split(`
`).filter(e=>e.length>0);return(0,h.jsx)(i,{children:(0,h.jsxs)(s,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:d,children:[(0,h.jsx)(r,{children:` `}),(0,h.jsx)(r,{children:` `}),f.map((e,t)=>(0,h.jsx)(r,{children:e},t)),(0,h.jsx)(r,{children:` `}),(0,h.jsx)(r,{children:` `}),(0,h.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,h.jsxs)(r,{children:[(0,h.jsx)(r,{bold:t===`ios`,underline:t===`ios`,children:`iOS`}),(0,h.jsx)(r,{dimColor:!0,children:` / `}),(0,h.jsx)(r,{bold:t===`android`,underline:t===`android`,children:`Android`})]}),(0,h.jsx)(r,{dimColor:!0,children:`(tab to switch, esc to close)`})]}),(0,h.jsx)(r,{dimColor:!0,children:l})]})})}async function f(e){return(0,h.jsx)(d,{onDone:e})}var p,m,h,g;e((()=>{p=u(),n(),m=t(n(),1),a(),l(),h=c(),g={ios:{url:`https://apps.apple.com/app/claude-by-anthropic/id6473753684`},android:{url:`https://play.google.com/store/apps/details?id=com.anthropic.claude`}}}))();export{f as call};