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.eddc32f4.js";import{L}from"./CircularLoading.c96bd1c9.js";import{E as C}from"./Error.de65b1d3.js";import{F as N,R as H}from"./broker.c247ccf4.js";import{B as M}from"./BackButton.cc75430c.js";import{a as _}from"./asyncComputed.562c187e.js";import{F as V}from"./forms.264a49f9.js";import{W}from"./workspaces.afa6238e.js";import"./lottie.6d443700.js";import"./passwordlessManager.8b97cbcd.js";import"./icons.54ab2234.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.93a730d7.js";import"./Passwordless.a3421c62.js";import"./executeJs.808febb8.js";import"./PlayerNavbar.051aa9d4.js";import"./index.611a11f3.js";import"./WidgetsFrame.b21a0c80.js";import"./colors.bcdf4144.js";import"./Modal.bb1eb9c5.js";import"./log.3b9a52f8.js";import"./activeRecord.ed4e0294.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="973a6778-f889-45e3-91fc-d17779a2ff81",s._sentryDebugIdIdentifier="sentry-dbid-973a6778-f889-45e3-91fc-d17779a2ff81")}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(s){const t=q(),r=E(),a=x({started:!1}),d=F(null),{loading:h,result:c,error:f,refetch:u}=_(()=>V.get(r.params.formPath)),{result:p}=_(()=>W.get()),y=R(()=>H.create({isLocal:!1,formPath:r.params.formPath,isPreview:!0})),v=async()=>{var o;if(!a.started){(o=d.value)==null||o.run();return}a.started=!1},g=({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())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},k=()=>{a.started=!0},b=()=>{a.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(c)||!e(p)?(n(),B(L,{key:0})):e(f)?(n(),i("div",J,[m(C,{error:e(f),onReload:e(u)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[m(N,{ref_key:"runner",ref:d,form:e(c).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:g,onLogout:v,onExit:b,onStart:k},null,8,["form","params","broker"]),m(M,{onExitFullscreenPreview:w})])]))]))}});const fe=D(U,[["__scopeId","data-v-f7c2ba13"]]);export{fe as default};
//# sourceMappingURL=FormPreview.33fed69b.js.map
