"use strict";(()=>{vare={};e.id=291,e.ids=[291],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},81630:e=>{e.exports=require("http")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},50667:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>d,routeModule:()=>f});vars={};t.r(s),t.d(s,{default:()=>_});varn=t(89947),i=t(2706),o=t(96762),a=t(51348),u=t.n(a),c=t(6420),l=t.n(c);asyncfunction_(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});lett=awaitl()(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});awaitu()("DELETE FROM invitations WHERE id = ? AND inviting_user_id = ?",[e.body.id,t.id]),r.json({success:!0})}letd=(0,o.M)(s,"default"),p=(0,o.M)(s,"config"),f=newn.PagesAPIRouteModule({definition:{kind:i.A.PAGES_API,page:"/api/deleteInvitation",pathname:"/api/deleteInvitation",bundlePath:"",filename:""},userland:s})},6420:(e,r,t)=>{t(81630);lets=t(51348),n=t(72835),i=t(29021),o=t(31341);asyncfunctiona(e,r,t,a){let{keyCookieName:u,csrfCookieName:c}=o();if(!e.cookies?.[u]?.match(/./))returnnull;letl=n({encryptedString:e.cookies[u]});if(!l)returnnull;let_=JSON.parse(l);if(!_.csrf_k||t&&!e.headers["x-csrf-auth"]?.match(RegExp(`${_.csrf_k}`)))returnnull;letd=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!d)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(t&&!i.existsSync(`${d}/${_.csrf_k}`))returnnull;if(0==_.verification_status&&!t){lete=awaits(`SELECT verification_status FROM users WHERE id='${_.id}'`);e&&e[0]&&1==e[0].verification_status&&r.setHeader("Set-Cookie",["user_refresh=1"])}return_?.date&&Date.now()-_.date>6048e5?null:_}e.exports=a},31341:e=>{e.exports=function(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",s=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",i=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=r;e?.userId&&(o+=`user_${e.userId}_`),i&&(o+=`${i}_`),o+=t;leta=r;e?.userId&&(a+=`user_${e.userId}_`),i&&(a+=`${i}_`),a+=s;letu=r;returne?.userId&&(u+=`user_${e.userId}_`),i&&(u+=`${i}_`),{keyCookieName:o,csrfCookieName:a,oneTimeCodeName:u+=n}}},72835:(e,r,t)=>{let{scryptSync:s,createDecipheriv:n}=t(55511),{Buffer:i}=t(79428);e.exports=({encryptedString:e,encryptionKey:r,encryptionSalt:t})=>{if(!e?.match(/./))returnconsole.log("Encrypted string is invalid"),e;leto=r||process.env.DSQL_ENCRYPTION_PASSWORD,a=t||process.env.DSQL_ENCRYPTION_SALT,u=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!o?.match(/.{8,}/))returnconsole.log("Decrption key is invalid"),e;if(!a?.match(/.{8,}/))returnconsole.log("Decrption salt is invalid"),e;letc=n("aes-192-cbc",s(o,a,u),i.alloc(16,0));try{letr=c.update(e,"hex","utf8");returnr+=c.final("utf8")}catch(r){returnconsole.log("Error in decrypting =>",r.message),e}}},51348:(e,r,t)=>{lets=t(9973),n=t(21580),i=s({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void0,charset:"utf8mb4",ssl:n()}});asyncfunctiono(...e){try{letr=awaiti.query(...e);returnawaiti.end(),JSON.parse(JSON.stringify(r))}catch(e){returnconsole.log("DB Error =>",e),{success:!1,error:e.message}}}e.exports=o},21580:(e,r,t)=>{lets=t(29021);e.exports=function(){lete=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;letr=`${e}/ca-cert.pem`;if(!s.existsSync(r)){console.log(`${r} does not exist`);return}return{ca:s.readFileSync(`${e}/ca-cert.pem`)}}},2706:(e,r)=>{vart;Objec