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.ff0e603c.js";import{L}from"./CircularLoading.b4308657.js";import{E as N}from"./Error.597f2775.js";import{F as M,R as V}from"./broker.62890e64.js";import{B as W}from"./BackButton.2c18bd2e.js";import{a as _}from"./asyncComputed.47db4727.js";import{F as H}from"./forms.21b47742.js";import{W as S}from"./workspaces.145b71db.js";import{r as U}from"./index.e3ad034d.js";import"./lottie.0af290d8.js";import"./passwordlessManager.c02d6ee2.js";import"./pubsub.bd8735a3.js";import"./storage.db287aee.js";import"./Passwordless.e0f23eef.js";import"./icons.e90de051.js";import"./executeJs.f91f5f90.js";import"./PlayerNavbar.9da36452.js";import"./Steps.483489b6.js";import"./Modal.61a541af.js";import"./WidgetsFrame.09aba4b0.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.16ec1715.js";import"./activeRecord.193d97cb.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]="e1259b0e-6b29-4339-a4e3-f9498d0d3a23",a._sentryDebugIdIdentifier="sentry-dbid-e1259b0e-6b29-4339-a4e3-f9498d0d3a23")}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(a){const t=F(),o=R(),s=B({started:!1});function y(r,n){U("preview",t,r,n)}const u=I(null),{loading:h,result:c,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(!s.started){(r=u.value)==null||r.run();return}s.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=()=>{s.started=!0},P=()=>{s.started=!1};return(r,n)=>(i(),d("div",$,[e(h)||!e(c)||!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:u,form:e(c).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"]),m(W,{onExitFullscreenPreview:b})])]))]))}});const le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.31419814.js.map
