"use strict";(()=>{vare={};e.id=9664,e.ids=[9664],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}}})},29249:(e,r,t)=>{t.r(r),t.d(r,{config:()=>f,default:()=>_,routeModule:()=>S});vars={};t.r(s),t.d(s,{default:()=>d});varo=t(89947),n=t(2706),a=t(96762),i=t(51348),c=t.n(i),u=t(19131),l=t.n(u);letp=t(29021);asyncfunctiond(e,r){if("POST"!==e.method)returnr.json({success:!1,msg:"Wrong Method"});lett=awaitl()(e);if(!t?.logged_in_status)returnr.json({success:!1,log:"No Logs"});lets=e.body.user,o=s?.id.toString().replace(/[^0-9]/g,"").replace(/\//g,""),n=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${o}`,a=[];!functione({originArray:r,rootPath:t}){lets=p.readdirSync(t);for(leto=0;o<s.length;o++){letn=s[o];if(n?.match(/\..{2,5}$/))r.push({name:n,type:"file",root:t});else{lets={name:n,type:"folder",root:t,content:[]};e({originArray:s.content,rootPath:`${t}/${n}`}),r.push(s)}}}({originArray:a,rootPath:n});leti=awaitc()(`SHOW databases LIKE 'datasquirel_user_${s.id}_%'`);r.json({success:!0,data:a,databases:i.map(e=>Object.values(e)[0])})}let_=(0,a.M)(s,"default"),f=(0,a.M)(s,"config"),S=newo.PagesAPIRouteModule({definition:{kind:n.A.PAGES_API,page:"/api/admin/getUserData",pathname:"/api/admin/getUserData",bundlePath:"",filename:""},userland:s})},19131:(e,r,t)=>{let{IncomingMessage:s}=t(81630),o=t(72835),n=t(31341);e.exports=asyncfunction(e){let{keyCookieName:r,csrfCookieName:t}=n(),s=`${r}_su`;if(!e.cookies?.[s])returnconsole.log("No auth key cookie found"),null;leta=o({encryptedString:e.cookies[s]});if(!a)returnconsole.log("No user payload found"),null;leti=JSON.parse(a);returni.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},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",o=r;e?.userId&&(o+=`user_${e.userId}_`),e?.database&&(o+=`${e.database}_`),o+=t;letn=r;returne?.userId&&(n+=`user_${e.userId}_`),e?.database&&(n+=`${e.database}_`),{keyCookieName:o,csrfCookieName:n+=s}}},72835:(e,r,t)=>{let{scryptSync:s,createDecipheriv:o}=t(55511),{Buffer:n}=t(79428);e.exports=({encryptedString:e,encryptionKey:r,encryptionSalt:t})=>{if(!e?.match(/./))returnconsole.log("Encrypted string is invalid"),e;leta=r||process.env.DSQL_ENCRYPTION_PASSWORD,i=t||process.env.DSQL_ENCRYPTION_SALT,c=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!a?.match(/.{8,}/))returnconsole.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))returnconsole.log("Decrption salt is invalid"),e;letu=o("aes-192-cbc",s(a,i,c),n.alloc(16,0));try{letr=u.update(e,"hex","utf8");returnr+=u.final("utf8")}catch(r){returnconsole.log("Error in decrypting =>",r.message),e}}},51348:(e,r,t)=>{lets=t(9973),o=t(21580),n=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:o()}});asyncfunctiona(...e){try{letr=awaitn.query(...e);returnawaitn.end(),JSON.parse(JSON.stringify(r))}catch(e){returnconsole.log("DB Error =>",e),{success:!1,error:e.message}}}e.exports=a},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;Object.defineProp