(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{62821:(e,t,a)=>{Promise.resolve().then(a.bind(a,91252))},91252:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var s=a(95155),l=a(12115),i=a(82556),r=a(34018),o=a(3534),n=a(28777),c=a(77479);let d="https://9router.com";function u({machineId:e}){let t,a,v,[x,p]=(0,l.useState)([]),[h,g]=(0,l.useState)(!0),[f,m]=(0,l.useState)(null),[j,b]=(0,l.useState)({}),[E,w]=(0,l.useState)(!1),[S,P]=(0,l.useState)(!1),[k,y]=(0,l.useState)(""),[N,A]=(0,l.useState)(!1),[C,M]=(0,l.useState)(""),[U,I]=(0,l.useState)([]),[_,O]=(0,l.useState)({});(0,l.useEffect)(()=>{Z(),Q(),$(),T()},[]);let T=async()=>{try{let e=await fetch("/api/cli-tools/all-statuses");e.ok&&O(await e.json())}catch(e){console.log("Error fetching tool statuses:",e)}},Q=async()=>{try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();w(t.cloudEnabled||!1)}if(t.ok){let e=await t.json();P(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),y(e.tunnel?.publicUrl||""),A(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),M(e.tailscale?.tunnelUrl||"")}}catch(e){console.log("Error loading settings:",e)}},$=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();I(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},Z=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&p(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},q=()=>x.filter(e=>!1!==e.isActive),z=(0,l.useCallback)((e,t,a)=>{b(s=>s[e]?.[t]===a?s:{...s,[e]:{...s[e],[t]:a}})},[]);if(h)return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(i.Qv,{}),(0,s.jsx)(i.Qv,{}),(0,s.jsx)(i.Qv,{})]});let F=(t=q(),a=[],v=new Set,t.forEach(e=>{let t=n.Xg[e.provider]||e.provider;(0,n.KC)(e.provider).forEach(s=>{let l=`${t}/${s.id}`;v.has(l)||(v.add(l),a.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}),a).length>0,G=Object.entries(o.dM),K=Object.entries(o.wn);return(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("h1",{className:"text-[26px] font-semibold tracking-[-0.01em] text-[var(--text-primary)]",children:"CLI Tools"}),(0,s.jsx)("p",{className:"text-[14px] text-[var(--text-secondary)]",children:"Configure local coding tools to use your Uniro providers."})]}),(0,s.jsx)("div",{className:"grid gap-3 sm:gap-4",children:G.map(([e,t])=>((e,t)=>{let a={tool:t,isExpanded:f===e,onToggle:()=>m(f===e?null:e),baseUrl:S&&k?k:E&&d?d:window.location.origin,apiKeys:U,tunnelEnabled:S,tunnelPublicUrl:k,tailscaleEnabled:N,tailscaleUrl:C};switch(e){case"claude":return(0,s.jsx)(c.Tk,{...a,activeProviders:q(),modelMappings:j[e]||{},onModelMappingChange:(t,a)=>z(e,t,a),hasActiveProviders:F,cloudEnabled:E,initialStatus:_.claude},e);case"codex":return(0,s.jsx)(c.Ah,{...a,activeProviders:q(),cloudEnabled:E,initialStatus:_.codex},e);case"opencode":return(0,s.jsx)(c.qO,{...a,activeProviders:q(),cloudEnabled:E,initialStatus:_.opencode},e);case"cowork":return(0,s.jsx)(c.Q6,{...a,activeProviders:q(),hasActiveProviders:F,cloudEnabled:E,cloudUrl:d,tunnelEnabled:S,tunnelPublicUrl:k,tailscaleEnabled:N,tailscaleUrl:C,initialStatus:_.cowork},e);case"droid":return(0,s.jsx)(c.ZM,{...a,activeProviders:q(),hasActiveProviders:F,cloudEnabled:E,initialStatus:_.droid},e);case"openclaw":return(0,s.jsx)(c.yZ,{...a,activeProviders:q(),hasActiveProviders:F,cloudEnabled:E,initialStatus:_.openclaw},e);case"hermes":return(0,s.jsx)(c.RF,{...a,activeProviders:q(),hasActiveProviders:F,cloudEnabled:E,initialStatus:_.hermes},e);case"copilot":return(0,s.jsx)(c.h1,{...a,activeProviders:q(),cloudEnabled:E,initialStatus:_.copilot},e);case"cline":return(0,s.jsx)(c.aG,{...a,activeProviders:q(),cloudEnabled:E,initialStatus:_.cline},e);case"kilo":return(0,s.jsx)(c.c9,{...a,activeProviders:q(),cloudEnabled:E,initialStatus:_.kilo},e);default:return(0,s.jsx)(c.a7,{toolId:e,...a,activeProviders:q(),cloudEnabled:E,tunnelEnabled:S},e)}})(e,t))}),(0,s.jsxs)("div",{className:"grid gap-3 sm:gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)(r.A,{size:18,className:"text-[var(--accent-orange)]"}),(0,s.jsx)("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:"MITM Tools"})]}),K.map(([e,t])=>(0,s.jsx)(c.gY,{tool:t},e))]})]})}}},e=>{e.O(0,[2574,5730,3862,7924,3242,8475,8500,131,1327,6173,3795,7467,6357,5816,5772,85,9208,1131,7404,8441,3794,7358],()=>e(e.s=62821)),_N_E=e.O()}]);