varlsKeys={token:"token",chunkSize:"chunkSize",parallelUploads:"parallelUploads",uploadsHistoryOrder:"uploadsHistoryOrder",previewImages:"previewImages",fileLength:"fileLength",uploadAge:"uploadAge",stripTags:"stripTags"},page={token:localStorage[lsKeys.token],apiChecked:!1,private:null,enableUserAccounts:null,maxSize:null,chunkSizeConfig:null,temporaryUploadAges:null,defaultTemporaryUploadAge:null,fileIdentifierLength:null,stripTagsConfig:null,album:null,parallelUploads:null,previewImages:null,fileLength:null,uploadAge:null,stripTags:null,maxSizeBytes:null,urlMaxSize:null,urlMaxSizeBytes:null,chunkSize:null,tabs:[],activeTab:null,albumSelect:null,albumSelectOnChange:null,previewTemplate:null,dropzone:null,clipboardJS:null,lazyLoad:null,urlsQueue:[],activeUrlsQueue:0,imageExts:[".gif",".jpeg",".jpg",".png",".svg",".tif",".tiff",".webp",".bmp"],videoExts:[".avi",".m2ts",".m4v",".mkv",".mov",".mp4",".webm",".wmv"],albumTitleMaxLength:70,albumDescMaxLength:4e3,cloudflareErrors:{520:"Unknown Error",521:"Web Server Is Down",522:"Connection Timed Out",523:"Origin Is Unreachable",524:"A Timeout Occurred",525:"SSL Handshake Failed",526:"Invalid SSL Certificate",527:"Railgun Error",530:"Origin DNS Error"},onInitError:function(e){document.querySelector("#albumDiv").classList.add("is-hidden"),document.querySelector("#tabs").classList.add("is-hidden"),document.querySelectorAll(".tab-content").forEach((function(e){returne.classList.add("is-hidden")}));vara=document.querySelector("#loginToUpload");a.innerText="An error occurred. Try to reload?",a.classList.remove("is-loading"),a.classList.remove("is-hidden"),a.addEventListener("click",(function(){window.location.reload()})),e&&(e.response?page.onAxiosError(e):page.onError(e))},onError:function(e){console.error(e);vara=document.createElement("div");returna.innerHTML="\n <p><code>"+e.toString()+"</code></p>\n <p>Please check your console for more information.</p>\n ",swal({title:"An error occurred!",icon:"error",content:a})},onAxiosError:function(e){if(!e.response)returnpage.onError(e);vara=page.cloudflareErrors[e.response.status]||e.response.statusText,t=e.response.data&&e.response.data.description?e.response.data.description:"There was an error with the request.\nPlease check the console for more information.";returnswal(e.response.status+" "+a,t,"error")},formatAxiosError:function(e){vara=page.cloudflareErrors[e.response.status]||e.response.statusText;returne.response.data&&e.response.data.description?e.response:{data:{success:!1,description:e.response?e.response.status+" "+a:e.toString()}}},checkClientVersion:function(e){vara=document.querySelector("#mainScript").src.match(/\?_=(\d+)$/);if(a&&a[1]&&a[1]!==e)returnswal({title:"Update detected!",text:"Client assets have been updated. Reload to display the latest version?",icon:"info",buttons:{confirm:{text:"Reload",closeModal:!1}}}).then((function(){window.location.reload()}))},checkIfPublic:function(){returnaxios.get("api/check",{onDownloadProgress:function(){"undefined"==typeofrender||render.done||render.do(),"undefined"==typeofnewsfeed||newsfeed.done||newsfeed.do(),page.apiChecked||(page.apiChecked=!0)}}).then((function(e){returne.data.version&&page.checkClientVersion(e.data.version),page.private=e.data.private,page.enableUserAccounts=e.data.enableUserAccounts,page.maxSize=parseInt(e.data.maxSize),page.maxSizeBytes=1e6*page.maxSize,document.querySelector("#maxSize > span").innerHTML=page.getPrettyBytes(page.maxSizeBytes),page.chunkSizeConfig={max:e.data.chunkSize&&parseInt(e.data.chunkSize.max)||95,default:e.data.chunkSize&&parseInt(e.data.chunkSize.default)},page.temporaryUploadAges=e.data.temporaryUploadAges,page.defaultTemporaryUploadAge=e.data.defaultTemporaryUploadAge||null,page.fileIdentifierLength=e.data.fileIdentifierLength,page.stripTagsConfig=e.data.stripTags,page.preparePage()})).catch(page.onInitError)},preparePage:function(){if(page.token)returnpage.verifyToken(page.token);if(!page.private)returnpage.prepareUpload();vare=document.querySelector("#loginToUpload");e.href="auth",e.classList.remov