import{L as D}from"./CircularLoading-Dm1gD7nh.js";import{e as w,r as n,M as k,ae as x,f as c,j as I,q as l,b9 as C,g as i,aM as E}from"./jwt-decode.esm-C7p7KYmD.js";import{W as M}from"./Watermark-BBQ6W5Iz.js";import{u as W}from"./userStore-Cvp-HM2T.js";import{b as $}from"./consoleCapture-BZVsCKpd.js";import{b as S}from"./workspaceStore-C02eSYYX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="40f790e7-86a2-4a07-bdf3-a669e4155259",e._sentryDebugIdIdentifier="sentry-dbid-40f790e7-86a2-4a07-bdf3-a669e4155259")}catch{}})();const V={class:"page-container"},j={key:0,class:"loading"},L={key:1,class:"error-container"},P=["srcdoc"],R=w({__name:"PageStageView",props:{uiData:{}},setup(e){const t=e,f=x(),p=n(!0),u=n(""),s=n(!1),g=n(null);return k(async()=>{const a=W();a.loadJWT();try{const d=t.uiData.path?`/_page/${t.uiData.path}`:"/_page-home",o=await S(d,{headers:a.authHeaders});if(o.status===401){a.removeJWT(),f.push({name:"playerLogin",query:{redirect:`/${t.uiData.path}`}});return}if(o.ok){const m=await o.text(),r=o.headers.get("X-Execution-Id"),_=o.headers.get("X-Abstra-Debug")==="true";if(m){const h=`<base href="${d}" target="_top">`,b=a.jwt?`<meta name="abstra-auth-token" content="${a.jwt}">`:"",y=r?`<meta name="abstra-execution-id" content="${r}">`:"",v=r&&_?$(r,t.uiData.id):"";u.value=h+b+y+v+m}else s.value=!0}else s.value=!0}catch{s.value=!0}p.value=!1}),(a,d)=>(i(),c("div",V,[p.value?(i(),c("div",j,[l(D)])):s.value?(i(),c("div",L,[l(C,{"error-message":null,"execution-id":null,locale:"en"})])):u.value?(i(),c("iframe",{key:2,ref_key:"iframeRef",ref:g,class:"page-iframe",srcdoc:u.value},null,8,P)):I("",!0),l(M,{"page-id":e.uiData.id,locale:"en"},null,8,["page-id"])]))}}),A=E(R,[["__scopeId","data-v-0847c51d"]]);export{A as P};
//# sourceMappingURL=PageStageView-DgoYiUD6.js.map
