module.exports=[918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},120635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},857764,(e,t,r)=>{t.exports=e.x("node:url",()=>require("node:url"))},784941,(e,t,r)=>{t.exports=e.x("@prisma/client-2c3a283f134fdcb6/runtime/client",()=>require("@prisma/client-2c3a283f134fdcb6/runtime/client"))},723862,e=>e.a(async(t,r)=>{try{let t=await e.y("pg-587764f78a6c7a9c");e.n(t),r()}catch(e){r(e)}},!0),254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},484199,(e,t,r)=>{"use strict";var a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i={},l={VercelOidcTokenError:()=>p};for(var d in l)a(i,d,{get:l[d],enumerable:!0});t.exports=((e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||a(e,r,{get:()=>t[r],enumerable:!(i=n(t,r))||i.enumerable});return e})(a({},"__esModule",{value:!0}),i);class p extends Error{constructor(e,t){super(e),this.name="VercelOidcTokenError",this.cause=t}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}},575841,e=>e.a(async(t,r)=>{try{var a=e.i(712075),n=e.i(79832),s=e.i(5637),o=e.i(405898),i=t([n]);async function l(e){let t=await (0,n.auth)();if(!t?.user)return new Response("Unauthorized",{status:401});let{title:r,categoryCode:i,sections:l}=await e.json(),d=`Purpose:
${l.purpose||"Not provided"}

Scope:
${l.scope||"Not provided"}

Responsibilities:
${l.responsibilities||"Not provided"}

Definitions:
${l.definitions||"Not provided"}

Procedure:
${l.procedure||"Not provided"}

References:
${l.references||"Not provided"}

Safety Notes:
${l.safetyNotes||"Not provided"}`;return(0,a.streamText)({model:s.geminiPro,system:(0,o.buildReviewPrompt)({title:r,categoryCode:i}),prompt:`Review this SOP:

${d}`,maxOutputTokens:4e3}).toTextStreamResponse()}[n]=i.then?(await i)():i,e.s(["POST",()=>l]),r()}catch(e){r(e)}},!1),723428,e=>e.a(async(t,r)=>{try{var a=e.i(747909),n=e.i(174017),s=e.i(996250),o=e.i(759756),i=e.i(561916),l=e.i(174677),d=e.i(869741),p=e.i(316795),u=e.i(487718),c=e.i(995169),h=e.i(47587),v=e.i(666012),x=e.i(570101),m=e.i(626937),f=e.i(10372),R=e.i(193695);e.i(52474);var g=e.i(600220),w=e.i(575841),y=t([w]);[w]=y.then?(await y)():y;let E=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/ai/review/route",pathname:"/api/ai/review",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/ai/review/route.ts",nextConfigOutput:"standalone",userland:w}),{workAsyncStorage:P,workUnitAsyncStorage:C,serverHooks:N}=E;function _(){return(0,s.patchFetch)({workAsyncStorage:P,workUnitAsyncStorage:C})}async function b(e,t,r){E.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/ai/review/route";a=a.replace(/\/index$/,"")||"/";let s=await E.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:_,parsedUrl:b,isDraftMode:P,prerenderManifest:C,routerServerContext:N,isOnDemandRevalidate:O,revalidateOnlyGenerated:j,resolvedPathname:T,clientReferenceManifest:k,serverActionsManifest:A}=s,q=(0,d.normalizeAppPath)(a),S=!!(C.dynamicRoutes[q]||C.routes[T]),$=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,b,!1):t.end("This page could not be found"),null);if(S&&!P){let e=!!C.routes[T],t=C.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(_.experimental.adapterPath)return await $();throw new R.NoFallbackError}}let H=null;!S||E.isDev||P||(H=T,H="/index"===H?"/":H);let U=!0===E.isDev||!S,D=S&&!U;A&&k&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:k,serverActionsManifest:A});let I=e.method||"GET",M=(0,i.getTracer)(),F=M.getActiveScopeSpan(),K={params:y,prerenderManifest:C,renderOpts:{experimental:{authInterrupts:!!_.experimental.authInterrupts},cacheComponents:!!_.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:_.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>E.onRequestError(e,t,a,n,N)},sharedContext:{buildId:w}},B=new p.NodeNextRequest(e),L=new p.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(B,(0,u.signalFromNodeResponse)(t));try{let s=async e=>E.handle(V,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${I} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${I} ${a}`)}),l=!!(0,o.getRequestMeta)(e,"minimalMode"),d=async o=>{var i,d;let p=async({previousCacheEntry:n})=>{try{if(!l&&O&&j&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(o);e.fetchMetrics=K.renderOpts.fetchMetrics;let i=K.renderOpts.pendingWaitUntil;i&&r.waitUntil&&(r.waitUntil(i),i=void 0);let d=K.renderOpts.collectedTags;if(!S)return await (0,v.sendResponse)(B,L,a,K.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[f.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:O})},!1,N),t}},u=await E.handleResponse({req:e,nextConfig:_,cacheKey:H,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:j,responseGenerator:p,waitUntil:r.waitUntil,isMinimalMode:l});if(!S)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(d=u.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",O?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),P&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,x.fromNodeOutgoingHttpHeaders)(u.value.headers);return l&&S||c.delete(f.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,m.getCacheControlHeader)(u.cacheControl)),await (0,v.sendResponse)(B,L,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};F?await d(F):await M.withPropagatedContext(e.headers,()=>M.trace(c.BaseServerSpan.handleRequest,{spanName:`${I} ${a}`,kind:i.SpanKind.SERVER,attributes:{"http.method":I,"http.target":e.url}},d))}catch(t){if(t instanceof R.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:O})},!1,N),S)throw t;return await (0,v.sendResponse)(B,L,new Response(null,{status:500})),null}}e.s(["handler",()=>b,"patchFetch",()=>_,"routeModule",()=>E,"serverHooks",()=>N,"workAsyncStorage",()=>P,"workUnitAsyncStorage",()=>C]),r()}catch(e){r(e)}},!1),967030,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__f2425c1b._.js"].map(t=>e.l(t))).then(()=>t(783697)))},683671,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__d6b98630._.js"].map(t=>e.l(t))).then(()=>t(390391)))},916005,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_node:buffer_00e2e67a._.js"].map(t=>e.l(t))).then(()=>t(951615)))},918707,e=>{e.v(t=>Promise.all(["server/chunks/2e4a4_@prisma_client_runtime_query_compiler_fast_bg_postgresql_mjs_35c4194d._.js"].map(t=>e.l(t))).then(()=>t(407142)))},480599,e=>{e.v(t=>Promise.all(["server/chunks/9c9c5_client_runtime_query_compiler_fast_bg_postgresql_wasm-base64_mjs_9e69af0b._.js"].map(t=>e.l(t))).then(()=>t(417734)))}];

//# sourceMappingURL=%5Broot-of-the-server%5D__df86c54d._.js.map