"use strict";(()=>{var e={};e.id=5032,e.ids=[5032],e.modules={72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6005:e=>{e.exports=require("node:crypto")},51862:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>m,patchFetch:()=>f,requestAsyncStorage:()=>d,routeModule:()=>u,serverHooks:()=>x,staticGenerationAsyncStorage:()=>l});var s={};r.r(s),r.d(s,{POST:()=>p});var o=r(49303),n=r(88716),a=r(60670),i=r(87070),c=r(70446);async function p(e){try{let{token:t}=await e.json();if(!t)return i.NextResponse.json({error:"Token is required"},{status:400});let r=await (0,c.Gg)();return r.fcmToken=t,await r.save(),i.NextResponse.json({success:!0})}catch{return i.NextResponse.json({error:"Failed to save FCM token"},{status:500})}}let u=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/fcm/route",pathname:"/api/fcm",filename:"route",bundlePath:"app/api/fcm/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/fcm/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:d,staticGenerationAsyncStorage:l,serverHooks:x}=u,m="/api/fcm/route";function f(){return(0,a.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:l})}},70446:(e,t,r)=>{r.d(t,{Gg:()=>i,dx:()=>n,l7:()=>a,yK:()=>c});var s=r(78632),o=r(71615);let n={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},a={...n,cookieName:"baboon-admin-session"};async function i(){let e=await (0,o.cookies)();return(0,s.iW)(e,n)}async function c(){let e=await (0,o.cookies)();return(0,s.iW)(e,a)}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8948,3314,8632,5972],()=>r(51862));module.exports=s})();