"use strict";(()=>{vare={};e.id=3462,e.ids=[3462],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}}})},83246:(e,r,t)=>{t.r(r),t.d(r,{config:()=>E,default:()=>d,routeModule:()=>p});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"});lets=e.body,{user_type:n,user_id:i,email:o,invited_user_id:a}=s;awaitu()("DELETE FROM user_users WHERE id=?",[s.id]),n?.match(/admin/i)&&(awaitu()("DELETE FROM invitations WHERE inviting_user_id=? AND invited_user_email=?",[t.id,o]),awaitu()("DELETE FROM delegated_user_tables WHERE delegated_user_id=? AND root_user_id=?",[a,t.id])),r.json({success:!0,msg:"User Deleted!"})}t(29021);letd=(0,o.M)(s,"default"),E=(0,o.M)(s,"config"),p=newn.PagesAPIRouteModule({definition:{kind:i.A.PAGES_API,page:"/api/deleteUserUser",pathname:"/api/deleteUserUser",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.export