module.exports=[72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},53250,a=>{"use strict";let b="http://localhost:3000";async function c(a,d={}){let e=`${b}${a}`,f=await fetch(e,{...d,headers:{"Content-Type":"application/json",...d.headers}}),g=await f.json();if(!f.ok)throw Error(g.error||"Request failed");return g}async function d(c,e={},f){let{getToken:g,removeToken:h}=await a.A(66308),i=g();if(!i)throw f&&f(),Error("Authentication required");let j=`${b}${c}`,k=await fetch(j,{...e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`,...e.headers}}),l=await k.json();if(401===k.status)throw h(),f&&f(),Error(l.error||"Authentication failed");if(!k.ok)throw Error(l.error||"Request failed");return l}a.s(["apiRequest",()=>c,"authenticatedRequest",()=>d])},47033,a=>{"use strict";var b=a.i(53250);function c(){return null}function d(a){}function e(){}function f(){return null!==c()}async function g(a){let c=await (0,b.apiRequest)("/auth/login",{method:"POST",body:JSON.stringify(a)});return d(c.token),c}function h(){e()}a.s(["getToken",()=>c,"isAuthenticated",()=>f,"login",()=>g,"logout",()=>h,"removeToken",()=>e,"setToken",()=>d])},83694,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(47033);function f(){let a=(0,d.useRouter)(),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(!1);(0,c.useEffect)(()=>{(0,e.isAuthenticated)()&&a.push("/events")},[a]);let n=async b=>{b.preventDefault(),k(null),m(!0);try{await (0,e.login)({email:f,password:h}),a.push("/events")}catch(a){k(a instanceof Error?a.message:"Login failed")}finally{m(!1)}};return(0,b.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:(0,b.jsxs)("main",{className:"w-full max-w-md space-y-8 rounded-lg border border-gray-200 p-8",children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold text-center",children:"Login"}),(0,b.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium mb-1",children:"Email"}),(0,b.jsx)("input",{id:"email",type:"email",value:f,onChange:a=>g(a.target.value),required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium mb-1",children:"Password"}),(0,b.jsx)("input",{id:"password",type:"password",value:h,onChange:a=>i(a.target.value),required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),j&&(0,b.jsx)("div",{className:"text-red-600 text-sm",children:j}),(0,b.jsx)("button",{type:"submit",disabled:l,className:"w-full py-2 px-4 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:l?"Logging in...":"Login"})]})]})})}a.s(["default",()=>f])},66308,a=>{a.v(a=>Promise.resolve().then(()=>a(47033)))}];

//# sourceMappingURL=%5Broot-of-the-server%5D__c70f68d7._.js.map