2022-08-04 16:49:25 +00:00
|
|
|
{"version":3,"sources":["auth.js"],"names":["const","lsKeys","token","page","localStorage","user","pass","cloudflareErrors","loaderSection","document","querySelector","classList","add","loginSection","remove","floatingBtn","error","statusText","response","status","description","data","swal","dest","trigger","value","trim","axios","post","username","password","then","success","window","location","catch","onAxiosError","unhide","code","removeItem","addEventListener","form","event","preventDefault","loginBtn","checkValidity","do","currentTarget","registerBtn","click","verify"],"mappings":"AAEAA,IAAMC,OAAS,CACbC,MAAO,SAGHC,KAAO,CAEXD,MAAOE,aAAaH,OAAOC,OAG3BG,KAAM,KACNC,KAAM,KAGNC,iBAAkB,CAChB,IAAK,gBACL,IAAK,qBACL,IAAK,uBACL,IAAK,wBACL,IAAK,qBACL,IAAK,uBACL,IAAK,0BACL,IAAK,gBACL,IAAK,oBAITJ,OAAW,WACTH,IAAMQ,EAAgBC,SAASC,cAAc,WACzCF,GAAeA,EAAcG,UAAUC,IAAI,aAE/CZ,IAAMa,EAAeJ,SAASC,cAAc,oBACxCG,GAAcA,EAAaF,UAAUG,OAAO,aAEhDd,IAAMe,EAAcN,SAASC,cAAc,mCACvCK,GAAaA,EAAYJ,UAAUG,OAAO,YAChD,EAGAX,aAAiB,SAAGa,GAClBhB,IAAMiB,EAAad,KAAKI,iBAAiBS,EAAME,SAASC,SAAWH,EAAME,SAASD,WAC5EG,EAAcJ,EAAME,SAASG,MAAQL,EAAME,SAASG,KAAKD,YAC3DJ,EAAME,SAASG,KAAKD,YACpB,uFAEJ,OAAOE,KAAQN,EAAME,SAAS,OAAM,IAAID,EAAcG,EAAa,QACrE,EAEAjB,GAAO,SAAIoB,EAAMC,GACfxB,IAAMK,EAAOF,KAAKE,KAAKoB,MAAMC,OAC7B,IAAKrB,EAAM,OAAOiB,KAAK,qBAAsB,kCAAmC,SAEhFtB,IAAMM,EAAOH,KAAKG,KAAKmB,MAAMC,OAC7B,IAAKpB,EAAM,OAAOgB,KAAK,qBAAsB,kCAAmC,SAEhFE,EAAQb,UA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K,cAC5B,IAGE5C,KAAKD,MAAOC,KAAK+C,SAChB/C,KAAKkC,QACZ","file":"auth.js","sourcesContent":["/* global swal, axios */\n\nconst lsKeys = {\n token: 'token'\n}\n\nconst page = {\n // user token\n token: localStorage[lsKeys.token],\n\n // HTML elements\n user: null,\n pass: null,\n\n // Better Cloudflare errors\n cloudflareErrors: {\n 520: 'Unknown Error',\n 521: 'Web Server Is Down',\n 522: 'Connection Timed Out',\n 523: 'Origin Is Unreachable',\n 524: 'A Timeout Occurred',\n 525: 'SSL Handshake Failed',\n 526: 'Invalid SSL Certificate',\n 527: 'Railgun Error',\n 530: 'Origin DNS Error'\n }\n}\n\npage.unhide = () => {\n const loaderSection = document.querySelector('#loader')\n if (loaderSection) loaderSection.classList.add('is-hidden')\n\n const loginSection = document.querySelector('#login.is-hidden')\n if (loginSection) loginSection.classList.remove('is-hidden')\n\n const floatingBtn = document.querySelector('.floating-home-button.is-hidden')\n if (floatingBtn) floatingBtn.classList.remove('is-hidden')\n}\n\n// Handler for Axios errors\npage.onAxiosError = error => {\n const statusText = page.cloudflareErrors[error.response.status] || error.response.statusText\n const description = error.response.data && error.response.data.description\n ? error.response.data.description\n : 'There was an error with the request.\\nPlease check the console for more information.'\n\n return swal(`${error.response.status} ${statusText}`, description, 'error')\n}\n\npage.do = (dest, trigger) => {\n const user = page.user.value.trim()\n if (!user)
|