import{d as v,G as y,b as n,c as k,y as e,t as l,B as m,F as D,L as g,K as P,q as w}from"./registerWidgets.fff064a1.js";import{D as B,n as q}from"./DashPlayer.7373a7f9.js";import{a as d,L as x}from"./CircularLoading.59d7fd3d.js";import{r as R}from"./index.314cf40a.js";import{B as I}from"./BackButton.c350c17f.js";import{D as b}from"./dashes.da7ff1db.js";import{W as C}from"./workspaces.252c90d6.js";import"./WidgetsFrame.cebd6d3d.js";import"./icons.907f45d7.js";import"./Modal.2ceba592.js";import"./runnerData.9e14dd92.js";import"./utils.3371dfe5.js";const F=v({__name:"DashPreview",setup(L){const s=g(),o=P(),h=({id:r,type:t})=>{t==="dash"?(o.push({name:"dashPreview",params:{dashId:r},query:s.query}),_()):o.push({name:"form-preview",params:{formId:r},query:s.query})},{loading:f,result:a,refetch:_}=d(()=>b.get(s.params.dashPath)),{result:u}=d(()=>C.get()),p=y(()=>{if(!a.value||!u.value||!a.value.makeRunnerData(u.value))return null;const r=q.create(a.value.makeRunnerData(u.value),!1);return r.onRedirect(({url:t,queryParams:i})=>R(o,t,i)),r});return(r,t)=>(n(),k(D,null,[e(f)||!e(a)?(n(),l(x,{key:0,class:"loading",justify:"center"})):m("",!0),e(p)?(n(),l(B,{key:1,class:"player",dash:e(p).runnerData,"is-preview":!0,params:e(s).query,"dash-player-state":e(p),onNavigate:h},null,8,["dash","params","dash-player-state"])):m("",!0),e(a)?(n(),l(I,{key:2,onExitFullscreenPreview:t[0]||(t[0]=i=>{var c;return e(o).push(`/_editor/dash/${(c=e(a))==null?void 0:c.path}`)})})):m("",!0)],64))}});const H=w(F,[["__scopeId","data-v-427b9305"]]);export{H as default};
//# sourceMappingURL=DashPreview.64450e79.js.map
