import{d as x,v as P,r as F,K as R,b as n,c as i,z as e,t as B,e as d,x as I,H as q,J as E,q as D}from"./registerWidgets.0e006b6f.js";import{L as C}from"./CircularLoading.091208e5.js";import{E as L}from"./Error.a427bb84.js";import{F as N,R as H}from"./broker.a7e23963.js";import{B as M}from"./BackButton.e64ece86.js";import{a as _}from"./asyncComputed.62aacf33.js";import{F as V}from"./forms.f2dd5726.js";import{W}from"./workspaces.48d692e9.js";import"./lottie.b974d0b6.js";import"./passwordlessManager.4cf24a2b.js";import"./pubsub.13db2123.js";import"./icons.6bb7a228.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.42c8d93f.js";import"./Passwordless.11ab8892.js";import"./executeJs.64987f61.js";import"./PlayerNavbar.a41a317c.js";import"./index.cad410b6.js";import"./WidgetsFrame.58e774c2.js";import"./colors.7dccb471.js";import"./Modal.d54926bb.js";import"./activeRecord.d399634f.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]="43c32525-88bf-43fe-b706-a55bb776a444",a._sentryDebugIdIdentifier="sentry-dbid-43c32525-88bf-43fe-b706-a55bb776a444")}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=q(),r=E(),s=P({started:!1}),m=F(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:f}=_(()=>W.get()),y=R(()=>H.create({formPath:r.params.formPath})),b=async()=>{var o;if(!s.started){(o=m.value)==null||o.run();return}s.started=!1},v=({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(),i("div",z,[e(h)||!e(c)||!e(f)?(n(),B(C,{key:0})):e(u)?(n(),i("div",J,[d(L,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[d(N,{ref_key:"runner",ref:m,form:e(c).makeRunnerData(e(f)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:v,onLogout:b,onExit:k,onStart:w},null,8,["form","params","broker"]),d(M,{onExitFullscreenPreview:g})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.d7f4cc50.js.map
