import{d as b,ez as k,ey as h,b as s,c as m,w as i,aI as $,u as e,c0 as B,r as y,J as C,f as p,ev as u,eE as I}from"./outputWidgets.17e2270d.js";import{_ as P,a as R}from"./FormTester.vue_vue_type_script_setup_true_lang.5bba28c9.js";import{S as T,L as S}from"./SmartConsole.11639759.js";import{a as D}from"./asyncComputed.c8589796.js";import{F as N}from"./forms.4a239233.js";import{W as A}from"./workspaces.1c8fc227.js";import{_ as E}from"./SaveButton.vue_vue_type_script_setup_true_lang.6e46a263.js";import{_ as F}from"./DocsButton.vue_vue_type_script_setup_true_lang.93b7a046.js";import{_ as L}from"./LaunchButton.vue_vue_type_script_setup_true_lang.e00c1ac7.js";import{B as V}from"./BaseLayout.0fbdf4d1.js";import"./index.4787064b.js";import{r as q}from"./executeJs.dcb0cac7.js";import{A as g,T as M}from"./TabPane.f1ed80bf.js";import"./index.f56076f5.js";import{c as U}from"./index.038579df.js";import"./Title.7b6ce571.js";import"./Form.0e9953f6.js";import"./broker.f8850d2a.js";import"./index.678809b3.js";import"./pubsub.52f6192d.js";import"./CircularLoading.1c3b33da.js";import"./WidgetsFrame.b5c97561.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.6359e175.js";import"./icons.ae606380.js";import"./StageRunSelector.vue_vue_type_script_setup_true_lang.d5b385ae.js";import"./index.0e8e64cb.js";import"./CollapsePanel.0785fbcd.js";import"./index.bedec2c6.js";import"./index.34b7172c.js";import"./index.29151007.js";import"./dashes.f7f3f911.js";import"./activeRecord.1230459a.js";import"./runnerData.07784255.js";import"./hooks.793ec9e4.js";import"./jobs.5a9560be.js";import"./index.cfd05648.js";import"./uuid.79e36a56.js";import"./url.6c73df07.js";import"./ant-design.8d97eacb.js";import"./PlayerNavbar.03251a7c.js";import"./Steps.6af066e9.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="e97dd4be-4a8a-4339-9008-adce4b9e177d",a._sentryDebugIdIdentifier="sentry-dbid-e97dd4be-4a8a-4339-9008-adce4b9e177d")}catch{}})();const W=b({__name:"PreviewButton",props:{model:{}},setup(a){const o=a,c=k(),f=h(),r=()=>{const l=c.query;f.push({path:`/_editor/${o.model.routeName}/${encodeURIComponent(o.model.path)}/preview`,query:l})};return(l,t)=>(s(),m(e(B),{class:"preview-button",onClick:r},{default:i(()=>[$(" Preview ")]),_:1}))}}),Te=b({__name:"FormEditor",setup(a){const o=h(),c=k(),f=y(null),r=y("test");function l(){o.push({name:"forms"})}const{result:t,refetch:w}=D(()=>Promise.all([A.get(),N.get(c.params.formPath)]).then(([d,n])=>I({workspace:d,form:n}))),v=S.create();function x(d,n){q("editor",o,d,n)}return C(()=>c.params.formPath,()=>{w()}),(d,n)=>(s(),m(V,null,{navbar:i(()=>[e(t)?(s(),m(e(U),{key:0,title:e(t).form.title,style:{padding:"5px 10px"},onBack:l},{footer:i(()=>[p(e(M),{"active-key":r.value,"onUpdate:activeKey":n[0]||(n[0]=_=>r.value=_)},{default:i(()=>[p(e(g),{key:"test",tab:"Test"}),p(e(g),{key:"settings",tab:"Settings"})]),_:1},8,["active-key"])]),extra:i(()=>[p(L,{path:e(t).form.path},null,8,["path"]),p(F,{path:"forms/overview"}),p(W,{model:e(t).form},null,8,["model"]),r.value==="settings"?(s(),m(E,{key:0,model:e(t).form},null,8,["model"])):u("",!0)]),_:1},8,["title"])):u("",!0)]),content:i(()=>[e(t)&&r.value==="test"?(s(),m(P,{key:0,ref_key:"tester",ref:f,form:e(t).form,"log-service":e(v),onRedirect:x},null,8,["form","log-service"])):u("",!0),e(t)&&r.value==="settings"?(s(),m(R,{key:1,form:e(t).form},null,8,["form"])):u("",!0)]),footer:i(()=>{var _;return[e(t)&&r.value==="test"?(s(),m(T,{key:0,runtime:"forms","log-service":e(v),onRestart:(_=f.value)==null?void 0:_.restart},null,8,["log-service","onRestart"])):u("",!0)]}),_:1}))}});export{Te as default};
//# sourceMappingURL=FormEditor.a97ceaa2.js.map
