"use strict";(()=>{var e={};e.id=3114,e.ids=[3114],e.modules={85890:e=>{e.exports=require("better-sqlite3")},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")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},78818:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>h,patchFetch:()=>I,requestAsyncStorage:()=>l,routeModule:()=>c,serverHooks:()=>f,staticGenerationAsyncStorage:()=>x});var o={};t.r(o),t.d(o,{DELETE:()=>p,PUT:()=>d});var s=t(49303),n=t(88716),u=t(60670),a=t(87070),m=t(97425),i=t(75748);async function d(e,{params:r}){try{let t=(0,m.n)();if(!(0,i.gU)(t,r.id))return a.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});if(!(0,i.ZI)(t,r.memoId))return a.NextResponse.json({error:`Memo '${r.memoId}' not found`},{status:404});let{title:o,content:s}=await e.json().catch(()=>({}));if(void 0!==o&&o.length>100)return a.NextResponse.json({error:"title must be 100 characters or less"},{status:400});if(void 0!==s&&s.length>1e4)return a.NextResponse.json({error:"content must be 10000 characters or less"},{status:400});(0,i.Nr)(t,r.memoId,{title:o,content:s});let n=(0,i.ZI)(t,r.memoId);return a.NextResponse.json({memo:n},{status:200})}catch(e){return console.error("Error updating memo:",e),a.NextResponse.json({error:"Failed to update memo"},{status:500})}}async function p(e,{params:r}){try{let e=(0,m.n)();if(!(0,i.gU)(e,r.id))return a.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});if(!(0,i.ZI)(e,r.memoId))return a.NextResponse.json({error:`Memo '${r.memoId}' not found`},{status:404});return(0,i._e)(e,r.memoId),a.NextResponse.json({success:!0},{status:200})}catch(e){return console.error("Error deleting memo:",e),a.NextResponse.json({error:"Failed to delete memo"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/worktrees/[id]/memos/[memoId]/route",pathname:"/api/worktrees/[id]/memos/[memoId]",filename:"route",bundlePath:"app/api/worktrees/[id]/memos/[memoId]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/memos/[memoId]/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:l,staticGenerationAsyncStorage:x,serverHooks:f}=c,h="/api/worktrees/[id]/memos/[memoId]/route";function I(){return(0,u.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:x})}}};var r=require("../../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,7425],()=>t(78818));module.exports=o})();