module.exports=[70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(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"))},56704,(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"))},32319,(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"))},24725,(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"))},93695,(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"))},23862,e=>e.a(async(t,r)=>{try{let t=await e.y("pg-587764f78a6c7a9c");e.n(t),r()}catch(e){r(e)}},!0),63021,(e,t,r)=>{t.exports=e.x("@prisma/client-2c3a283f134fdcb6",()=>require("@prisma/client-2c3a283f134fdcb6"))},43793,e=>e.a(async(t,r)=>{try{let s;var a=e.i(23862),n=e.i(63021),i=e.i(4991),o=t([a,i]);[a,i]=o.then?(await o)():o;let l=process.env.DATABASE_URL;l?console.log("📡 [DB POOL] Intentando conectar a:",l.split("@")[1]||"URL INVÁLIDA"):console.error("❌ [DATABASE_URL] no está definida en el entorno.");let c=new a.Pool({connectionString:l,max:5,idleTimeoutMillis:1e4,connectionTimeoutMillis:1e4,statement_timeout:1e4});c.on("error",e=>{console.error("❌ [DB POOL ERROR]:",e.message)}),e.g.prisma||(s=new i.PrismaPg(c),new n.PrismaClient({adapter:s,log:["error"]})),e.s(["default",0,c]),r()}catch(e){r(e)}},!1),19177,e=>e.a(async(t,r)=>{try{var a=e.i(89171),n=e.i(43793),i=t([n]);async function o(e){try{let e=`
      SELECT 
          id AS id_cliente,
          name AS nombre_cliente,
          vat AS rnc,
          email AS correo,
          phone AS telefono,
          city AS ciudad
      FROM 
          res_partner
      WHERE 
          company_id = 11
          AND active = true
      ORDER BY 
          name ASC;
    `,t=(await n.default.query(e)).rows.map(e=>({id:String(e.id_cliente),nombre:e.nombre_cliente||"Sin nombre",rnc:e.rnc||"",email:e.correo||"",telefono:e.telefono||"",direccion:e.ciudad||"",limiteCredito:0,balanceActual:0,activo:!0,ultimaActualizacion:new Date().toISOString()}));return a.NextResponse.json(t)}catch(e){return console.error("Error fetching clients with extended custom script:",e.message),a.NextResponse.json({error:"Error al ejecutar el script de clientes",details:e.message},{status:500})}}[n]=i.then?(await i)():i,e.s(["GET",()=>o]),r()}catch(e){r(e)}},!1),34509,e=>e.a(async(t,r)=>{try{var a=e.i(47909),n=e.i(74017),i=e.i(96250),o=e.i(59756),s=e.i(61916),l=e.i(74677),c=e.i(69741),d=e.i(16795),u=e.i(87718),p=e.i(95169),h=e.i(47587),x=e.i(66012),R=e.i(70101),m=e.i(26937),v=e.i(10372),f=e.i(93695);e.i(52474);var g=e.i(220),E=e.i(19177),w=t([E]);[E]=w.then?(await w)():w;let C=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/clientes/route",pathname:"/api/clientes",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/clientes/route.ts",nextConfigOutput:"standalone",userland:E}),{workAsyncStorage:b,workUnitAsyncStorage:S,serverHooks:T}=C;function y(){return(0,i.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:S})}async function A(e,t,r){C.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/clientes/route";a=a.replace(/\/index$/,"")||"/";let i=await C.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!i)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:E,params:w,nextConfig:y,parsedUrl:A,isDraftMode:b,prerenderManifest:S,routerServerContext:T,isOnDemandRevalidate:O,revalidateOnlyGenerated:P,resolvedPathname:_,clientReferenceManifest:N,serverActionsManifest:q}=i,k=(0,c.normalizeAppPath)(a),D=!!(S.dynamicRoutes[k]||S.routes[_]),j=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,A,!1):t.end("This page could not be found"),null);if(D&&!b){let e=!!S.routes[_],t=S.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await j();throw new f.NoFallbackError}}let I=null;!D||C.isDev||b||(I=_,I="/index"===I?"/":I);let U=!0===C.isDev||!D,H=D&&!U;q&&N&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:N,serverActionsManifest:q});let M=e.method||"GET",L=(0,s.getTracer)(),B=L.getActiveScopeSpan(),F={params:w,prerenderManifest:S,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,T)},sharedContext:{buildId:E}},$=new d.NodeNextRequest(e),K=new d.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest($,(0,u.signalFromNodeResponse)(t));try{let i=async e=>C.handle(G,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=L.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.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=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${a}`)}),l=!!(0,o.getRequestMeta)(e,"minimalMode"),c=async o=>{var s,c;let d=async({previousCacheEntry:n})=>{try{if(!l&&O&&P&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(o);e.fetchMetrics=F.renderOpts.fetchMetrics;let s=F.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let c=F.renderOpts.collectedTags;if(!D)return await (0,x.sendResponse)($,K,a,F.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,R.toNodeOutgoingHttpHeaders)(a.headers);c&&(t[v.NEXT_CACHE_TAGS_HEADER]=c),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,n=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:F.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 C.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:O})},!1,T),t}},u=await C.handleResponse({req:e,nextConfig:y,cacheKey:I,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:P,responseGenerator:d,waitUntil:r.waitUntil,isMinimalMode:l});if(!D)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(c=u.value)?void 0:c.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"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,R.fromNodeOutgoingHttpHeaders)(u.value.headers);return l&&D||p.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,m.getCacheControlHeader)(u.cacheControl)),await (0,x.sendResponse)($,K,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};B?await c(B):await L.withPropagatedContext(e.headers,()=>L.trace(p.BaseServerSpan.handleRequest,{spanName:`${M} ${a}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},c))}catch(t){if(t instanceof f.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:O})},!1,T),D)throw t;return await (0,x.sendResponse)($,K,new Response(null,{status:500})),null}}e.s(["handler",()=>A,"patchFetch",()=>y,"routeModule",()=>C,"serverHooks",()=>T,"workAsyncStorage",()=>b,"workUnitAsyncStorage",()=>S]),r()}catch(e){r(e)}},!1)];

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