import{d as x,v as P,r as F,K as R,b as n,c as d,z as e,t as B,e as i,x as I,H as q,J as E,q as D}from"./registerWidgets.89616af0.js";import{L as C}from"./CircularLoading.0fb686c0.js";import{E as L}from"./Error.d0c3932f.js";import{F as N,R as H}from"./broker.67106cf5.js";import{B as M}from"./BackButton.fb83d4bd.js";import{a as _}from"./asyncComputed.8ac91a75.js";import{F as V}from"./forms.59430d62.js";import{W}from"./workspaces.621b79ad.js";import"./lottie.fc57e5ac.js";import"./passwordlessManager.884221ca.js";import"./pubsub.d7600aa1.js";import"./icons.9cfdae6d.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.5682728a.js";import"./Passwordless.ac83d40c.js";import"./executeJs.dfd1b55f.js";import"./PlayerNavbar.2a5ed820.js";import"./index.d40cd19f.js";import"./WidgetsFrame.2b06573d.js";import"./colors.bc71fdf2.js";import"./Modal.73e976a2.js";import"./activeRecord.3d3c7835.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]="0dc269d0-14ef-4b72-912b-57bbdc002ed8",s._sentryDebugIdIdentifier="sentry-dbid-0dc269d0-14ef-4b72-912b-57bbdc002ed8")}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(s){const t=q(),r=E(),a=P({started:!1}),m=F(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:f}=_(()=>W.get()),y=R(()=>H.create({formPath:r.params.formPath})),b=async()=>{var o;if(!a.started){(o=m.value)==null||o.run();return}a.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=()=>{a.started=!0},k=()=>{a.started=!1};return(o,l)=>(n(),d("div",z,[e(h)||!e(c)||!e(f)?(n(),B(C,{key:0})):e(u)?(n(),d("div",J,[i(L,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),d("main",K,[I("div",S,[i(N,{ref_key:"runner",ref:m,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"]),i(M,{onExitFullscreenPreview:g})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.203b2e5a.js.map
