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 d,x as I,H as q,J as E,q as D}from"./registerWidgets.fce18b61.js";import{L}from"./CircularLoading.01aaac49.js";import{E as C}from"./Error.f3084ce0.js";import{F as N,R as H}from"./broker.41b4afbe.js";import{B as M}from"./BackButton.f77362f6.js";import{a as _}from"./asyncComputed.aceaab2d.js";import{F as V}from"./forms.e294d432.js";import{W}from"./workspaces.001f8bee.js";import"./lottie.84b3db69.js";import"./passwordlessManager.2cd33479.js";import"./icons.99afd58c.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.9474c75a.js";import"./Passwordless.1c4f72d4.js";import"./executeJs.7046116d.js";import"./PlayerNavbar.079e91f3.js";import"./index.130927bb.js";import"./WidgetsFrame.bc1c8c2c.js";import"./colors.655cb633.js";import"./Modal.eb38c07a.js";import"./log.608a083b.js";import"./activeRecord.5ca93a47.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]="0d829a57-efe9-47ae-9dee-dae624001c6f",a._sentryDebugIdIdentifier="sentry-dbid-0d829a57-efe9-47ae-9dee-dae624001c6f")}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}),m=F(null),{loading:h,result:c,error:u,refetch:f}=_(()=>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=m.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}),f())},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(c)||!e(p)?(n(),B(L,{key:0})):e(u)?(n(),i("div",J,[d(C,{error:e(u),onReload:e(f)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[d(N,{ref_key:"runner",ref:m,form:e(c).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"]),d(M,{onExitFullscreenPreview:w})])]))]))}});const ue=D(U,[["__scopeId","data-v-f7c2ba13"]]);export{ue as default};
//# sourceMappingURL=FormPreview.18ac229e.js.map
