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