"use strict";(()=>{var e={};e.id=8585,e.ids=[8585],e.modules={72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},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")},6005:e=>{e.exports=require("node:crypto")},426:(e,t,n)=>{n.r(t),n.d(t,{originalPathname:()=>f,patchFetch:()=>x,requestAsyncStorage:()=>d,routeModule:()=>l,serverHooks:()=>m,staticGenerationAsyncStorage:()=>y});var o={};n.r(o),n.d(o,{POST:()=>u});var a=n(49303),s=n(88716),r=n(60670),i=n(87070),c=n(19191),p=n(90455);async function u(e){try{let t=await e.json(),n=await (0,c.F)("/url-payment-failed",{apiBase:"payment",method:"POST",token:(0,p.I2)(),body:t}),o=await n.json();return i.NextResponse.json(o,{status:n.status})}catch{return i.NextResponse.json({error:"Payment failure callback failed"},{status:500})}}let l=new a.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/payments/failed/route",pathname:"/api/payments/failed",filename:"route",bundlePath:"app/api/payments/failed/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/payments/failed/route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:d,staticGenerationAsyncStorage:y,serverHooks:m}=l,f="/api/payments/failed/route";function x(){return(0,r.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:y})}},19191:(e,t,n)=>{n.d(t,{F:()=>r,q:()=>s});var o=n(47090),a=n(70446);async function s(e,t={}){let{apiBase:n="mobile",method:s="GET",body:r,token:i,langCode:c,notificationToken:p,headers:u={},revalidate:l,cache:d}=t,y=o.Y8[n],m=`${y}${e.startsWith("/")?e:"/"+e}`,f={"Content-Type":"application/json","User-Agent":"BaboonWeb",...u};i&&(f.Authorization=i),c&&(f.langCode=c);let x=p;if(!x)try{x=(await (0,a.Gg)()).fcmToken}catch{}x&&(f.notificationToken=x);let A={method:s,headers:f};r&&"GET"!==s&&(A.body=JSON.stringify(r)),void 0!==l&&(A.next={revalidate:l}),d&&(A.cache=d);let g=await fetch(m,A);if(!g.ok)throw Error(`API request failed: ${g.status} ${g.statusText}`);return g.json()}async function r(e,t={}){let{apiBase:n="mobile",method:s="GET",body:r,token:i,langCode:c,notificationToken:p,headers:u={}}=t,l=o.Y8[n],d=`${l}${e.startsWith("/")?e:"/"+e}`,y={"Content-Type":"application/json","User-Agent":"BaboonWeb",...u};i&&(y.Authorization=i),c&&(y.langCode=c);let m=p;if(!m)try{m=(await (0,a.Gg)()).fcmToken}catch{}m&&(y.notificationToken=m);let f={method:s,headers:y};return r&&"GET"!==s&&(f.body=JSON.stringify(r)),fetch(d,f)}},90455:(e,t,n)=>{function o(e){return e.token?e.token:e.user?.token?e.user.token:process.env.BABOON_APP_BUSINESS_TOKEN||""}function a(){return process.env.BABOON_APP_BUSINESS_TOKEN||""}n.d(t,{I2:()=>a,LP:()=>o})},47090:(e,t,n)=>{n.d(t,{RF:()=>o,Y8:()=>s,pH:()=>a});let o=["al","en","it"],a={AL:{latitude:41.327546,longitude:19.818698,cityId:1,countryId:1},XK:{latitude:42.662914,longitude:21.165503,cityId:2,countryId:2}},s={mobile:process.env.BABOON_API_MOBILE_URL,legacy:process.env.BABOON_API_URL,sysadmin:process.env.BABOON_API_SYSADMIN_URL,payment:process.env.BABOON_API_PAYMENT_URL}},70446:(e,t,n)=>{n.d(t,{Gg:()=>i,dx:()=>s,l7:()=>r,yK:()=>c});var o=n(78632),a=n(71615);let s={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},r={...s,cookieName:"baboon-admin-session"};async function i(){let e=await (0,a.cookies)();return(0,o.iW)(e,s)}async function c(){let e=await (0,a.cookies)();return(0,o.iW)(e,r)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),o=t.X(0,[8948,3314,8632,5972],()=>n(426));module.exports=o})();