/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/yekonga-server@4.3.72/src/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
process.env.NODE_TLS_REJECT_UNAUTHORIZED=0,require("./global");const{YekongaServer:YekongaServer}=require("./core/init");Yekonga.setConfig=function(e,r){serverLibrary.__dirname=process.cwd(),serverLibrary.__src=__dirname,new YekongaServer(e,r)},Yekonga.Storage=new class{constructor(){this.hasRedis=!1,this.client=null,this.localState={}}async connect(){try{var e={};Yekonga.Config.ports.redis&&(e.url=`redis://localhost:${Yekonga.Config.ports.redis}`),e.url?(this.client=global.serverLibrary.createClient(e),this.client.on("error",(e=>{console.error("Redis Client Error",e),this.hasRedis=!1}))):(await this.client.connect(),this.hasRedis=!0)}catch(e){console.error("Redis Connection",e),this.hasRedis=!1}}async set(e,r){this.hasRedis?await this.client.set(e,JSON.stringify(r)):this.localState[e]=r}async get(e,r){var o=null;try{o=this.hasRedis?JSON.parse(await this.client.get(e)):this.localState[e]}catch(e){console.error("Yekonga.Storage",e)}return void 0===o?r:o}async setObject(e,r){this.hasRedis?await this.client.hSet(e,r):this.localState[e]=r}async getObject(e,r){var o=null;return void 0===(o=this.hasRedis?await this.client.hGet(e):this.localState[e])?r||null:o}},Yekonga.updateConfig=function(e,r){var o=null,i=e.split(".");i.reverse();for(const e of i){var t={};t[e]=o||r,o=Yekonga.Helper.copyJson(t)}if(o.logoUrl){var s=Array.isArray(Yekonga.Config.public)?Yekonga.Config.public[0]:Yekonga.Config.public;o.logoUrl="uploads/"+Yekonga.Helper.saveFile(o.logoUrl,`${s}/uploads`)}Yekonga.Helper.mergeJSON(Yekonga.Config,o);const n=JSON.stringify(Yekonga.Config,null,4);Yekonga.Helper.writeFile("config.json",n,!0)};let logo=serverLibrary.fs.readFileSync(serverLibrary.path.join(__dirname,"assets/logo-sm.text"),{encoding:"utf8"});Yekonga.Helper.printLog(null,logo,"yellow"),module.exports=()=>{console.info("Setup is ready")};
//# sourceMappingURL=/sm/25f3f2904dc1588b9cdd7e1db6f61291598a9981171020c51bbfb64564631aed.map