(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{16512:(e,s,t)=>{Promise.resolve().then(t.bind(t,84353))},84353:(e,s,t)=>{"use strict";t.d(s,{default:()=>c});var a=t(95155),n=t(12115),i=t(3534),r=t(28777),l=t(52679),d=t(77479);function c(){let[e,s]=(0,n.useState)([]),[t,c]=(0,n.useState)([]),[o,u]=(0,n.useState)({}),[x,p]=(0,n.useState)(!1),[h,m]=(0,n.useState)(null),[f,g]=(0,n.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,n.useEffect)(()=>{v(),j(),w(),y()},[]);let v=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let t=await e.json();s(t.connections||[])}}catch{}},j=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();c(s.keys||[])}}catch{}},w=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},y=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();p(s.cloudEnabled||!1)}}catch{}},N=()=>e.filter(e=>!1!==e.isActive),S=Object.entries(i.wn);return(0,a.jsxs)("div",{className:"px-8 py-7",children:[(0,a.jsx)("h1",{className:"text-[26px] font-semibold tracking-[-0.01em] text-[var(--text-primary)]",children:"MITM Proxy"}),(0,a.jsx)("p",{className:"mt-1 text-[14px] text-[var(--text-secondary)] max-w-[640px]",children:"Intercept HTTPS from CLI tools that don't support custom endpoints — Copilot, Cursor, Antigravity, Kiro."}),(0,a.jsxs)("div",{className:"mt-6 flex w-full flex-col gap-6",children:[(0,a.jsxs)("header",{className:"card flex flex-wrap items-center gap-5 px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:`dot-pulse ${f.running?"":"error"}`,"aria-hidden":"true"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"brand-mark text-base mb-0.5",children:["MITM proxy ",f.running?"intercepting":"paused"]}),(0,a.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Port 7878 \xb7 ",S.length," CLI tools routed \xb7 CA ",f.certExists?"installed":"not installed"]})]})]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("span",{className:`chip ${f.running?"ok":"bad"} text-[11px]`,children:f.running?"active":"offline"})]}),(0,a.jsx)(d.tA,{apiKeys:t,cloudEnabled:x,onStatusChange:g}),(0,a.jsx)("div",{className:"grid gap-3 sm:gap-4",children:S.map(([e,s])=>(0,a.jsx)(d.kn,{tool:s,isExpanded:h===e,onToggle:()=>m(h===e?null:e),serverRunning:f.running,dnsActive:f.dnsStatus?.[e]||!1,hasCachedPassword:f.hasCachedPassword||!1,needsSudoPassword:!1!==f.needsSudoPassword,isWin:!0===f.isWin,apiKeys:t,activeProviders:N(),hasActiveProviders:N().some(e=>(0,r.KC)(e.provider).length>0||(0,l.mq)(e.provider)||(0,l.gb)(e.provider)),modelAliases:o,cloudEnabled:x,onDnsChange:e=>g(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},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=16512)),_N_E=e.O()}]);