"use strict";(()=>{var e={};e.id=540,e.ids=[540],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")},73209:(e,t,s)=>{s.r(t),s.d(t,{originalPathname:()=>y,patchFetch:()=>g,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>x,staticGenerationAsyncStorage:()=>m});var r={};s.r(r),s.d(r,{PUT:()=>d});var a=s(49303),o=s(88716),n=s(60670),i=s(87070),c=s(19191),u=s(70446);async function d(e,{params:t}){let s=await (0,u.Gg)(),r="0"===t.id&&s.user?.id?s.user.id:t.id,{addressId:a,activationCode:o}=await e.json(),n=process.env.BABOON_APP_BUSINESS_TOKEN||"";if(!a||!o)return i.NextResponse.json({success:!1,error:"addressId and activationCode are required"},{status:400});try{let e=await (0,c.q)(`/customers/v1/${r}/addresses/${a}/activation/${o}`,{apiBase:"mobile",method:"PUT",token:n,cache:"no-store"}),t=e.statusMessage?.status;if(500===t)return i.NextResponse.json({success:!1,error:"Jeni regjistruar njehere me kete numer"},{status:500});return i.NextResponse.json({success:!0})}catch{return i.NextResponse.json({success:!1,error:"Kodi i aktivizimit nuk eshte i sakte"},{status:400})}}let p=new a.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/customers/[id]/addresses/activate/route",pathname:"/api/customers/[id]/addresses/activate",filename:"route",bundlePath:"app/api/customers/[id]/addresses/activate/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/customers/[id]/addresses/activate/route.ts",nextConfigOutput:"standalone",userland:r}),{requestAsyncStorage:l,staticGenerationAsyncStorage:m,serverHooks:x}=p,y="/api/customers/[id]/addresses/activate/route";function g(){return(0,n.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:m})}},19191:(e,t,s)=>{s.d(t,{F:()=>n,q:()=>o});var r=s(47090),a=s(70446);async function o(e,t={}){let{apiBase:s="mobile",method:o="GET",body:n,token:i,langCode:c,notificationToken:u,headers:d={},revalidate:p,cache:l}=t,m=r.Y8[s],x=`${m}${e.startsWith("/")?e:"/"+e}`,y={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(y.Authorization=i),c&&(y.langCode=c);let g=u;if(!g)try{g=(await (0,a.Gg)()).fcmToken}catch{}g&&(y.notificationToken=g);let v={method:o,headers:y};n&&"GET"!==o&&(v.body=JSON.stringify(n)),void 0!==p&&(v.next={revalidate:p}),l&&(v.cache=l);let h=await fetch(x,v);if(!h.ok)throw Error(`API request failed: ${h.status} ${h.statusText}`);return h.json()}async function n(e,t={}){let{apiBase:s="mobile",method:o="GET",body:n,token:i,langCode:c,notificationToken:u,headers:d={}}=t,p=r.Y8[s],l=`${p}${e.startsWith("/")?e:"/"+e}`,m={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(m.Authorization=i),c&&(m.langCode=c);let x=u;if(!x)try{x=(await (0,a.Gg)()).fcmToken}catch{}x&&(m.notificationToken=x);let y={method:o,headers:m};return n&&"GET"!==o&&(y.body=JSON.stringify(n)),fetch(l,y)}},47090:(e,t,s)=>{s.d(t,{RF:()=>r,Y8:()=>o,pH:()=>a});let r=["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}},o={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,s)=>{s.d(t,{Gg:()=>i,dx:()=>o,l7:()=>n,yK:()=>c});var r=s(78632),a=s(71615);let o={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},n={...o,cookieName:"baboon-admin-session"};async function i(){let e=await (0,a.cookies)();return(0,r.iW)(e,o)}async function c(){let e=await (0,a.cookies)();return(0,r.iW)(e,n)}}};var t=require("../../../../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),r=t.X(0,[8948,3314,8632,5972],()=>s(73209));module.exports=r})();