import{d as x,ex as F,ey as R,E as B,r as I,F as E,b as i,c,bu as e,u as q,e as d,er as D,t as C}from"./registerWidgets.0d6f36c3.js";import{L}from"./CircularLoading.c1ba3036.js";import{E as N}from"./Error.0ffaf297.js";import{F as M,R as V}from"./broker.8d40beea.js";import{B as W}from"./BackButton.7eb3f856.js";import{a as _}from"./asyncComputed.f5c93ddf.js";import{F as H}from"./forms.4022505a.js";import{W as S}from"./workspaces.5ee373e9.js";import{r as U}from"./index.d832b0e2.js";import"./lottie.aa3f8e33.js";import"./passwordlessManager.7ee1fbd9.js";import"./pubsub.c204a78d.js";import"./storage.674259be.js";import"./Passwordless.a68e6afc.js";import"./icons.0e440585.js";import"./executeJs.0eeb9888.js";import"./PlayerNavbar.437d5d77.js";import"./Steps.f9247165.js";import"./Modal.04b37ba8.js";import"./WidgetsFrame.20e6738d.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.af8cb7d2.js";import"./activeRecord.43bccff7.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]="c5d16426-8cc1-4966-a199-fb457cc4ab0d",a._sentryDebugIdIdentifier="sentry-dbid-c5d16426-8cc1-4966-a199-fb457cc4ab0d")}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 m=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(!s.started){(r=m.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(),c("div",$,[e(h)||!e(u)||!e(l)?(i(),q(L,{key:0})):e(f)?(i(),c("div",j,[d(N,{error:e(f),onReload:e(p)},null,8,["error","onReload"])])):(i(),c("main",z,[D("div",A,[d(M,{ref_key:"runner",ref:m,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"]),d(W,{onExitFullscreenPreview:b})])]))]))}});const le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.81142ba0.js.map
