import{d as x,H as P,J as F,v as R,r as B,K as I,b as n,c as d,z as e,t as q,e as i,x as E,q as D}from"./registerWidgets.7afd6438.js";import{L as C}from"./CircularLoading.283e573b.js";import{E as L}from"./Error.61ba999a.js";import{F as N,R as H}from"./broker.86f82403.js";import{B as M}from"./BackButton.258f879d.js";import{a as _}from"./asyncComputed.b60ddd9a.js";import{F as V}from"./forms.5559899c.js";import{W}from"./workspaces.ddbd5106.js";import"./lottie.36f8e1f2.js";import"./passwordlessManager.7da7ab9e.js";import"./pubsub.9805d82b.js";import"./Passwordless.2c1a2517.js";import"./icons.0ae396f2.js";import"./executeJs.ad83f949.js";import"./PlayerNavbar.c33c7896.js";import"./index.60b26bb0.js";import"./Steps.224fdd6f.js";import"./Modal.94284cfc.js";import"./WidgetsFrame.0c0e8621.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.e2b7aceb.js";import"./activeRecord.e140ff8e.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]="9580ab4a-62e2-4f8c-9c6b-abd4d838e8da",a._sentryDebugIdIdentifier="sentry-dbid-9580ab4a-62e2-4f8c-9c6b-abd4d838e8da")}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=P(),r=F(),s=R({started:!1}),m=B(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:f}=_(()=>W.get()),y=I(()=>H.create({formPath:r.params.formPath})),v=async()=>{var o;if(!s.started){(o=m.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}),p())},g=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},w=()=>{s.started=!0},k=()=>{s.started=!1};return(o,l)=>(n(),d("div",z,[e(h)||!e(c)||!e(f)?(n(),q(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,[E("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:y.value,style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:b,onLogout:v,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.d48035ad.js.map
