import{d as g,H as S,J as I,r as $,K as D,b as e,c as o,F as v,L as k,x as a,N as y,G as w,e as r,I as x,D as m,t as B,w as T,z as _,q as f,O as A,Q as N,a as O}from"./registerWidgets.802bba2f.js";import{d as W,s as j,w as F,a as R,b as V,c as z,m as E,e as G}from"./icons.97625e56.js";import{T as H}from"./Tooltip.345f0ce8.js";import{_ as J}from"./logo.084e5d7c.js";import{a as M}from"./asyncComputed.1364aaa9.js";import{W as q}from"./workspaces.4c177a35.js";import{L}from"./login.29b4c1f1.js";import"./utils.95f0e9e8.js";import"./pubsub.a0411919.js";const K={class:"sidebar"},Q={class:"section-name"},U=["onClick"],P={class:"item-name"},X={key:0,class:"tag soon"},Y={key:1,class:"tag beta"},Z={key:2,class:"tag cloud"},ee=g({__name:"Sidebar",setup(n){var p;const c=S(),u=I(),s=$((p=u.name)!=null?p:"forms"),d=D(()=>[{name:"Runtime",items:[{name:"Forms",icon:W,path:"forms"},{name:"Jobs",icon:j,path:"jobs",cloud:!0},{name:"Hooks",icon:F,path:"hooks"},{name:"Dashes",icon:R,path:"dashes",beta:!0}]},{name:"Resources",items:[{name:"Tables",icon:V,path:"tables",beta:!0}]},{name:"Settings",items:[{name:"Style",icon:z,path:"style"},{name:"Sidebar",icon:E,path:"sidebar"}]}]),b=l=>{l.unavailable||(c.push(l.path),s.value=l.path)};return(l,h)=>(e(),o("div",K,[(e(!0),o(v,null,k(_(d),i=>(e(),o("div",{key:i.name,class:"section"},[a("span",Q,y(i.name),1),(e(!0),o(v,null,k(i.items,t=>(e(),o("div",{key:t.name,role:"button",class:w(["item",{active:s.value===t.path,disabled:t.unavailable||i.cloud}]),tabindex:"0",onClick:ve=>b(t)},[r(x,{class:w(["icon",{disabled:t.unavailable,active:s.value===t.path}]),path:t.icon,width:"20",height:"20"},null,8,["class","path"]),a("span",P,y(t.name),1),t.unavailable?(e(),o("span",X,"SOON")):m("",!0),t.beta?(e(),o("span",Y,"BETA")):m("",!0),t.cloud?(e(),o("span",Z,"CLOUD")):m("",!0),t.warning?(e(),B(H,{key:3,class:"warning",text:t.warning,fixed:!0,top:18,left:18},{default:T(()=>[r(x,{path:_(G),fill:"#D35249",width:"20",height:"20"},null,8,["path"])]),_:2},1032,["text"])):m("",!0)],10,U))),128))]))),128))]))}});const oe=f(ee,[["__scopeId","data-v-320e9ff3"]]);const te={},C=n=>(A("data-v-ccfb70ef"),n=n(),N(),n),se={class:"logo"},ae=C(()=>a("img",{src:J,alt:"Abstra cloud logo"},null,-1)),ne=C(()=>a("span",null," Abstra ",-1)),ce=[ae,ne];function le(n,c){return e(),o("div",se,ce)}const re=f(te,[["render",le],["__scopeId","data-v-ccfb70ef"]]),ie={key:0,class:"login-block"},_e={key:1,class:"login-block"},ue=["href"],de={key:1,class:"button"},pe={key:2,class:"login-block"},he=g({__name:"LoginBlock",setup(n){const c=$(!1),{loading:u,result:s,refetch:d}=M(()=>L.get());async function b(){const h=prompt("Token");!h||(await L.create(h),d())}async function p(){!s.value||(await s.value.delete(),d())}async function l(){!s.value||(c.value=!0,confirm("Are you sure you want to deploy this project to Abstra Cloud?")&&(await q.deploy(),alert("Deployed!")),c.value=!1)}return(h,i)=>_(u)?(e(),o("div",ie,"loading...")):_(s)?(e(),o("div",_e,[a("a",{class:"button",href:`https://cloud.abstra.io/projects/${_(s).projectId}`,target:"_blank"},"Go to console ",8,ue),c.value?(e(),o("button",de,"Deploying...")):(e(),o("button",{key:0,class:"button",onClick:l},"Deploy")),a("button",{class:"button",onClick:p},"Logout")])):(e(),o("div",pe,[a("button",{class:"button",onClick:b},"Login")]))}});const me=f(he,[["__scopeId","data-v-7d8a9386"]]),fe={class:"workspace"},be=g({__name:"Workspace",setup(n){return(c,u)=>{const s=O("router-view");return e(),o(v,null,[a("nav",null,[r(re),r(me)]),a("div",fe,[r(oe,{class:"sidebar"}),r(s)])],64)}}});const Ie=f(be,[["__scopeId","data-v-91804c74"]]);export{Ie as default};
//# sourceMappingURL=Workspace.bdb450a1.js.map
