import{F as I,r as R,R as B}from"./FormRunner.57c46b4c.js";import{d as P,eB as q,eA as x,G as D,J as p,H as y,u as d,b as a,ev as i,f as E,c as F,eE as S,eF as K,e as u,v as L}from"./outputWidgets.8e744bdb.js";import{u as h}from"./uuid.c76143bc.js";import{a as N}from"./asyncComputed.317c8625.js";import{g as A}from"./api.057778fa.js";import{L as C}from"./CircularLoading.ef3e0493.js";import"./url.9304e931.js";import"./Passwordless.be99935f.js";import"./index.fe22d0e7.js";import"./pubsub.a3628e87.js";import"./icons.805cd884.js";import"./PlayerNavbar.5d2d8622.js";import"./ActionButton.af56cfec.js";import"./WidgetsFrame.75d98aa9.js";import"./index.9fb0ac7b.js";import"./Base.bd673c5e.js";import"./Link.ea06bf6e.js";import"./Paragraph.15ec5eb0.js";import"./Text.07e986e0.js";import"./Title.d066fbae.js";import"./Card.9b1248c3.js";import"./TabPane.a9cb823a.js";import"./hasIn.23fe66f7.js";import"./runnerData.28ea29fd.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="1ff53d7d-b8a8-4e9e-8ebc-d39318988e71",o._sentryDebugIdIdentifier="sentry-dbid-1ff53d7d-b8a8-4e9e-8ebc-d39318988e71")}catch{}})();const c=o=>(S("data-v-485e3719"),o=o(),K(),o),T={key:0,class:"loading"},V={key:1,class:"error"},G=c(()=>u("h1",null,"Oops! Something went wrong",-1)),H=c(()=>u("p",null,"An unknown error ocurred. Please try again or contact support.",-1)),J=[G,H],O={key:2,class:"form"},j={key:3,class:"error not-found",style:{height:"100vh"}},z=c(()=>u("h1",null,"Page not found",-1)),M=c(()=>u("p",null,"The page you requested could not be found.",-1)),Q=[z,M],U=P({__name:"Player",setup(o){const t=q(),l=x(),m=D({playerKey:h()});p(t,()=>w());function v(e,s){R("player",l,e,s)}const g=({path:e})=>{l.push({name:"player",query:t.query,params:{path:e.split("/")}})},_=async()=>{m.playerKey=h()};p([()=>t.path,()=>t.query],()=>_());const{loading:b,result:r,error:k,refetch:w}=N(()=>{var e;return A((e=t.path.slice(1))!=null?e:"")}),f=y(()=>n.value?B.create(n.value.id):null),n=y(()=>{var e,s;return(s=(e=r.value)==null?void 0:e.form)!=null?s:null});return p(r,()=>{var e;!r.value||r.value.form&&(document.title=(e=r.value.form.welcomeTitle)!=null?e:r.value.form.title)}),(e,s)=>d(b)?(a(),i("div",T,[E(C)])):d(k)?(a(),i("div",V,J)):n.value&&f.value?(a(),i("div",O,[(a(),F(I,{key:m.playerKey,class:"player",form:n.value,"is-preview":!1,params:d(t).query,broker:f.value,"enable-auto-focus":!0,onNavigate:g,onLogout:_,onRedirect:v},null,8,["form","params","broker"]))])):(a(),i("div",j,Q))}});const ge=L(U,[["__scopeId","data-v-485e3719"]]);export{ge as default};
//# sourceMappingURL=Player.895c95cb.js.map
