import{d as P,v as x,r as F,K as R,b as n,c as i,z as e,t as B,e as m,x as I,H as q,J as E,q as D}from"./registerWidgets.dc0b6768.js";import{L}from"./CircularLoading.8d483ca6.js";import{E as C}from"./Error.f6e237b9.js";import{F as N,R as H}from"./broker.ab28f50c.js";import{B as M}from"./BackButton.780c3f1c.js";import{a as _}from"./asyncComputed.1ef6bcd7.js";import{F as V}from"./forms.cef7eeb8.js";import{W}from"./workspaces.964a7daa.js";import"./lottie.eb38a9e8.js";import"./passwordlessManager.914ef4f9.js";import"./icons.79ac4c38.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.97b43c01.js";import"./Passwordless.451bc665.js";import"./executeJs.be5526ce.js";import"./PlayerNavbar.eaceadad.js";import"./index.60bce881.js";import"./WidgetsFrame.300273f9.js";import"./colors.a35572bb.js";import"./Modal.cf860ea9.js";import"./log.709af14c.js";import"./activeRecord.81c73286.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]="5bc5a8a6-b195-49d6-816a-bba535b531f7",a._sentryDebugIdIdentifier="sentry-dbid-5bc5a8a6-b195-49d6-816a-bba535b531f7")}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=P({__name:"FormPreview",setup(a){const t=q(),r=E(),s=x({started:!1}),d=F(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:f}=_(()=>W.get()),y=R(()=>H.create({isLocal:!1,formPath:r.params.formPath,isPreview:!0})),b=async()=>{var o;if(!s.started){(o=d.value)==null||o.run();return}s.started=!1},v=({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}),p())},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(c)||!e(f)?(n(),B(L,{key:0})):e(u)?(n(),i("div",J,[m(C,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[m(N,{ref_key:"runner",ref:d,form:e(c).makeRunnerData(e(f)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:v,onLogout:b,onExit:k,onStart:w},null,8,["form","params","broker"]),m(M,{onExitFullscreenPreview:g})])]))]))}});const ue=D(U,[["__scopeId","data-v-f7c2ba13"]]);export{ue as default};
//# sourceMappingURL=FormPreview.a813ec58.js.map
