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]=`5b50ca54-0794-428f-9e7d-368947abfd56`,e._sentryDebugIdIdentifier=`sentry-dbid-5b50ca54-0794-428f-9e7d-368947abfd56`)}catch{}import"./_sentry-release-injection-file-C4oXeC0H.js";import{Gn as e,ai as t}from"./indexeddb-crypto-store-DDjyMFqS.js";import{Gt as n,a as r}from"./matrix-BMlTzVh5.js";async function i(i,a){try{let o=i();if(!o)return t.log(`No session stored; continuing without a client`),null;t.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 e&&n.errcode===`M_UNKNOWN_TOKEN`)return t.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-BW6X0pJ7.js.map