"use strict";(()=>{var e={};e.id=889,e.ids=[889],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},7561:e=>{e.exports=require("node:fs")},9411:e=>{e.exports=require("node:path")},1680:(e,t,n)=>{n.r(t),n.d(t,{originalPathname:()=>x,patchFetch:()=>h,requestAsyncStorage:()=>f,routeModule:()=>p,serverHooks:()=>v,staticGenerationAsyncStorage:()=>j});var r={};n.r(r),n.d(r,{POST:()=>l});var i=n(3277),s=n(5265),o=n(5356),u=n(7076),a=n(1760);let c={potential:"pending_validation",verified:"verified",invalid:"rejected",duplicate:"duplicate"},d=new Set(["pending_validation","unverified","verified","rejected","duplicate"]);async function l(e,{params:t}){let n;let r=t.id,i=await e.json();if(i.status){if(!d.has(i.status))return u.NextResponse.json({error:`Invalid status: ${i.status}`},{status:400});n=i.status}else if(!i.column)return u.NextResponse.json({error:"Body must include either 'column' or 'status'"},{status:400});else if(!(n=c[i.column]))return u.NextResponse.json({error:`Invalid column: ${i.column}`},{status:400});let s=(0,a.gn)("tracking.json")??{findings:[]},o=s.findings.find(e=>e.id===r);return o?(o.status=n,void 0!==i.duplicate_of&&(o.duplicate_of=i.duplicate_of),"duplicate"!==n&&o.duplicate_of&&(o.duplicate_of=null),(0,a.au)("tracking.json",s),u.NextResponse.json({ok:!0,id:r,status:n})):u.NextResponse.json({error:`Issue ${r} not found in tracking.json`},{status:404})}let p=new i.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/issues/[id]/move/route",pathname:"/api/issues/[id]/move",filename:"route",bundlePath:"app/api/issues/[id]/move/route"},resolvedPagePath:"/home/dx/Work/hex/dashboard/app/api/issues/[id]/move/route.ts",nextConfigOutput:"",userland:r}),{requestAsyncStorage:f,staticGenerationAsyncStorage:j,serverHooks:v}=p,x="/api/issues/[id]/move/route";function h(){return(0,o.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:j})}},1760:(e,t,n)=>{n.d(t,{J1:()=>f,V9:()=>j,ZN:()=>p,au:()=>d,gn:()=>a,ki:()=>l,ws:()=>c});var r=n(7561),i=n.n(r),s=n(9411),o=n.n(s);function u(){let e=process.env.HEX_PROJECT_DIR??process.env.SOLAUDIT_PROJECT_DIR??process.cwd();try{let t=o().join(e,".hex","config.json");if(i().existsSync(t))return o().join(e,".hex");let n=o().join(e,".solaudit","config.json");if(i().existsSync(n))return o().join(e,".solaudit")}catch{}return o().join(e,".hex")}function a(e){try{let t=o().join(u(),e),n=i().readFileSync(t,"utf-8");return JSON.parse(n)}catch{return null}}function c(e){try{let t=o().join(u(),e);return i().readFileSync(t,"utf-8")}catch{return null}}function d(e,t){let n=o().join(u(),e);i().writeFileSync(n,JSON.stringify(t,null,2),"utf-8")}function l(e){try{let t=o().join(u(),e);return i().existsSync(t)}catch{return!1}}function p(){return u()}function f(e){try{let t=o().join(u(),e);if(!i().existsSync(t))return[];return i().readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)}catch{return[]}}function j(e){try{let t=o().join(u(),e),n=i().readFileSync(t,"utf-8");return JSON.parse(n)}catch{return null}}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),r=t.X(0,[916,786],()=>n(1680));module.exports=r})();