import{d as P,v as x,r as F,K as R,b as n,c as i,z as e,t as B,e as m,x as I,H as q,J as E,q as D}from"./registerWidgets.68b4d727.js";import{L}from"./CircularLoading.d7ae4d10.js";import{E as C}from"./Error.36a26a5d.js";import{F as N,R as H}from"./broker.f865809f.js";import{B as M}from"./BackButton.e07bee68.js";import{a as _}from"./asyncComputed.93878fc8.js";import{F as V}from"./forms.3fd63c4b.js";import{W}from"./workspaces.987721db.js";import"./lottie.d1957a7e.js";import"./passwordlessManager.a7d5c3a4.js";import"./icons.ef86ff2e.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.5681d83c.js";import"./Passwordless.bf03ab53.js";import"./executeJs.c67b4605.js";import"./PlayerNavbar.db54667c.js";import"./index.9f0d5f28.js";import"./WidgetsFrame.990b2044.js";import"./colors.8344a969.js";import"./Modal.d08e28ea.js";import"./log.088604d7.js";import"./activeRecord.65858c58.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]="7f2100a9-a525-4fa2-9381-e43471984f6c",a._sentryDebugIdIdentifier="sentry-dbid-7f2100a9-a525-4fa2-9381-e43471984f6c")}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=P({__name:"FormPreview",setup(a){const t=q(),r=E(),s=x({started:!1}),c=F(null),{loading:h,result:d,error:f,refetch:u}=_(()=>V.get(r.params.formPath)),{result:p}=_(()=>W.get()),y=R(()=>H.create({isLocal:!1,formPath:r.params.formPath,isPreview:!0})),v=async()=>{var o;if(!s.started){(o=c.value)==null||o.run();return}s.started=!1},g=({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}),u())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},k=()=>{s.started=!0},b=()=>{s.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(d)||!e(p)?(n(),B(L,{key:0})):e(f)?(n(),i("div",J,[m(C,{error:e(f),onReload:e(u)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[m(N,{ref_key:"runner",ref:c,form:e(d).makeRunnerData(e(p)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:g,onLogout:v,onExit:b,onStart:k},null,8,["form","params","broker"]),m(M,{onExitFullscreenPreview:w})])]))]))}});const fe=D(U,[["__scopeId","data-v-f7c2ba13"]]);export{fe as default};
//# sourceMappingURL=FormPreview.87a4349e.js.map
