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