import{d as x,ex as F,ey as R,E as B,r as I,F as E,b as i,c as m,bu as e,u as q,e as c,er as D,t as C}from"./registerWidgets.f16d9611.js";import{L}from"./CircularLoading.955865b1.js";import{E as N}from"./Error.d5adc6b0.js";import{F as M,R as V}from"./broker.3df311ce.js";import{B as W}from"./BackButton.fd5f2ab5.js";import{a as _}from"./asyncComputed.5a3fb141.js";import{F as H}from"./forms.8c7bb72d.js";import{W as S}from"./workspaces.03168f53.js";import{r as U}from"./index.6ce32df2.js";import"./lottie.eab5e6f1.js";import"./passwordlessManager.7fb318b8.js";import"./pubsub.1eec455f.js";import"./storage.9f674036.js";import"./Passwordless.8c0e4f21.js";import"./icons.3c1b43b5.js";import"./executeJs.68b2615a.js";import"./PlayerNavbar.eb774f8e.js";import"./Steps.327dc602.js";import"./Modal.4a31ff16.js";import"./WidgetsFrame.0dd3b757.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.2ac48342.js";import"./activeRecord.5c8dc9b3.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]="ce3698c9-053c-446b-b1e9-9281df2e0908",s._sentryDebugIdIdentifier="sentry-dbid-ce3698c9-053c-446b-b1e9-9281df2e0908")}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 d=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})),g=async()=>{var r;if(!a.started){(r=d.value)==null||r.run();return}a.started=!1},w=({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())},b=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},k=()=>{a.started=!0},P=()=>{a.started=!1};return(r,n)=>(i(),m("div",$,[e(h)||!e(u)||!e(l)?(i(),q(L,{key:0})):e(f)?(i(),m("div",j,[c(N,{error:e(f),onReload:e(p)},null,8,["error","onReload"])])):(i(),m("main",z,[D("div",A,[c(M,{ref_key:"runner",ref:d,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:w,onLogout:g,onExit:P,onStart:k,onRedirect:y},null,8,["form","params","broker"]),c(W,{onExitFullscreenPreview:b})])]))]))}});const le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.939a0f32.js.map
