`);t.append(e),n.error&&e.querySelectorAll("a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),d.err("ContentManager",`Error details for ${n.name?n.name:n.file}.`,n.error)}))}return t}const i=[a(e),a(t)];o.querySelectorAll(".tab-bar-item").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();const t=o.querySelector(".tab-bar-item.selected");t&&c.removeClass(t,"selected"),c.addClass(e.target,"selected");const n=o.querySelector(".scroller");n.innerHTML="",n.append(i[c.index(e.target)])})),o.querySelector(".footer button").addEventListener("click",()=>{c.addClass(o,"closing"),setTimeout(()=>{o.remove()},300)}),o.querySelector(".bd-backdrop").addEventListener("click",()=>{c.addClass(o,"closing"),setTimeout(()=>{o.remove()},300)}),c.query("#app-mount").append(o),e.length?o.querySelector(".tab-bar-item").click():o.querySelectorAll(".tab-bar-item")[1].click()}static showChangelogModal(e={}){const t=l.findByProps("push","update","pop","popWithKey"),n=l.findByProps("fixed","improved"),s=l.findByDisplayName("Text"),r=l.findByProps("Child"),o=l.findByProps("Tags","default"),a=l.find(e=>e.defaultProps&&0==e.defaultProps.selectable),i=l.findByProps("defaultRules","parse");if(!(a&&t&&n&&s&&r&&o&&i))return;const{image:c="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:d="",changes:u=[],title:h="BandagedBD",subtitle:p=`v${ce}`,footer:m}=e,g=oe.React.createElement,f=[g("img",{src:c})];d&&f.push(g("p",null,i.parse(d)));for(let e=0;eg("li",null,i.parse(e))));f.push(o)}const b=function(){return g(r.Child,{grow:1,shrink:1},g(o.default,{tag:o.Tags.H4},h),g(s,{size:s.Sizes.SMALL,color:s.Colors.STANDARD,className:n.date},p))},y=()=>{const e=l.find(e=>"Anchor"==e.displayName),n=l.findByProps("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},o=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),oe.joinBD2()},a=e?g(e,{onClick:o},"Join our Discord Server."):g("a",{className:`${n.anchor} ${n.anchorUnderlineOnHover}`,onClick:o},"Join our Discord Server."),i=g(s,{size:s.Sizes.SMALL,color:s.Colors.STANDARD},"Need support? ",a);return g(r.Child,{grow:1,shrink:1},m||i)};return t.push((function(e){return g(a,Object.assign({className:n.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:b,renderFooter:y,children:f},e))}))}static showConfirmationModal(e,t,n={}){const s=l.findByProps("push","update","pop","popWithKey"),r=l.findByDisplayName("Markdown"),o=l.find(e=>e.defaultProps&&e.key&&"confirm-modal"==e.key());if(!s||!o||!r)return d.alert(e,t);const a=()=>{},{onConfirm:i=a,onCancel:c=a,confirmText:u="Okay",cancelText:h="Cancel",danger:p=!1,key:m}=n;return Array.isArray(t)||(t=[t]),t=t.map(e=>"string"==typeof e?oe.React.createElement(r,null,e):e),s.push(o,{header:e,children:t,red:p,confirmText:u,cancelText:h,onConfirm:i,onCancel:c},m)}static removeDa(e){return e?e.split(" ").filter(e=>!e.startsWith("da-")).join(" "):e}}d.showToast=d.suppressErrors(d.showToast,"Could not show toast."),window.Lightcord.BetterDiscord.Utils=d;const u=window.require,h=n(2),p=n(1),m=DiscordNative.globals?DiscordNative.globals.releaseChannel:DiscordNative.app?DiscordNative.app.getReleaseChannel():"stable";var g=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={},window.Lightcord.BetterDiscord.DataStore=this}initialize(){try{h.existsSync(this.BDFile)||h.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4),"binary");const e=JSON.parse(h.readFileSync(this.BDFile,"binary"));if(e.hasOwnProperty("settings")&&(this.data=e),!h.existsSync(this.settingsFile))return;let t=u(this.settingsFile);h.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[m]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}catch(e){console.error(e),d.alert("Corrupt Storage","The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.")}}get injectionPath(){return this._injectionPath=null}get configFile(){return this._configFile||(this._configFile=p.resolve(this.injectionPath,"betterdiscord","config.json"))}get BDFile(){return this._BDFile||(this._BDFile=p.resolve(ve.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=p.resolve(ve.dataPath,"bdsettings.json"))}getPluginFile(e){return p.resolve(ne.pluginsFolder,e+".config.json")}getSettingGroup(e){return this.data.settings[m][e]||null}setSettingGroup(e,t){this.data.settings[m][e]=t,h.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4),"binary")}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,h.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4),"binary")}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]:h.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(h.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]):void 0}setPluginData(e,t,n){void 0!==n&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=n,h.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4),"binary"))}deletePluginData(e,t){void 0===this.pluginData[e]&&(this.pluginData[e]={}),delete this.pluginData[e][t],h.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4),"binary")}};const f=n(5);var b=new class extends f{constructor(){super(),window.Lightcord.BetterDiscord.BDEvents=this}dispatch(e,...t){this.emit(e,...t)}off(e,t){this.removeListener(e,t)}};class y{constructor(){window.Lightcord.BetterDiscord.PluginModule=this}get folder(){return ne.pluginsFolder}}y.prototype.loadPlugins=async function(){this.loadPluginData(),be.splice(0,0,...await ne.loadPlugins());const e=Object.keys(Ee);for(let t=0;tsetTimeout(e,10))}this.savePluginData(),n(0).remote.getCurrentWebContents().on("did-navigate-in-page",this.channelSwitch.bind(this))},y.prototype.startPlugin=function(e,t=!1){try{Ee[e].plugin.start(),me["fork-ps-2"]&&!t&&d.showToast(`${Ee[e].plugin.getName()} v${Ee[e].plugin.getVersion()} has started.`)}catch(n){me["fork-ps-2"]&&!t&&d.showToast(`${Ee[e].plugin.getName()} v${Ee[e].plugin.getVersion()} could not be started.`,{type:"error"}),Ce[e]=!1,this.savePluginData(),d.err("Plugins",e+" could not be started.",n)}},y.prototype.stopPlugin=function(e,t=!1){try{Ee[e].plugin.stop(),me["fork-ps-2"]&&!t&&d.showToast(`${Ee[e].plugin.getName()} v${Ee[e].plugin.getVersion()} has stopped.`)}catch(n){me["fork-ps-2"]&&!t&&d.showToast(`${Ee[e].plugin.getName()} v${Ee[e].plugin.getVersion()} could not be stopped.`,{type:"error"}),d.err("Plugins",Ee[e].plugin.getName()+" could not be stopped.",n)}},y.prototype.enablePlugin=function(e,t=!1){Ce[e]||(Ce[e]=!0,this.savePluginData(),this.startPlugin(e,t))},y.prototype.enable=function(e,t=!1){return this.enablePlugin(e,t)},y.prototype.disablePlugin=function(e,t=!1){Ce[e]&&(Ce[e]=!1,this.savePluginData(),this.stopPlugin(e,t))},y.prototype.disable=function(e,t=!1){return this.disablePlugin(e,t)},y.prototype.togglePlugin=function(e){Ce[e]?this.disablePlugin(e):this.enablePlugin(e)},y.prototype.toggle=function(e,t=!1){return this.togglePlugin(e,t)},y.prototype.loadPlugin=async function(e){const t=await ne.loadContent(e,"plugin");if(t)return me["fork-ps-1"]&&d.showContentErrors({plugins:[t]}),me["fork-ps-2"]&&d.showToast(`${e} could not be loaded.`,{type:"error"}),d.err("ContentManager",`${e} could not be loaded.`,t);const n=Object.values(Ee).find(t=>console.log(t.filename,e)||t.filename==e).plugin;try{n.load&&"function"==typeof n.load&&n.load()}catch(e){me["fork-ps-1"]&&d.showContentErrors({plugins:[e]})}d.log("ContentManager",`${n.getName()} v${n.getVersion()} was loaded.`),me["fork-ps-2"]&&d.showToast(`${n.getName()} v${n.getVersion()} was loaded.`,{type:"success"}),b.dispatch("plugin-loaded",n.getName())},y.prototype.unloadPlugin=function(e){const t=Object.values(Ee).find(t=>t.filename==e)||Ee[e];if(!t)return;const n=t.plugin.getName();Ce[n]&&this.disablePlugin(n,!0);const s=ne.unloadContent(Ee[n].filename,"plugin");if(delete Ee[n],s)return me["fork-ps-1"]&&d.showContentErrors({plugins:[s]}),me["fork-ps-2"]&&d.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),d.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);d.log("ContentManager",`${n} was unloaded.`),me["fork-ps-2"]&&d.showToast(`${n} was unloaded.`,{type:"success"}),b.dispatch("plugin-unloaded",n)},y.prototype.delete=function(e){const t=Object.values(Ee).find(t=>t.filename==e)||Ee[e];if(!t)return;this.unloadPlugin(t.filename);const s=n(1).resolve(ne.pluginsFolder,t.filename);n(2).unlinkSync(s)},y.prototype.reloadPlugin=async function(e){const t=Object.values(Ee).find(t=>t.filename==e)||Ee[e];if(!t)return this.loadPlugin(e);const n=t.plugin.getName(),s=Ce[n];s&&this.stopPlugin(n,!0);const r=await ne.reloadContent(Ee[n].filename,"plugin");if(r)return me["fork-ps-1"]&&d.showContentErrors({plugins:[r]}),me["fork-ps-2"]&&d.showToast(`${n} could not be reloaded.`,{type:"error"}),d.err("ContentManager",`${n} could not be reloaded.`,r);Ee[n].plugin.load&&"function"==typeof Ee[n].plugin.load&&Ee[n].plugin.load(),s&&this.startPlugin(n,!0),d.log("ContentManager",`${n} v${Ee[n].plugin.getVersion()} was reloaded.`),me["fork-ps-2"]&&d.showToast(`${n} v${Ee[n].plugin.getVersion()} was reloaded.`,{type:"success"}),b.dispatch("plugin-reloaded",n)},y.prototype.reload=function(e){return this.reloadPlugin(e)},y.prototype.edit=function(e){console.log("Edit "+e);const t=Object.values(Ee).find(t=>t.filename==e)||Ee[e];if(!t)return;const s=n(1).resolve(ne.pluginsFolder,t.filename);console.log("Edit "+s),n(0).shell.openItem(`${s}`)},y.prototype.updatePluginList=function(){const e=ne.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},y.prototype.loadPluginData=function(){const e=g.getSettingGroup("plugins");e&&Object.assign(Ce,e)},y.prototype.savePluginData=function(){g.setSettingGroup("plugins",Ce)},y.prototype.newMessage=function(){const e=Object.keys(Ee);for(let t=0;t{if(this.disabled)return;this.show();const e=new MutationObserver(t=>{t.forEach(t=>{const n=Array.from(t.removedNodes),s=n.indexOf(this.node)>-1,r=n.some(e=>e.contains(this.node));(s||r)&&(this.hide(),e.disconnect())})});e.observe(document.body,{subtree:!0,childList:!0})}),this.node.addEventListener("mouseleave",()=>{this.hide()})}get container(){return document.querySelector("."+BDModules.get(e=>e.popouts)[0].popouts.split(" ")[0]+" ~ ."+BDModules.get(e=>e.layerContainer)[0].layerContainer.split(" ")[0])}get canShowAbove(){return this.node.getBoundingClientRect().top-this.element.offsetHeight>=0}get canShowBelow(){return this.node.getBoundingClientRect().top+this.node.offsetHeight+this.element.offsetHeight<=d.screenHeight}get canShowLeft(){return this.node.getBoundingClientRect().left-this.element.offsetWidth>=0}get canShowRight(){return this.node.getBoundingClientRect().left+this.node.offsetWidth+this.element.offsetWidth<=d.screenWidth}hide(){this.element.remove(),this.tooltipElement.className=this._className}show(){this.tooltipElement.className=`${D().tooltip} ${M(this.style)}`,this.labelElement.textContent=this.label,this.container.append(this.element),"top"==this.side&&(this.canShowAbove||!this.canShowAbove&&this.preventFlip?this.showAbove():this.showBelow()),"bottom"==this.side&&(this.canShowBelow||!this.canShowBelow&&this.preventFlip?this.showBelow():this.showAbove()),"left"==this.side&&(this.canShowLeft||!this.canShowLeft&&this.preventFlip?this.showLeft():this.showRight()),"right"==this.side&&(this.canShowRight||!this.canShowRight&&this.preventFlip?this.showRight():this.showLeft())}showAbove(){this.tooltipElement.classList.add(M("top")),this.element.style.setProperty("top",N(this.node.getBoundingClientRect().top-this.element.offsetHeight-10)),this.centerHorizontally()}showBelow(){this.tooltipElement.classList.add(M("bottom")),this.element.style.setProperty("top",N(this.node.getBoundingClientRect().top+this.node.offsetHeight+10)),this.centerHorizontally()}showLeft(){this.tooltipElement.classList.add(M("left")),this.element.style.setProperty("left",N(this.node.getBoundingClientRect().left-this.element.offsetWidth-10)),this.centerVertically()}showRight(){this.tooltipElement.classList.add(M("right")),this.element.style.setProperty("left",N(this.node.getBoundingClientRect().left+this.node.offsetWidth+10)),this.centerVertically()}centerHorizontally(){const e=this.node.getBoundingClientRect().left+this.node.offsetWidth/2;this.element.style.setProperty("left",N(e-this.element.offsetWidth/2))}centerVertically(){const e=this.node.getBoundingClientRect().top+this.node.offsetHeight/2;this.element.style.setProperty("top",N(e-this.element.offsetHeight/2))}}var L=class extends React.Component{constructor(e){super(e)}async componentDidMount(){const{style:e="black",side:t="top",text:n=""}=this.props;this.node=oe.reactDom.findDOMNode(this),this.tooltip=new P(this.node,n,{style:e,side:t})}componentWillUnmount(){this.tooltip.hide(),delete this.tooltip}render(){return this.props.children}},A=n(2),$=n(1);const T={},R={};var j=new class{constructor(){window.Lightcord.BetterDiscord.PluginCertifier=this}patch(e,t){process.nextTick(()=>{!function(e,t){if(!document.getElementById(t))return;if(!e.url.startsWith("https://cdn.discordapp.com/"))return document.getElementById(t).remove();if(!e.filename.endsWith(".plugin.js")&&!e.filename.endsWith(".theme.css"))return document.getElementById(t).remove();C()(e.url,{headers:{"User-Agent":r.remote.getCurrentWebContents().userAgent}}).then(n=>{if(200!==n.status)throw new Error("File doesn't exist.");const s=w.createHash("sha256");let o=Buffer.alloc(0);n.body.on("data",e=>{o=Buffer.concat([o,e]),s.update(e)}),n.body.on("end",()=>{const n=s.digest("hex");R[e.url]=n,O[n]=e.url,I(n,o,e.filename,n=>{!function(e,t,n){const s=document.getElementById(e);if(!s||s.childNodes.length>0)return;F||(F=BDModules.get(e=>e.flowerStarContainer)[0]);z||(z=BDModules.get(e=>e.childContainer)[0]);if(t.suspect){try{s.parentNode.style.borderColor="rgb(240, 71, 71)";let e=s=>{for(let o of s.children)"A"===o.tagName?o.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation(),d.showConfirmationModal("Are you sure you want to download this ?","The "+t.type.toLowerCase()+" **"+n+"** might be dangerous **("+t.harm+")**. \n\n**We don't recommand to download it**. However, you can still do it below.",{confirmText:"Download Anyway",cancelText:"Don't !",danger:!0,onCancel:()=>{},onConfirm:()=>{r.remote.shell.openExternal(o.href)}})}):["div"].includes(o.tagName.toLowerCase())&&e(o)};e(s.parentNode)}catch(e){console.error(e)}oe.reactDom.render(oe.react.createElement(L,{text:t.type+" "+t.name+" is potentially dangerous."},oe.react.createElement("div",{className:F.flowerStarContainer,style:{width:"20px",height:"20px"}},oe.react.createElement("svg",{className:BDModules.get(e=>e.svg)[0].svg,"aria-hidden":"false",width:"20px",height:"20px",viewBox:"0 0 40 32"},oe.react.createElement("rect",{x:"0",y:"0",width:"32",height:"32",mask:"url(#svg-mask-avatar-status-round-32)",fill:"#f04747",mask:"url(#svg-mask-status-dnd)",className:BDModules.get(e=>e.pointerEvents)[0].pointerEvents})))),s)}else if(t.official){s.parentNode.style.borderColor="#4087ed";let e=oe.react.createElement("span",{style:{display:"inherit"}},[oe.react.createElement(L,{text:t.type+" "+t.name+" was made by the developers of Lightcord.",style:"brand"},oe.react.createElement("div",{className:F.flowerStarContainer,style:{width:"20px",height:"20px",float:"left"}},oe.react.createElement("svg",{className:F.flowerStar,"aria-hidden":"false",width:"20px",height:"20px",viewBox:"0 0 16 15.2",stroke:"#36393f",style:{color:"#4087ed"}},oe.react.createElement("path",{fill:"currentColor","fill-rule":"evenodd",d:"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z"})),oe.react.createElement("div",{className:z.childContainer},oe.react.createElement("svg",{"aria-hidden":"false",width:"20px",height:"20px",viewBox:"0 0 16 15.2"},oe.react.createElement("path",{fill:"#ffffff",d:"M10.7,5.28a2.9,2.9,0,0,0-2.11.86.11.11,0,0,0,0,.16l1.05.94a.11.11,0,0,0,.15,0,1.27,1.27,0,0,1,.9-.33c.65,0,.65.73.65.73a.64.64,0,0,1-.65.65,1.73,1.73,0,0,1-1.18-.54c-.31-.26-.36-.32-.73-.66S7.06,5.28,5.65,5.28A2.26,2.26,0,0,0,3.37,7.56,2.59,2.59,0,0,0,3.82,9a2.18,2.18,0,0,0,1.83.89,2.94,2.94,0,0,0,2.1-.81.11.11,0,0,0,0-.16L6.74,8A.11.11,0,0,0,6.6,8a1.58,1.58,0,0,1-.94.29h0A.71.71,0,0,1,5,7.56H5a.63.63,0,0,1,.65-.64c.71,0,1.42.75,1.94,1.27.75.76,1.66,1.79,3.11,1.74A2.28,2.28,0,0,0,13,7.64a2.59,2.59,0,0,0-.45-1.47A2.14,2.14,0,0,0,10.7,5.28Z"}))))),oe.react.createElement(L,{text:"Install this "+t.type.toLowerCase()+" on Lightcord."},oe.react.createElement("div",{className:F.flowerStarContainer,style:{width:"20px",height:"20px"},onClick(){d.showConfirmationModal("Are you sure you want to download this "+t.type.toLowerCase()+" ?","Lightcord will automatically download and load this "+t.type.toLowerCase()+". You must enable it in the settings.",{confirmText:"Download and Install",cancelText:"I've changed my mind",danger:!1,onCancel:()=>{},onConfirm:()=>{let e=H(R).find(e=>e[1]===t.hash)[0];C()(e).then(async e=>{if(200!==e.status)throw new Error("Status was not 200");let n=await e.buffer(),s=Object($.join)("Plugin"===t.type?ne._pluginsFolder:ne._themesFolder,t.filename);Object(A.writeFileSync)(s,n),d.showToast(t.type+" succesfully installed.")}).catch(e=>{e=e instanceof Error?e:new Error(e),d.showToast(e.message,{type:"error"})})}})}},oe.react.createElement("svg",{className:F.flowerStar,"aria-hidden":"false",width:"20px",height:"20px",viewBox:"0 0 24 24",style:{color:"rgb(67, 181, 129)",cursor:"pointer"}},React.createElement("g",{fill:"none","fill-rule":"evenodd"},React.createElement("path",{d:"M0 0h24v24H0z"}),React.createElement("path",{class:"fill",fill:"currentColor",d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))))]);oe.reactDom.render(e,s)}else{s.parentNode.style.borderColor="#4087ed";let e=oe.react.createElement("span",{style:{display:"inherit"}},[oe.react.createElement(L,{text:t.type+" "+t.name+" is certified by Lightcord."},oe.react.createElement("div",{className:F.flowerStarContainer,style:{width:"20px",height:"20px",float:"left"}},oe.react.createElement("svg",{className:F.flowerStar,"aria-hidden":"false",width:"20px",height:"20px",viewBox:"0 0 16 15.2"},oe.react.createElement("path",{fill:"#4f545c","fill-rule":"evenodd",d:"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z"})),oe.react.createElement("div",{className:z.childContainer},oe.react.createElement("svg",{"aria-hidden":"false",width:"20px",height:"20px",viewBox:"0 0 16 15.2"},oe.react.createElement("path",{fill:"#ffffff",d:"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z"}))))),oe.react.createElement(L,{text:"Install this "+t.type.toLowerCase()+" on Lightcord."},oe.react.createElement("div",{className:F.flowerStarContainer,style:{width:"20px",height:"20px"},onClick(){d.showConfirmationModal("Are you sure you want to download this "+t.type.toLowerCase()+" ?","Lightcord will automatically install and launch this "+t.type.toLowerCase()+". You don't have anything to do.",{confirmText:"Download and Install",cancelText:"I've changed my mind",danger:!1,onCancel:()=>{},onConfirm:()=>{let e=H(R).find(e=>e[1]===t.hash)[0];console.log(e),C()(e).then(async e=>{if(200!==e.status)throw new Error("Status was not 200");let n=await e.buffer(),s=Object($.join)("Plugin"===t.type?ne._pluginsFolder:ne._themesFolder,t.filename);console.log(s),Object(A.writeFileSync)(s,n),d.showToast(t.type+" succesfully installed.")}).catch(e=>{e=e instanceof Error?e:new Error(e),d.showToast(e.message,{type:"error"})})}})}},oe.react.createElement("svg",{className:F.flowerStar,"aria-hidden":"false",width:"20px",height:"20px",viewBox:"0 0 24 24",style:{color:"rgb(67, 181, 129)",cursor:"pointer"}},React.createElement("g",{fill:"none","fill-rule":"evenodd"},React.createElement("path",{d:"M0 0h24v24H0z"}),React.createElement("path",{class:"fill",fill:"currentColor",d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))))]);oe.reactDom.render(e,s)}}(t,n,e.filename)},()=>{let e=document.getElementById(t);e&&e.remove()})})}).catch(()=>{})}(e,t)})}start(){}isTrusted(e){return T[e]&&!T[e].suspect}};const O={};function I(e,t,n,s,o){if(console.log(`File: ${n} hash: ${e}`),T[e]){const t=T[e];s(t)}else C()("https://cdn.jsdelivr.net/gh/Lightcord/filehashes@master/hashes/"+e,{headers:{"User-Agent":r.remote.getCurrentWebContents().userAgent}}).then(async r=>{if(200!==r.status)return n.endsWith(".theme.css")?o(e):void function(e,t,n,s,r){t=t.toString("utf8");let o=!1;for(let e of t.split(/[^\w\d]+/g)){for(let t of["token","email","phone","MFA","2fa","process","child_process","localStorage","eval","getGlobal","BrowserWindow"])if(e.toLowerCase().includes(t.toLowerCase())&&!e.toLowerCase().includes("DOMTokenList")){console.log(t,e),o="token stealer/virus";break}if(o)break}if(!o){const e=t.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,"").trim();if(/var [\w\d_$]+=\["/gi.test(e)&&(o="obfuscation/hidden code"),!o){const t=[/_0x\w{4}\('0x[\dabcdef]+'\)/g,/_0x\w{4}\('0x[\dabcdef]+'[, ]+'[^']{4}'\)/g,/\w+\('0x[\dabcdef]+'\)/g,/\w+\('0x[\dabcdef]+'[, ]+'[^']{4}'\)/g];for(let n of t){if(o)break;o=!!n.test(e)&&"obfuscation/hidden code"}}}if(!o)return s(e);T[e]={suspect:!0,name:O[e].split("/").pop(),type:O[e].endsWith(".js")?"Plugin":"Theme",harm:o,hash:e,filename:r},console.log(`Found potentially dangerous ${T[e].type.toLowerCase()}: ${T[e].name}`),n(T[e])}(e,t,s,o,n);const a=await r.json();a.hash=e,a.filename=n,T[e]=a,s(a)}).catch(console.error)}function _(e,t,n=(e=>{}),s=!1){const r=w.createHash("sha256");let o=Buffer.alloc(0);Object(A.createReadStream)(e).on("data",e=>{o=Buffer.concat([o,e]),r.update(e)}).on("end",()=>{const a=r.digest("hex");if(O[a]=e,s&&te[a]){let e=te[a];if(!(e.timestampe.flowerStarContainer)[0],z=BDModules.get(e=>e.childContainer)[0];function H(e){let t=[];return Object.keys(e).forEach(n=>{t.push([n,e[n]])}),t}let W=null,U=null;function q(){W=[w.randomBytes(16).toString("base64"),w.randomBytes(32).toString("base64")]}function G(e){let t=[Buffer.from(W[1],"base64"),Buffer.from(W[0],"base64")],n=w.createCipheriv("aes-256-cbc",...t),s=n.update(Buffer.from(e,"utf8"));return s=Buffer.concat([s,n.final()]),s.toString("base64")}window.Lightcord.Api.ensureExported(e=>e.ObjectStorage).then(e=>{let t=e.impl;U=function(){t.set("PluginCertifierKeyEncryption__",btoa(JSON.stringify(W)))},setInterval(()=>{U()},1e5);try{let e=function(e){try{return JSON.parse(e)}catch(e){return e instanceof Error?new Error(e):e}}(atob(t.get("PluginCertifierKeyEncryption__")));if(e instanceof Error||!Array.isArray(e)||2!==e.length||e.find(e=>"string"!=typeof e)||16!==Buffer.from(e[0],"base64").length||32!==Buffer.from(e[1],"base64").length)return q(),void U();W=e}catch(e){q(),U()}});n(5);const V=n(1),J=n(2),Z=n(6).Module;Z.globalPaths.push(V.resolve(n(0).remote.app.getAppPath(),"node_modules"));class Y extends Error{constructor(e){super(e),this.name="MetaError"}}const K=Z._extensions[".js"],X=Z._extensions[".css"]?Z._extensions[".css"]:()=>null,Q=/[^\S\r\n]*?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,ee=/^\\@/;let te={};var ne=new class{constructor(){this.timeCache={},this.watchers={},Z._extensions[".js"]=this.getContentRequire("plugin"),Z._extensions[".css"]=this.getContentRequire("theme")}get pluginsFolder(){return this._pluginsFolder||(this._pluginsFolder=J.realpathSync(V.resolve(ve.dataPath+"plugins/")))}get themesFolder(){return this._themesFolder||(this._themesFolder=J.realpathSync(V.resolve(ve.dataPath+"themes/")))}loadAddonCertifierCache(){if("string"!=typeof g.getSettingGroup("PluginCertifierHashes"))g.setSettingGroup("PluginCertifierHashes",G("{}"));else try{te=JSON.parse(function(e){try{let t=w.createDecipheriv("aes-256-cbc",Buffer.from(W[1],"base64"),Buffer.from(W[0],"base64")),n=t.update(Buffer.from(e,"base64"));return n=Buffer.concat([n,t.final()]),n.toString("utf8")}catch(e){return"{}"}}(g.getSettingGroup("PluginCertifierHashes")))}catch(e){g.setSettingGroup("PluginCertifierHashes",G("{}")),te={}}Object.keys(te).forEach(e=>{let t=te[e];if(!t||"object"!=typeof t||Array.isArray(t))return delete te[e];let n=[{key:"timestamp",type:"number"},{key:"result",type:"object"},{key:"hash",type:"string"}];for(let s of n)if(!(s.key in t)||typeof t[s.key]!==s.type)return void delete te[e];t.hash===e?t.result.suspect&&delete te[e]:delete te[e]}),this.saveAddonCache()}saveAddonCache(){g.setSettingGroup("PluginCertifierHashes",G(JSON.stringify(te)))}watchContent(e){if(this.watchers[e])return;const t="plugin"===e,n=t?this.pluginsFolder:this.themesFolder,s=t?".plugin.js":".theme.css";this.watchers[e]=J.watch(n,{persistent:!1},async(e,r)=>{if(!e||!r||!r.endsWith(s))return;await new Promise(e=>setTimeout(e,50));try{J.statSync(V.resolve(n,r))}catch(e){if("ENOENT"!==e.code)return;return delete this.timeCache[r],t?v.unloadPlugin(r):re.unloadTheme(r)}if(!J.statSync(V.resolve(n,r)).isFile())return;const o=J.statSync(V.resolve(n,r));o&&o.mtime&&o.mtime.getTime()&&"number"==typeof o.mtime.getTime()&&this.timeCache[r]!=o.mtime.getTime()&&(this.timeCache[r]=o.mtime.getTime(),"rename"==e&&(t?await v.loadPlugin(r):await re.loadTheme(r)),"change"==e&&(t?await v.reloadPlugin(r):await re.reloadTheme(r)))})}unwatchContent(e){this.watchers[e]&&(this.watchers[e].close(),delete this.watchers[e])}extractMeta(e){const t=e.split("\n")[0];if(t.includes("//META"))return this.parseOldMeta(e);if(t.includes("/**"))return this.parseNewMeta(e);throw new Y("META was not found.")}parseOldMeta(e){const t=e.split("\n")[0],n=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//"));if(t.indexOf("META")<0)throw new Y("META was not found.");const s=d.testJSON(n);if(!s)throw new Y("META could not be parsed.");if(!s.name)throw new Y("META missing name data.");return s.format="json",s}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],n={};let s="",r="";for(const e of t.split(Q))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){n[s]=r;const t=e.indexOf(" ");s=e.substr(1,t-1),r=e.substr(t+1)}else r+=" "+e.replace("\\n","\n").replace(ee,"@");return n[s]=r.trim(),delete n[""],n.format="jsdoc",n}getContentRequire(e){const t="plugin"===e,n=this,s=t?K:X;return function(e,r){const o=t?n.pluginsFolder:n.themesFolder,a=V.resolve(o,V.basename(r));if(!J.existsSync(a)||r!==J.realpathSync(a))return Reflect.apply(s,this,arguments);let i=J.readFileSync(r,"utf8");i=d.stripBOM(i);const l=J.statSync(r),c=n.extractMeta(i);if(c.filename=V.basename(r),c.added=l.atimeMs,c.modified=l.mtimeMs,c.size=l.size,t||(c.css=i,"json"==c.format&&(c.css=c.css.split("\n").slice(1).join("\n")),i=`module.exports = ${JSON.stringify(c)};`),t){e._compile(i,e.filename),!d.isEmpty(e.exports)?(c.type=e.exports,e.exports=c,i=""):i+=`\nmodule.exports = ${JSON.stringify(c)};\nmodule.exports.type = ${c.exports||c.name};`}e._compile(i,r)}}makePlaceholderPlugin(e){return{plugin:{start:()=>{},getName:()=>e.name||e.filename,getAuthor:()=>"???",getDescription:()=>e.message?e.message:"This plugin was unable to be loaded. Check the author's page for updates.",getVersion:()=>"???"},name:e.name||e.filename,filename:e.filename,source:e.source?e.source:"",website:e.website?e.website:""}}async loadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t,s=n?this.pluginsFolder:this.themesFolder;if(me["fork-ps-6"]){let t=await new Promise(t=>{_(V.resolve(s,e),e=>{console.log(e),t(e)},n=>{t({suspect:!1,hash:n,filename:e,name:e})},!0)});if(t&&(te[t.hash]={timestamp:Date.now(),hash:t.hash,result:t},this.saveAddonCache(),t.suspect))return{name:e,file:e,message:"This plugin might be dangerous ("+t.harm+").",error:new Error("This plugin might be dangerous ("+t.harm+").")}}try{window.require(V.resolve(s,e))}catch(t){return{name:e,file:e,message:"Could not be compiled.",error:{message:t.message,stack:t.stack}}}const r=window.require(V.resolve(s,e));if(!r.name)return{name:e,file:e,message:"Cannot escape the ID.",error:{message:"Cannot read property 'replace' of undefined",stack:"Cannot read property 'replace' of undefined"}};if(r.id=d.escapeID(r.name),n){if(!r.type)return;try{r.plugin=new r.type,delete Ee[r.plugin.getName()],Ee[r.plugin.getName()]=r}catch(t){return{name:e,file:e,message:"Could not be constructed.",error:{message:t.message,stack:t.stack}}}}else delete we[r.name],we[r.name]=r}unloadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{delete window.require.cache[window.require.resolve(V.resolve(n,e))]}catch(t){return{name:e,file:e,message:"Could not be unloaded.",error:{message:t.message,stack:t.stack}}}}isLoaded(e,t){const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{window.require.cache[window.require.resolve(V.resolve(n,e))]}catch(e){return!1}return!0}async reloadContent(e,t){const n=this.unloadContent(e,t);return n||await this.loadContent(e,t)}loadNewContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,r=J.readdirSync(s),o=Object.values(t?Ee:we),a=o.filter(e=>!r.includes(e.filename)).map(e=>t?e.plugin.getName():e.name);return{added:r.filter(e=>!o.find(t=>t.filename==e)&&e.endsWith(n)&&J.statSync(V.resolve(s,e)).isFile()),removed:a}}async loadAllContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,r=[],o=J.readdirSync(s);for(const t of o){if(!J.statSync(V.resolve(s,t)).isFile()||!t.endsWith(n))continue;const o=await this.loadContent(t,e);o&&r.push(o)}return r}loadPlugins(){return this.loadAllContent("plugin")}loadThemes(){return this.loadAllContent("theme")}};class se{constructor(){window.Lightcord.BetterDiscord.ThemeModule=this}get folder(){return ne.themesFolder}}se.prototype.loadThemes=async function(){this.loadThemeData(),ye.splice(0,0,...await ne.loadThemes());const e=Object.keys(we);for(let t=0;tsetTimeout(e,10))}for(const e in Se)we[e]||delete Se[e];this.saveThemeData()},se.prototype.enableTheme=function(e,t=!1){Se[e]=!0,this.saveThemeData();const n=we[e];c.addStyle(c.escapeID(n.id),unescape(n.css)),me["fork-ps-2"]&&!t&&d.showToast(`${n.name} v${n.version} has been applied.`)},se.prototype.enable=function(e,t=!1){return this.enableTheme(e,t)},se.prototype.disableTheme=function(e,t=!1){Se[e]=!1,this.saveThemeData();const n=we[e];c.removeStyle(c.escapeID(n.id)),me["fork-ps-2"]&&!t&&d.showToast(`${n.name} v${n.version} has been disabled.`)},se.prototype.disable=function(e,t=!1){return this.disableTheme(e,t)},se.prototype.toggleTheme=function(e){Se[e]?this.disableTheme(e):this.enableTheme(e)},se.prototype.toggle=function(e,t=!1){return this.toggleTheme(e,t)},se.prototype.loadTheme=async function(e){const t=await ne.loadContent(e,"theme");if(t)return me["fork-ps-1"]&&d.showContentErrors({themes:[t]}),me["fork-ps-2"]&&d.showToast(`${e} could not be loaded. It may not have been loaded.`,{type:"error"}),d.err("ContentManager",`${e} could not be loaded.`,t);const n=Object.values(we).find(t=>t.filename==e);d.log("ContentManager",`${n.name} v${n.version} was loaded.`),me["fork-ps-2"]&&d.showToast(`${n.name} v${n.version} was loaded.`,{type:"success"}),b.dispatch("theme-loaded",n.name)},se.prototype.unloadTheme=function(e){const t=Object.values(we).find(t=>t.filename==e)||we[e];if(!t)return;const n=t.name;Se[n]&&this.disableTheme(n,!0);const s=ne.unloadContent(we[n].filename,"theme");if(delete we[n],s)return me["fork-ps-1"]&&d.showContentErrors({themes:[s]}),me["fork-ps-2"]&&d.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),d.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);d.log("ContentManager",`${n} was unloaded.`),me["fork-ps-2"]&&d.showToast(`${n} was unloaded.`,{type:"success"}),b.dispatch("theme-unloaded",n)},se.prototype.delete=function(e){const t=Object.values(we).find(t=>t.filename==e)||we[e];if(!t)return;this.unloadTheme(t.filename);const s=n(1).resolve(ne.pluginsFolder,t.filename);n(2).unlinkSync(s)},se.prototype.reloadTheme=async function(e){const t=Object.values(we).find(t=>t.filename==e)||we[e];if(!t)return this.loadTheme(e);const n=t.name,s=await ne.reloadContent(we[n].filename,"theme");if(Se[n]&&(this.disableTheme(n,!0),this.enableTheme(n,!0)),s)return me["fork-ps-1"]&&d.showContentErrors({themes:[s]}),me["fork-ps-2"]&&d.showToast(`${n} could not be reloaded.`,{type:"error"}),d.err("ContentManager",`${n} could not be reloaded.`,s);d.log("ContentManager",`${n} v${we[n].version} was reloaded.`),me["fork-ps-2"]&&d.showToast(`${n} v${we[n].version} was reloaded.`,{type:"success"}),b.dispatch("theme-reloaded",n)},se.prototype.reload=function(e){return this.reloadTheme(e)},se.prototype.edit=function(e){const t=Object.values(we).find(t=>t.filename==e)||we[e];if(!t)return;const s=n(1).resolve(ne.themesFolder,t.filename);n(0).shell.openItem(`${s}`)},se.prototype.updateThemeList=function(){const e=ne.loadNewContent("theme");for(const t of e.added)this.loadTheme(t);for(const t of e.removed)this.unloadTheme(t)},se.prototype.loadThemeData=function(){const e=g.getSettingGroup("themes");e&&Object.assign(Se,e)},se.prototype.saveThemeData=function(){g.setSettingGroup("themes",Se)};var re=new se,oe=new class{constructor(){this.editorDetached=!1,this.WebpackModules=(()=>{const e=webpackJsonp.push([[],{__extra_id__:(e,t,n)=>e.exports=n},[["__extra_id__"]]]);delete e.m.__extra_id__,delete e.c.__extra_id__;const t=(e,t)=>{let n=t?e:e.default;if(!n)return e;if(n.remove&&n.set&&n.clear&&n.get&&!n.sort)return null;if(!n.getToken&&!n.getEmail&&!n.showToken)return e;const s=new Proxy(n,{getOwnPropertyDescriptor:function(e,t){if("getToken"!==t&&"getEmail"!==t&&"showToken"!==t)return Object.getOwnPropertyDescriptor(e,t)},get:function(e,t){return"getToken"==t?()=>"mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa":"getEmail"==t?()=>"puppet11112@gmail.com":"showToken"==t?()=>!0:e[t]}});return t?s:Object.assign({},e,{default:s})},n=n=>{for(const s in e.c)if(e.c.hasOwnProperty(s)){const r=e.c[s].exports;if(r&&r.__esModule&&r.default&&n(r.default))return t(r.default,!0);if(r&&n(r))return t(r,!1)}return null};return{find:n,findAll:n=>{const s=[];for(const r in e.c)if(e.c.hasOwnProperty(r)){const o=e.c[r].exports;o&&o.__esModule&&o.default&&n(o.default)?s.push(t(o.default,!0)):o&&n(o)&&s.push(t(o,!1))}return s},findByUniqueProperties:e=>n(t=>e.every(e=>void 0!==t[e])),findByPrototypes:e=>n(t=>t.prototype&&e.every(e=>void 0!==t.prototype[e])),findByDisplayName:e=>n(t=>t.displayName===e)}})(),this.internal={react:this.WebpackModules.findByUniqueProperties(["Component","PureComponent","Children","createElement","cloneElement"]),reactDom:this.WebpackModules.findByUniqueProperties(["findDOMNode"])},this.getInternalInstance=e=>e[Object.keys(e).find(e=>e.startsWith("__reactInternalInstance"))],window.Lightcord.BetterDiscord.V2=this}initialize(){}joinBD1(){this.InviteActions.acceptInviteAndTransitionToInviteChannel("0Tmfo5ZbORCRqbAd")}leaveBD1(){this.GuildActions.leaveGuild("86004744966914048")}joinBD2(){this.InviteActions.acceptInviteAndTransitionToInviteChannel("2HScm8j")}leaveBD2(){this.GuildActions.leaveGuild("280806472928198656")}joinLC(){this.InviteActions.acceptInviteAndTransitionToInviteChannel("7eFff2A")}leaveLC(){this.GuildActions.leaveGuild("705908350218666117")}get react(){return this.internal.react}get React(){return this.internal.react}get reactDom(){return this.internal.reactDom}get ReactDom(){return this.internal.reactDom}get reactComponent(){return this.internal.react.Component}get ReactComponent(){return this.internal.react.Component}get anchorClasses(){return this.WebpackModules.findByUniqueProperties(["anchorUnderlineOnHover"])||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"}}get slateEditorClasses(){return this.WebpackModules.findByUniqueProperties(["slateTextArea"])}get messageClasses(){return this.WebpackModules.findByUniqueProperties(["message","containerCozy"])}get guildClasses(){const e=BDModules.get(e=>e.wrapper&&e.unreadMentionsBar)[0],t=BDModules.get(e=>e.guildsError&&e.selected)[0],n=BDModules.get(e=>e.blobContainer)[0];return Object.assign({},e,t,n)}get MessageContentComponent(){return this.WebpackModules.find(e=>e.defaultProps&&e.defaultProps.hasOwnProperty("disableButtons"))}get MessageComponent(){return this.WebpackModules.find(e=>e.default&&e.default.displayName&&"Message"==e.default.displayName)}get TimeFormatter(){return this.WebpackModules.findByUniqueProperties(["dateFormat"])}get TooltipWrapper(){return this.WebpackModules.findByDisplayName("Tooltip")}get NativeModule(){return this.WebpackModules.findByUniqueProperties(["setBadge"])}get InviteActions(){return this.WebpackModules.findByUniqueProperties(["acceptInvite"])}get GuildActions(){return this.WebpackModules.findByUniqueProperties(["leaveGuild"])}get Tooltips(){return this.WebpackModules.find(e=>e.hide&&e.show&&!e.search&&!e.submit&&!e.search&&!e.activateRagingDemon&&!e.dismiss)}get KeyGenerator(){return this.WebpackModules.find(e=>e.toString&&/"binary"/.test(e.toString()))}get LayerStack(){return this.WebpackModules.findByUniqueProperties(["popLayer"])}get UserStore(){return this.WebpackModules.findByUniqueProperties(["getCurrentUser"])}get ChannelStore(){return this.WebpackModules.findByUniqueProperties(["getChannel"])}get ChannelActions(){return this.WebpackModules.findByUniqueProperties(["openPrivateChannel"])}get PrivateChannelActions(){return this.WebpackModules.findByUniqueProperties(["selectPrivateChannel"])}openDM(e){const t=this.UserStore.getCurrentUser().id;if(t==e)return;const n=this.ChannelStore.getDMFromUserId(e);if(n)return this.PrivateChannelActions.selectPrivateChannel(n);this.ChannelActions.openPrivateChannel(t,e)}parseSettings(e){return Object.keys(he).reduce((t,n)=>{const s=he[n];return s.cat===e&&s.implemented&&!s.hidden&&(s.text=n,t.push(s)),t},[])}};const ae="0.0.306",ie=window.DiscordNative&&window.DiscordNative.remoteApp&&window.DiscordNative.remoteApp.getVersion&&window.DiscordNative.remoteApp.getVersion()||"0.0.306",le="0.3.0",ce="0.3.4",de={description:"Lightcord's changelog",changes:[{title:"What's New?",items:["Lightcord is now available !","We removed emotes. That's sad for people who were actually using it, but it was leading to more loading time and some basic words were emote."]}],image:"https://i.imgur.com/sfNhqwP.png",title:"Lightcord",subtitle:"v"+r.remote.getGlobal("BuildInfo").version,footer:function(){const e=l.findByDisplayName("Text"),t=l.findByProps("push","update","pop","popWithKey");if(!e||!t)return null;const n=l.find(e=>"Anchor"==e.displayName),s=l.findByProps("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},r=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),oe.joinLC()},o=n?oe.React.createElement(n,{onClick:r},"Join our Discord Server."):oe.React.createElement("a",{className:`${s.anchor} ${s.anchorUnderlineOnHover}`,onClick:r},"Join our Discord Server.");return oe.React.createElement(e,{size:e.Sizes.SMALL,color:e.Colors.STANDARD},"Need support? ",o)}()},ue={description:"BBD's changelog.",changes:[{title:"What's New?",items:["**Lightcord** is now using BandagedBD. That means all plugins you were using can be used too !","**Window Transparency** changes were made to more compatible with external window managers and addons like Glasscord.","Initialization sequence has once again been changed slightly to hopefully improve loading times."]},{title:"Bug Fixes",type:"fixed",items:["Some fixes related to showing modals in the `BdApi`."]}]},he={"Custom css live update":{id:"bda-css-0",info:"",implemented:!0,hidden:!0,cat:"core"},"Custom css auto udpate":{id:"bda-css-1",info:"",implemented:!0,hidden:!0,cat:"core"},"BetterDiscord Blue":{id:"bda-gs-b",info:"Replace Discord blue with BD Blue",implemented:!1,hidden:!1,cat:"core"},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Dark Mode":{id:"bda-gs-5",info:"Make certain elements dark by default(wip)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Disconnect":{id:"bda-dc-0",info:"Disconnect from voice server when closing Discord",implemented:!0,hidden:!1,cat:"core",category:"modules"},"24 Hour Timestamps":{id:"bda-gs-6",info:"Replace 12hr timestamps with proper ones",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Colored Text":{id:"bda-gs-7",info:"Make text color the same as role color",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Normalize Classes":{id:"fork-ps-4",info:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Content Error Modal":{id:"fork-ps-1",info:"Shows a modal with plugin/theme errors",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Scan Plugins":{id:"fork-ps-6",info:"Scan plugins for any threat that can be hidden inside.",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Show Toasts":{id:"fork-ps-2",info:"Shows a small notification for important information",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Scroll To Settings":{id:"fork-ps-3",info:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Automatic Loading":{id:"fork-ps-5",info:"Automatically loads, reloads, and unloads plugins and themes",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Developer Mode":{id:"bda-gs-8",info:"Developer Mode Toggle",implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"Copy Selector":{id:"fork-dm-1",info:'Adds a "Copy Selector" option to context menus when developer mode is active',implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"React DevTools":{id:"reactDevTools",info:"Adds react developer tools to the devtools. Must be installed in Google Chrome on your pc.",implemented:!0,hidden:!0,cat:"core",category:"developer settings"},"Disable BetterDiscord":{id:"bd-disable",info:"Disable Betterdiscord (plugins, themes, etc) (Not implemented).",implemented:!1,hidden:!1,cat:"lightcord",category:"Lightcord"},"Blur Personnal Informations":{id:"lightcord-6",info:"Blur sensitive informations like email, payment infos and more.",implemented:!0,hidden:!1,cat:"lightcord",category:"Lightcord"},"Calling Ring Beat":{id:"lightcord-2",info:"Enable Discord's special calling beat.",implemented:!0,hidden:!1,cat:"lightcord",category:"Lightcord"},"Developer Options":{id:"lightcord-1",info:'Enable Discord\'s & Lightcord\'s Internal Developer Options. This allow the "Experiments" tab, the "Developer Options" tab and the "Api Components" tab. (must reopen settings)',implemented:!0,hidden:!1,cat:"lightcord",category:"Lightcord"},"Ad Block":{id:"lightcord-4",info:"Block any BOT that dms you with an invite link. Even in an embed.",implemented:!0,hidden:!1,cat:"lightcord",category:"Lightcord"},"Enable Lightcord Servers":{id:"lightcord-5",info:"Enable Lightcord's servers. Disabling this will disable custom badges.",implemented:!0,hidden:!1,cat:"lightcord",category:"Lightcord"},"Disable typing":{id:"lightcord-7",info:"Don't let other see you're typing.",implemented:!0,hidden:!1,cat:"lightcord",category:"Lightcord"},"Always-on-Top":{id:"lightcord-3",info:"Enable window's Always-on-Top mode, where Lightcord stays on top of other applications.",implemented:!0,hidden:!1,cat:"lightcord",category:"Window"},Enable:{id:"lightcord-presence-1",info:"Enable RichPresence below.",implemented:!0,hidden:!1,cat:"status"}},pe={"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!1,"bda-gs-5":!0,"bda-gs-6":!1,"bda-gs-7":!1,"bda-gs-8":!0,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-4":!1,"bda-es-6":!0,"bda-es-7":!0,"bda-gs-b":!1,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0,"fork-dm-1":!1,"fork-ps-1":!0,"fork-ps-2":!0,"fork-ps-3":!0,"fork-ps-4":!0,"fork-ps-5":!0,"fork-ps-6":!0,"fork-es-2":!1,"fork-es-3":!0,"fork-wp-1":!1,"fork-wp-2":!1,"fork-beta":!0,reactDevTools:!1,"lightcord-1":!1,"lightcord-2":!0,"lightcord-presence-1":!1,"lightcord-3":!1,"lightcord-4":!1,"lightcord-5":!0,"lightcord-6":!0,"lightcord-7":!1},me={},ge={},fe={name:"Lightcord",application_id:"711416957718757418",state:"Lightcord Client",details:"Browsing Discord","timestamps.start":Date.now(),"assets.small":null,"assets.large":"712323821037682791"},be=[],ye=[],ve=Object.create(BetterDiscordConfig),we={},Ee={},Ce={},Se={};class xe{constructor(){this.panels={}}register(e,t){this.panels[e]=t}getComponent(e){return this.panels[e]}get items(){return[{text:"BetterDiscord Settings",id:"core"},{text:"Plugins",id:"plugins"},{text:"Themes",id:"themes"},{text:"Custom CSS",id:"customcss"}]}get LCitems(){let e=[{text:"Lightcord Settings",id:"lightcord"},{text:"RichPresence",id:"status"},{text:"Account Info",id:"accountinfo"}];return window.Lightcord.Settings.devMode&&e.push({text:"Api Components Preview",id:"lcapipreview"}),e}render(){return[{section:"HEADER",label:"Lightcord"},...this.LCitems.map(e=>({section:e.id,label:e.text,element:this.getComponent(e.id)})),{section:"DIVIDER"},{section:"CUSTOM",element:this.getComponent("BDChangelogTitle")},...this.items.map(e=>({section:e.id,label:e.text,element:this.getComponent(e.id)})),{section:"DIVIDER"}]}}var De=new class{injectColoredText(){this.cancelColoredText||oe.MessageComponent&&(this.cancelColoredText=d.monkeyPatch(oe.MessageComponent,"default",{before:e=>{const t=e.methodArguments[0];if(!t||!t.childrenMessageContent)return;const n=t.childrenMessageContent;if(!n.type||!n.type.type||"MessageContent"!=n.type.type.displayName)return;const s=n.type.type;s.__originalMethod||(n.type.type=function(e){const t=s(e),n=me["bda-gs-7"]&&e.message.colorString||"";return t.props.style={color:n},t},n.type.type.__originalMethod=s,Object.assign(n.type.type,s))}}))}removeColoredText(){let e=BDModules.get(e=>e.markup)[0].markup;document.querySelectorAll("."+e.split(" ")[0]).forEach(e=>{e.style.setProperty("color","")})}},ke=new class{inject24Hour(){if(this.cancel24Hour)return;const e=new RegExp("([0-9]{1,2}):([0-9]{1,2})\\s(AM|PM)"),t=t=>{if(!me["bda-gs-6"])return;const n=t.returnValue.match(e);return n&&4===n.length?"AM"===n[3]?t.returnValue=t.returnValue.replace(n[0],`${"12"===n[1]?"00":n[1].padStart(2,"0")}:${n[2]}`):t.returnValue=t.returnValue.replace(n[0],`${"12"===n[1]?"12":parseInt(n[1])+12}:${n[2]}`):void 0},n=d.monkeyPatch(oe.TimeFormatter,"calendarFormat",{after:t}),s=d.monkeyPatch(oe.TimeFormatter,"dateFormat",{after:t});this.cancel24Hour=()=>{n(),s()}}remove24Hour(){this.cancel24Hour&&this.cancel24Hour()}};class Me extends oe.reactComponent{constructor(e){super(e)}render(){return oe.react.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",style:{width:"18px",height:"18px"}},oe.react.createElement("g",{className:"background",fill:"none",fillRule:"evenodd"},oe.react.createElement("path",{d:"M0 0h12v12H0"}),oe.react.createElement("path",{className:"fill",fill:"#dcddde",d:"M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6"})))}}class Be extends oe.reactComponent{constructor(e){super(e),this.onClick=this.onClick.bind(this)}render(){let e=BDModules.get(e=>e.toolsContainer)[0],t=BDModules.get(e=>e.container&&e.closeButton&&e.closeButtonBold)[0];return oe.react.createElement("div",{className:"tools-container "+e.toolsContainer},oe.react.createElement("div",{className:"tools "+e.tools},oe.react.createElement("div",{className:t.container},oe.react.createElement("div",{className:"btn-close "+t.closeButton,onClick:this.onClick},oe.react.createElement(Me,null)),oe.react.createElement("div",{className:"esc-text "+t.keybind},"ESC"))))}onClick(){this.props.onClick&&this.props.onClick();const e=document.querySelector("."+BDModules.get(e=>e.closeButton&&e.keybindBold)[0].closeButton.split(" ")[0]);e&&e.click()}}class Ne extends oe.reactComponent{constructor(e){super(e)}render(){return oe.react.createElement("h2",{className:"ui-form-title h2 margin-reset margin-bottom-20"},this.props.text)}}class Pe extends oe.reactComponent{constructor(e){super(e)}render(){return oe.react.createElement("div",{className:"ui-tab-bar-separator margin-top-8 margin-bottom-8"})}}class Le extends oe.reactComponent{constructor(e){super(e)}render(){return oe.react.createElement("div",{className:"ui-tab-bar-header"},this.props.text,this.props.button)}}class Ae extends oe.reactComponent{constructor(e){super(e),this.setInitialState(),this.onClick=this.onClick.bind(this)}setInitialState(){this.state={selected:this.props.selected||!1}}render(){return oe.react.createElement("div",{className:`ui-tab-bar-item${this.props.selected?" selected":""}`,onClick:this.onClick},this.props.text)}onClick(){this.props.onClick&&this.props.onClick(this.props.id)}}class $e extends oe.reactComponent{constructor(e){super(e),this.props.server.iconUrl||(this.props.server.iconUrl=this.props.fallback),this.state={imageError:!1,joined:this.props.guildList.includes(this.props.server.identifier)}}render(){const{server:e}=this.props;let t=BDModules.get(e=>e.card&&e.cardPrimary)[0],n=BDModules.get(e=>e.flexChild&&e._horizontalReverse)[0],s=BDModules.get(e=>e.noWrap&&!e.streamerModeEnabled)[0];return oe.react.createElement("div",{className:`${t.card} ${t.cardPrimary} ${BDModules.get(e=>e.marginBottom8)[0].marginBottom8} bd-server-card${e.pinned?" bd-server-card-pinned":""}`},oe.react.createElement("img",{ref:"img",className:"bd-server-image",src:e.iconUrl,onError:this.handleError.bind(this),draggable:!1}),oe.react.createElement("div",{className:n.flexChild+" bd-server-content"},oe.react.createElement("div",{className:n.horizontal+" "+s.noWrap+" bd-server-header"},oe.react.createElement("h5",{className:"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-name"},e.name),oe.react.createElement("h5",{className:"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-member-count"},e.members," Members")),oe.react.createElement("div",{className:n.horizontal+" "+s.noWrap},oe.react.createElement("div",{className:"scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y bd-server-description-container"},oe.react.createElement("div",{className:"scroller-2FKFPG scroller bd-server-description"},e.description))),oe.react.createElement("div",{className:"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-footer"},oe.react.createElement("div",{className:"flexChild-faoVW3 bd-server-tags",style:{flex:"1 1 auto"}},e.categories.join(", ")),this.state.joined&&oe.react.createElement("button",{type:"button",className:"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN colorGreen-29iAKY",style:{minHeight:"12px",marginTop:"4px",backgroundColor:"#3ac15c"}},oe.react.createElement("div",{className:"ui-button-contents"},"Joined")),e.error&&oe.react.createElement("button",{type:"button",className:"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN disabled-9aF2ug",style:{minHeight:"12px",marginTop:"4px",backgroundColor:"#c13a3a"}},oe.react.createElement("div",{className:"ui-button-contents"},"Error")),!e.error&&!this.state.joined&&oe.react.createElement("button",{type:"button",className:"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN",style:{minHeight:"12px",marginTop:"4px"},onClick:()=>{this.join()}},oe.react.createElement("div",{className:"ui-button-contents"},"Join")))))}handleError(){this.props.server.iconUrl=this.props.fallback,this.setState({imageError:!0})}join(){this.props.join(this)}}class Te extends oe.reactComponent{constructor(e){super(e)}render(){let e=BDModules.get(e=>e.scrollerHorizontal)[0],t=BDModules.get(e=>e.sidebarRegionScroller)[0],n=`${e.scrollerWrap} ${e.scrollerThemed} ${e.themeGhostHairline}${this.props.fade?" "+e.scrollerFade:""}`,s=e.scroller+" scroller";this.props.sidebar&&(s+=` ${t.sidebarRegionScroller} sidebar-region-scroller`),this.props.contentColumn&&(s+=" "+t.contentRegionScroller+" content-region-scroller",n=`${e.scrollerWrap} ${t.contentRegionScrollerWrap} content-region-scroller-wrap ${e.scrollerThemed} ${e.themeGhost} ${e.scrollerTrack}`);const{children:r}=this.props;return oe.react.createElement("div",{key:"scrollerwrap",className:n},oe.react.createElement("div",{key:"scroller",ref:"scroller",className:s},r))}}class Re extends oe.reactComponent{constructor(e){super(e)}render(){const{sidebar:e,content:t,tools:n}=this.props.children;return oe.react.createElement("div",{className:"standardSidebarView-3F1I7i ui-standard-sidebar-view"},oe.react.createElement("div",{className:"sidebarRegion-VFTUkN sidebar-region"},oe.react.createElement(Te,{key:"sidebarScroller",ref:"sidebarScroller",sidebar:!0,fade:e.fade||!0,dark:e.dark||!0},e.component)),oe.react.createElement("div",{className:"contentRegion-3nDuYy content-region"},oe.react.createElement("div",{className:"contentTransitionWrap-3hqOEW content-transition-wrap"},oe.react.createElement("div",{className:"scrollerWrap-2lJEkd firefoxFixScrollFlex-cnI2ix contentRegionScrollerWrap-3YZXdm content-region-scroller-wrap scrollerThemed-2oenus themeGhost-28MSn0 scrollerTrack-1ZIpsv"},oe.react.createElement("div",{className:"scroller-2FKFPG firefoxFixScrollFlex-cnI2ix contentRegionScroller-26nc1e content-region-scroller scroller",ref:"contentScroller"},oe.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},t.component),n.component)))))}}class je extends oe.reactComponent{constructor(e){super(e),this.setInitialState(),this.close=this.close.bind(this),this.changeCategory=this.changeCategory.bind(this),this.search=this.search.bind(this),this.searchKeyDown=this.searchKeyDown.bind(this),this.checkConnection=this.checkConnection.bind(this),this.join=this.join.bind(this),this.connect=this.connect.bind(this),this.GuildStore=oe.WebpackModules.findByUniqueProperties(["getGuilds"]),this.AvatarDefaults=oe.WebpackModules.findByUniqueProperties(["getUserAvatarURL","DEFAULT_AVATARS"]),this.InviteActions=oe.WebpackModules.findByUniqueProperties(["acceptInvite"]),this.SortedGuildStore=oe.WebpackModules.findByUniqueProperties(["getSortedGuilds"])}componentDidMount(){this.checkConnection()}setInitialState(){this.state={selectedCategory:-1,title:"Loading...",loading:!0,servers:[],next:null,connection:{state:0,user:null}}}close(){oe.reactDom.unmountComponentAtNode(document.getElementById(this.props.rootId))}search(e,t){const n=this;fetch(`${n.endPoint}${e}${e?"&schema=new":"?schema=new"}`,{method:"get"}).then(async e=>{if(200!==e.status)throw await e.text();let s=await e.json(),r=s.results.reduce((e,t)=>(t.joined=!1,e.push(t),e),[]);t||(r=n.state.servers.concat(r));let o=s.size+s.from;s.next=`?from=${o}`,n.state.term&&(s.next+=`&term=${n.state.term}`),n.state.selectedCategory&&(s.next+=`&category=${n.categoryButtons[n.state.selectedCategory]}`),o>=s.total&&(o=s.total,s.next=null);let a=`Showing 1-${o} of ${s.total} results in ${n.categoryButtons[n.state.selectedCategory]}`;n.state.term&&(a+=` for ${n.state.term}`),n.setState({loading:!1,title:a,servers:r,next:s.next}),t&&(n.refs.sbv.refs.contentScroller.scrollTop=0)}).catch(e=>(console.error(e),n.setState({loading:!1,title:"Failed to load servers. Check console for details"})))}async join(e){if(e.props.pinned)return this.InviteActions.acceptInvite(e.props.invite_code);await fetch(`${this.joinEndPoint}/${e.props.server.identifier}`,{method:"GET",credentials:"include",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"}}),e.setState({joined:!0})}connect(){const e=this,t=e.windowOptions;t.x=Math.round(window.screenX+window.innerWidth/2-t.width/2),t.y=Math.round(window.screenY+window.innerHeight/2-t.height/2),e.joinWindow=new(window.require("electron").remote.BrowserWindow)(t);e.joinWindow.webContents.on("did-navigate",(t,n)=>{"https://auth.discordservers.com/info"==n&&(e.joinWindow.close(),e.checkConnection())}),e.joinWindow.loadURL("https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info")}get windowOptions(){return{width:500,height:550,backgroundColor:"#282b30",show:!0,resizable:!1,maximizable:!1,minimizable:!1,alwaysOnTop:!0,frame:!1,center:!1,webPreferences:{nodeIntegration:!1}}}get bdServer(){const e=this.SortedGuildStore.getFlattenedGuildIds(),t=this.AvatarDefaults.DEFAULT_AVATARS;return[oe.react.createElement($e,{server:{name:"Lightcord",online:"30+",members:"50+",categories:["community","programming","support"],description:"Official Lightcord server for support etc",identifier:"86004744966914048",iconUrl:"https://avatars3.githubusercontent.com/u/65690058?s=200&v=4",nativejoin:!0,invite_code:"7eFff2A",pinned:!0},pinned:!0,join:this.join,guildList:e,fallback:t[Math.floor(5*Math.random())]}),oe.react.createElement($e,{server:{name:"BetterDiscord",online:"7500+",members:"20000+",categories:["community","programming","support"],description:"Official BetterDiscord server for support etc",identifier:"86004744966914048",iconUrl:"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp",nativejoin:!0,invite_code:"0Tmfo5ZbORCRqbAd",pinned:!0},pinned:!0,join:this.join,guildList:e,fallback:t[Math.floor(5*Math.random())]})]}get endPoint(){return"https://search.discordservers.com"}get joinEndPoint(){return"https://j.discordservers.com"}get connectEndPoint(){return"https://join.discordservers.com/connect"}async checkConnection(){const e=this;try{const t=await fetch("https://auth.discordservers.com/info",{method:"GET",credentials:"include",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"}}),n=await t.json();e.setState({selectedCategory:0,connection:{state:2,user:n}}),e.search("",!0)}catch(t){console.error(t),e.setState({title:"Not connected to discordservers.com!",loading:!0,selectedCategory:-1,connection:{state:1,user:null}})}}render(){return oe.react.createElement(Re,{ref:"sbv"},this.component)}get component(){return{sidebar:{component:this.sidebar},content:{component:this.content},tools:{component:oe.react.createElement(Be,{key:"pt",ref:"tools",onClick:this.close})}}}get sidebar(){return oe.react.createElement("div",{className:"sidebar",key:"ps"},oe.react.createElement("div",{className:"ui-tab-bar SIDE"},oe.react.createElement("div",{className:"ui-tab-bar-header",style:{fontSize:"16px"}},"Public Servers"),oe.react.createElement(Pe,null),this.searchInput,oe.react.createElement(Pe,null),oe.react.createElement(Le,{text:"Categories"}),this.categoryButtons.map((e,t)=>oe.react.createElement(Ae,{id:t,onClick:this.changeCategory,key:t,text:e,selected:this.state.selectedCategory===t})),oe.react.createElement(Pe,null),this.footer,this.connection))}get searchInput(){return oe.react.createElement("div",{className:"ui-form-item"},oe.react.createElement("div",{className:"ui-text-input flex-vertical",style:{width:"172px",marginLeft:"10px"}},oe.react.createElement("input",{ref:"searchinput",onKeyDown:this.searchKeyDown,onChange:()=>{},type:"text",className:"input default",placeholder:"Search...",maxLength:"50"})))}searchKeyDown(e){const t=this;if(t.state.loading||13!==e.which)return;t.setState({loading:!0,title:"Loading...",term:e.target.value});let n=`?term=${e.target.value}`;0!==t.state.selectedCategory&&(n+=`&category=${t.categoryButtons[t.state.selectedCategory]}`),t.search(n,!0)}get categoryButtons(){return["All","FPS Games","MMO Games","Strategy Games","MOBA Games","RPG Games","Tabletop Games","Sandbox Games","Simulation Games","Music","Community","Language","Programming","Other"]}changeCategory(e){const t=this;t.state.loading||(t.refs.searchinput.value="",t.setState({loading:!0,selectedCategory:e,title:"Loading...",term:null}),0!==e?t.search(`?category=${t.categoryButtons[e]}`,!0):t.search("",!0))}get content(){const e=this,t=this.SortedGuildStore.getFlattenedGuildIds(),n=this.AvatarDefaults.DEFAULT_AVATARS;if(1===e.state.connection.state)return e.notConnected;let s=BDModules.get(e=>e.contentColumnDefault)[0];return[oe.react.createElement("div",{ref:"content",key:"pc",className:s.contentColumn+" "+s.contentColumn+" content-column default"},oe.react.createElement(Ne,{text:e.state.title}),e.bdServer,e.state.servers.map(s=>oe.react.createElement($e,{key:s.identifier,server:s,join:e.join,guildList:t,fallback:n[Math.floor(5*Math.random())]})),e.state.next&&oe.react.createElement("button",{type:"button",onClick:()=>{e.state.loading||(e.setState({loading:!0}),e.search(e.state.next,!1))},className:"ui-button filled brand small grow",style:{width:"100%",marginTop:"10px",marginBottom:"10px"}},oe.react.createElement("div",{className:"ui-button-contents"},e.state.loading?"Loading":"Load More")),e.state.servers.length>0&&oe.react.createElement(Ne,{text:e.state.title}))]}get notConnected(){let e=BDModules.get(e=>e.contentColumnDefault)[0];return[oe.react.createElement("div",{key:"ncc",ref:"content",className:e.contentColumn+" "+e.contentColumn+" content-column default"},oe.react.createElement("h2",{className:"ui-form-title h2 margin-reset margin-bottom-20"},"Not connected to discordservers.com!",oe.react.createElement("button",{onClick:this.connect,type:"button",className:"ui-button filled brand small grow",style:{display:"inline-block",minHeight:"18px",marginLeft:"10px",lineHeight:"14px"}},oe.react.createElement("div",{className:"ui-button-contents"},"Connect"))),this.bdServer)]}get footer(){return oe.react.createElement("div",{className:"ui-tab-bar-header"},oe.react.createElement("a",{href:"https://discordservers.com",target:"_blank"},"Discordservers.com"))}get connection(){const{connection:e}=this.state;return 2!==e.state?oe.react.createElement("span",null):oe.react.createElement("span",null,oe.react.createElement(Pe,null),oe.react.createElement("span",{style:{color:"#b9bbbe",fontSize:"10px",marginLeft:"10px"}},"Connected as: ",`${e.user.username}#${e.user.discriminator}`),oe.react.createElement("div",{style:{padding:"5px 10px 0 10px"}},oe.react.createElement("button",{style:{width:"100%",minHeight:"20px"},type:"button",className:"ui-button filled brand small grow"},oe.react.createElement("div",{className:"ui-button-contents",onClick:this.connect},"Reconnect"))))}}class Oe extends oe.reactComponent{constructor(e){super(e),this.keyupListener=this.keyupListener.bind(this)}keyupListener(e){27===e.which&&oe.reactDom.unmountComponentAtNode(this.refs.root.parentNode)}componentDidMount(){window.addEventListener("keyup",this.keyupListener);const e=c.query(`#${this.props.id}`);c.animate({duration:200,update:function(t){e.style.transform=`scale(${1.1-.1*t}) translateZ(0px)`,e.style.opacity=t,1==t&&setImmediate(()=>{e.style.transform="",e.style.opacity=""})}})}componentWillUnmount(){window.removeEventListener("keyup",this.keyupListener);const e=c.query(`#${this.props.id}`);c.animate({duration:200,update:function(t){e.style.transform=`scale(${1.1-.1*(1-t)}) translateZ(0px)`,e.style.opacity=1-t,1==t&&setImmediate(()=>{e.remove()})}});const t=c.query(".publicServersOpen");t.classList.remove("publicServersOpen"),c.animate({duration:200,update:function(e){t.style.transform=`scale(${.07*e+.93}) translateZ(0px)`,t.style.opacity=e,1==e&&setImmediate(()=>{t.style.transform="",t.style.opacity=""})}})}componentWillMount(){const e=c.query('[class*="layer-"]');e.classList.add("publicServersOpen"),c.animate({duration:200,update:function(t){e.style.transform=`scale(${.07*(1-t)+.93}) translateZ(0px)`,e.style.opacity=1-t}})}render(){return oe.react.createElement("div",{className:"layer bd-layer "+BDModules.get(e=>e.layer&&e.animating)[0].layer,id:this.props.id,ref:"root",style:{opacity:0,transform:"scale(1.1) translateZ(0px)"}},this.props.children)}}var Ie=new class{constructor(){this._appendButton=this._appendButton.bind(this),window.Lightcord.BetterDiscord.V2_PublicServers=this}get component(){return oe.react.createElement(Oe,{rootId:"pubslayerroot",id:"pubslayer"},oe.react.createElement(je,{rootId:"pubslayerroot"}))}get root(){const e=document.getElementById("pubslayerroot");return e||(this.injectRoot()?this.root:null)}injectRoot(){let[e]=[BDModules.get(e=>e.layers&&e.layer)[0].layers.split(" ")[0]];const t=c.query(".layers, ."+e);return!!t&&(t.append(c.createElement("
")),!0)}render(){const e=this.root;e?oe.reactDom.render(this.component,e):console.log("FAILED TO LOCATE ROOT: .layers")}get button(){const e=c.createElement(`