"use strict";(()=>{var e={};e.id=5467,e.ids=[5467],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},29756:(e,r,n)=>{n.r(r),n.d(r,{config:()=>l,default:()=>_,routeModule:()=>d});var t={};n.r(t),n.d(t,{default:()=>c});var s=n(89947),o=n(2706),i=n(96762),u=n(89159),a=n(68829);async function c(e,r){if("POST"!==e.method)return r.json({user:null,msg:"Failed"});let{email:n,password:t,authKey:s}=e.body;if(t!==process.env.DSQL_USER_KEY||s!==process.env.DSQL_SPECIAL_KEY)return r.json({success:!1});let o=(0,a.A)({data:JSON.stringify({email:n,password:process.env.DSQL_USER_KEY,authKey:process.env.DSQL_SPECIAL_KEY,logged_in_status:!0,date:Date.now()})}),{keyCookieName:i,csrfCookieName:c}=(0,u.A)();r.setHeader("Set-Cookie",[`${i}_su=${o};samesite=strict;path=/;HttpOnly=true;Secure=true`]),r.json({success:!0})}let _=(0,i.M)(t,"default"),l=(0,i.M)(t,"config"),d=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/loginSuUser",pathname:"/api/admin/loginSuUser",bundlePath:"",filename:""},userland:t})},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=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+_/,""),i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=n;let u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=t;let a=r;return e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),{keyCookieName:i,csrfCookieName:u,oneTimeCodeName:a+=s}}},68829:(e,r,n)=>{n.d(r,{A:()=>i});var t=n(55511),s=n(79428),o=n(31542);function i({data:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encryption string is invalid"),e;let{key:i,salt:u,keyLen:a,algorithm:c,bufferAllocSize:_}=(0,o.A)({encryptionKey:r});if(!i?.match(/.{8,}/))return console.log("Encryption key is invalid"),e;if(!u?.match(/.{8,}/))return console.log("Encryption salt is invalid"),e;let l=(0,t.scryptSync)(i,u,a),d=s.Buffer.alloc(_,0),p=(0,t.createCipheriv)(c,l,d);try{let r=p.update(e,"utf8","hex");return r+=p.final("hex")}catch(r){return console.log("Error in encrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=29756);module.exports=n})();