"use strict";(()=>{vare={};e.id=2500,e.ids=[2500],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")},29021:e=>{e.exports=require("fs")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},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}}})},66162:(e,r,t)=>{t.r(r),t.d(r,{config:()=>d,default:()=>p,routeModule:()=>S});vars={};t.r(s),t.d(s,{default:()=>_});varn=t(89947),o=t(2706),a=t(96762),c=t(33364),i=t.n(c),l=t(6420),u=t.n(l);asyncfunction_(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});if(!awaitu()(e,r,!0))returnr.json({success:!1,msg:"Unauthorized"});let{user_type:t}=e.body,s=(()=>{letr=Object.keys(e.body),s={};returnr.forEach(r=>{!(t?.match(/database/)&&r?.match(/user_type|priviledge|database_access|databases?|confirm/))&&(r?.match(/databases|confirm/)||(s[r]=e.body[r]))}),s})(),n=awaiti()({dbFullName:"datasquirel",tableName:"user_users",identifierColumnName:"id",identifierValue:e.body.id,data:{...s}});r.json({success:!!n?.affectedRows,msg:n?.affectedRows?"User Updated":n})}letp=(0,a.M)(s,"default"),d=(0,a.M)(s,"config"),S=newn.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/updateUserUser",pathname:"/api/updateUserUser",bundlePath:"",filename:""},userland:s})},6420:(e,r,t)=>{t(81630);lets=t(51348),n=t(72835),o=t(29021),a=t(31341);asyncfunctionc(e,r,t,c){let{keyCookieName:i,csrfCookieName:l}=a();if(!e.cookies?.[i]?.match(/./))returnnull;letu=n({encryptedString:e.cookies[i]});if(!u)returnnull;let_=JSON.parse(u);if(!_.csrf_k||t&&!e.headers["x-csrf-auth"]?.match(RegExp(`${_.csrf_k}`)))returnnull;letp=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!p)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(t&&!o.existsSync(`${p}/${_.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=c},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",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),a=r;e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),a+=t;letc=r;e?.userId&&(c+=`user_${e.userId}_`),o&&(c+=`${o}_`),c+=s;leti=r;returne?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),{keyCookieName:a,csrfCookieName:c,oneTimeCodeName:i+=n}}},33364:(e,r,t)=>{lets=t(72583),n=t(16570),o=t(51348),a=t(21339),c=t(20503),i=t(44900);asyncfunctionl({dbContext:e,paradigm:r,dbFullName:t,tableName:l,data:u,tableSchema:_,identifierColumnName:p,identifierValue:d,encryptionKey:S,encryptionSalt:f,useLocal:E}){if(!u||!Object.keys(u).length)returnnull;letD=!!E||!e?.match(/dsql.user/i)&&(!t||!!t.match(/^datasquirel$/)),g=E?i:D?o:a,h=Object.keys(u),m=[],y=[];for(lete=0;e<h.length;e++)try{letr=h[e],t=u[r],o=_?_?.fields?.filter(e=>e.fieldName===r):null,a=o&&o[0]?o[0]:null;if(null==t||void0==t)continue;leti=/<[^>]+>/g;(a?.richText||String(t).match(i))&&(t=s(t,n)),a?.encrypted&&(t=c({data:t,encryptionKey:S,encryptionSalt:f})),"object"==typeoft&&(t=JSON.stringify(t)),a?.pattern&&!newRegExp(a.pattern,a.patternFlags||"").test(t)&&(console.log("DSQL: Pattern not matched =>",t),t=""),"string"==typeoft&&t.match(/^null$/i)&&(t={toSqlString:function(){return"NULL"}}),"string"!=typeoft||t.match(/./i)||(t={toSqlString:function(){return"NULL"}}),m.push(`\`${r}\`=?`),"number"==typeoft?y.push(String(t)):y.push