"use strict";(()=>{var e={};e.id=6298,e.ids=[6298],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},72583:e=>{e.exports=require("sanitize-html")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},21407:(e,r,s)=>{s.r(r),s.d(r,{config:()=>p,default:()=>o,routeModule:()=>m});var a={};s.r(a),s.d(a,{default:()=>d});var i=s(89947),t=s(2706),u=s(96762),l=s(98e3),n=s(48786);async function d(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let{email:s,alerts:a,userId:i}=e.body;if(a)a&&await (0,n.A)("DELETE FROM unsubscribes WHERE email=? AND type='alerts'",[s]);else{let e=await (0,n.A)("SELECT email FROM unsubscribes WHERE email=? AND type='alerts'",[s]);e&&e[0]||await (0,l.A)({dbFullName:"datasquirel",tableName:"unsubscribes",data:{email:s,type:"alerts",user_id:i||null}})}r.json({success:!0})}let o=(0,u.M)(a,"default"),p=(0,u.M)(a,"config"),m=new i.PagesAPIRouteModule({definition:{kind:t.A.PAGES_API,page:"/api/unsubscribe",pathname:"/api/unsubscribe",bundlePath:"",filename:""},userland:a})}};var r=require("../../webpack-api-runtime.js");r.C(e);var s=e=>r(r.s=e),a=r.X(0,[1251],()=>s(21407));module.exports=a})();