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]=`50e0047c-8094-4c64-ad41-b226dde5c439`,e._sentryDebugIdIdentifier=`sentry-dbid-50e0047c-8094-4c64-ad41-b226dde5c439`)}catch{}import"./rolldown-runtime-eb2nym32.js";import{Zf as e,dm as t,gm as n,im as r,om as i,vd as a}from"./entry.client-dr7r6s9a.js";import{a as o,n as s,r as c,t as l}from"./HttpUtils-e2rnpjqi.js";var u=e();t(),r();var d=class{playFetch;cv;getLogger;get logger(){return this.getLogger(`AuthenticationService`)}constructor(e=new u.CorrelationVector,t,r=globalThis.fetch){this.cv=e,this.getLogger=t,this.playFetch=n(r,{request:[new o,new i(async()=>this.cv.increment().getValue())],error:[new c(this.logger)]})}setSessionCv(e){this.cv=e}async loginUser(e,t){let n=e.serviceSettings.getHeaders(),r=`${e.serviceSettings.getDomain()}/v2/login/user`;n?.get(`Forwarded`)&&(r+=`/delegated`);let i=await l(this.playFetch,e,n)(r,{method:`POST`,body:a(t)}),o=await i.json();return o.retrievedAtTimestamp=Date.now(),[o,i]}async fetchOfferings(e,t){let r=`${t.getDomain()}/v1/offerings/user`,i=await(await n(this.playFetch,{request:[new s(t.getHeaders())]})(r,{method:`POST`,body:a({authenticationType:`Xbox`,token:e})})).text(),o=JSON.parse(i);return this.logger.info(`retrieved ${o.offerings.length} offerings for user`),o.offerings}};export{d as AuthenticationService};