"use strict";(()=>{var e={};e.id=878,e.ids=[878],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},4770:e=>{e.exports=require("crypto")},665:e=>{e.exports=require("dns")},7702:e=>{e.exports=require("events")},2048:e=>{e.exports=require("fs")},2615:e=>{e.exports=require("http")},5240:e=>{e.exports=require("https")},8216:e=>{e.exports=require("net")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},6162:e=>{e.exports=require("stream")},2452:e=>{e.exports=require("tls")},7360:e=>{e.exports=require("url")},1764:e=>{e.exports=require("util")},1568:e=>{e.exports=require("zlib")},4240:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>g,patchFetch:()=>h,requestAsyncStorage:()=>u,routeModule:()=>l,serverHooks:()=>x,staticGenerationAsyncStorage:()=>c});var s={};t.r(s),t.d(s,{POST:()=>d});var o=t(9303),n=t(8716),i=t(670),p=t(7070),a=t(5245);async function d(e){try{let{name:r,phone:t,email:s,message:o}=await e.json();if(!r||!t||!o)return p.NextResponse.json({error:"Vui l\xf2ng điền đầy đủ th\xf4ng tin bắt buộc"},{status:400});if(!/^(0|\+84)(3|5|7|8|9)[0-9]{8}$/.test(t.replace(/\s/g,"")))return p.NextResponse.json({error:"Số điện thoại kh\xf4ng hợp lệ"},{status:400});if(s&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s))return p.NextResponse.json({error:"Email kh\xf4ng hợp lệ"},{status:400});let n=a.createTransport({service:"gmail",auth:{user:process.env.GMAIL_USER,pass:process.env.GMAIL_APP_PASSWORD}}),i=new Date().toLocaleString("vi-VN",{dateStyle:"short",timeStyle:"short"}),d={from:process.env.GMAIL_USER,to:process.env.NOTIFICATION_EMAIL,subject:"\uD83D\uDCE9 KH\xc1CH H\xc0NG GỬI FORM LI\xcaN HỆ - V_LOG MEDIA",html:`
        <div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 10px;">
          <div style="background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
            <h1 style="color: #dc2626; margin-top: 0; font-size: 24px; border-bottom: 3px solid #dc2626; padding-bottom: 10px;">
              📩 KH\xc1CH H\xc0NG GỬI FORM LI\xcaN HỆ
            </h1>

            <div style="background: #fef2f2; padding: 20px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #dc2626;">
              <p style="margin: 10px 0; font-size: 16px;">
                <strong style="color: #dc2626;">👤 Họ t\xean:</strong>
                <span style="color: #374151;">${r}</span>
              </p>
              <p style="margin: 10px 0; font-size: 16px;">
                <strong style="color: #dc2626;">📱 Số điện thoại:</strong>
                <span style="color: #374151;">${t}</span>
              </p>
              ${s?`<p style="margin: 10px 0; font-size: 16px;">
                <strong style="color: #dc2626;">📧 Email:</strong>
                <span style="color: #374151;">${s}</span>
              </p>`:""}
              <p style="margin: 10px 0; font-size: 16px;">
                <strong style="color: #dc2626;">🕐 Thời gian:</strong>
                <span style="color: #374151;">${i}</span>
              </p>
            </div>

            <div style="background: #f9fafb; padding: 20px; border-radius: 8px; margin: 20px 0; border: 2px solid #e5e7eb;">
              <h3 style="color: #374151; margin-top: 0; font-size: 16px;">💬 Nội dung tin nhắn:</h3>
              <p style="color: #4b5563; line-height: 1.6; white-space: pre-wrap;">${o}</p>
            </div>

            <div style="background: linear-gradient(135deg, #dc2626 0%, #f97316 100%); padding: 15px; border-radius: 8px; text-align: center; margin-top: 20px;">
              <p style="color: white; margin: 0; font-size: 18px; font-weight: bold;">
                🎯 V_LOG MEDIA
              </p>
              <p style="color: white; margin: 5px 0 0 0; font-size: 14px; opacity: 0.9;">
                Phản hồi kh\xe1ch h\xe0ng ngay để tạo ấn tượng tốt!
              </p>
            </div>
          </div>
        </div>
      `};return await n.sendMail(d),p.NextResponse.json({message:"Cảm ơn bạn! Ch\xfang t\xf4i sẽ li\xean hệ lại sớm nhất."},{status:200})}catch(e){return console.error("Email sending error:",e),p.NextResponse.json({error:"C\xf3 lỗi xảy ra, vui l\xf2ng thử lại sau"},{status:500})}}let l=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/send-contact/route",pathname:"/api/send-contact",filename:"route",bundlePath:"app/api/send-contact/route"},resolvedPagePath:"D:\\Develop\\Home\\VlogMD\\app\\api\\send-contact\\route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:u,staticGenerationAsyncStorage:c,serverHooks:x}=l,g="/api/send-contact/route";function h(){return(0,i.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:c})}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[276,770],()=>t(4240));module.exports=s})();