"use strict";(()=>{var e={};e.id=6142,e.ids=[6142],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")},99633:(e,t,n)=>{n.r(t),n.d(t,{originalPathname:()=>y,patchFetch:()=>m,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>h,staticGenerationAsyncStorage:()=>g});var o={};n.r(o),n.d(o,{POST:()=>u});var s=n(49303),r=n(88716),a=n(60670),i=n(87070),c=n(19191),p=n(90455);async function u(e){let{email:t,code:n,newPassword:o}=await e.json();if(!t||!n||!o)return i.NextResponse.json({error:"All fields are required"},{status:400});try{let e=await (0,c.q)("/customers/v1/password/change",{apiBase:"mobile",method:"POST",token:(0,p.I2)(),body:{email:t,code:n,newPassword:o},cache:"no-store"});return i.NextResponse.json(e)}catch{return i.NextResponse.json({error:"Password change failed"},{status:500})}}let d=new s.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/password/change/route",pathname:"/api/password/change",filename:"route",bundlePath:"app/api/password/change/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/password/change/route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:l,staticGenerationAsyncStorage:g,serverHooks:h}=d,y="/api/password/change/route";function m(){return(0,a.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:g})}},19191:(e,t,n)=>{n.d(t,{F:()=>a,q:()=>r});var o=n(47090),s=n(70446);async function r(e,t={}){let{apiBase:n="mobile",method:r="GET",body:a,token:i,langCode:c,notificationToken:p,headers:u={},revalidate:d,cache:l}=t,g=o.Y8[n],h=`${g}${e.startsWith("/")?e:"/"+e}`,y={"Content-Type":"application/json","User-Agent":"BaboonWeb",...u};i&&(y.Authorization=i),c&&(y.langCode=c);let m=p;if(!m)try{m=(await (0,s.Gg)()).fcmToken}catch{}m&&(y.notificationToken=m);let x={method:r,headers:y};a&&"GET"!==r&&(x.body=JSON.stringify(a)),void 0!==d&&(x.next={revalidate:d}),l&&(x.cache=l);let f=await fetch(h,x);if(!f.ok)throw Error(`API request failed: ${f.status} ${f.statusText}`);return f.json()}async function a(e,t={}){let{apiBase:n="mobile",method:r="GET",body:a,token:i,langCode:c,notificationToken:p,headers:u={}}=t,d=o.Y8[n],l=`${d}${e.startsWith("/")?e:"/"+e}`,g={"Content-Type":"application/json","User-Agent":"BaboonWeb",...u};i&&(g.Authorization=i),c&&(g.langCode=c);let h=p;if(!h)try{h=(await (0,s.Gg)()).fcmToken}catch{}h&&(g.notificationToken=h);let y={method:r,headers:g};return a&&"GET"!==r&&(y.body=JSON.stringify(a)),fetch(l,y)}},90455:(e,t,n)=>{function o(e){return e.token?e.token:e.user?.token?e.user.token:process.env.BABOON_APP_BUSINESS_TOKEN||""}function s(){return process.env.BABOON_APP_BUSINESS_TOKEN||""}n.d(t,{I2:()=>s,LP:()=>o})},47090:(e,t,n)=>{n.d(t,{RF:()=>o,Y8:()=>r,pH:()=>s});let o=["al","en","it"],s={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,n)=>{n.d(t,{Gg:()=>i,dx:()=>r,l7:()=>a,yK:()=>c});var o=n(78632),s=n(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,s.cookies)();return(0,o.iW)(e,r)}async function c(){let e=await (0,s.cookies)();return(0,o.iW)(e,a)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),o=t.X(0,[8948,3314,8632,5972],()=>n(99633));module.exports=o})();