"use strict";(()=>{var e={};e.id=4404,e.ids=[4404],e.modules={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")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},21149:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>x,patchFetch:()=>y,requestAsyncStorage:()=>d,routeModule:()=>p,serverHooks:()=>l,staticGenerationAsyncStorage:()=>m});var n={};r.r(n),r.d(n,{POST:()=>c});var o=r(49303),a=r(88716),i=r(60670),s=r(87070),u=r(73141);async function c(e){try{let t=await e.json(),r=t.accountId,n=t.priceId;if(!r||!n)return s.NextResponse.json({error:"accountId and priceId are required."},{status:400});let o=await u.G.prices.retrieve(n,{},{stripeAccount:r});if(!o.unit_amount||!o.currency)return s.NextResponse.json({error:"Price is missing unit_amount or currency."},{status:400});let a=await u.G.paymentIntents.create({amount:o.unit_amount,currency:o.currency,automatic_payment_methods:{enabled:!0},application_fee_amount:Math.max(50,Math.floor(.1*o.unit_amount))},{stripeAccount:r});return s.NextResponse.json({clientSecret:a.client_secret})}catch(e){return s.NextResponse.json({error:e?.message||"Failed to create payment intent."},{status:500})}}let p=new o.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/connect/payment-intent/route",pathname:"/api/connect/payment-intent",filename:"route",bundlePath:"app/api/connect/payment-intent/route"},resolvedPagePath:"/root/ShiftedOffRoad/app/api/connect/payment-intent/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:d,staticGenerationAsyncStorage:m,serverHooks:l}=p,x="/api/connect/payment-intent/route";function y(){return(0,i.patchFetch)({serverHooks:l,staticGenerationAsyncStorage:m})}},73141:(e,t,r)=>{r.d(t,{G:()=>a});var n=r(89777);let o=process.env.STRIPE_SECRET_KEY,a=o?new n.Z(o,{}):new Proxy({},{get(){throw Error("Missing STRIPE_SECRET_KEY. Add it to your environment before starting the server.")}})}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[9276,5972,9777],()=>r(21149));module.exports=n})();