import{r as q}from"./index.60b26bb0.js";import{u as g}from"./uuid.261a01ca.js";import{F as x,R as S}from"./broker.86f82403.js";import{d as B,J as K,H as E,v as N,a1 as m,K as f,z as i,b as o,c as l,e as O,t as w,O as T,Q as F,x as d,q as L}from"./registerWidgets.7afd6438.js";import{D as C,m as V}from"./DashPlayer.00071d09.js";import{a as j}from"./asyncComputed.b60ddd9a.js";import{r as z,l as A}from"./runnerData.7369dff0.js";import{L as H}from"./CircularLoading.283e573b.js";import"./passwordlessManager.7da7ab9e.js";import"./pubsub.9805d82b.js";import"./Passwordless.2c1a2517.js";import"./icons.0ae396f2.js";import"./executeJs.ad83f949.js";import"./PlayerNavbar.c33c7896.js";import"./Steps.224fdd6f.js";import"./Modal.94284cfc.js";import"./WidgetsFrame.0c0e8621.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.e2b7aceb.js";import"./lottie.36f8e1f2.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="f0b377ad-057f-4c24-ba2b-c1a806aecb21",r._sentryDebugIdIdentifier="sentry-dbid-f0b377ad-057f-4c24-ba2b-c1a806aecb21")}catch{}})();async function J(r){const e=await fetch(`/_api/${r}`);if(e.status==404)return null;if(!e.ok)throw new Error(await e.text());const{form:s,dash:n}=await e.json();return{form:s&&z(s),dash:n&&A(n)}}const p=r=>(T("data-v-2840ab73"),r=r(),F(),r),Q={key:0,class:"loading"},$={key:1,class:"error"},G=p(()=>d("h1",null,"Oops! Something went wrong",-1)),M=p(()=>d("p",null,"An unknown error ocurred. Please try again or contact support.",-1)),U=[G,M],W={key:2,class:"form"},X={key:3,class:"dash-wrapper"},Y={key:4,class:"error not-found"},Z=p(()=>d("h1",null,"Page not found",-1)),ee=p(()=>d("p",null,"The page you requested could not be found.",-1)),ae=[Z,ee],re=B({__name:"Player",setup(r){const e=K(),s=E(),n=N({playerKey:g()});m(e,()=>I());const _=({path:a})=>{s.push({name:"player",query:e.query,params:{path:a.split("/")}})},y=async()=>{n.playerKey=g()};m([()=>e.path,()=>e.query],()=>y());const{loading:k,result:t,error:D,refetch:I}=j(()=>{var a;return J((a=e.path.slice(1))!=null?a:"")}),h=f(()=>c.value?S.create({formPath:c.value.path}):null),c=f(()=>{var a,u;return(u=(a=t.value)==null?void 0:a.form)!=null?u:null}),v=f(()=>{var u,b;if(!((u=t.value)!=null&&u.dash))return null;const a=V((b=t.value)==null?void 0:b.dash);return a.onRedirect(({url:P,queryParams:R})=>q(s,P,R)),a});return m(t,()=>{var a;!t.value||(t.value.form?document.title=(a=t.value.form.welcomeTitle)!=null?a:t.value.form.title:t.value.dash&&(document.title=t.value.dash.title))}),(a,u)=>i(k)?(o(),l("div",Q,[O(H)])):i(D)?(o(),l("div",$,U)):c.value&&h.value?(o(),l("div",W,[(o(),w(x,{key:n.playerKey,class:"player",form:c.value,"is-preview":!1,params:i(e).query,broker:h.value,"enable-auto-focus":!0,onNavigate:_,onLogout:y},null,8,["form","params","broker"]))])):v.value?(o(),l("div",X,[(o(),w(C,{key:n.playerKey,class:"player","is-preview":!1,params:i(e).query,"dash-player-service":v.value,onNavigate:_},null,8,["params","dash-player-service"]))])):(o(),l("div",Y,ae))}});const ke=L(re,[["__scopeId","data-v-2840ab73"]]);export{ke as default};
//# sourceMappingURL=Player.bc278c5f.js.map
