"use strict";(()=>{var e={};e.id=3841,e.ids=[3841,2331],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")},74180:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>h,requestAsyncStorage:()=>c,routeModule:()=>d,serverHooks:()=>m,staticGenerationAsyncStorage:()=>l});var a={};r.r(a),r.d(a,{GET:()=>n});var s=r(49303),i=r(88716),p=r(60670),o=r(87070),u=r(72331);async function n(e){try{let{searchParams:t}=new URL(e.url),r=parseInt(t.get("page")??"1"),a=parseInt(t.get("limit")??"20"),s=t.get("status"),i=(r-1)*a,p={};s&&(p.status=s);let[n,d]=await Promise.all([u.prisma.supportTicket.findMany({where:p,include:{user:{select:{userId:!0}}},orderBy:{createdAt:"desc"},skip:i,take:a}),u.prisma.supportTicket.count({where:p})]);return o.NextResponse.json({success:!0,data:n.map(e=>({id:e.id,thread_id:e.threadId,user_id:e.user?.userId??"-",subject:e.subject,category:e.category,status:e.status,priority:e.priority,created_at:e.createdAt,updated_at:e.updatedAt})),pagination:{page:r,limit:a,total:d,total_pages:Math.ceil(d/a)}})}catch(e){return console.error("Admin support GET error:",e),o.NextResponse.json({success:!1,message:"Gagal memuat tiket"},{status:500})}}let d=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/admin/support/route",pathname:"/api/admin/support",filename:"route",bundlePath:"app/api/admin/support/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\admin\\support\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:c,staticGenerationAsyncStorage:l,serverHooks:m}=d,g="/api/admin/support/route";function h(){return(0,p.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:l})}},72331:(e,t,r)=>{r.d(t,{prisma:()=>s});var a=r(53524);let s=globalThis.prisma??new a.PrismaClient({log:["error"]})}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[9276,5972],()=>r(74180));module.exports=a})();