import{d as y,r as h,o as w,L as v,b as c,c as s,w as e,aI as a,u as t,c0 as u,f as n,eB as m,cE as k}from"./outputWidgets.a4629ff8.js";import{A as C,a as b}from"./Text.eb216708.js";import{A as g}from"./index.fda4c602.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new Error().stack;d&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[d]="72337958-d252-42bb-a36b-da6634b3b8dd",o._sentryDebugIdIdentifier="sentry-dbid-72337958-d252-42bb-a36b-da6634b3b8dd")}catch{}})();const D=y({__name:"Debugger",setup(o){async function d(){const i=await fetch("/_editor/api/debugger",{method:"GET"});if(!i.ok)throw new Error("Failed to check debugger connection");return await i.json()}async function f(){await fetch("/_editor/api/debugger/vscode-launch",{method:"POST"}),_()}const r=h({connected:!1,port:0,is_launch_json_configured:!1});async function _(){r.value=await d()}let l=null;return w(()=>{l=setInterval(_,1e3)}),v(()=>{l&&clearInterval(l)}),(i,p)=>r.value.connected?(c(),s(t(u),{key:0,disabled:""},{default:e(()=>[a("VSCode connected")]),_:1})):(c(),s(t(k),{key:1},{content:e(()=>[n(t(g),{direction:"vertical"},{default:e(()=>[n(t(C),null,{default:e(()=>[a(" Abstra allows you to connect to your VSCode debugger ")]),_:1}),n(t(b),null,{default:e(()=>[a(" You're not connected ")]),_:1}),r.value.is_launch_json_configured?(c(),s(t(g),{key:0,direction:"vertical"},{default:e(()=>[n(t(b),{style:{"font-size":"24px"},copyable:"",code:""},{default:e(()=>[a(m(r.value.port),1)]),_:1}),n(t(u),{href:"https://docs.abstra.io/debug/vscode",target:"_blank"},{default:e(()=>[a(" Learn how to connect to vscode ")]),_:1})]),_:1})):(c(),s(t(u),{key:1,onClick:f},{default:e(()=>[a("Configure launch.json")]),_:1}))]),_:1})]),default:e(()=>[n(t(u),null,{default:e(()=>[a("Connect to VSCode")]),_:1})]),_:1}))}});export{D as _};
//# sourceMappingURL=Debugger.vue_vue_type_script_setup_true_lang.cf40fd84.js.map
