import{d as x,ex as F,ey as R,E as B,r as I,F as E,b as i,c as d,bu as e,u as q,e as m,er as D,t as C}from"./registerWidgets.daf4e0d4.js";import{L}from"./CircularLoading.56bf1e90.js";import{E as N}from"./Error.3593c802.js";import{F as M,R as V}from"./broker.9a40da63.js";import{B as W}from"./BackButton.db58d920.js";import{a as _}from"./asyncComputed.ea0509ca.js";import{F as H}from"./forms.6d364979.js";import{W as S}from"./workspaces.b71a7837.js";import{r as U}from"./index.a5a2f87c.js";import"./lottie.1c3e1229.js";import"./passwordlessManager.cc6b1127.js";import"./pubsub.bf966380.js";import"./storage.62ab7605.js";import"./Passwordless.b90967a1.js";import"./icons.74a49ba5.js";import"./executeJs.a21550bd.js";import"./PlayerNavbar.cae0df6c.js";import"./Steps.5b08a7ec.js";import"./Modal.041843ec.js";import"./WidgetsFrame.88a82b36.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.a4b4dcd8.js";import"./activeRecord.8789da8d.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]="953c3fb0-00d7-4cb6-a6b1-83273d364456",s._sentryDebugIdIdentifier="sentry-dbid-953c3fb0-00d7-4cb6-a6b1-83273d364456")}catch{}})();const $={class:"page"},j={key:1,class:"error"},z={key:2,style:{width:"100%",height:"100%",display:"flex"}},A={style:{width:"100%",height:"100%",display:"flex"}},G=x({__name:"FormPreview",setup(s){const t=F(),o=R(),a=B({started:!1});function y(r,n){U("preview",t,r,n)}const c=I(null),{loading:h,result:u,error:f,refetch:p}=_(()=>H.get(o.params.formPath)),{result:l}=_(()=>S.get()),v=E(()=>V.create({formPath:o.params.formPath})),b=async()=>{var r;if(!a.started){(r=c.value)==null||r.run();return}a.started=!1},g=({path:r,type:n})=>{n==="dash"?t.push({name:"dashPreview",params:{dashPath:r},query:o.query}):(t.push({name:"formPreview",params:{formPath:r},query:o.query}),p())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},k=()=>{a.started=!0},P=()=>{a.started=!1};return(r,n)=>(i(),d("div",$,[e(h)||!e(u)||!e(l)?(i(),q(L,{key:0})):e(f)?(i(),d("div",j,[m(N,{error:e(f),onReload:e(p)},null,8,["error","onReload"])])):(i(),d("main",z,[D("div",A,[m(M,{ref_key:"runner",ref:c,form:e(u).makeRunnerData(e(l)),params:e(o).query,"is-preview":!0,"enable-auto-focus":!0,broker:v.value,style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:g,onLogout:b,onExit:P,onStart:k,onRedirect:y},null,8,["form","params","broker"]),m(W,{onExitFullscreenPreview:w})])]))]))}});const le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.6d81cd18.js.map
