try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`78d70855-d439-4076-9092-fd687213cef5`,e._sentryDebugIdIdentifier=`sentry-dbid-78d70855-d439-4076-9092-fd687213cef5`)}catch{}import"./_sentry-release-injection-file-CD3YgipC.js";import"./rolldown-runtime-Ck9zZCT2.js";import{K as e,L as t,n,t as r}from"./index-ZYqhOGev.js";async function i(i,a){try{let o=i();if(!o)return e.log(`No session stored; continuing without a client`),null;e.log(`Using a standalone client`);let{user_id:s,device_id:c,access_token:l,passwordlessUser:u}=o,d={baseUrl:n.defaultHomeserverUrl(),accessToken:l,userId:s,deviceId:c,fallbackICEServerAllowed:!1,livekitServiceURL:n.get().livekit?.livekit_service_url};try{return{widgetApi:null,client:await r(d,!0),passwordlessUser:u}}catch(n){if(n instanceof t&&n.errcode===`M_UNKNOWN_TOKEN`)return e.log(`The session from local store is invalid; continuing without a client`),a(),null;throw n}}catch(e){throw a(),e}}export{i as initSPA};
//# sourceMappingURL=spa-D0Zcr1Ri.js.map