import{d as f,u as k,K as I,b as o,c as a,y as _,V as v,W as g,v as c,B as p,H as b,e as x,a5 as M,R as y,N as A,O as L,q as h,x as V,G as E,o as T,A as m,F as N,J as R,a6 as U,a as C,E as D,t as B,a7 as F,a8 as H,w as J}from"./registerWidgets.fff064a1.js";import{p as O}from"./icons.907f45d7.js";import{a as P}from"./CircularLoading.59d7fd3d.js";import{F as j}from"./forms.7bc6baea.js";import{D as q}from"./dashes.da7ff1db.js";import{H as z}from"./hooks.039c0cd9.js";import{J as w}from"./jobs.af366134.js";const S=e=>(A("data-v-36feb34b"),e=e(),L(),e),G={class:"runtime-settings"},K={key:0,class:"field"},W=S(()=>c("div",{class:"label"},"Path",-1)),Z={class:"field"},Q=S(()=>c("div",{class:"label"},"Code",-1)),X={class:"input-row"},Y={key:0,class:"root-path"},tt={key:1,class:"root-path loading"},et={key:1,class:"error"},ot=f({__name:"RuntimeCommonSettings",props:{runtime:null},setup(e){const t=e,r=k({pathError:null}),l=()=>{fetch("/_editor/api/workspace/open-file",{method:"POST",body:JSON.stringify({path:t.runtime.file}),headers:{"Content-Type":"application/json"}})},d=I(),{result:s}=P(()=>fetch("/_editor/api/workspace/root-path").then(u=>u.text()));return t.runtime.onUpdate(()=>{if(!(t.runtime instanceof w))if(console.log("runtime updated",t.runtime.path),t.runtime instanceof j)d.push({path:`/_editor/form/${t.runtime.path}`});else if(t.runtime instanceof z)d.push({path:`/_editor/hook/${t.runtime.path}`});else if(t.runtime instanceof q)d.push({path:`/_editor/dash/${t.runtime.path}`});else throw new Error(`Unknown runtime type ${t.runtime}`)}),(u,n)=>(o(),a("div",G,[e.runtime instanceof _(w)?p("",!0):(o(),a("div",K,[W,v(c("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>e.runtime.path=i),class:"path-input",type:"text"},null,512),[[g,e.runtime.path]])])),c("div",Z,[Q,c("div",X,[_(s)?(o(),a("span",Y,b(_(s)),1)):(o(),a("span",tt," Loading... ")),v(c("input",{"onUpdate:modelValue":n[1]||(n[1]=i=>e.runtime.file=i),type:"text"},null,512),[[g,e.runtime.file]]),c("button",{class:"open-file-icon",onClick:n[2]||(n[2]=i=>l())},[x(M,{path:_(O)},null,8,["path"]),y(" Open in editor ")])])]),r.pathError?(o(),a("div",et,b(r.pathError),1)):p("",!0)]))}});const St=h(ot,[["__scopeId","data-v-36feb34b"]]),st={class:"tab-menu"},nt={class:"tabs"},at={key:0,class:"group"},it={class:"group"},ct=["onClick"],rt={key:1,class:"group"},lt={class:"content"},dt=f({__name:"TabMenuUnderline",setup(e){const t=k([]),r=V(),l=s=>{const u=n=>n==s;t.forEach((n,i)=>{n.isActive=u(i)})},d=E(()=>t.findIndex(s=>s.isActive));return U("addTab",s=>{t.push(s)}),T(()=>{l(0)}),(s,u)=>{const n=C("icon");return o(),a("div",st,[c("div",nt,[_(r).left?(o(),a("div",at,[m(s.$slots,"left",{},void 0,!0)])):p("",!0),c("div",it,[(o(!0),a(N,null,R(t,(i,$)=>(o(),a("button",{key:i.title,class:D(["form-tab",_(d)==$&&"active"]),onClick:yt=>l($)},[i.icon?(o(),B(n,{key:0,path:i.icon,fill:"#8692A5",width:"10",height:"10"},null,8,["path"])):p("",!0),y(" "+b(i.title),1)],10,ct))),128))]),_(r).right?(o(),a("div",rt,[m(s.$slots,"right",{},void 0,!0)])):p("",!0)]),c("div",lt,[m(s.$slots,"default",{},void 0,!0)])])}}});const It=h(dt,[["__scopeId","data-v-60b2affa"]]),_t={class:"tab"},ut=f({__name:"Tab",props:{title:null,icon:null},setup(e){const t=e,r=k({isActive:!1,title:t.title,icon:t.icon}),l=F("addTab");return T(()=>{l(r)}),(d,s)=>v((o(),a("div",_t,[m(d.$slots,"default",{},void 0,!0)],512)),[[H,r.isActive]])}});const Mt=h(ut,[["__scopeId","data-v-9c2e92c2"]]),pt={},ht={width:"12",height:"10",viewBox:"0 0 12 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},mt=c("path",{d:"M2.8725 4.25L5.5575 1.5575L4.5 0.5L0 5L4.5 9.5L5.5575 8.4425L2.8725 5.75H12V4.25H2.8725Z",fill:"#6D7C93"},null,-1),ft=[mt];function vt(e,t){return o(),a("svg",ht,ft)}const bt=h(pt,[["render",vt]]),kt=f({__name:"BackButton",props:{link:null},setup(e){return(t,r)=>{const l=C("router-link");return o(),B(l,{class:"link-button",to:e.link},{default:J(()=>[x(bt),y(" Back ")]),_:1},8,["to"])}}});const At=h(kt,[["__scopeId","data-v-56a12edc"]]);export{At as B,St as R,It as T,Mt as a};
//# sourceMappingURL=BackButton.ffb72b1d.js.map
