"use strict";(()=>{var e={};e.id=1873,e.ids=[1873],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")},29580:(e,t,o)=>{o.r(t),o.d(t,{originalPathname:()=>x,patchFetch:()=>y,requestAsyncStorage:()=>m,routeModule:()=>l,serverHooks:()=>f,staticGenerationAsyncStorage:()=>g});var s={};o.r(s),o.d(s,{GET:()=>p});var n=o(49303),r=o(88716),a=o(60670),i=o(87070),u=o(19191),c=o(70446),d=o(90455);async function p(e,{params:t}){let o=await (0,c.Gg)(),s=(0,d.LP)(o),n=o.user?.id;if(!s||!n)return i.NextResponse.json({error:"Not authenticated"},{status:401});let r=e.nextUrl.searchParams,a=await (0,u.q)(`/customers/v1/${n}/businesses/favourites?latitude=${r.get("latitude")||o.storageLatitude}&longitude=${r.get("longitude")||o.storageLongitude}`,{apiBase:"mobile",token:s,cache:"no-store"}),p=a.data?.businesses??[];return i.NextResponse.json(p)}let l=new n.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/customers/[id]/favourites/route",pathname:"/api/customers/[id]/favourites",filename:"route",bundlePath:"app/api/customers/[id]/favourites/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/customers/[id]/favourites/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:m,staticGenerationAsyncStorage:g,serverHooks:f}=l,x="/api/customers/[id]/favourites/route";function y(){return(0,a.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:g})}},19191:(e,t,o)=>{o.d(t,{F:()=>a,q:()=>r});var s=o(47090),n=o(70446);async function r(e,t={}){let{apiBase:o="mobile",method:r="GET",body:a,token:i,langCode:u,notificationToken:c,headers:d={},revalidate:p,cache:l}=t,m=s.Y8[o],g=`${m}${e.startsWith("/")?e:"/"+e}`,f={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(f.Authorization=i),u&&(f.langCode=u);let x=c;if(!x)try{x=(await (0,n.Gg)()).fcmToken}catch{}x&&(f.notificationToken=x);let y={method:r,headers:f};a&&"GET"!==r&&(y.body=JSON.stringify(a)),void 0!==p&&(y.next={revalidate:p}),l&&(y.cache=l);let v=await fetch(g,y);if(!v.ok)throw Error(`API request failed: ${v.status} ${v.statusText}`);return v.json()}async function a(e,t={}){let{apiBase:o="mobile",method:r="GET",body:a,token:i,langCode:u,notificationToken:c,headers:d={}}=t,p=s.Y8[o],l=`${p}${e.startsWith("/")?e:"/"+e}`,m={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(m.Authorization=i),u&&(m.langCode=u);let g=c;if(!g)try{g=(await (0,n.Gg)()).fcmToken}catch{}g&&(m.notificationToken=g);let f={method:r,headers:m};return a&&"GET"!==r&&(f.body=JSON.stringify(a)),fetch(l,f)}},90455:(e,t,o)=>{function s(e){return e.token?e.token:e.user?.token?e.user.token:process.env.BABOON_APP_BUSINESS_TOKEN||""}function n(){return process.env.BABOON_APP_BUSINESS_TOKEN||""}o.d(t,{I2:()=>n,LP:()=>s})},47090:(e,t,o)=>{o.d(t,{RF:()=>s,Y8:()=>r,pH:()=>n});let s=["al","en","it"],n={AL:{latitude:41.327546,longitude:19.818698,cityId:1,countryId:1},XK:{latitude:42.662914,longitude:21.165503,cityId:2,countryId:2}},r={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,o)=>{o.d(t,{Gg:()=>i,dx:()=>r,l7:()=>a,yK:()=>u});var s=o(78632),n=o(71615);let r={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},a={...r,cookieName:"baboon-admin-session"};async function i(){let e=await (0,n.cookies)();return(0,s.iW)(e,r)}async function u(){let e=await (0,n.cookies)();return(0,s.iW)(e,a)}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var o=e=>t(t.s=e),s=t.X(0,[8948,3314,8632,5972],()=>o(29580));module.exports=s})();