module.exports=[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"))},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"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},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"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},425747,e=>{"use strict";e.i(684843),e.s([])},869789,e=>{"use strict";e.i(425747),e.s([])},868259,e=>{"use strict";var t=e.i(747909),r=e.i(174017),a=e.i(996250),s=e.i(759756),n=e.i(561916),o=e.i(174677),i=e.i(869741),l=e.i(316795),d=e.i(487718),p=e.i(995169),u=e.i(47587),c=e.i(666012),h=e.i(570101),v=e.i(626937),m=e.i(10372),x=e.i(193695);e.i(820232);var y=e.i(600220),f=e.i(89171);e.i(869789);var g=e.i(826882);let R="https://api.vercel.com",w=`
export const config = { runtime: "edge" };

export default async function handler(req) {
  const target = req.headers.get("x-relay-target");
  const relayPath = req.headers.get("x-relay-path") || "/";
  if (!target) {
    return new Response(JSON.stringify({ error: "Missing x-relay-target header" }), {
      status: 400,
      headers: { "content-type": "application/json" },
    });
  }

  const targetUrl = target.replace(/\\/$/, "") + relayPath;

  const headers = new Headers(req.headers);
  headers.delete("x-relay-target");
  headers.delete("x-relay-path");
  headers.delete("host");

  const response = await fetch(targetUrl, {
    method: req.method,
    headers,
    body: req.method !== "GET" && req.method !== "HEAD" ? req.body : undefined,
    duplex: "half",
  });

  return new Response(response.body, {
    status: response.status,
    headers: response.headers,
  });
}
`;async function E(e,t,r=12e4){let a=Date.now();for(;Date.now()-a<r;){let r=await fetch(`${R}/v13/deployments/${e}`,{headers:{Authorization:`Bearer ${t}`}}),a=await r.json();if("READY"===a.readyState)return a;if("ERROR"===a.readyState||"CANCELED"===a.readyState)throw Error(`Deployment failed: ${a.readyState}`);await new Promise(e=>setTimeout(e,3e3))}throw Error("Deployment timed out")}async function P(e){try{let t=await e.json(),r=t.vercelToken,a=t.projectName?.trim()||`relay-${Date.now().toString(36)}`;if(!r)return f.NextResponse.json({error:"Vercel API token is required"},{status:400});let s=await fetch(`${R}/v13/deployments`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({name:a,files:[{file:"api/relay.js",data:w},{file:"package.json",data:JSON.stringify({name:a,version:"1.0.0"})},{file:"vercel.json",data:JSON.stringify({rewrites:[{source:"/(.*)",destination:"/api/relay"}]})}],projectSettings:{framework:null},target:"production"})});if(!s.ok){let e=await s.json().catch(()=>({}));return f.NextResponse.json({error:e.error?.message||"Failed to create Vercel deployment"},{status:s.status})}let n=await s.json(),o=n.id||n.uid,i=n.projectId||a;await fetch(`${R}/v9/projects/${i}`,{method:"PATCH",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({ssoProtection:null})});let l=await E(o,r),d=`https://${l.url}`,p=await (0,g.createProxyPool)({name:a,proxyUrl:d,type:"vercel",noProxy:"",isActive:!0,strictProxy:!1});return f.NextResponse.json({proxyPool:p,deployUrl:d},{status:201})}catch(e){return console.log("Error deploying Vercel relay:",e),f.NextResponse.json({error:e.message||"Deploy failed"},{status:500})}}e.s(["POST",0,P],490977);var _=e.i(490977);let j=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/proxy-pools/vercel-deploy/route",pathname:"/api/proxy-pools/vercel-deploy",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/proxy-pools/vercel-deploy/route.js",nextConfigOutput:"standalone",userland:_,...{}}),{workAsyncStorage:C,workUnitAsyncStorage:b,serverHooks:A}=j;async function N(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),j.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/proxy-pools/vercel-deploy/route";f=f.replace(/\/index$/,"")||"/";let g=await j.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!g)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:R,deploymentId:w,params:E,nextConfig:P,parsedUrl:_,isDraftMode:C,prerenderManifest:b,routerServerContext:A,isOnDemandRevalidate:N,revalidateOnlyGenerated:q,resolvedPathname:S,clientReferenceManifest:k,serverActionsManifest:T}=g,O=(0,i.normalizeAppPath)(f),D=!!(b.dynamicRoutes[O]||b.routes[S]),$=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,_,!1):t.end("This page could not be found"),null);if(D&&!C){let e=!!b.routes[S],t=b.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(P.adapterPath)return await $();throw new x.NoFallbackError}}let H=null;!D||j.isDev||C||(H="/index"===(H=S)?"/":H);let U=!0===j.isDev||!D,I=D&&!U;T&&k&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:k,serverActionsManifest:T});let M=e.method||"GET",B=(0,n.getTracer)(),F=B.getActiveScopeSpan(),K=!!(null==A?void 0:A.isWrappedByNextServer),z=!!(0,s.getRequestMeta)(e,"minimalMode"),L=(0,s.getRequestMeta)(e,"incrementalCache")||await j.getIncrementalCache(e,P,b,z);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let V={params:E,previewProps:b.preview,renderOpts:{experimental:{authInterrupts:!!P.experimental.authInterrupts},cacheComponents:!!P.cacheComponents,supportsDynamicResponse:U,incrementalCache:L,cacheLifeProfiles:P.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>j.onRequestError(e,t,a,s,A)},sharedContext:{buildId:R,deploymentId:w}},J=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(J,(0,d.signalFromNodeResponse)(t));try{let s,o=async e=>j.handle(W,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.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 a=r.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",a),s.updateName(t))}else e.updateName(`${M} ${f}`)}),i=async s=>{var n,i;let l=async({previousCacheEntry:r})=>{try{if(!z&&N&&q&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(s);e.fetchMetrics=V.renderOpts.fetchMetrics;let i=V.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let l=V.renderOpts.collectedTags;if(!D)return await (0,c.sendResponse)(J,G,n,V.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:N})},!1,A),t}},d=await j.handleResponse({req:e,nextConfig:P,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:q,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:z});if(!D)return null;if((null==d||null==(n=d.value)?void 0:n.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});z||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return z&&D||p.delete(m.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,v.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(J,G,new Response(d.value.body,{headers:p,status:d.value.status||200})),null};K&&F?await i(F):(s=B.getActiveScopeSpan(),await B.withPropagatedContext(e.headers,()=>B.trace(p.BaseServerSpan.handleRequest,{spanName:`${M} ${f}`,kind:n.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},i),void 0,!K))}catch(t){if(t instanceof x.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:N})},!1,A),D)throw t;return await (0,c.sendResponse)(J,G,new Response(null,{status:500})),null}}e.s(["handler",0,N,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:b})},"routeModule",0,j,"serverHooks",0,A,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,b],868259)},603283,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~uwc~g._.js"].map(t=>e.l(t))).then(()=>t(227359)))},255840,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0slucb~._.js"].map(t=>e.l(t))).then(()=>t(317026)))},654059,e=>{e.v(t=>Promise.all(["server/chunks/src_lib_db_0q087i2._.js"].map(t=>e.l(t))).then(()=>t(72167)))},287292,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~p~am2._.js"].map(t=>e.l(t))).then(()=>t(344805)))},149047,e=>{e.v(t=>Promise.all(["server/chunks/src_lib_db_03zbn-s._.js"].map(t=>e.l(t))).then(()=>t(177498)))},936498,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0kaoh2i._.js"].map(t=>e.l(t))).then(()=>t(321297)))},866510,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_constants_pricing_0oa_fz9.js"].map(t=>e.l(t))).then(()=>t(722503)))},555812,e=>{e.v(e=>Promise.resolve().then(()=>e(284904)))},552465,e=>{e.v(e=>Promise.resolve().then(()=>e(278199)))},43476,e=>{e.v(e=>Promise.resolve().then(()=>e(739080)))},224847,e=>{e.v(e=>Promise.resolve().then(()=>e(866951)))},378161,e=>{e.v(e=>Promise.resolve().then(()=>e(192561)))}];

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