"use strict";(()=>{var e={};e.id=9146,e.ids=[9146],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")},30494:(e,t,o)=>{o.r(t),o.d(t,{originalPathname:()=>m,patchFetch:()=>f,requestAsyncStorage:()=>y,routeModule:()=>l,serverHooks:()=>x,staticGenerationAsyncStorage:()=>g});var n={};o.r(n),o.d(n,{POST:()=>p});var r=o(49303),s=o(88716),a=o(60670),i=o(87070),c=o(19191),d=o(70446),u=o(90455);async function p(e){let t=await (0,d.Gg)(),o=(0,u.LP)(t),n=await e.json();try{let e=await (0,c.q)("/orders",{apiBase:"legacy",method:"POST",token:o,langCode:t.langCode||"al",body:n,headers:{source:"web",deviceModel:"web",applicationVersion:"1.0"},cache:"no-store"});return i.NextResponse.json(e)}catch{return i.NextResponse.json({error:"Order creation failed"},{status:500})}}let l=new r.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/orders/route",pathname:"/api/orders",filename:"route",bundlePath:"app/api/orders/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/orders/route.ts",nextConfigOutput:"standalone",userland:n}),{requestAsyncStorage:y,staticGenerationAsyncStorage:g,serverHooks:x}=l,m="/api/orders/route";function f(){return(0,a.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:g})}},19191:(e,t,o)=>{o.d(t,{F:()=>a,q:()=>s});var n=o(47090),r=o(70446);async function s(e,t={}){let{apiBase:o="mobile",method:s="GET",body:a,token:i,langCode:c,notificationToken:d,headers:u={},revalidate:p,cache:l}=t,y=n.Y8[o],g=`${y}${e.startsWith("/")?e:"/"+e}`,x={"Content-Type":"application/json","User-Agent":"BaboonWeb",...u};i&&(x.Authorization=i),c&&(x.langCode=c);let m=d;if(!m)try{m=(await (0,r.Gg)()).fcmToken}catch{}m&&(x.notificationToken=m);let f={method:s,headers:x};a&&"GET"!==s&&(f.body=JSON.stringify(a)),void 0!==p&&(f.next={revalidate:p}),l&&(f.cache=l);let h=await fetch(g,f);if(!h.ok)throw Error(`API request failed: ${h.status} ${h.statusText}`);return h.json()}async function a(e,t={}){let{apiBase:o="mobile",method:s="GET",body:a,token:i,langCode:c,notificationToken:d,headers:u={}}=t,p=n.Y8[o],l=`${p}${e.startsWith("/")?e:"/"+e}`,y={"Content-Type":"application/json","User-Agent":"BaboonWeb",...u};i&&(y.Authorization=i),c&&(y.langCode=c);let g=d;if(!g)try{g=(await (0,r.Gg)()).fcmToken}catch{}g&&(y.notificationToken=g);let x={method:s,headers:y};return a&&"GET"!==s&&(x.body=JSON.stringify(a)),fetch(l,x)}},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:()=>s,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}},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 n=o(78632),r=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,r.cookies)();return(0,n.iW)(e,s)}async function c(){let e=await (0,r.cookies)();return(0,n.iW)(e,a)}}};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(30494));module.exports=n})();