');for(const n of e){const e=L.createElement(`
\n
${n.name?n.name:n.file}
\n
${n.message}
\n
\n
`);t.append(e),n.error&&e.querySelectorAll("a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),P.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&&L.removeClass(t,"selected"),L.addClass(e.target,"selected");const n=o.querySelector(".scroller");n.innerHTML="",n.append(i[L.index(e.target)])})),o.querySelector(".footer button").addEventListener("click",()=>{L.addClass(o,"closing"),setTimeout(()=>{o.remove()},300)}),o.querySelector(".bd-backdrop").addEventListener("click",()=>{L.addClass(o,"closing"),setTimeout(()=>{o.remove()},300)}),L.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=d("push","update","pop","popWithKey"),n=d("fixed","improved"),s=u("Text"),r=d("Child"),a=d("Tags","default"),i=l(e=>e.defaultProps&&0==e.defaultProps.selectable),c=d("defaultRules","parse");if(!(i&&t&&n&&s&&r&&a&&c))return;const{image:h="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:p="",changes:m=[],title:f="BandagedBD",subtitle:b=`v${g}`,footer:v}=e,y=o.React.createElement,E=[y("img",{src:h})];p&&E.push(y("p",null,c.parse(p)));for(let e=0;e
y("li",null,c.parse(e))));E.push(o)}const C=function(){return y(r.Child,{grow:1,shrink:1},y(a.default,{tag:a.Tags.H4},f),y(s,{size:s.Sizes.SMALL,color:s.Colors.STANDARD,className:n.date},b))},w=()=>{const e=l(e=>"Anchor"==e.displayName),n=d("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},a=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),o.joinBD2()},i=e?y(e,{onClick:a},"Join our Discord Server."):y("a",{className:`${n.anchor} ${n.anchorUnderlineOnHover}`,onClick:a},"Join our Discord Server."),c=y(s,{size:s.Sizes.SMALL,color:s.Colors.STANDARD},"Need support? ",i);return y(r.Child,{grow:1,shrink:1},v||c)};return t.push((function(e){return y(i,Object.assign({className:n.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:C,renderFooter:w,children:E},e))}))}static showConfirmationModal(e,t,n={}){const s=d("push","update","pop","popWithKey"),r=u("Markdown"),a=l(e=>e.defaultProps&&e.key&&"confirm-modal"==e.key());if(!s||!a||!r)return P.alert(e,t);const i=()=>{},{onConfirm:c=i,onCancel:h=i,confirmText:p="Okay",cancelText:m="Cancel",danger:g=!1,key:f}=n;return Array.isArray(t)||(t=[t]),t=t.map(e=>"string"==typeof e?o.React.createElement(r,null,e):e),s.push(a,{header:e,children:t,red:g,confirmText:p,cancelText:m,onConfirm:c,onCancel:h},f)}static removeDa(e){return e?e.split(" ").filter(e=>!e.startsWith("da-")).join(" "):e}}P.showToast=P.suppressErrors(P.showToast,"Could not show toast."),window.Lightcord.BetterDiscord.Utils=P;const $=n(5);var A=new class extends ${dispatch(e,...t){this.emit(e,...t)}off(e,t){this.removeListener(e,t)}};class T{get folder(){return V.pluginsFolder}}T.prototype.loadPlugins=async function(){this.loadPluginData(),S.splice(0,0,...await V.loadPlugins());const e=Object.keys(M);for(let t=0;tt.filename==e).plugin;try{n.load&&"function"==typeof n.load&&n.load()}catch(e){E["fork-ps-1"]&&P.showContentErrors({plugins:[e]})}P.log("ContentManager",`${n.getName()} v${n.getVersion()} was loaded.`),E["fork-ps-2"]&&P.showToast(`${n.getName()} v${n.getVersion()} was loaded.`,{type:"success"}),A.dispatch("plugin-loaded",n.getName())},T.prototype.unloadPlugin=function(e){const t=Object.values(M).find(t=>t.filename==e)||M[e];if(!t)return;const n=t.plugin.getName();B[n]&&this.disablePlugin(n,!0);const s=V.unloadContent(M[n].filename,"plugin");if(delete M[n],s)return E["fork-ps-1"]&&P.showContentErrors({plugins:[s]}),E["fork-ps-2"]&&P.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),P.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);P.log("ContentManager",`${n} was unloaded.`),E["fork-ps-2"]&&P.showToast(`${n} was unloaded.`,{type:"success"}),A.dispatch("plugin-unloaded",n)},T.prototype.delete=function(e){const t=Object.values(M).find(t=>t.filename==e)||M[e];if(!t)return;this.unloadPlugin(t.filename);const s=n(1).resolve(V.pluginsFolder,t.filename);n(2).unlinkSync(s)},T.prototype.reloadPlugin=async function(e){const t=Object.values(M).find(t=>t.filename==e)||M[e];if(!t)return this.loadPlugin(e);const n=t.plugin.getName(),s=B[n];s&&this.stopPlugin(n,!0);const r=await V.reloadContent(M[n].filename,"plugin");if(r)return E["fork-ps-1"]&&P.showContentErrors({plugins:[r]}),E["fork-ps-2"]&&P.showToast(`${n} could not be reloaded.`,{type:"error"}),P.err("ContentManager",`${n} could not be reloaded.`,r);M[n].plugin.load&&"function"==typeof M[n].plugin.load&&M[n].plugin.load(),s&&this.startPlugin(n,!0),P.log("ContentManager",`${n} v${M[n].plugin.getVersion()} was reloaded.`),E["fork-ps-2"]&&P.showToast(`${n} v${M[n].plugin.getVersion()} was reloaded.`,{type:"success"}),A.dispatch("plugin-reloaded",n)},T.prototype.reload=function(e){return this.reloadPlugin(e)},T.prototype.edit=function(e){console.log("Edit "+e);const t=Object.values(M).find(t=>t.filename==e)||M[e];if(!t)return;const s=n(1).resolve(V.pluginsFolder,t.filename);console.log("Edit "+s),n(0).shell.openItem(`${s}`)},T.prototype.updatePluginList=function(){const e=V.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},T.prototype.loadPluginData=function(){const e=Q.getSettingGroup("plugins");e&&Object.assign(B,e)},T.prototype.savePluginData=function(){Q.setSettingGroup("plugins",B)},T.prototype.newMessage=function(){const e=Object.keys(M);for(let t=0;tt.filename==e);P.log("ContentManager",`${n.name} v${n.version} was loaded.`),E["fork-ps-2"]&&P.showToast(`${n.name} v${n.version} was loaded.`,{type:"success"}),A.dispatch("theme-loaded",n.name)},j.prototype.unloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const n=t.name;N[n]&&this.disableTheme(n,!0);const s=V.unloadContent(k[n].filename,"theme");if(delete k[n],s)return E["fork-ps-1"]&&P.showContentErrors({themes:[s]}),E["fork-ps-2"]&&P.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),P.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);P.log("ContentManager",`${n} was unloaded.`),E["fork-ps-2"]&&P.showToast(`${n} was unloaded.`,{type:"success"}),A.dispatch("theme-unloaded",n)},j.prototype.delete=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;this.unloadTheme(t.filename);const s=n(1).resolve(V.pluginsFolder,t.filename);n(2).unlinkSync(s)},j.prototype.reloadTheme=async function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return this.loadTheme(e);const n=t.name,s=await V.reloadContent(k[n].filename,"theme");if(N[n]&&(this.disableTheme(n,!0),this.enableTheme(n,!0)),s)return E["fork-ps-1"]&&P.showContentErrors({themes:[s]}),E["fork-ps-2"]&&P.showToast(`${n} could not be reloaded.`,{type:"error"}),P.err("ContentManager",`${n} could not be reloaded.`,s);P.log("ContentManager",`${n} v${k[n].version} was reloaded.`),E["fork-ps-2"]&&P.showToast(`${n} v${k[n].version} was reloaded.`,{type:"success"}),A.dispatch("theme-reloaded",n)},j.prototype.reload=function(e){return this.reloadTheme(e)},j.prototype.edit=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const s=n(1).resolve(V.themesFolder,t.filename);n(0).shell.openItem(`${s}`)},j.prototype.updateThemeList=function(){const e=V.loadNewContent("theme");for(const t of e.added)this.loadTheme(t);for(const t of e.removed)this.unloadTheme(t)},j.prototype.loadThemeData=function(){const e=Q.getSettingGroup("themes");e&&Object.assign(N,e)},j.prototype.saveThemeData=function(){Q.setSettingGroup("themes",N)};var R=new j;const I=window.require,_=n(1),F=n(2),W=n(6).Module;W.globalPaths.push(_.resolve(n(0).remote.app.getAppPath(),"node_modules"));class U extends Error{constructor(e){super(e),this.name="MetaError"}}const z=W._extensions[".js"],H=W._extensions[".css"]?W._extensions[".css"]:()=>null,q=/[^\S\r\n]*?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,G=/^\\@/;var V=new class{constructor(){this.timeCache={},this.watchers={},W._extensions[".js"]=this.getContentRequire("plugin"),W._extensions[".css"]=this.getContentRequire("theme")}get pluginsFolder(){return this._pluginsFolder||(this._pluginsFolder=F.realpathSync(_.resolve(D.dataPath+"plugins/")))}get themesFolder(){return this._themesFolder||(this._themesFolder=F.realpathSync(_.resolve(D.dataPath+"themes/")))}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]=F.watch(n,{persistent:!1},async(e,r)=>{if(!e||!r||!r.endsWith(s))return;await new Promise(e=>setTimeout(e,50));try{F.statSync(_.resolve(n,r))}catch(e){if("ENOENT"!==e.code)return;return delete this.timeCache[r],t?O.unloadPlugin(r):R.unloadTheme(r)}if(!F.statSync(_.resolve(n,r)).isFile())return;const o=F.statSync(_.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 O.loadPlugin(r):await R.loadTheme(r)),"change"==e&&(t?await O.reloadPlugin(r):await R.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 U("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 U("META was not found.");const s=P.testJSON(n);if(!s)throw new U("META could not be parsed.");if(!s.name)throw new U("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(G,"@");return n[s]=r.trim(),delete n[""],n.format="jsdoc",n}getContentRequire(e){const t="plugin"===e,n=this,s=t?z:H;return function(e,r){const o=t?n.pluginsFolder:n.themesFolder,a=_.resolve(o,_.basename(r));if(!F.existsSync(a)||r!==F.realpathSync(a))return Reflect.apply(s,this,arguments);let i=F.readFileSync(r,"utf8");i=P.stripBOM(i);const l=F.statSync(r),c=n.extractMeta(i);if(c.filename=_.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),!P.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;try{I(_.resolve(s,e))}catch(t){return{name:e,file:e,message:"Could not be compiled.",error:{message:t.message,stack:t.stack}}}const r=I(_.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=P.escapeID(r.name),n){if(!r.type)return;try{r.plugin=new r.type,delete M[r.plugin.getName()],M[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 k[r.name],k[r.name]=r}unloadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{delete I.cache[I.resolve(_.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{I.cache[I.resolve(_.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=F.readdirSync(s),o=Object.values(t?M:k),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)&&F.statSync(_.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=F.readdirSync(s);for(const t of o){if(!F.statSync(_.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")}};const J=window.require,Z=n(2),Y=n(1),K=DiscordNative.globals?DiscordNative.globals.releaseChannel:DiscordNative.app?DiscordNative.app.getReleaseChannel():"stable";var Q=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={}}initialize(){try{Z.existsSync(this.BDFile)||Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4),"binary");const e=JSON.parse(Z.readFileSync(this.BDFile,"binary"));if(e.hasOwnProperty("settings")&&(this.data=e),!Z.existsSync(this.settingsFile))return;let t=J(this.settingsFile);Z.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[K]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}catch(e){console.error(e),P.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=Y.resolve(this.injectionPath,"betterdiscord","config.json"))}get BDFile(){return this._BDFile||(this._BDFile=Y.resolve(D.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=Y.resolve(D.dataPath,"bdsettings.json"))}getPluginFile(e){return Y.resolve(V.pluginsFolder,e+".config.json")}getSettingGroup(e){return this.data.settings[K][e]||null}setSettingGroup(e,t){this.data.settings[K][e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4),"binary")}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4),"binary")}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]:Z.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(Z.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,Z.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],Z.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4),"binary")}};class X extends o.reactComponent{constructor(e){super(e)}render(){return o.react.createElement("div",{className:"ui-tab-bar-separator margin-top-8 margin-bottom-8"})}}class ee extends o.reactComponent{constructor(e){super(e)}render(){return o.react.createElement("div",{className:"ui-tab-bar-header"},this.props.text,this.props.button)}}class te extends o.reactComponent{constructor(e){super(e),this.setInitialState(),this.onClick=this.onClick.bind(this)}setInitialState(){this.state={selected:this.props.selected||!1}}render(){return o.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 ne extends o.reactComponent{constructor(e){super(e);const t=document.querySelector("[class*=side-] > [class*=selected]");t&&(this.scn=t.className);const n=document.querySelector("[class*=side-] > [class*='item-']:not([class*=selected])");n&&(this.nscn=n.className);const s=document.querySelectorAll("[class*='side-'] > [class*='item-']");for(const e of s)e.addEventListener("click",()=>{this.setState({selected:null})});this.setInitialState(),this.onClick=this.onClick.bind(this),this.setSelected=this.setSelected.bind(this),se.push(this)}setInitialState(){const e=this;e.state={selected:null,items:e.props.items};const t=e.props.items.find(e=>e.selected);t&&(e.state.selected=t.id)}render(){const e=this,{headerText:t}=e.props,{items:n,selected:s}=e.state;return o.react.createElement("div",null,o.react.createElement(X,null),o.react.createElement(ee,{text:t,button:this.props.headerButton}),n.map(t=>{const{id:n,text:r}=t;return o.react.createElement(te,{key:n,selected:s===n,text:r,id:n,onClick:e.onClick})}))}setSelected(e){e.target.className=this.scn}onClick(e){const t=document.querySelector("[class*=side] > [class*=selected]");t&&(t.removeEventListener("click",this.setSelected),t.addEventListener("click",this.setSelected),t.className=this.nscn),se.forEach(e=>{e.state.selected&&e.setState({selected:null})}),this.setState({selected:e}),this.props.onClick&&this.props.onClick(e)}componentWillUnmount(){let e=se.findIndex(e=>e===this);e&&se.splice(e,1)}}const se=[];const re=o.React;class oe extends re.Component{render(){const e=this.props.size||"18px";return re.createElement("svg",{viewBox:"0 0 24 24",fill:"#FFFFFF",className:this.props.className||"",style:{width:e,height:e},onClick:this.props.onClick},re.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),re.createElement("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}))}}let ae,ie;function le(){return ae||(ae=d("tooltip","tooltipBlack"))}function ce(){return ie||(ie=d("layer","layerContainer"))}const de=function(e){const t=e[0].toUpperCase()+e.slice(1),n=le()[`tooltip${t}`];return n||null},ue=function(e){return!!de(e)},he=function(e){return`${e}px`};class pe{constructor(e,t,n={}){const{style:s="black",side:r="top",preventFlip:o=!1,disabled:a=!1}=n;if(this.node=e instanceof jQuery?e[0]:e,this.label=t,this.style=s.toLowerCase(),this.side=r.toLowerCase(),this.preventFlip=o,this.disabled=a,!ue(this.side))return P.err("EmulatedTooltip",`Side ${this.side} does not exist.`);if(!ue(this.style))return P.err("EmulatedTooltip",`Style ${this.style} does not exist.`);this.element=document.createElement("div"),this.element.className=ce().layer+" "+ce().disabledPointerEvents,this.tooltipElement=document.createElement("div"),this.tooltipElement.className=`${le().tooltip} ${de(this.style)}`,this.labelElement=document.createElement("div"),this.labelElement.className=le().tooltipContent;const i=document.createElement("div");i.className=le().tooltipPointer,this.tooltipElement.append(i),this.tooltipElement.append(this.labelElement),this.element.append(this.tooltipElement),this.node.addEventListener("mouseenter",()=>{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<=P.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<=P.screenWidth}hide(){this.element.remove(),this.tooltipElement.className=this._className}show(){this.tooltipElement.className=`${le().tooltip} ${de(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(de("top")),this.element.style.setProperty("top",he(this.node.getBoundingClientRect().top-this.element.offsetHeight-10)),this.centerHorizontally()}showBelow(){this.tooltipElement.classList.add(de("bottom")),this.element.style.setProperty("top",he(this.node.getBoundingClientRect().top+this.node.offsetHeight+10)),this.centerHorizontally()}showLeft(){this.tooltipElement.classList.add(de("left")),this.element.style.setProperty("left",he(this.node.getBoundingClientRect().left-this.element.offsetWidth-10)),this.centerVertically()}showRight(){this.tooltipElement.classList.add(de("right")),this.element.style.setProperty("left",he(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",he(e-this.element.offsetWidth/2))}centerVertically(){const e=this.node.getBoundingClientRect().top+this.node.offsetHeight/2;this.element.style.setProperty("top",he(e-this.element.offsetHeight/2))}}var me=class extends o.reactComponent{constructor(e){super(e)}async componentDidMount(){const{style:e="black",side:t="top",text:n=""}=this.props;this.node=o.reactDom.findDOMNode(this),this.tooltip=new pe(this.node,n,{style:e,side:t})}componentWillUnmount(){this.tooltip.hide(),delete this.tooltip}render(){return this.props.children}};class ge{constructor(e){this.onClick=e}get items(){return[{text:"BetterDiscord Settings",id:"core"},{text:"Plugins",id:"plugins"},{text:"Themes",id:"themes"},{text:"Custom CSS",id:"customcss"}]}get LCitems(){return[{text:"Lightcord Settings",id:"lightcord"},{text:"RichPresence",id:"status"},{text:"Account Info",id:"accountinfo"}]}get component(){const e=o.react.createElement(me,{color:"black",side:"top",text:"BBD's Changelog"},o.react.createElement("div",{className:"bd-changelog-button",onClick:()=>{P.showChangelogModal(b)}},o.react.createElement(oe,{className:"bd-icon",size:"16px"}))),t=o.react.createElement(me,{color:"black",side:"top",text:"Lightcord's Changelog"},o.react.createElement("div",{className:"bd-changelog-button",onClick:()=>{P.showChangelogModal(f)}},o.react.createElement(oe,{className:"bd-icon",size:"16px"})));return[o.react.createElement("span",null,o.react.createElement(ne,{onClick:this.onClick,headerText:"Lightcord",headerButton:t,items:this.LCitems})),o.react.createElement("span",null,o.react.createElement(ne,{onClick:this.onClick,headerText:"Bandaged BD",headerButton:e,items:this.items}))]}get root(){const e=L.query("#bd-settings-sidebar");return e||(this.injectRoot()?this.root:null)}injectRoot(){const e=L.queryAll("[class*='side-'] > [class*='item-']:not([class*=Danger])"),t=e[e.length-1];return!!t&&(t.parentElement.insertBefore(L.createElement('