(function(){let n=window.require("fs"),d=window.require("process"),r=d.platform,o=("win32"===r?d.env.APPDATA:"darwin"===r?d.env.HOME+"/Library/Preferences":process.env.HOME+"/.config")+"/BetterDiscord/",c={};if(n.existsSync(`${o}localStorage.json`))try{c=JSON.parse(n.readFileSync(`${o}localStorage.json`))}catch(b){console.log(b)}else if(n.existsSync("localStorage.json"))try{c=JSON.parse(n.readFileSync("localStorage.json"))}catch(b){console.log(b)}var l=c;l.setItem=function(b,g){l[b]=g,this.save()},l.getItem=function(b){return l[b]||null},l.save=function(){n.writeFileSync(`${o}/localStorage.json`,JSON.stringify(this),null,4)};var u=new Proxy(l,{set:function(b,g,f){l[g]=f,l.save()},get:function(b,g){return l[g]||null}});window.localStorage=u})(),(()=>{let n=document.createElement("div");n.className="bd-loaderv2",n.title="BetterDiscord is loading...",document.body.appendChild(n)})(),window.bdStorage={},window.bdStorage.get=function(n){return betterDiscordIPC.sendSync("synchronous-message",{arg:"storage",cmd:"get","var":n})},window.bdStorage.set=function(n,d){betterDiscordIPC.sendSync("synchronous-message",{arg:"storage",cmd:"set","var":n,data:d})},window.bdPluginStorage={},window.bdPluginStorage.get=function(n,d){return betterDiscordIPC.sendSync("synchronous-message",{arg:"pluginstorage",cmd:"get",pn:n,"var":d})},window.bdPluginStorage.set=function(n,d,r){betterDiscordIPC.sendSync("synchronous-message",{arg:"pluginstorage",cmd:"set",pn:n,"var":d,data:r})},betterDiscordIPC.on("asynchronous-reply",(n,d)=>{console.log(n),console.log(d)});var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,pluginModule,themeModule,customCssEditor,dMode,jsVersion=1.792,supportedVersion="0.2.81",mainObserver,twitchEmoteUrlStart="https://static-cdn.jtvnw.net/emoticons/v1/",twitchEmoteUrlEnd="/1.0",ffzEmoteUrlStart="https://cdn.frankerfacez.com/emoticon/",ffzEmoteUrlEnd="/1",bttvEmoteUrlStart="https://cdn.betterttv.net/emote/",bttvEmoteUrlEnd="/1x",mainCore,settings={"Save logs locally":{id:"bda-gs-0",info:"Saves chat logs locally",implemented:!1,hidden:!1,cat:"core"},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0,hidden:!1,cat:"core"},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0,hidden:!1,cat:"core"},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0,hidden:!1,cat:"core"},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0,hidden:!1,cat:"core"},"Dark Mode":{id:"bda-gs-5",info:"Make certain elements dark by default(wip)",implemented:!0,hidden:!1,cat:"core"},"Override Default Emotes":{id:"bda-es-5",info:"Override default emotes",implemented:!1,hidden:!1,cat:"core"},"Voice Disconnect":{id:"bda-dc-0",info:"Disconnect from voice server when closing Discord",implemented:!0,hidden:!1,cat:"core"},"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"},"24 Hour Timestamps":{id:"bda-gs-6",info:"Replace 12hr timestamps with proper ones",implemented:!0,hidden:!1,cat:"core"},"Coloured Text":{id:"bda-gs-7",info:"Make text colour the same as role colour",implemented:!0,hidden:!1,cat:"core"},"BetterDiscord Blue":{id:"bda-gs-b",info:"Replace Discord blue with BD Blue",implemented:!0,hidden:!1,cat:"core"},"Developer Mode":{id:"bda-gs-8",info:"Developer Mode",implemented:!0,hidden:!1,cat:"core"},"Twitch Emotes":{id:"bda-es-7",info:"Show Twitch emotes",implemented:!0,hidden:!1,cat:"emote"},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0,hidden:!1,cat:"emote"},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0,hidden:!1,cat:"emote"},"Emote Menu":{id:"bda-es-0",info:"Show Twitch/Favourite emotes in emote menu",implemented:!0,hidden:!1,cat:"emote"},"Emoji Menu":{id:"bda-es-9",info:"Show Discord emoji menu",implemented:!0,hidden:!1,cat:"emote"},"Emote Autocomplete":{id:"bda-es-3",info:"Autocomplete emote commands",implemented:!1,hidden:!1,cat:"emote"},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!0,hidden:!1,cat:"emote"},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0,hidden:!1,cat:"emote"},"Show emote modifiers":{id:"bda-es-8",info:"Enable emote mods",implemented:!0,hidden:!1,cat:"emote"}},links={"Jiiks.net":{text:"Jiiks.net",href:"thtp://jiiks.net",target:"_blank"},twitter:{text:"Twitter",href:"http://twitter.com/jiiksi",target:"_blank"},github:{text:"Github",href:"http://github.com/jiiks",target:"_blank"}},defaultCookie={version:jsVersion,"bda-gs-0":!1,"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":!1,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-3":!1,"bda-es-4":!1,"bda-es-5":!0,"bda-es-6":!0,"bda-es-7":!0,"bda-gs-b":!0,"bda-es-8":!0,"bda-jd":!0,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0},bdchangelog={changes:{"0a":{title:"1.78 : Temp support for new settingspanel",text:"Added temp support for Discord's new settingspanel until v2.",img:""},"0b":{title:"1.78 : Public Servers",text:"New look and flow for public servers",img:""},"0c":{title:"1.78 : New loading icon",text:"New loading icon will now display in bottom right when BD is loading.",img:""},"0d":{title:"1.78 : New CustomCSS editor look",text:"Updated CustomCSS editor with dark theme",img:""},"0e":{title:"1.78 : BetterDiscord Blue",text:"Replace Discord blue with BetterDiscord blue!",img:""}},fixes:{"0a":{title:"1.792 : Fixed settingspanel injection",text:"Still has some minor bugs",img:""},"0b":{title:"1.791 : Restored Buttons",text:"Restored Open Theme Folder and Open Plugin Folder buttons",img:""},"0c":{title:"1.79 : Settings Saving",text:"Fixed settings not saving with new settings panel",img:""}}},settingsCookie={};function Core(){}Core.prototype.init=function(){function n(){if(console.log(new Date().getTime()+" Defer"),0<$(".guilds-wrapper .guilds").children().length){console.log(new Date().getTime()+" Defer Loaded");var c=$(".guilds>li:first-child"),l=$("
";if(null!=bdchangelog.changes){for(var d in n+="

New Stuff

"}if(null!=bdchangelog.fixes){for(var r in n+="

Fixed

"}if(null!=bdchangelog.upcoming){for(var o in n+="

Coming Soon

"}return n+="
",n},Core.prototype.alert=function(n,d){for(var r="",o=0;5>o;o++)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".length));var c="
BetterDiscord - "+n+"
"+d+"
for support. #support Join
";$("body").append(c),utils.addBackdrop(r)};var emotesFfz={},emotesBTTV={},emotesTwitch={emote:{id:0}},subEmotesTwitch={};function EmoteModule(){}EmoteModule.prototype.init=function(){},EmoteModule.prototype.getBlacklist=function(){$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/data/emotefilter.json",function(n){bemotes=n.blacklist})},EmoteModule.prototype.obsCallback=function(n){for(var o,d=this,r=0;r\""+c+"\"").replace(/﷙/g,""))[0]},EmoteModule.prototype.autoCapitalize=function(){var n=this;$("body").delegate($(".channel-text-area-default textarea:first"),"keyup change paste",function(){if(settingsCookie["bda-es-4"]){var d=$(".channel-text-area-default textarea:first").val();if(void 0!=d){var r=d.split(" ").pop();if(3",{class:"guild",id:"bd-pub-li",css:{height:"20px",display:settingsCookie["bda-gs-1"]?"":"none"}}).append($("
",{class:"guild-inner",css:{height:"20px","border-radius":"4px"}}).append($("",{}).append($("
",{text:"public",id:"bd-pub-button",css:{"line-height":"20px","font-size":"12px"},click:()=>{n.v2p.render()}}))));return d}init(){let n=this,d=$(".guilds>:first-child");d.after(n.button)}get layer(){let n=this,d=``;return d=$(d),d.on("blur",r=>{"bd-pubs-search"===r.relatedTarget.id||(d.focus(),console.log("blur:"),console.log(r))}),d.on("keydown",r=>{if(13===r.which&&"bd-pubs-search"===r.target.id){let o=$("#bd-pubs-layer .ui-tab-bar-item.selected").text();return"All"===o&&(o=""),void n.search(n.query({term:r.target.value,category:o}),!0)}27!==r.which||n.hide()}),d.find(".btn-close").on("click",()=>{n.hide()}),d.find(".ui-tab-bar.SIDE .ui-tab-bar-item").on("click",r=>{let o=r.target.textContent;"All"===o&&(o=""),n.search(n.query({term:$("#bd-pubs-search").val(),category:o}),!0)}),d}serverCard(n){return`
${n.name}
${n.online}/${n.members} Members
${n.description}
${n.categories.join(" ,")}
`}get bdServerCard(){let n={name:"BetterDiscord",icon:"https://cdn.discordapp.com/icons/86004744966914048/c8d49dc02248e1f55caeb897c3e1a26e.webp",online:"7500+",members:"20000+",description:"Official BetterDiscord support server"};return`
${n.name}
Too many members
${n.description}
`}getPanel(){return console.log("pubs get panel"),"
"}getPinnedServer(){return console.log("pubs get pinned server"),"
"}hidePinnedServer(){console.log("pubs hide pinned server")}showPinnedServer(){console.log("pubs show pinned server")}show(){let n=this;$(".layers, .layers-20RVFW").append(n.layer)}hide(){$("#bd-pubs-layer").remove()}loadServers(){console.log("pubs load servers")}search(n,d){let r=this,o=$("#bd-pubs-listing");d&&(o.empty(),$("#bd-pubs-listing-container").hide(),$("#bd-pubs-bg-spinner").show()),$.ajax({method:"GET",url:`${r.endPoint}?${n}`,success:c=>{o.append(r.bdServerCard),c.results.map(l=>{o.append(r.serverCard(l))}),$("#bd-pubs-listing-container").show(),$("#bd-pubs-bg-spinner").hide(),r.setSearchText(1,$(".bd-server-card").size(),c.total,null,$("#bd-pubs-search").val())}})}setSearchText(n,d,r,o,c){o||(o=$("#bd-pubs-layer .ui-tab-bar-item.selected").text());let l=`Showing ${n}-${d} of ${r} results in ${o}`;c&&c.length&&(l+=` for: ${c}`),$("#bd-pubs-results").text(l)}get next(){let n=this;if(!n.next)return null}joinServer(){console.log("pubs join")}joinServerDirect(){console.log("pubs join direct")}escape(){console.log("pubs escape")}query(n){return require("querystring").stringify(n)}}function QuickEmoteMenu(){}QuickEmoteMenu.prototype.init=function(){$(document).on("mousedown",function(b){"rmenu"!=b.target.id&&$("#rmenu").remove()}),this.favoriteEmotes={};var n=bdStorage.get("bdfavemotes");""!==n&&null!==n&&(this.favoriteEmotes=JSON.parse(atob(n)));var d="";d+="
",d+=" ",d+=" ",d+="
",this.qmeHeader=d;var r="";for(var o in r+="
",r+="
",r+="
",r+="
",emotesTwitch)if(emotesTwitch.hasOwnProperty(o)){var c=emotesTwitch[o].id;r+="
",r+=" \"\"",r+=" ",r+="
"}r+="
",r+="
",r+="
",r+="
",this.teContainer=r;var l="";for(var o in l+="
",l+="
",l+="
",l+="
",this.favoriteEmotes){var u=this.favoriteEmotes[o];l+="
",l+=" \"\"",l+=" ",l+="
"}l+="
",l+="
",l+="
",l+="
",this.faContainer=l},QuickEmoteMenu.prototype.favContext=function(n,d){n.stopPropagation();var r=$("
",{id:"rmenu","data-emoteid":$(d).prop("title"),text:"Remove"});return r.css({top:n.pageY-$("#bda-qem-favourite-container").offset().top,left:n.pageX-$("#bda-qem-favourite-container").offset().left}),$(d).parent().append(r),r.on("click",function(o){return o.preventDefault(),o.stopPropagation(),$(this).remove(),delete quickEmoteMenu.favoriteEmotes[$(this).data("emoteid")],quickEmoteMenu.updateFavorites(),!1}),!1},QuickEmoteMenu.prototype.switchHandler=function(n){this.switchQem($(n).attr("id"))},QuickEmoteMenu.prototype.switchQem=function(n){var d=$("#bda-qem-twitch"),r=$("#bda-qem-favourite"),o=$("#bda-qem-emojis");d.removeClass("active"),r.removeClass("active"),o.removeClass("active"),$(".emoji-picker").hide(),$("#bda-qem-favourite-container").hide(),$("#bda-qem-twitch-container").hide();"bda-qem-twitch"===n?(d.addClass("active"),$("#bda-qem-twitch-container").show()):"bda-qem-favourite"===n?(r.addClass("active"),$("#bda-qem-favourite-container").show()):"bda-qem-emojis"===n?(o.addClass("active"),$(".emoji-picker").show()):void 0;this.lastTab=n;var c=$(".emote-icon");c.off(),c.on("click",function(){var l=$(this).attr("title"),u=$(".channel-text-area-default textarea");u.val(" "==u.val().slice(-1)?u.val()+l:u.val()+" "+l)})},QuickEmoteMenu.prototype.obsCallback=function(n){if(settingsCookie["bda-es-9"]?n.removeClass("bda-qme-hidden"):n.addClass("bda-qme-hidden"),!!settingsCookie["bda-es-0"]){this;n.prepend(this.qmeHeader),n.append(this.teContainer),n.append(this.faContainer),void 0==this.lastTab&&(this.lastTab="bda-qem-favourite"),this.switchQem(this.lastTab)}},QuickEmoteMenu.prototype.favorite=function(n,d){this.favoriteEmotes.hasOwnProperty(n)||(this.favoriteEmotes[n]=d),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){var n="";for(var d in n+="
",n+="
",n+="
",n+="
",this.favoriteEmotes){var r=this.favoriteEmotes[d];n+="
",n+=" \"\"",n+=" ",n+="
"}n+="
",n+="
",n+="
",n+="
",this.faContainer=n,$("#bda-qem-favourite-container").replaceWith(n),window.bdStorage.set("bdfavemotes",btoa(JSON.stringify(this.favoriteEmotes)))};function CustomCssEditor(){}CustomCssEditor.prototype.init=function(){var n=this;n.hideBackdrop=!1,n.editor=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{lineNumbers:!0,mode:"css",indentUnit:4,theme:"material",scrollbarStyle:"simple"}),n.editor.on("change",function(o){var c=o.getValue();n.applyCustomCss(c,!1,!1)});var d="";d+="
",d+="
    ",d+="
  • ",d+="
    ",d+="
    ",d+=" Live Update",d+="
    ",d+="
  • ",d+="
  • ",d+="
    ",d+="
    ",d+=" TEMPDISABLED",d+="
    ",d+="
  • ",d+="
  • ",d+="
    ",d+="
    ",d+=" Hide Backdrop",d+="
    ",d+="
  • ",d+="
",d+="
",d+=" ",d+=" ",d+=" ",d+="
",d+="
",this.attachEditor=d,$("#bd-customcss-innerpane").append(d),$("#bd-customcss-detached-update").on("click",function(){return n.applyCustomCss(n.editor.getValue(),!0,!1),!1}),$("#bd-customcss-detached-save").on("click",function(){return n.applyCustomCss(n.editor.getValue(),!1,!0),!1});var r="";r+="
",r+="
",r+="
",r+="
",this.detachedEditor=r},CustomCssEditor.prototype.attach=function(){$("#editor-detached").hide(),$("#app-mount").removeClass("bd-detached-editor"),$("#bd-customcss-pane").append($("#bd-customcss-innerpane")),$("#bd-customcss-detached-detach").show(),$("#bd-customcss-detach-container").remove()},CustomCssEditor.prototype.detach=function(){this;this.attach(),$("#editor-detached").show(),$("#bd-customcss-detached-detach").hide(),$("#app-mount").addClass("bd-detached-editor"),$(".app").parent().append(this.detachedEditor),$("#bd-customcss-detach-editor").append($("#bd-customcss-innerpane"))},CustomCssEditor.prototype.applyCustomCss=function(n,d,r){0==$("#customcss").length&&$("head").append(""),(d||settingsCookie["bda-css-0"])&&$("#customcss").html(n),r&&window.bdStorage.set("bdcustomcss",btoa(n))};var settingsButton=null,panel=null;function SettingsPanel(){utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/codemirror.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/mode/css/css.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/addon/scroll/simplescrollbars.min.js"),utils.injectCss("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/addon/scroll/simplescrollbars.min.css"),utils.injectCss("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/theme/material.min.css"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.4.2/Sortable.min.js")}SettingsPanel.prototype.init=function(){var n=this;n.v2SettingsPanel=new V2_SettingsPanel,n.construct();var d=$("body");settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?d.addClass("bd-minimal"):d.removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?d.addClass("bd-minimal-chan"):d.removeClass("bd-minimal-chan"),settingsCookie["bda-gs-4"]&&voiceMode.enable(),settingsCookie["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),settingsCookie["bda-es-6"]?(emoteNamePopup=$("
"),$(document).on("mouseover",".emote",function(){var r=$(this).offset(),o=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(o),$(emoteNamePopup).css("left",r.left-25),$(emoteNamePopup).css("top",r.top-37),$(".app").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote"),settingsCookie["bda-gs-8"]?dMode.enable():dMode.disable(),settingsCookie["bda-gs-b"]?$("body").addClass("bd-blue"):$("body").removeClass("bd-blue")};var customCssInitialized=!1,lastTab="";SettingsPanel.prototype.changeTab=function(n){this;lastTab=n;$("#bd-control-groups");switch($(".bd-tab").removeClass("selected"),$(".bd-pane").hide(),$("#"+n).addClass("selected"),$("#"+n.replace("tab","pane")).show(),n){case"bd-settings-tab":$(".bda-slist-top").show();break;case"bd-emotes-tab":$(".bda-slist-top").show();break;case"bd-customcss-tab":$(".bda-slist-top").show(),customCssInitialized||(customCssEditor.init(),customCssInitialized=!0);break;case"bd-themes-tab":$(".bda-slist-top:first").hide();break;case"bd-plugins-tab":$(".bda-slist-top:first").hide();break;default:$(".bda-slist-top").show();}},SettingsPanel.prototype.updateSetting=function(n){var d=$(n).children().find("input[type=\"checkbox\"]"),r=!d.is(":checked"),o=d.attr("id");d.prop("checked",r),"bda-css-2"==o&&($("#app-mount").removeClass("bd-hide-bd"),customCssEditor.hideBackdrop=r,r&&$("#app-mount").addClass("bd-hide-bd")),"bda-gs-8"==o&&r&&mainCore.alert("Developer Mode Enabled","Use F8 to break/resume execution
More coming soon"),settingsCookie[o]=r,this.updateSettings()},SettingsPanel.prototype.updateSettings=function(){settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-b"]?$("body").addClass("bd-blue"):$("body").removeClass("bd-blue"),settingsCookie["bda-gs-2"]?$("body").addClass("bd-minimal"):$("body").removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?$("body").addClass("bd-minimal-chan"):$("body").removeClass("bd-minimal-chan"),settingsCookie["bda-gs-1"]?$("#bd-pub-li").show():$("#bd-pub-li").hide(),settingsCookie["bda-gs-4"]?voiceMode.enable():voiceMode.disable(),$("#app-mount").removeClass("bda-dark"),settingsCookie["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),settingsCookie["bda-es-6"]?(emoteNamePopup=$("
"),$(document).on("mouseover",".emote",function(){var n=$(this).offset(),d=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(d),$(emoteNamePopup).css("left",n.left-25),$(emoteNamePopup).css("top",n.top-32),$("div[data-reactid='.0.1.1']").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote"),settingsCookie["bda-gs-8"]?dMode.enable():dMode.disable(),mainCore.saveSettings()},SettingsPanel.prototype.construct=function(){var d=this;panel=$("
",{id:"bd-pane",class:"settings-inner",css:{display:"none"}});var r="
",settingsButton=$("
",{class:"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:function(){$(".tab-bar-item").removeClass("selected"),settingsButton.addClass("selected"),$(".form .settings-right .settings-inner").first().hide(),panel.show(),""==lastTab?d.changeTab("bd-settings-tab"):d.changeTab(lastTab)}}),panel.html(r),this.panel=panel},SettingsPanel.prototype.inject=function(n){if(!this.injectNew(n)&&"childList"==n.type&&!(0>=n.addedNodes.length)&&!(0>=$(n.addedNodes[0]).find(".user-settings-modal").length)){var d=this;this.panel.hide();var r=$(".tab-bar.SIDE").first();$(".tab-bar.SIDE .tab-bar-item").click(function(){$(".form .settings-right .settings-inner").first().show(),$("#bd-settings-new").removeClass("selected"),d.panel.hide()}),r.append(settingsButton),$(".form .settings-right .settings-inner").last().after(d.panel),$("#bd-settings-new").removeClass("selected")}},SettingsPanel.prototype.injectNew=function(n){let d=this;if(n.target.classList.contains("layers")||n.target.classList.contains("layers-20RVFW")){if($(".guild-settings-base-section").length)try{n.addedNodes[0].setAttribute("layer-id","server-settings")}catch(r){}if($(".socialLinks-1oZoF3").length){try{n.addedNodes[0].setAttribute("layer-id","user-settings")}catch(r){}if(!$("#bd-settings-sidebar").length)return d.v2SettingsPanel.renderSidebar(),!0}}},SettingsPanel.prototype.versionInfo=function(){let n=this,d=$("
",{class:"bd-versioninfo-wrapper"}).append($("",{text:`BetterDiscord v${"undefined"==typeof version?bdVersion:version}:${jsVersion} by `})).append($("",{text:"Jiiks",href:"https://google.com",target:"_blank"}));return d},SettingsPanel.prototype.tabBarNew=function(){let n=this,d=$("
",{class:"tab-bar TOP",style:"border-bottom:none"});return[{id:"bd-core",text:"Core"},{id:"bd-emotes",text:"Emotes"},{id:"bd-customcss",text:"Custom CSS"},{id:"bd-plugins",text:"Plugins"},{id:"bd-themes",text:"Themes"}].map(o=>{d.append($("
",{class:"tab-bar-item bd-tab",text:o.text,id:o.id,click:()=>n.changeTabNew(o.id)}))}),d},SettingsPanel.prototype.changeTabNew=function(n){$(".bd-tab").removeClass("selected"),$(`#${n}`).addClass("selected"),$(".bd-pane").hide(),$(`#${n}-pane`).show(),"bd-customcss"!==n||customCssInitialized||(customCssEditor.init(),customCssInitialized=!0)},SettingsPanel.prototype.updateSettingNew=function(n,d){"bda-css-2"==n&&($("#app-mount").removeClass("bd-hide-bd"),customCssEditor.hideBackdrop=d,d&&$("#app-mount").addClass("bd-hide-bd")),"bda-gs-8"==n&&d&&mainCore.alert("Developer Mode Enabled","Use F8 to break/resume execution
More coming soon"),settingsCookie[n]=d,this.updateSettings()},SettingsPanel.prototype.settingsSwitch=function(n){let d=this,r=settings[n];return $("
",{class:"ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"}).append($("
",{class:"ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"}).append($("

",{class:"ui-form-title h3 margin-reset margin-reset ui-flex-child",text:n})).append($("