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