(()=>{var e={};e.id=9401,e.ids=[9401],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12909:(e,r,t)=>{"use strict";function s(){let e=process.env.JWT_SECRET;if(!e)throw Error("JWT_SECRET is not set");return e}function n(e){let r=e.headers.get("authorization");if(r&&r.startsWith("Bearer "))return r.slice(7);let t=e.cookies.get("admin_token")?.value;if(t)return t;let s=e.cookies.get("token")?.value;return s||null}t.d(r,{V:()=>n,u:()=>s})},23813:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>j,routeModule:()=>h,serverHooks:()=>g,workAsyncStorage:()=>f,workUnitAsyncStorage:()=>v});var s={};t.r(s),t.d(s,{GET:()=>x});var n=t(96559),i=t(48088),a=t(37719),o=t(32190),u=t(43205),d=t.n(u),p=t(96330),l=t(12909);let c=new p.PrismaClient,m=(0,l.u)();async function x(e){try{let r,t=(0,l.V)(e);if(!t)return o.NextResponse.json({error:"Unauthorized"},{status:401});try{r=d().verify(t,m)}catch{return o.NextResponse.json({error:"Invalid token"},{status:401})}if(!r.isGlobalAdmin||!r.globalAdminId)return o.NextResponse.json({error:"Unauthorized"},{status:403});let s=await c.globalAdmin.findUnique({where:{id:r.globalAdminId}});if(!s)return o.NextResponse.json({error:"Global admin not found"},{status:404});return o.NextResponse.json({user:{id:s.id,email:s.email,name:s.name,surname:s.surname,isSuperAdmin:s.isSuperAdmin,isGlobalAdmin:!0}})}catch(e){return console.error("Global admin me error:",e),o.NextResponse.json({error:"Server error"},{status:500})}}let h=new n.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/admin/auth/me/route",pathname:"/api/admin/auth/me",filename:"route",bundlePath:"app/api/admin/auth/me/route"},resolvedPagePath:"/Users/mustafaseyhan/Project/PazarAnalist/src/app/api/admin/auth/me/route.ts",nextConfigOutput:"standalone",userland:s}),{workAsyncStorage:f,workUnitAsyncStorage:v,serverHooks:g}=h;function j(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:v})}},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:e=>{"use strict";e.exports=require("crypto")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79428:e=>{"use strict";e.exports=require("buffer")},96330:e=>{"use strict";e.exports=require("@prisma/client")},96487:()=>{}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[4447,580,3205],()=>t(23813));module.exports=s})();