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]=`880a1d2e-8888-4310-a2fc-5c4d935ee532`,e._sentryDebugIdIdentifier=`sentry-dbid-880a1d2e-8888-4310-a2fc-5c4d935ee532`)}catch{}import{Cd as e,Sd as t,_m as n,bd as r,dm as i,gm as a,xd as o,ym as s}from"./entry.client-dr7r6s9a.js";i();var c=class{priority=0;intercept=async e=>n.fromRequest(e,{additionalHeaders:{"Content-Type":`application/json; charset=utf-8`}})},l={Uninitialized:0,Continue:100,SwitchingProtocols:101,Processing:102,OK:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,Ambiguous:300,MovedPermanently:301,Moved:301,Found:302,Redirect:302,SeeOther:303,RedirectMethod:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,RedirectKeepVerb:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,RequestEntityTooLarge:413,RequestUriTooLong:414,UnsupportedMediaType:415,RequestedRangeNotSatisfiable:416,ExpectationFailed:417,IAmATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,UpgradeRequired:426,TooManyRequests:429,PreconditionRequired:428,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};i();var u=async(e,n)=>{let i=await n.text();if(!i)return;let a;try{a=JSON.parse(i)}catch{}if(a){let i=a;if(i&&r(i))throw e.error(`ServiceErrorDetails issue detected. Code:${i.code}, Message:${i.message}, Status:${n.status}`),new t(`ServiceErrorDetails issue detected. Code:${i.code}, Message:${i.message}, Status:${n.status}`,o(i.code));let s=a.errorDetails;if(s&&r(s))throw e.error(`ServiceErrorDetails issue detected. Code:${s.code}, Message:${s.message}, Status:${n.status}`),new t(`ServiceErrorDetails issue detected. Code:${s.code}, Message:${s.message}, Status:${n.status}`,o(s.code))}n.ok||e.error(`Failing body unprocessed: ${i}`)},d=class{priority=0;logger;constructor(e){this.logger=e}intercept=async(e,t)=>{let n=t.clone();return await u(this.logger,n),t}},f=class{priority=0;logger;constructor(e){this.logger=e}intercept=async(n,r)=>{if(r.message===`Network request failed`)throw this.logger.error(`Network request failed`,e.NoNetwork),new t(`The network request failed`,e.NoNetwork);if(r.message===`Failed to fetch`)throw this.logger.error(`Failed to fetch`,e.NoNetwork),new t(`Failed to fetch`,e.NoNetwork);if(r.message===`Timeout`)throw this.logger.error(`The operation timed out`,e.Timeout),new t(`The operation timed out`,e.Timeout);if(!(r instanceof s))throw r;let i=r.response.clone();switch(await u(this.logger,i),i.status){case l.Forbidden:throw this.logger.error(`Forbidden`,e.AuthUnauthorized),new t(`Forbidden`,e.AuthUnauthorized);case l.Unauthorized:throw this.logger.error(`Unauthorized`,e.AuthUnauthorized),new t(`Unauthorized`,e.AuthUnauthorized);case l.Conflict:throw this.logger.error(`A resource is already in use by the current user. Please try again`,e.Conflict),new t(`A resource is already in use by the current user. Please try again`,e.Conflict);case l.NotFound:throw this.logger.error(`Not Found`,e.NotFound),new t(`Not Found`,e.NotFound);case l.Gone:throw this.logger.error(`The session is gone`,e.Gone),new t(`The session is gone`,e.Gone)}throw r}};i();var p=class{priority=0;headers;constructor(e){this.headers=e}intercept=async e=>this.headers?n.fromRequest(e,{additionalHeaders:this.headers}):e};i();var m=class{priority=0;user;constructor(e){this.user=e}intercept=async e=>{let t=await this.user.getAuthorizationHeader();return n.fromRequest(e,{additionalHeaders:{Authorization:t}})}},h=class{priority=0;addSignature;constructor(e){this.addSignature=e}intercept=async e=>(await this.addSignature(e),e)};i();function g(e,t,n,r){let i=[new m(t),new p(n)];return r&&i.push(new h(r)),a(e,{request:i})}export{c as a,d as i,p as n,f as r,g as t};