import{d as x,v as P,r as F,K as R,b as n,c as i,z as e,t as B,e as d,x as I,H as q,J as E,q as D}from"./registerWidgets.358232d6.js";import{L as C}from"./CircularLoading.66cf5ef8.js";import{E as L}from"./Error.d63e8ecd.js";import{F as N,R as H}from"./broker.2c645842.js";import{B as M}from"./BackButton.8dccce05.js";import{a as _}from"./asyncComputed.c8d50303.js";import{F as V}from"./forms.fc2763e2.js";import{W}from"./workspaces.445d6cdf.js";import"./lottie.fbc237c8.js";import"./passwordlessManager.5093fac0.js";import"./pubsub.5d0401cb.js";import"./icons.c4e80053.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.7e7bf4fe.js";import"./Passwordless.b773d311.js";import"./executeJs.ee77da09.js";import"./PlayerNavbar.d4b69fb4.js";import"./index.f504f95d.js";import"./WidgetsFrame.578f4bff.js";import"./colors.58e6e833.js";import"./Modal.a3024ac1.js";import"./activeRecord.360f8d7f.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="1f43f9a3-df1f-4aeb-8aab-f1ffe110fc22",a._sentryDebugIdIdentifier="sentry-dbid-1f43f9a3-df1f-4aeb-8aab-f1ffe110fc22")}catch{}})();const z={class:"page"},J={key:1,class:"error"},K={key:2,style:{width:"100%",height:"100%",display:"flex"}},S={style:{width:"100%",height:"100%",display:"flex"}},U=x({__name:"FormPreview",setup(a){const t=q(),r=E(),s=P({started:!1}),f=F(null),{loading:h,result:m,error:c,refetch:u}=_(()=>V.get(r.params.formPath)),{result:p}=_(()=>W.get()),y=R(()=>H.create({formPath:r.params.formPath})),v=async()=>{var o;if(!s.started){(o=f.value)==null||o.run();return}s.started=!1},b=({path:o,type:l})=>{l==="dash"?t.push({name:"dashPreview",params:{dashPath:o},query:r.query}):(t.push({name:"form-preview",params:{formPath:o},query:r.query}),u())},g=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},w=()=>{s.started=!0},k=()=>{s.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(m)||!e(p)?(n(),B(C,{key:0})):e(c)?(n(),i("div",J,[d(L,{error:e(c),onReload:e(u)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[d(N,{ref_key:"runner",ref:f,form:e(m).makeRunnerData(e(p)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:b,onLogout:v,onExit:k,onStart:w},null,8,["form","params","broker"]),d(M,{onExitFullscreenPreview:g})])]))]))}});const ce=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ce as default};
//# sourceMappingURL=FormPreview.244742f2.js.map
