"use strict";(()=>{var e={};e.id=1356,e.ids=[1356],e.modules={53524:e=>{e.exports=require("@prisma/client")},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")},84770:e=>{e.exports=require("crypto")},32232:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>f,patchFetch:()=>g,requestAsyncStorage:()=>m,routeModule:()=>c,serverHooks:()=>h,staticGenerationAsyncStorage:()=>x});var s={};t.r(s),t.d(s,{GET:()=>d,PUT:()=>l});var o=t(49303),a=t(88716),n=t(60670),u=t(87070),i=t(72331),p=t(98691);async function d(e){try{let{searchParams:r}=new URL(e.url),t=r.get("id");if(!t)return u.NextResponse.json({error:"Missing id"},{status:400});let s=await i._.user.findUnique({where:{id:t}});if(!s)return u.NextResponse.json({error:"Not found"},{status:404});return u.NextResponse.json(s)}catch(e){return console.error("Fetch user error:",e),u.NextResponse.json({error:e.message||"Internal Server Error"},{status:500})}}async function l(e){try{let{id:r,username:t,email:s,phoneNumber:o,password:a}=await e.json();if(!r)return u.NextResponse.json({error:"User ID required"},{status:400});let n={username:t,email:s,phoneNumber:o};a&&""!==a.trim()&&(n.password=await p.ZP.hash(a.trim(),10));let d=await i._.user.update({where:{id:r},data:n});return u.NextResponse.json(d)}catch(e){return console.error("Update user error:",e),u.NextResponse.json({error:e.message||"Update failed"},{status:500})}}let c=new o.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/user/route",pathname:"/api/user",filename:"route",bundlePath:"app/api/user/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\user\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:m,staticGenerationAsyncStorage:x,serverHooks:h}=c,f="/api/user/route";function g(){return(0,n.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:x})}},72331:(e,r,t)=>{t.d(r,{_:()=>o});var s=t(53524);let o=global.prisma||new s.PrismaClient}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,8691],()=>t(32232));module.exports=s})();