"use strict";(()=>{vare={};e.id=8932,e.ids=[8932],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},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")},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}}})},36629:(e,r,t)=>{t.r(r),t.d(r,{config:()=>_,default:()=>p,routeModule:()=>S});vara={};t.r(a),t.d(a,{default:()=>d});vars=t(89947),n=t(2706),o=t(96762),l=t(69842),i=t(67619),u=t(60125),c=t(30944);asyncfunctiond(e,r){if("POST"!==e.method)returnr.json({user:null,msg:"Registration Failed!"});lett=await(0,l.A)(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});leta=e.body;try{lets=await(0,u.A)({databaseSlug:a.dbName,request:e,user:t,query:e.query}),n=s?s?.rootUserId?s.rootUserId:s.dbUserId:null;if(!n)throwError("User not Found!");leto=`datasquirel_user_${n}_${a.dbName}`,l=a.tableName,i=a.page,d=20*i,p=`SELECT * FROM ${o}.${l}`,_=[];a.search&&a.searchField&&(p+=` WHERE LOWER(\`${a.searchField.toLowerCase().replace(/ /g,"_")}\`) LIKE ?`,_.push(`%${a.search.toLowerCase()}%`)),p+=` ORDER BY id DESC LIMIT 20 OFFSET ${d}`;letS=await(0,c.A)({database:o,queryString:p,queryValuesArray:_,tableSchema:a.tableSchema}),f={success:!0,data:S,page:Number(i)+1};r.json(f)}catch(e){(0,i.A)({component:"/api/infiniteScroll/catch-error",message:e.message,user:t}),r.json({success:!1,data:null})}}letp=(0,o.M)(a,"default"),_=(0,o.M)(a,"config"),S=news.PagesAPIRouteModule({definition:{kind:n.A.PAGES_API,page:"/api/infiniteScroll",pathname:"/api/infiniteScroll",bundlePath:"",filename:""},userland:a})},60125:(e,r,t)=>{t.d(r,{A:()=>s});vara=t(95969);asyncfunctions({request:e,databaseSlug:r,user:t,query:s}){try{letn=t.id,o=null;if(!s?.delegated)return{dbUserId:n};letl=s.dbUserId,i=`${process.env.DSQL_USER_DB_PREFIX}${l}_${r}`,u=`${process.env.DSQL_USER_DELEGATED_DB_COOKIE_PREFIX}${i}`;try{if(!e.cookies?.[u])throwError("Cookie not present");lett=(0,a.A)({encryptedString:e.cookies[u]});if(!t)throwError("Invalid Token");if((o=JSON.parse(t)).databaseSlug===r)return{dbUserId:n=o.rootUserId,rootUserId:o.rootUserId,rootUserName:o.rootUserName,rootUserEmail:o.rootUserEmail,rootUserImage:o.rootUserImage,databaseFullName:o.databaseFullName,databaseSlug:o.databaseSlug,allowedTables:o.allowedTables,priviledges:o.priviledges,database:o.databaseSlug,delegated:!0}}catch(e){}return{dbUserId:n}}catch(e){returnnull}}},69842:(e,r,t)=>{t.d(r,{A:()=>n});vara=t(39908),s=t.n(a);asyncfunctionn(e,r,t){leta=s()({req:e,level:t?"deep":void0});returnconsole.log(a),a.payload}},43775:(e,r,t)=>{t.d(r,{A:()=>n});vara=t(95969);lets=/^id$|^uuid$|^date_created$|^date_created_code$|^date_created_timestamp$|^date_updated$|^date_updated_code$|^date_updated_timestamp$/;asyncfunctionn({unparsedResults:e,tableSchema:r}){lett=[];try{for(letn=0;n<e.length;n++){leto=e[n],l=Object.keys(o);for(lete=0;e<l.length;e++){lett=l[e],n=r?.fields[e];if(t?.match(s))continue;leti=o[t];("number"==typeofi||i)&&n?.encrypted&&i?.match(/./)&&(o[t]=(0,a.A)({encryptedString:i}))}t.push(o)}returnt}catch(r){returnconsole.log("ERROR in parseDbResults Function =>",r.message),e}}},67619:(e,r,t)=>{t.d(r,{A:()=>n});vara=t(29021),s=t.n(a);asyncfunctionn({user:e,message:r,component:t,noMail:a,req:n}){leto=newDate,l=(()=>{if(!n)returnnull;try{lete=n.headers["x-forwarded-for"],r=n.headers["x-real-ip"],t=n.headers["cf-connecting-ip"],a=Array.isArray(e)?e[0]:e?.split(",")[0],s=t||a||r||n.socket.remoteAddress;if(!s)returnnull;returnString(s)}catch(e){returnnull}})();try{leta=`🚀 SERVER ERROR ===========================