(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,38036,t=>{"use strict";var e=t.i(54858);let o="auth_token";function r(){return localStorage.getItem(o)}function n(t){localStorage.setItem(o,t)}function i(){localStorage.removeItem(o)}function a(){return null!==r()}async function s(t){let o=await (0,e.apiRequest)("/auth/login",{method:"POST",body:JSON.stringify(t)});return n(o.token),o}function u(){i()}t.s(["getToken",()=>r,"isAuthenticated",()=>a,"login",()=>s,"logout",()=>u,"removeToken",()=>i,"setToken",()=>n])},54858,t=>{"use strict";let e="http://localhost:3000";async function o(t,r={}){let n=`${e}${t}`,i=await fetch(n,{...r,headers:{"Content-Type":"application/json",...r.headers}}),a=await i.json();if(!i.ok)throw Error(a.error||"Request failed");return a}async function r(o,n={},i){let{getToken:a,removeToken:s}=await t.A(48323),u=a();if(!u)throw i&&i(),Error("Authentication required");let c=`${e}${o}`,l=await fetch(c,{...n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`,...n.headers}}),h=await l.json();if(401===l.status)throw s(),i&&i(),Error(h.error||"Authentication failed");if(!l.ok)throw Error(h.error||"Request failed");return h}t.s(["apiRequest",()=>o,"authenticatedRequest",()=>r])},18566,(t,e,o)=>{e.exports=t.r(76562)},48323,t=>{t.v(t=>Promise.resolve().then(()=>t(38036)))}]);