"use strict";(()=>{var e={};e.id=9118,e.ids=[9118],e.modules={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")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},80665:e=>{e.exports=require("dns")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},53011:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>h,patchFetch:()=>g,requestAsyncStorage:()=>c,routeModule:()=>f,serverHooks:()=>m,staticGenerationAsyncStorage:()=>u});var r={};a.r(r),a.d(r,{POST:()=>d});var i=a(49303),o=a(88716),n=a(60670),s=a(87070),l=a(8194),p=a(6350);async function d(e){try{let{email:t}=await e.json();if(!t)return s.NextResponse.json({error:"Email harus diisi"},{status:400});let a="Jika email terdaftar, kami telah mengirimkan link reset password.",r=await l._.user.findFirst({where:{email:t,isActive:!0}});if(!r)return s.NextResponse.json({message:a});let i=(0,p.cl)(),o=new Date(Date.now()+36e5);await l._.user.update({where:{id:r.id},data:{resetToken:i,resetExpiry:o}});let n=`http://localhost:3000/reset-password?token=${i}`,d=(0,p.W)(r.name,n);try{await (0,p.Yb)({to:r.email,subject:"Reset Password - RestoMenu",html:d})}catch(e){console.error("Failed to send reset password email:",e)}return s.NextResponse.json({message:a})}catch(e){return console.error("Forgot password error:",e),s.NextResponse.json({error:"Terjadi kesalahan server"},{status:500})}}let f=new i.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/auth/forgot-password/route",pathname:"/api/auth/forgot-password",filename:"route",bundlePath:"app/api/auth/forgot-password/route"},resolvedPagePath:"D:\\PROJECT\\resto-saas\\src\\app\\api\\auth\\forgot-password\\route.ts",nextConfigOutput:"",userland:r}),{requestAsyncStorage:c,staticGenerationAsyncStorage:u,serverHooks:m}=f,h="/api/auth/forgot-password/route";function g(){return(0,n.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:u})}},8194:(e,t,a)=>{a.d(t,{_:()=>i});let r=require("@prisma/client"),i=globalThis.prisma??new r.PrismaClient},6350:(e,t,a)=>{a.d(t,{W:()=>s,Yb:()=>o,cl:()=>n,y5:()=>l});var r=a(55245),i=a(56811);async function o({to:e,subject:t,html:a}){let o=await (0,i.$X)(),n=r.createTransport({host:o.smtp_host,port:parseInt(o.smtp_port||"587"),secure:"true"===o.smtp_secure,auth:{user:o.smtp_user,pass:o.smtp_pass}}),s=o.smtp_from_name||"RestoMenu",l=o.smtp_from_email||o.smtp_user;await n.sendMail({from:`"${s}" <${l}>`,to:e,subject:t,html:a})}function n(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="";for(let a=0;a<64;a++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function s(e,t){return`
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Reset Password Anda</title>
</head>
<body style="margin: 0; padding: 0; background-color: #f9fafb; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
  <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #f9fafb; padding: 40px 0;">
    <tr>
      <td align="center">
        <table width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);">
          <!-- Header -->
          <tr>
            <td style="background-color: #ea580c; padding: 32px 40px; text-align: center;">
              <h1 style="margin: 0; color: #ffffff; font-size: 24px; font-weight: 700;">RestoMenu</h1>
            </td>
          </tr>
          <!-- Body -->
          <tr>
            <td style="padding: 40px;">
              <h2 style="margin: 0 0 16px; color: #111827; font-size: 22px; font-weight: 700;">Reset Password Anda</h2>
              <p style="margin: 0 0 24px; color: #374151; font-size: 16px; line-height: 1.6;">
                Halo ${e},
              </p>
              <p style="margin: 0 0 32px; color: #374151; font-size: 16px; line-height: 1.6;">
                Kami menerima permintaan untuk mengatur ulang password akun RestoMenu Anda. Klik tombol di bawah ini untuk membuat password baru.
              </p>
              <!-- Button -->
              <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                  <td align="center" style="padding-bottom: 32px;">
                    <a href="${t}" style="display: inline-block; background-color: #ea580c; color: #ffffff; text-decoration: none; padding: 14px 40px; border-radius: 8px; font-size: 16px; font-weight: 600;">
                      Reset Password
                    </a>
                  </td>
                </tr>
              </table>
              <p style="margin: 0 0 8px; color: #6b7280; font-size: 14px; line-height: 1.6;">
                Atau salin dan tempel link berikut di browser Anda:
              </p>
              <p style="margin: 0 0 24px; color: #ea580c; font-size: 14px; line-height: 1.6; word-break: break-all;">
                ${t}
              </p>
              <div style="border-top: 1px solid #e5e7eb; padding-top: 24px; margin-top: 8px;">
                <p style="margin: 0; color: #9ca3af; font-size: 13px; line-height: 1.6;">
                  Link berlaku 1 jam. Jika Anda tidak meminta reset password, abaikan email ini. Password Anda tidak akan berubah.
                </p>
              </div>
            </td>
          </tr>
          <!-- Footer -->
          <tr>
            <td style="background-color: #f9fafb; padding: 24px 40px; text-align: center; border-top: 1px solid #e5e7eb;">
              <p style="margin: 0; color: #9ca3af; font-size: 12px;">
                Powered by <a href="https://restomenu.id" style="color: #ea580c; text-decoration: none; font-weight: 600;">restomenu.id</a>
              </p>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</body>
</html>
`}function l(e,t){return`
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Verifikasi Email Anda</title>
</head>
<body style="margin: 0; padding: 0; background-color: #f9fafb; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
  <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #f9fafb; padding: 40px 0;">
    <tr>
      <td align="center">
        <table width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);">
          <!-- Header -->
          <tr>
            <td style="background-color: #ea580c; padding: 32px 40px; text-align: center;">
              <h1 style="margin: 0; color: #ffffff; font-size: 24px; font-weight: 700;">RestoMenu</h1>
            </td>
          </tr>
          <!-- Body -->
          <tr>
            <td style="padding: 40px;">
              <h2 style="margin: 0 0 16px; color: #111827; font-size: 22px; font-weight: 700;">Verifikasi Email Anda</h2>
              <p style="margin: 0 0 24px; color: #374151; font-size: 16px; line-height: 1.6;">
                Halo ${e},
              </p>
              <p style="margin: 0 0 32px; color: #374151; font-size: 16px; line-height: 1.6;">
                Terima kasih telah mendaftar di RestoMenu. Silakan klik tombol di bawah ini untuk memverifikasi alamat email Anda.
              </p>
              <!-- Button -->
              <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                  <td align="center" style="padding-bottom: 32px;">
                    <a href="${t}" style="display: inline-block; background-color: #ea580c; color: #ffffff; text-decoration: none; padding: 14px 40px; border-radius: 8px; font-size: 16px; font-weight: 600;">
                      Verifikasi Email
                    </a>
                  </td>
                </tr>
              </table>
              <p style="margin: 0 0 8px; color: #6b7280; font-size: 14px; line-height: 1.6;">
                Atau salin dan tempel link berikut di browser Anda:
              </p>
              <p style="margin: 0 0 24px; color: #ea580c; font-size: 14px; line-height: 1.6; word-break: break-all;">
                ${t}
              </p>
              <div style="border-top: 1px solid #e5e7eb; padding-top: 24px; margin-top: 8px;">
                <p style="margin: 0; color: #9ca3af; font-size: 13px; line-height: 1.6;">
                  Link berlaku 24 jam. Jika Anda tidak merasa mendaftar di RestoMenu, abaikan email ini.
                </p>
              </div>
            </td>
          </tr>
          <!-- Footer -->
          <tr>
            <td style="background-color: #f9fafb; padding: 24px 40px; text-align: center; border-top: 1px solid #e5e7eb;">
              <p style="margin: 0; color: #9ca3af; font-size: 12px;">
                Powered by <a href="https://restomenu.id" style="color: #ea580c; text-decoration: none; font-weight: 600;">restomenu.id</a>
              </p>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</body>
</html>
`}},56811:(e,t,a)=>{a.d(t,{$X:()=>n,Km:()=>o,Rx:()=>s,ks:()=>l});var r=a(8194);let i={payment_fee_mode:"percentage",payment_fee_amount:"2.5",payment_enabled:"true",min_withdrawal:"50000",affiliate_commission_rate:"10",affiliate_enabled:"true",affiliate_min_withdrawal:"50000",email_verification_enabled:"false",smtp_host:"",smtp_port:"587",smtp_user:"",smtp_pass:"",smtp_from_email:"",smtp_from_name:"RestoMenu",smtp_secure:"false"};async function o(e){let t=await r._.platformSetting.findUnique({where:{key:e}});return t?.value??i[e]??""}async function n(){let e=await r._.platformSetting.findMany(),t={...i};for(let a of e)t[a.key]=a.value;return t}async function s(e){let t=Object.entries(e).map(([e,t])=>r._.platformSetting.upsert({where:{key:e},update:{value:t},create:{key:e,value:t}}));await r._.$transaction(t)}function l(e,t,a){let r=parseFloat(a)||0,i=0;i=Math.min(i="percentage"===t?Math.round(e*r/100):Math.round(r),e);let o=e-i;return{fee:i,tenantAmount:o}}}};var t=require("../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,5972,5245],()=>a(53011));module.exports=r})();