"use strict";(()=>{var e={};e.id=1697,e.ids=[1697],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")},4668:(e,t,o)=>{o.r(t),o.d(t,{originalPathname:()=>g,patchFetch:()=>A,requestAsyncStorage:()=>y,routeModule:()=>l,serverHooks:()=>x,staticGenerationAsyncStorage:()=>h});var r={};o.r(r),o.d(r,{GET:()=>p});var n=o(49303),s=o(88716),a=o(60670),i=o(87070),c=o(19191),u=o(70446),d=o(90455);async function p(e){try{let t=await (0,u.Gg)(),o=(0,d.LP)(t),r=e.nextUrl.searchParams,n=t.user?.phone;if(!n||!o)return i.NextResponse.json({success:!1,data:[]});let s=r.get("orderActive")||"1",a=await (0,c.q)(`/userOrders?phone=${n}&orderActive=${s}&fullBody=true`,{apiBase:"legacy",token:o,cache:"no-store"});return i.NextResponse.json({success:!0,data:a.data??[]})}catch(e){return console.error("[orders/history] ERROR:",e),i.NextResponse.json({success:!1,data:[]})}}let l=new n.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/orders/history/route",pathname:"/api/orders/history",filename:"route",bundlePath:"app/api/orders/history/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/orders/history/route.ts",nextConfigOutput:"standalone",userland:r}),{requestAsyncStorage:y,staticGenerationAsyncStorage:h,serverHooks:x}=l,g="/api/orders/history/route";function A(){return(0,a.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:h})}},19191:(e,t,o)=>{o.d(t,{F:()=>a,q:()=>s});var r=o(47090),n=o(70446);async function s(e,t={}){let{apiBase:o="mobile",method:s="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={},revalidate:p,cache:l}=t,y=r.Y8[o],h=`${y}${e.startsWith("/")?e:"/"+e}`,x={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(x.Authorization=i),c&&(x.langCode=c);let g=u;if(!g)try{g=(await (0,n.Gg)()).fcmToken}catch{}g&&(x.notificationToken=g);let A={method:s,headers:x};a&&"GET"!==s&&(A.body=JSON.stringify(a)),void 0!==p&&(A.next={revalidate:p}),l&&(A.cache=l);let f=await fetch(h,A);if(!f.ok)throw Error(`API request failed: ${f.status} ${f.statusText}`);return f.json()}async function a(e,t={}){let{apiBase:o="mobile",method:s="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={}}=t,p=r.Y8[o],l=`${p}${e.startsWith("/")?e:"/"+e}`,y={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(y.Authorization=i),c&&(y.langCode=c);let h=u;if(!h)try{h=(await (0,n.Gg)()).fcmToken}catch{}h&&(y.notificationToken=h);let x={method:s,headers:y};return a&&"GET"!==s&&(x.body=JSON.stringify(a)),fetch(l,x)}},90455:(e,t,o)=>{function r(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:()=>r})},47090:(e,t,o)=>{o.d(t,{RF:()=>r,Y8:()=>s,pH:()=>n});let r=["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}},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,o)=>{o.d(t,{Gg:()=>i,dx:()=>s,l7:()=>a,yK:()=>c});var r=o(78632),n=o(71615);let s={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},a={...s,cookieName:"baboon-admin-session"};async function i(){let e=await (0,n.cookies)();return(0,r.iW)(e,s)}async function c(){let e=await (0,n.cookies)();return(0,r.iW)(e,a)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var o=e=>t(t.s=e),r=t.X(0,[8948,3314,8632,5972],()=>o(4668));module.exports=r})();