diff --git a/.eslintrc b/.eslintrc index 35cbe007..dc148d58 100644 --- a/.eslintrc +++ b/.eslintrc @@ -115,9 +115,7 @@ "Symbol": "readonly", "alert": "off", - "atob": "off", "blur": "off", - "btoa": "off", "caches": "off", "close": "off", "closed": "off", diff --git a/.travis.yml b/.travis.yml index a5eecf2b..3ce475a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,9 @@ language: node_js node_js: - "node" +git: + autocrlf: true + branches: only: - development @@ -20,7 +23,7 @@ deploy: skip_cleanup: true github_token: $TRAVIS_ACCESS keep_history: true - local_dir: ./dist + local_dir: . name: BetterDiscord Deployment target_branch: gh-pages on: diff --git a/assets/emotes/blacklist.json b/assets/emotes/blocklist.json similarity index 100% rename from assets/emotes/blacklist.json rename to assets/emotes/blocklist.json diff --git a/dist/remote.js b/dist/remote.js new file mode 100644 index 00000000..df08efef --- /dev/null +++ b/dist/remote.js @@ -0,0 +1 @@ +!function(e){var t={};function s(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,s),i.l=!0,i.exports}s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=9)}([function(e,t){e.exports=require("electron")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("request")},function(e,t){e.exports=require("module")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("rimraf")},function(e,t){e.exports=require("yauzl")},function(e,t){e.exports=require("mkdirp")},function(e,t,s){"use strict";s.r(t);var n={};s.r(n),s.d(n,"CustomCSS",(function(){return wt})),s.d(n,"WindowPrefs",(function(){return St})),s.d(n,"TwentyFourHour",(function(){return Ct})),s.d(n,"ClassNormalizer",(function(){return Mt})),s.d(n,"PublicServers",(function(){return Bt})),s.d(n,"VoiceDisconnect",(function(){return It})),s.d(n,"ColoredText",(function(){return Ft})),s.d(n,"DarkMode",(function(){return Ot})),s.d(n,"MinimalMode",(function(){return Rt})),s.d(n,"VoiceMode",(function(){return Ut})),s.d(n,"EmoteModule",(function(){return rt})),s.d(n,"EmoteMenu",(function(){return Jt})),s.d(n,"CopySelector",(function(){return Kt})),s.d(n,"Debugger",(function(){return Xt})),s.d(n,"ReactDevTools",(function(){return is}));var i={local:!1,localPath:"",localServer:"//localhost:8080",minified:!0,version:"0.3.0",branch:"master",repo:"rauenzi",minSupportedVersion:"0.3.0",bbdVersion:"1.0.0"},o=[{type:"category",id:"general",name:"General",collapsible:!0,settings:[{type:"switch",id:"download",value:!0},{type:"switch",id:"emoteMenu",value:!0},{type:"switch",id:"hideEmojiMenu",value:!1,enableWith:"emoteMenu"},{type:"switch",id:"showNames",value:!0},{type:"switch",id:"modifiers",value:!0},{type:"switch",id:"animateOnHover",value:!1}]},{type:"category",id:"categories",name:"Categories",collapsible:!0,settings:[{type:"switch",id:"twitchglobal",value:!0},{type:"switch",id:"twitchsubscriber",value:!1},{type:"switch",id:"frankerfacez",value:!0},{type:"switch",id:"bttv",value:!0}]}],r=[{type:"category",id:"general",collapsible:!0,settings:[{type:"switch",id:"emotes",value:!0},{type:"switch",id:"publicServers",value:!0},{type:"switch",id:"voiceDisconnect",value:!1},{type:"switch",id:"twentyFourHour",value:!1},{type:"switch",id:"classNormalizer",value:!0},{type:"switch",id:"showToasts",value:!0}]},{type:"category",id:"appearance",collapsible:!0,settings:[{type:"switch",id:"voiceMode",value:!1},{type:"switch",id:"minimalMode",value:!1},{type:"switch",id:"hideChannels",value:!1,enableWith:"minimalMode"},{type:"switch",id:"darkMode",value:!0},{type:"switch",id:"coloredText",value:!1}]},{type:"category",id:"addons",collapsible:!0,shown:!1,settings:[{type:"switch",id:"addonErrors",value:!0},{type:"switch",id:"autoScroll",value:!0},{type:"switch",id:"autoReload",value:!0},{type:"dropdown",id:"editAction",value:"detached",options:[{value:"detached"},{value:"system"}]}]},{type:"category",id:"customcss",collapsible:!0,shown:!1,settings:[{type:"switch",id:"customcss",value:!0},{type:"switch",id:"liveUpdate",value:!1},{type:"dropdown",id:"openAction",value:"settings",options:[{value:"settings"},{value:"detached"},{value:"system"}]}]},{type:"category",id:"developer",collapsible:!0,shown:!1,settings:[{type:"switch",id:"debuggerHotkey",value:!1},{type:"switch",id:"copySelector",value:!1},{type:"switch",id:"reactDevTools",value:!1}]},{type:"category",id:"window",collapsible:!0,shown:!1,settings:[{type:"switch",id:"transparency",value:!1},{type:"switch",id:"frame",value:!1,hidden:!0}]}],a={Panels:{plugins:"Plugins",themes:"Themes",customcss:"Custom CSS"},Collections:{settings:{name:"Settings",general:{name:"General",emotes:{name:"Emote System",note:"Enables BD's emote system"},publicServers:{name:"Public Servers",note:"Display public servers button"},voiceDisconnect:{name:"Voice Disconnect",note:"Disconnect from voice server when closing Discord"},twentyFourHour:{name:"24-Hour Timestamps",note:"Hides channels when in minimal mode"},classNormalizer:{name:"Normalize Classes",note:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)"},showToasts:{name:"Show Toasts",note:"Shows a small notification for important information"}},appearance:{name:"Appearance",voiceMode:{name:"Voice Mode",note:"Hides everything that isn't voice chat"},minimalMode:{name:"Minimal Mode",note:"Hide elements and reduce the size of elements"},hideChannels:{name:"Hide Channels",note:"Hides channels when in minimal mode"},darkMode:{name:"Dark Mode",note:"Make certain elements dark by default"},coloredText:{name:"Colored Text",note:"Make text colour the same as role color"}},addons:{name:"Addon Manager",addonErrors:{name:"Show Addon Errors",note:"Shows a modal with plugin/theme errors"},autoScroll:{name:"Scroll To Settings",note:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)"},autoReload:{name:"Automatic Loading",note:"Automatically loads, reloads, and unloads plugins and themes"},editAction:{name:"Edit Action",note:"Where plugins & themes appear when editing",options:{detached:"Detached Window",system:"System Editor"}}},customcss:{name:"Custom CSS",customcss:{name:"Custom CSS",note:"Enables the Custom CSS tab"},liveUpdate:{name:"Live Update",note:"Updates the css as you type"},startDetached:{name:"Start Detached",note:"Clicking the Custom CSS tab opens the editor in a separate window"},nativeOpen:{name:"Open in Native Editor",note:"Clicking the Custom CSS tab opens your custom css in your native editor"},openAction:{name:"Editor Location",note:"Where Custom CSS should open by default",options:{settings:"Settings Menu",detached:"Detached Window",system:"System Editor"}}},developer:{name:"Developer Settings",debuggerHotkey:{name:"Debugger Hotkey",note:"Allows activating debugger when pressing F8"},copySelector:{name:"Copy Selector",note:'Adds a "Copy Selector" option to context menus when developer mode is active'},reactDevTools:{name:"React Developer Tools",note:"Injects your local installation of React Developer Tools into Discord"}},window:{name:"Window Preferences",transparency:{name:"Enable Transparency",note:"Enables the main window to be see-through (requires restart)"},frame:{name:"Window Frame",note:"Adds the native os window frame to the main window"}}},emotes:{name:"Emotes",general:{name:"General",download:{name:"Download Emotes",note:"Download emotes whenever they are out of date"},emoteMenu:{name:"Emote Menu",note:"Show Twitch/Favourite emotes in emote menu"},hideEmojiMenu:{name:"Hide Emoji Menu",note:"Hides Discord's emoji menu when using emote menu"},autoCaps:{name:"Emote Autocapitalization",note:"Autocapitalize emote commands"},showNames:{name:"Show Names",note:"Show emote names on hover"},modifiers:{name:"Show Emote Modifiers",note:"Enable emote mods (flip, spin, pulse, spin2, spin3, 1spin, 2spin, 3spin, tr, bl, br, shake, shake2, shake3, flap)"},animateOnHover:{name:"Animate On Hover",note:"Only animate the emote modifiers on hover"}},categories:{name:"Categories",twitchglobal:{name:"Twitch Globals",note:"Show Twitch global emotes"},twitchsubscriber:{name:"Twitch Subscribers",note:"Show Twitch subscriber emotes"},frankerfacez:{name:"FrankerFaceZ",note:"Show emotes from FFZ"},bttv:{name:"BetterTTV",note:"Show emotes from BTTV"}}}},Addons:{title:"{{name}} v{{version}} by {{author}}",openFolder:"Open {{type}} Folder",reload:"Reload",addonSettings:"Settings",website:"Website",source:"Source",invite:"Support Server",donate:"Donate",patreon:"Patreon",name:"Name",author:"Author",version:"Version",added:"Date Added",modified:"Date Modified",search:"Search {{type}}",editAddon:"Edit",deleteAddon:"Delete",confirmDelete:"Are you sure you want to delete {{name}}?",confirmationText:"You have unsaved changes to {{name}}. Closing this window will lose all those changes.",enabled:"{{name}} has been enabled.",disabled:"{{name}} has been disabled.",couldNotEnable:"{{name}} could not be enabled.",couldNotDisable:"{{name}} could not be disabled.",couldNotStart:"{{name}} could not be started.",couldNotStop:"{{name}} could not be stopped.",methodError:"{{method}} could not be fired.",unknownAuthor:"Unknown Author",noDescription:"Description not provided.",alreadyExists:"There is already a {{type}} with name {{name}}",alreadWatching:"Already watching addons.",metaError:"META could not be parsed.",missingNameData:"META missing name data.",metaNotFound:"META was not found.",compileError:"Could not be compiled.",wasUnloaded:"{{name}} was unloaded.",alreadyWatching:"Already watching {{prefix}} addons.",startingWatch:"Starting to watch {{prefix}} addons.",wasNotWatching:"Was not watching {{prefix}} addons.",noLongerWatching:"No longer watching {{prefix}} addons."},CustomCSS:{confirmationText:"You have unsaved changes to your Custom CSS. Closing this window will lose all those changes.",update:"Update",save:"Save",openNative:"Open in System Editor",openDetached:"Detach Window",settings:"Editor Settings",editorTitle:"Custom CSS Editor"},Developer:{copySelector:"Copy Selector"},Emotes:{loading:"Loading emotes in the background do not reload.",loaded:"All emotes successfully loaded.",clearEmotes:"Clear Emote Data",favoriteAction:"Favorite!"},PublicServers:{button:"public",join:"Join",joining:"Joining",joined:"Joined",loading:"Loading",loadMore:"Load More",notConnected:"Not connected to DiscordServers.com!",search:"Search",connect:"Connect",reconnect:"Reconnect",categories:"Categories",connection:"Connected as: {{username}}#{{discriminator}}",results:"Showing {{start}}-{{end}} of {{total}} results in {{category}}",query:"for {{query}}"},Modals:{confirmAction:"Are You Sure?",okay:"Okay",cancel:"Cancel",close:"Close",name:"Name",message:"Message",error:"Error",addonErrors:"Addon Errors",restartRequired:"Restart Required",restartNow:"Restart Now",restartLater:"Restart Later",additionalInfo:"Additional Info"},ReactDevTools:{notFound:"Extension Not Found",notFoundDetails:"Unable to find the React Developer Tools extension on your PC. Please install the extension on your local Chrome installation."},Sorting:{sortBy:"Sort By",order:"Order",ascending:"Ascending",descending:"Descending"},Startup:{notSupported:"Not Supported",versionMismatch:"BandagedBD Injector v{{injector}} is not supported by the latest remote (v{{remote}}).\n\nPlease download the latest version from [GitHub](https://github.com/rauenzi/BetterDiscordApp/releases/latest)",incompatibleApp:"BandagedBD does not work with {{app}}. Please uninstall one of them.",updateNow:"Update Now",maybeLater:"Maybe Later",updateAvailable:"Update Available",updateInfo:"There is an update available for BandagedBD's Injector ({{version}}).\n\nYou can either update and restart now, or later.",updateFailed:"Could Not Update",manualUpdate:"Unable to update automatically, please download the installer and reinstall normally.\n\n[Download Installer](https://github.com/rauenzi/BetterDiscordApp/releases/latest)",jqueryFailed:"jQuery Failed To Load",jqueryFailedDetails:"jQuery could not be loaded, and some plugins may not work properly. Proceed at your own risk."},WindowPrefs:{enabledInfo:"This option requires a transparent theme in order to work properly. On Windows this may break your aero snapping and maximizing.\n\nIn order to take effect, Discord needs to be restarted. Do you want to restart now?",disabledInfo:"In order to take effect, Discord needs to be restarted. Do you want to restart now?"}},l={video:"https://i.zackrauen.com/EEM6Nor0XW.mp4",poster:"https://i.imgur.com/tNGALts.jpeg",description:"The rewrite you didn't even know about is finally here.",changes:[{title:"What's New?",items:["**Everything** is entirely rewritten, for better or worse.","**Emotes and CustomCSS** can be completely turned off for those not interested. It saves on memory too but not loading those components.","**Floating editors** for both custom css and plugins/themes are now available. (See video above)","**Settings panels** are completely new and sleek. They are also highly extensible for potential future features :eyes:","**Translations** are now integrated starting with only a couple languages, but feel free to contribute your own!","**Emote menu** now uses React Patching and properly integrates into the new Emoji Picker. (Thanks Strencher#1044!)"]},{title:"Minor Stuff",type:"improved",items:["**Patcher API** was added to `BdApi` under `BdApi.Patcher`. The old `BdApi.monkeyPatch` was patched to use the Patcher as well. This allows plugins and patches to play nice with one another.","**jQuery** usage was totally eliminated and is now ___deprecated___ for plugins.","**General performance** improvements throughout the app, from startup to emotes to addons.","**Exporting** by plugins is now highly encouraged over trying to match your meta name and class name."]},{title:"Fixes",type:"fixed",items:["There are a lot of little issues that this rewrite fixes.","I forgot to write them down","But I'm sure many more will be found soon"]}]};const d={err:"error",error:"error",dbg:"debug",debug:"debug",log:"log",warn:"warn",info:"info"};class c{static stacktrace(e,t,s){console.error(`%c[${e}]%c ${t}\n\n%c`,"color: #3a71c1; font-weight: 700;","color: red; font-weight: 700;","color: red;",s)}static err(e,...t){c._log(e,t,"error")}static warn(e,...t){c._log(e,t,"warn")}static info(e,...t){c._log(e,t,"info")}static debug(e,...t){c._log(e,t,"debug")}static log(e,...t){c._log(e,t)}static _log(e,t,s="log"){s=c.parseType(s),Array.isArray(t)||(t=[t]),console[s](`%c[BandagedBD]%c [${e}]%c`,"color: #3E82E5; font-weight: 700;","color: #3a71c1;","",...t)}static parseType(e){return d[e]||"log"}}class h{static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"-")}static addStyle(e,t){document.head.append(h.createElement(``))}static removeStyle(e){const t=document.getElementById(e);t&&t.remove()}static addScript(e,t){return new Promise(s=>{const n=document.createElement("script");n.id=e,n.src=t,n.type="text/javascript",n.onload=s,document.head.append(n)})}static removeScript(e){e=this.escapeID(e);const t=document.getElementById(e);t&&t.remove()}static animate({timing:e=(e=>e),update:t,duration:s}){const n=performance.now();requestAnimationFrame((function i(o){let r=(o-n)/s;r>1&&(r=1);const a=e(r);t(a),r<1&&requestAnimationFrame(i)}))}static Q(e){const t=this.parseHTML(e);return(t instanceof NodeList?Array.from(t).some(e=>1===e.nodeType):1===t.nodeType)?t:this.query(e)}static query(e,t){return t||(t=document),t.querySelector(e)}static queryAll(e,t){return t||(t=document),t.querySelectorAll(e)}static parseHTML(e,t=!1){const s=document.createElement("template");s.innerHTML=e;const n=s.content.cloneNode(!0);return t?n:n.childNodes.length>1?n.childNodes:n.childNodes[0]}static createElement(e,t=!1){return this.parseHTML(e,t)}static escapeHTML(e){const t=document.createTextNode(""),s=document.createElement("span");return s.append(t),t.nodeValue=e,s.innerHTML}static addClass(e,...t){t=t.flat().filter(e=>e);for(let e=0;ee),e.classList.add(...t),e}static removeClass(e,...t){for(let e=0;ee),e.classList.remove(...t),e}static toggleClass(e,t,s){return t=t.toString().split(" ").filter(e=>e),void 0!==s?t.forEach(t=>e.classList.toggle(t,s)):t.forEach(t=>e.classList.toggle(t)),e}static hasClass(e,t){return t.toString().split(" ").filter(e=>e).every(t=>e.classList.contains(t))}static replaceClass(e,t,s){return e.classList.replace(t,s),e}static appendTo(e,t){return"string"==typeof t&&(t=this.query(t)),t?(t.append(e),e):null}static prependTo(e,t){return"string"==typeof t&&(t=this.query(t)),t?(t.prepend(e),e):null}static insertAfter(e,t){return t.parentNode.insertBefore(e,t.nextSibling),e}static after(e,t){return e.parentNode.insertBefore(t,e.nextSibling),e}static next(e,t=""){return t?e.querySelector("+ "+t):e.nextElementSibling}static nextAll(e){return e.querySelectorAll("~ *")}static nextUntil(e,t){const s=[];for(;e.nextElementSibling&&!e.nextElementSibling.matches(t);)s.push(e=e.nextElementSibling);return s}static previous(e,t=""){const s=e.previousElementSibling;return t?s&&s.matches(t)?s:null:s}static previousAll(e){const t=[];for(;e.previousElementSibling;)t.push(e=e.previousElementSibling);return t}static previousUntil(e,t){const s=[];for(;e.previousElementSibling&&!e.previousElementSibling.matches(t);)s.push(e=e.previousElementSibling);return s}static indexInParent(e){const t=e.parentNode.childNodes;let s=0;for(let n=0;n "+t)}static findChildren(e,t){return e.querySelectorAll(":scope > "+t)}static parents(e,t=""){const s=[];if(t)for(;e.parentElement&&e.parentElement.closest(t);)s.push(e=e.parentElement.closest(t));else for(;e.parentElement;)s.push(e=e.parentElement);return s}static parentsUntil(e,t){const s=[];for(;e.parentElement&&!e.parentElement.matches(t);)s.push(e=e.parentElement);return s}static siblings(e,t="*"){return Array.from(e.parentElement.children).filter(s=>s!=e&&s.matches(t))}static css(e,t,s){return void 0===s?global.getComputedStyle(e)[t]:(e.style[t]=s,e)}static width(e,t){return void 0===t?parseInt(getComputedStyle(e).width):(e.style.width=t,e)}static height(e,t){return void 0===t?parseInt(getComputedStyle(e).height):(e.style.height=t,e)}static text(e,t){return void 0===t?e.textContent:e.textContent=t}static innerWidth(e){return e.clientWidth}static innerHeight(e){return e.clientHeight}static outerWidth(e){return e.offsetWidth}static outerHeight(e){return e.offsetHeight}static offset(e){return e.getBoundingClientRect()}static get listeners(){return this._listeners||(this._listeners={})}static on(e,t,s,n){const[i,o]=t.split("."),r=s&&n;n||(n=s);const a=r?function(e){e.target.matches(s)&&n(e)}:n;e.addEventListener(i,a);const l=()=>{e.removeEventListener(i,a)};if(o){this.listeners[o]||(this.listeners[o]=[]);const t=()=>{l(),this.listeners[o].splice(this.listeners[o].findIndex(t=>t.event==i&&t.element==e),1)};return this.listeners[o].push({event:i,element:e,cancel:t}),t}return l}static once(e,t,s,n){const[i,o]=t.split("."),r=s&&n;n||(n=s);const a=r?function(t){t.target.matches(s)&&(n(t),e.removeEventListener(i,a))}:function(t){n(t),e.removeEventListener(i,a)};e.addEventListener(i,a);const l=()=>{e.removeEventListener(i,a)};if(o){this.listeners[o]||(this.listeners[o]=[]);const t=()=>{l(),this.listeners[o].splice(this.listeners[o].findIndex(t=>t.event==i&&t.element==e),1)};return this.listeners[o].push({event:i,element:e,cancel:t}),t}return l}static __offAll(e,t){const[s,n]=e.split(".");let i=e=>e.event==s,o=e=>e;t&&(i=e=>e.event==s&&e.element==t,o=e=>e.element==t);const r=this.listeners[n]||[],a=s?r.filter(i):r.filter(o);for(let e=0;e{this.observer.unsubscribe(n),t()};return this.observer.subscribe(n,t=>{const n=Array.from(s?t.addedNodes:t.removedNodes),i=n.indexOf(e)>-1,o=n.some(t=>t.contains(e));return i||o}),e}static onMount(e,t){return this.onMountChange(e,t)}static onUnmount(e,t){return this.onMountChange(e,t,!1)}static onAdded(e,t){return this.onMount(e,t)}static onRemoved(e,t){return this.onUnmount(e,t,!1)}static wrap(e){const t=this.parseHTML('
');for(let s=0;s1?n.childNodes:n.childNodes[0]}static getTextArea(){return h.query(".channelTextArea-1LDbYG textarea")}static insertText(e,t){e.focus(),e.selectionStart=0,e.selectionEnd=e.value.length,document.execCommand("insertText",!1,t)}static escape(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}static testJSON(e){try{return JSON.parse(e)}catch(e){return!1}}static suppressErrors(e,t){return(...s)=>{try{return e(...s)}catch(e){c.stacktrace("SuppressedError","Error occurred in "+t,e)}}}static onRemoved(e,t){const s=new MutationObserver(n=>{for(let i=0;i-1,l=r.some(t=>t.contains(e));(a||l)&&(s.disconnect(),t())}});s.observe(document.body,{subtree:!0,childList:!0})}static isEmpty(e){if(null==e||null==e||""==e)return!0;if("object"!=typeof e)return!1;if(Array.isArray(e))return 0==e.length;for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}static memoizeObject(e){const t=new Proxy(e,{get:function(e,t){if(e.hasOwnProperty(t)){if(Object.getOwnPropertyDescriptor(e,t).get){const s=e[t];delete e[t],e[t]=s}return e[t]}},set:function(e,t,s){return e.hasOwnProperty(t)?c.error("MemoizedObject","Trying to overwrite existing property"):(e[t]=s,e[t])}});return Object.defineProperty(t,"hasOwnProperty",{value:function(e){return void 0!==this[e]}}),t}static extend(e,...t){for(let s=0;se.startsWith("__reactInternalInstance"))]||null}static getOwnerInstance(e,{include:t,exclude:s=["Popout","Tooltip","Scroller","BackgroundFlash"],filter:n=(e=>e)}={}){if(void 0===e)return;const i=void 0===t,o=i?s:t;function r(e){const t=function(e){const t=e.type;return t&&(t.displayName||t.name)||null}(e);return null!==t&&!!(o.includes(t)^i)}let a=this.getReactInstance(e);for(a=a&&a.return;null!==a;a=a.return){if(null===a)continue;const e=a.stateNode;if(null!==a&&!(e instanceof HTMLElement)&&r(a)&&n(e))return e}return null}}class p{static byProperties(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&e.every(e=>void 0!==n[e])}}static byPrototypeFields(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&(!!n.prototype&&e.every(e=>void 0!==n.prototype[e]))}}static byCode(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&-1!==n.toString([]).search(e)}}static byString(...e){return t=>{const s=t.toString([]);for(const t of e)if(!s.includes(t))return!1;return!0}}static byDisplayName(e){return t=>t&&t.displayName===e}static combine(...e){return t=>e.every(e=>e(t))}}const m=e=>{if(e.remove&&e.set&&e.clear&&e.get&&!e.sort)return null;if(!e.getToken&&!e.getEmail&&!e.showToken)return e;return new Proxy(e,{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]}})};class g{static find(e,t=!0){return this.getModule(e,t)}static findAll(e){return this.getModule(e,!1)}static findByUniqueProperties(e,t=!0){return t?this.getByProps(...e):this.getAllByProps(...e)}static findByDisplayName(e){return this.getByDisplayName(e)}static getModule(e,t=!0){const s=this.getAllModules(),n=[];for(const i in s){if(!s.hasOwnProperty(i))continue;const o=s[i],{exports:r}=o;let a=null;if(r&&(r.__esModule&&r.default&&e(r.default)&&(a=r.default),e(r)&&(a=r),a)){if(t)return m(a);n.push(m(a))}}return t||0==n.length?void 0:n}static getModules(e){return this.getModule(e,!1)}static getByDisplayName(e){return this.getModule(p.byDisplayName(e),!0)}static getByRegex(e,t=!0){return this.getModule(p.byCode(e),t)}static getByPrototypes(...e){return this.getModule(p.byPrototypeFields(e),!0)}static getAllByPrototypes(...e){return this.getModule(p.byPrototypeFields(e),!1)}static getByProps(...e){return this.getModule(p.byProperties(e),!0)}static getAllByProps(...e){return this.getModule(p.byProperties(e),!1)}static getByString(...e){return this.getModule(p.byString(...e),!0)}static getAllByString(...e){return this.getModule(p.byString(...e),!1)}static get require(){if(this._require)return this._require;const e="bbd-webpackmodules",t=window.webpackJsonp.push([[],{[e]:(e,t,s)=>e.exports=s},[[e]]]);return delete t.m[e],delete t.c[e],this._require=t}static getAllModules(){return this.require.c}}var f=u.memoizeObject({get React(){return g.getByProps("createElement","cloneElement")},get ReactDOM(){return g.getByProps("render","findDOMNode")},get Flux(){return g.getByProps("connectStores")},get Events(){return g.getByPrototypes("setMaxListeners","emit")},get GuildStore(){return g.getByProps("getGuild")},get SortedGuildStore(){return g.getByProps("getSortedGuilds")},get SelectedGuildStore(){return g.getByProps("getLastSelectedGuildId")},get GuildSync(){return g.getByProps("getSyncedGuilds")},get GuildInfo(){return g.getByProps("getAcronym")},get GuildChannelsStore(){return g.getByProps("getChannels","getDefaultChannel")},get GuildMemberStore(){return g.getByProps("getMember")},get MemberCountStore(){return g.getByProps("getMemberCounts")},get GuildEmojiStore(){return g.getByProps("getEmojis")},get GuildActions(){return g.getByProps("markGuildAsRead")},get GuildPermissions(){return g.getByProps("getGuildPermissions")},get ChannelStore(){return g.getByProps("getChannels","getDMFromUserId")},get SelectedChannelStore(){return g.getByProps("getLastSelectedChannelId")},get ChannelActions(){return g.getByProps("selectChannel")},get PrivateChannelActions(){return g.getByProps("openPrivateChannel")},get ChannelSelector(){return g.getByProps("selectGuild","selectChannel")},get UserInfoStore(){return g.getByProps("getToken")},get UserSettingsStore(){return g.getByProps("guildPositions")},get AccountManager(){return g.getByProps("register","login")},get UserSettingsUpdater(){return g.getByProps("updateRemoteSettings")},get OnlineWatcher(){return g.getByProps("isOnline")},get CurrentUserIdle(){return g.getByProps("getIdleTime")},get RelationshipStore(){return g.getByProps("isBlocked","getFriendIDs")},get RelationshipManager(){return g.getByProps("addRelationship")},get MentionStore(){return g.getByProps("getMentions")},get UserStore(){return g.getByProps("getCurrentUser")},get UserStatusStore(){return g.getByProps("getStatus","getState")},get UserTypingStore(){return g.getByProps("isTyping")},get UserActivityStore(){return g.getByProps("getActivity")},get UserNameResolver(){return g.getByProps("getName")},get UserNoteStore(){return g.getByProps("getNote")},get UserNoteActions(){return g.getByProps("updateNote")},get EmojiInfo(){return g.getByProps("isEmojiDisabled")},get EmojiUtils(){return g.getByProps("getGuildEmoji")},get EmojiStore(){return g.getByProps("getByCategory","EMOJI_NAME_RE")},get InviteStore(){return g.getByProps("getInvites")},get InviteResolver(){return g.getByProps("findInvite")},get InviteActions(){return g.getByProps("acceptInvite")},get DiscordConstants(){return g.getByProps("Permissions","ActivityTypes","StatusTypes")},get DiscordPermissions(){return g.getByProps("Permissions","ActivityTypes","StatusTypes").Permissions},get PermissionUtils(){return g.getByProps("getHighestRole")},get ColorConverter(){return g.getByProps("hex2int")},get ColorShader(){return g.getByProps("darken")},get TinyColor(){return g.getByPrototypes("toRgb")},get ClassResolver(){return g.getByProps("getClass")},get ButtonData(){return g.getByProps("ButtonSizes")},get IconNames(){return g.getByProps("IconNames")},get NavigationUtils(){return g.getByProps("transitionTo","replaceWith","getHistory")},get MessageStore(){return g.getByProps("getMessages")},get MessageActions(){return g.getByProps("jumpToMessage","_sendMessage")},get MessageQueue(){return g.getByProps("enqueue")},get MessageParser(){return g.getByProps("createMessage","parse","unparse")},get hljs(){return g.getByProps("highlight","highlightBlock")},get SimpleMarkdown(){return g.getByProps("parseBlock","parseInline","defaultOutput")},get ExperimentStore(){return g.getByProps("getExperimentOverrides")},get ExperimentsManager(){return g.getByProps("isDeveloper")},get CurrentExperiment(){return g.getByProps("getExperimentId")},get ImageResolver(){return g.getByProps("getUserAvatarURL","getGuildIconURL")},get ImageUtils(){return g.getByProps("getSizedImageSrc")},get AvatarDefaults(){return g.getByProps("getUserAvatarURL","DEFAULT_AVATARS")},get WindowInfo(){return g.getByProps("isFocused","windowSize")},get TagInfo(){return g.getByProps("VALID_TAG_NAMES")},get DOMInfo(){return g.getByProps("canUseDOM")},get LocaleManager(){return g.getByProps("setLocale")},get Moment(){return g.getByProps("parseZone")},get LocationManager(){return g.getByProps("createLocation")},get Timestamps(){return g.getByProps("fromTimestamp")},get TimeFormatter(){return g.getByProps("dateFormat")},get Strings(){return g.getByProps("Messages").Messages},get StringFormats(){return g.getByProps("a","z")},get StringUtils(){return g.getByProps("toASCII")},get URLParser(){return g.getByProps("Url","parse")},get ExtraURLs(){return g.getByProps("getArticleURL")},get DNDActions(){return g.getByProps("beginDrag")},get DNDSources(){return g.getByProps("addTarget")},get DNDObjects(){return g.getByProps("DragSource")},get MediaDeviceInfo(){return g.getByProps("Codecs","SUPPORTED_BROWSERS")},get MediaInfo(){return g.getByProps("getOutputVolume")},get MediaEngineInfo(){return g.getByProps("MediaEngineFeatures")},get VoiceInfo(){return g.getByProps("EchoCancellation")},get VideoStream(){return g.getByProps("getVideoStream")},get SoundModule(){return g.getByProps("playSound")},get ElectronModule(){return g.getByProps("setBadge")},get Dispatcher(){return g.getByProps("dirtyDispatch")},get PathUtils(){return g.getByProps("hasBasename")},get NotificationModule(){return g.getByProps("showNotification")},get RouterModule(){return g.getByProps("Router")},get APIModule(){return g.getByProps("getAPIBaseURL")},get AnalyticEvents(){return g.getByProps("AnalyticEventConfigs")},get KeyGenerator(){return g.getByRegex(/"binary"/)},get Buffers(){return g.getByProps("Buffer","kMaxLength")},get DeviceStore(){return g.getByProps("getDevices")},get SoftwareInfo(){return g.getByProps("os")},get CurrentContext(){return g.getByProps("setTagsContext")},get GuildClasses(){const e=g.getByProps("wrapper","unreadMentionsBar"),t=g.getByProps("guildsError","selected"),s=g.getByProps("blobContainer");return Object.assign({},e,t,s)},get LayerStack(){return g.getByProps("pushLayer")}});const y=s(2),b=s(1),v=DiscordNative.globals?DiscordNative.globals.releaseChannel:DiscordNative.app?DiscordNative.app.getReleaseChannel():"stable";var w=new class{constructor(){this.data={misc:{}},this.pluginData={},this.cacheData={}}initialize(){y.existsSync(this.baseFolder)||y.mkdirSync(this.baseFolder),y.existsSync(this.dataFolder)||y.mkdirSync(this.dataFolder),y.existsSync(this.localeFolder)||y.mkdirSync(this.localeFolder),y.existsSync(this.emoteFolder)||y.mkdirSync(this.emoteFolder),y.existsSync(this.cacheFile)||y.writeFileSync(this.cacheFile,JSON.stringify({})),y.existsSync(this.customCSS)||y.writeFileSync(this.customCSS,"");const e=y.readdirSync(this.dataFolder).filter(e=>!y.statSync(b.resolve(this.dataFolder,e)).isDirectory()&&e.endsWith(".json"));for(const t of e)this.data[t.split(".")[0]]=require(b.resolve(this.dataFolder,t));this.cacheData=u.testJSON(y.readFileSync(this.cacheFile).toString())||{},this.convertOldData()}convertOldData(){const e=b.join(i.dataPath,"bdstorage.json");if(!y.existsSync(e))return;const t=require(e);y.renameSync(e,e+".bak");const s=(e,t,s,n="json")=>y.writeFileSync(b.resolve(this.baseFolder,e,`${t}.${n}`),JSON.stringify(s,null,4)),n=["stable","canary","ptb"],o=atob(t.bdcustomcss),r=t.bdfavemotes?JSON.parse(atob(t.bdfavemotes)):"";for(const e of n){y.existsSync(b.resolve(this.baseFolder,e))||y.mkdirSync(b.resolve(this.baseFolder,e));const n=t.settings[e];if(!n)continue;const i=n.settings,a={general:{publicServers:i["bda-gs-1"],voiceDisconnect:i["bda-dc-0"],twentyFourHour:i["bda-gs-6"],classNormalizer:i["fork-ps-4"],showToasts:i["fork-ps-2"]},appearance:{voiceMode:i["bda-gs-4"],minimalMode:i["bda-gs-2"],hideChannels:i["bda-gs-3"],darkMode:i["bda-gs-5"],coloredText:i["bda-gs-7"]},addons:{addonErrors:i["fork-ps-1"],autoScroll:i["fork-ps-3"],autoReload:i["fork-ps-5"]},developer:{debuggerHotkey:i["bda-gs-8"],copySelector:i["fork-dm-1"],reactDevTools:i.reactDevTools}},l={general:{download:i["fork-es-3"],emoteMenu:i["bda-es-0"],hideEmojiMenu:!i["bda-es-9"],showNames:i["bda-es-6"],modifiers:i["bda-es-8"],animateOnHover:i["fork-es-2"]},categories:{twitchglobal:i["bda-es-7"],twitchsubscriber:i["bda-es-7"],frankerfacez:i["bda-es-1"],bttv:i["bda-es-2"]}};s(e,"settings",a),s(e,"emotes",l),s(e,"plugins",n.plugins),s(e,"themes",n.themes),s(e,"misc",{favoriteEmotes:r}),y.writeFileSync(b.resolve(this.baseFolder,e,"custom.css"),o)}this.initialize()}get injectionPath(){if(this._injectionPath)return this._injectionPath;const e=s(0).remote.app,t=e.getAppPath(),n=e.getPath("userData"),i=b.resolve(n,e.getVersion(),"modules","discord_desktop_core","injector"),o=b.resolve(t,"..","app"),r=y.existsSync(o)?o:y.existsSync(i)?i:null;return this._injectionPath=r||null}get customCSS(){return this._customCSS||(this._customCSS=b.resolve(this.dataFolder,"custom.css"))}get baseFolder(){return this._baseFolder||(this._baseFolder=b.resolve(i.dataPath,"data"))}get dataFolder(){return this._dataFolder||(this._dataFolder=b.resolve(this.baseFolder,""+v))}get localeFolder(){return this._localeFolder||(this._localeFolder=b.resolve(this.baseFolder,"locales"))}get emoteFolder(){return this._emoteFolder||(this._emoteFolder=b.resolve(this.baseFolder,"emotes"))}get cacheFile(){return this._cacheFile||(this._cacheFile=b.resolve(this.baseFolder,".cache"))}getPluginFile(e){return b.resolve(i.dataPath,"plugins",e+".config.json")}_getFile(e){return"settings"==e||"plugins"==e||"themes"==e||"window"==e?b.resolve(this.dataFolder,e+".json"):b.resolve(this.dataFolder,"misc.json")}getBDData(e){return this.data.misc[e]||""}setBDData(e,t){this.data.misc[e]=t,y.writeFileSync(b.resolve(this.dataFolder,"misc.json"),JSON.stringify(this.data.misc,null,4))}getLocale(e){const t=b.resolve(this.localeFolder,e+".json");return y.existsSync(t)?u.testJSON(y.readFileSync(t).toString()):null}saveLocale(e,t){y.writeFileSync(b.resolve(this.localeFolder,e+".json"),JSON.stringify(t,null,4))}getCacheHash(e,t){return this.cacheData[e]&&y.existsSync(b.resolve(this.baseFolder,e,t+".json"))&&this.cacheData[e][t]||""}setCacheHash(e,t,s){this.cacheData[e]||(this.cacheData[e]={}),this.cacheData[e][t]=s,y.writeFileSync(this.cacheFile,JSON.stringify(this.cacheData))}invalidateCache(e,t){this.cacheData[e]&&(delete this.cacheData[e][t],y.writeFileSync(this.cacheFile,JSON.stringify(this.cacheData)))}emotesExist(e){return y.existsSync(b.resolve(this.emoteFolder,e+".json"))}getEmoteData(e){const t=b.resolve(this.emoteFolder,e+".json");return y.existsSync(t)?u.testJSON(y.readFileSync(t).toString()):null}saveEmoteData(e,t){y.writeFileSync(b.resolve(this.emoteFolder,e+".json"),JSON.stringify(t))}getData(e){return this.data[e]||""}setData(e,t){this.data[e]=t,y.writeFileSync(b.resolve(this.dataFolder,e+".json"),JSON.stringify(t,null,4))}loadCustomCSS(){return y.readFileSync(this.customCSS).toString()}saveCustomCSS(e){return y.writeFileSync(this.customCSS,e)}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:y.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(y.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,s){void 0!==s&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=s,y.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4)))}deletePluginData(e,t){void 0===this.pluginData[e]&&(this.pluginData[e]={}),delete this.pluginData[e][t],y.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};class S{static get bdHead(){return this.getElement("bd-head")}static get bdBody(){return this.getElement("bd-body")}static get bdScripts(){return this.getElement("bd-scripts")}static get bdStyles(){return this.getElement("bd-styles")}static get bdThemes(){return this.getElement("bd-themes")}static get bdCustomCSS(){return this.getElement("#customcss")}static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"-")}static getElement(e,t=document){return e instanceof Node?e:t.querySelector(e)}static createElement(e,t={}){const{className:s,id:n,target:i}=t,o=document.createElement(e);return s&&(o.className=s),n&&(o.id=n),i&&this.getElement(i).append(o),o}static removeStyle(e){e=this.escapeID(e);const t=this.getElement("#"+e,this.bdStyles);t&&t.remove()}static injectStyle(e,t){e=this.escapeID(e);const s=this.getElement("#"+e,this.bdStyles)||this.createElement("style",{id:e});s.textContent=t,this.bdStyles.append(s)}static unlinkStyle(e){return this.removeStyle(e)}static linkStyle(e,t){return e=this.escapeID(e),new Promise(s=>{const n=this.getElement("#"+e,this.bdStyles)||this.createElement("link",{id:e});n.rel="stylesheet",n.href=t,n.onload=s,this.bdStyles.append(n)})}static removeTheme(e){e=this.escapeID(e);const t=this.getElement("#"+e,this.bdThemes);t&&t.remove()}static injectTheme(e,t){e=this.escapeID(e);const s=this.getElement("#"+e,this.bdThemes)||this.createElement("style",{id:e});s.textContent=t,this.bdThemes.append(s)}static updateCustomCSS(e){this.bdCustomCSS.textContent=e}static removeScript(e){e=this.escapeID(e);const t=this.getElement("#"+e,this.bdScripts);t&&t.remove()}static injectScript(e,t){return e=this.escapeID(e),new Promise(s=>{const n=this.getElement("#"+e,this.bdScripts)||this.createElement("script",{id:e});n.src=t,n.onload=s,this.bdScripts.append(n)})}}S.createElement("bd-head",{target:document.head}),S.createElement("bd-body",{target:document.body}),S.createElement("bd-scripts",{target:S.bdHead}),S.createElement("bd-styles",{target:S.bdHead}),S.createElement("bd-themes",{target:S.bdHead}),S.createElement("style",{id:"customcss",target:S.bdHead});const C=s(5);var E=new class extends C{constructor(){super(),this.setMaxListeners(20)}dispatch(e,...t){this.emit(e,...t)}};const M=s(3),{Dispatcher:x,DiscordConstants:N,UserSettingsStore:P}=f;var D=new class{get discordLocale(){return P.locale.split("-")[0]}get defaultLocale(){return"en"}constructor(){this.locale="",this.strings={}}async initialize(){await this.setLocale(this.discordLocale),x.subscribe(N.ActionTypes.USER_SETTINGS_UPDATE,({settings:e})=>{const t=e.locale;t&&t!=this.locale&&this.setLocale(t.split("-")[0])})}async setLocale(e){let t;if(e!=this.defaultLocale){if(t=await this.getLocaleStrings(e),!t)return this.setLocale(this.defaultLocale)}else t=a;this.locale=e,u.extend(this.strings,t),E.emit("strings-updated")}async getLocaleStrings(e){const t=w.getCacheHash("locales",e);if(!t)return await this.downloadLocale(e);const s=await this.downloadLocale(e,t);return s||w.getLocale(e)}downloadLocale(e,t=""){return new Promise(s=>{const n={url:u.repoUrl(`assets/locales/${e}.json`),timeout:2e3,json:!0};t&&(n.headers={"If-None-Match":t}),M.get(n,(t,n,i)=>{if(t||200!==n.statusCode)return s(null);w.saveLocale(e,i),w.setCacheHash("locales",e,n.headers.etag),s(i)})})}};class A extends String{format(e){return u.formatString(this,e)}}var k=new Proxy(D.strings,{get:function(e,t){return e.hasOwnProperty(t)?new Proxy(e[t],{get:function(e,t){return"string"==typeof e[t]?new A(e[t]):e[t]}}):new Proxy({},{get:function(){return`String group "${t}" not found.`}})}}),T=new class{constructor(){this.state={},this.collections=[],this.panels=[],this.updateStrings=this.updateStrings.bind(this)}initialize(){this.registerCollection("settings","Settings",r),E.on("strings-updated",this.updateStrings)}registerCollection(e,t,s,n=null){if(this.collections.find(t=>t.id==e))return c.error("Settings","Already have a collection with id "+e);this.collections.push({type:"collection",id:e,name:t,settings:s,button:n}),this.setupCollection(e),this.loadCollection(e),this.updateStrings()}removeCollection(e){const t=this.collections.findIndex(t=>t.id==e);if(!t<0)return c.error("Settings","No collection with id "+e);this.collections.splice(t,1)}registerPanel(e,t,s){if(this.panels.find(t=>t.id==e))return c.error("Settings","Already have a panel with id "+e);const{element:n,onClick:i,order:o=1}=s,r={id:e,order:o,label:t,section:e};i&&(r.clickListener=i),n&&(r.element=n instanceof f.React.Component?()=>f.React.createElement(n,{}):"function"==typeof n?n:()=>n),this.panels.push(r)}removePanel(e){const t=this.panels.findIndex(t=>t.id==e);if(!t<0)return c.error("Settings","No collection with id "+e);this.panels.splice(t,1)}getPath(e,t="",s=""){return{collection:3==e.length?e[0]:t,category:3==e.length?e[1]:2==e.length?e[0]:s,setting:e[e.length-1]}}setupCollection(e){const t=this.collections.find(t=>t.id==e);if(!t)return;const s=t.settings;this.state[t.id]||(this.state[t.id]={});for(let e=0;e{const e=this.state[o.collection][o.category][o.setting];return s.enableWith?!e:e}})}}}}saveSettings(){for(const e in this.state)this.saveCollection(e)}loadSettings(){for(const e in this.state)this.loadCollection(e)}saveCollection(e){w.setData(e,this.state[e])}loadCollection(e){const t=w.getData(e);if(!t)return this.saveCollection(e);for(const s in this.state[e]){t[s]||Object.assign(t,{[s]:this.state[e][s]});for(const n in this.state[e][s]){if(null==t[s][n])continue;const i=this.getSetting(e,s,n);if("switch"==i.type&&(this.state[e][s][n]=t[s][n]),"dropdown"==i.type){i.options.some(e=>e.value==t[s][n])&&(this.state[e][s][n]=t[s][n])}}}this.saveCollection(e)}onSettingChange(e,t,s,n){this.state[e][t][s]=n,E.dispatch("setting-updated",e,t,s,n),this.saveCollection(e)}getSetting(e,t,s){return 2==arguments.length?this.collections[0].find(e=>e.id==arguments[0]).settings.find(e=>e.id==arguments[1]):this.collections.find(t=>t.id==e).settings.find(e=>e.id==t).settings.find(e=>e.id==s)}get(e,t,s){return 2==arguments.length&&(s=t,t=e,e="settings"),!(!this.state[e]||!this.state[e][t])&&this.state[e][t][s]}set(e,t,s,n){return 3==arguments.length&&(n=s,s=t,t=e,e="settings"),this.onSettingChange(e,t,s,n)}on(e,t,s,n){const i=(i,o,r,a)=>{i===e&&o===t&&r===s&&n(a)};return E.on("setting-updated",i),()=>{E.off("setting-updated",i)}}updateStrings(){for(let e=0;e"before"===e.type))try{t.callback(this,arguments)}catch(s){c.err("Patcher",`Could not fire before callback of ${e.functionName} for ${t.caller}`,s)}const s=e.children.filter(e=>"instead"===e.type);if(s.length)for(const n of s)try{const s=n.callback(this,arguments,e.originalFunction.bind(this));void 0!==s&&(t=s)}catch(t){c.err("Patcher",`Could not fire instead callback of ${e.functionName} for ${n.caller}`,t)}else t=e.originalFunction.apply(this,arguments);for(const s of e.children.filter(e=>"after"===e.type))try{const e=s.callback(this,arguments,t);void 0!==e&&(t=e)}catch(t){c.err("Patcher",`Could not fire after callback of ${e.functionName} for ${s.caller}`,t)}return t}}static rePatch(e){e.proxyFunction=e.module[e.functionName]=this.makeOverride(e)}static makePatch(e,t,s){const n={name:s,module:e,functionName:t,originalFunction:e[t],proxyFunction:null,revert:()=>{n.module[n.functionName]=n.originalFunction,n.proxyFunction=null,n.children=[]},counter:0,children:[]};return n.proxyFunction=e[t]=this.makeOverride(n),this.patches.push(n),n}static before(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"before"}))}static after(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"after"}))}static instead(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"instead"}))}static pushChildPatch(e,t,s,n,i={}){const{type:o="after",forcePatch:r=!0}=i,a=this.resolveModule(t);if(!a)return null;if(!a[s]&&r&&(a[s]=function(){}),!(a[s]instanceof Function))return null;"string"==typeof t&&(i.displayName=t);const l=`${i.displayName||a.displayName||a.name||a.constructor.displayName||a.constructor.name}.${s}`,d=this.patches.find(e=>e.module==a&&e.functionName==s)||this.makePatch(a,s,l);d.proxyFunction||this.rePatch(d);const c={caller:e,type:o,id:d.counter,callback:n,unpatch:()=>{if(d.children.splice(d.children.findIndex(e=>e.id===c.id&&e.type===o),1),d.children.length<=0){const e=this.patches.findIndex(e=>e.module==a&&e.functionName==s);this.patches[e].revert(),this.patches.splice(e,1)}}};return d.children.push(c),d.counter++,c.unpatch}}const j=f.React,B={},I=new Set,z=new Set;var F=new class{get named(){return B}get unknown(){return I}get listeners(){return z}constructor(){L.after("ReactComponents",j,"createElement",(e,t,s)=>{this.walkRenderTree(s)}),L.instead("ReactComponents",j.Component.prototype,"componentWillMount",e=>{this.addComponent(e.constructor)}),L.instead("ReactComponents",j.Component.prototype,"UNSAFE_componentWillMount",e=>{this.addComponent(e.constructor)}),L.instead("ReactComponents",j.PureComponent.prototype,"componentWillMount",e=>{this.addComponent(e.constructor)}),L.instead("ReactComponents",j.PureComponent.prototype,"UNSAFE_componentWillMount",e=>{this.addComponent(e.constructor)})}initialize(){this.walkReactTree(document.querySelector("#app-mount")._reactRootContainer._internalRoot.current)}get(e,t){return new Promise(s=>{if(B[e])return s(B[e]);if(z.add({name:e,filter:t,resolve:s}),t)for(const s of I)t(s)&&(s.displayName=e,I.delete(s),this.addNamedComponent(s))})}addNamedComponent(e){const t=e.displayName;if(!B[t]){B[t]=e;for(const s of z)s.name===t&&(s.resolve(e),z.delete(s))}}addUnknownComponent(e){if(!I.has(e)){for(const t of z)t.filter&&t.filter(e)&&(e.displayName=t.name,this.addNamedComponent(e));e.displayName||I.add(e)}}addComponent(e){return e.displayName?this.addNamedComponent(e):this.addUnknownComponent(e)}walkRenderTree(e){if(e){if("function"==typeof e.type&&this.addComponent(e.type),Array.isArray(e))for(const t of e)this.walkRenderTree(t);e.props&&e.props.children&&this.walkRenderTree(e.props.children)}}walkReactTree(e){e&&("function"==typeof e.type&&this.addComponent(e.type),e.child&&this.walkReactTree(e.child),e.sibling&&this.walkReactTree(e.sibling))}};const O=f.React,R=f.ReactDOM,U=g.getByProps("sidebar","hasNotice").sidebar.split(" ")[0],H=g.getByProps("membersWrap").membersWrap.split(" ")[0];class q{static get shouldShowToasts(){return T.get("settings","general","showToasts")}static async success(e,t={}){return this.show(e,Object.assign(t,{type:"success"}))}static async info(e,t={}){return this.show(e,Object.assign(t,{type:"info"}))}static async warning(e,t={}){return this.show(e,Object.assign(t,{type:"warning"}))}static async error(e,t={}){return this.show(e,Object.assign(t,{type:"error"}))}static async default(e,t={}){return this.show(e,Object.assign(t,{type:""}))}static show(e,t={}){const{type:s="",icon:n=!0,timeout:i=3e3,forceShow:o=!1}=t;if(!this.shouldShowToasts&&!o)return;this.ensureContainer();const r=document.createElement("div");r.classList.add("bd-toast"),s&&r.classList.add("toast-"+s),s&&n&&r.classList.add("icon"),r.innerText=e,document.querySelector(".bd-toasts").appendChild(r),setTimeout(()=>{r.classList.add("closing"),setTimeout(()=>{r.remove(),document.querySelectorAll(".bd-toasts .bd-toast").length||document.querySelector(".bd-toasts").remove()},300)},i)}static ensureContainer(){if(document.querySelector(".bd-toasts"))return;const e=document.querySelector(`.${U} + div`),t=e.querySelector("."+H),s=e?e.querySelector("form"):null,n=e?e.getBoundingClientRect().left:310,i=t?t.getBoundingClientRect().left:0,o=i?i-e.getBoundingClientRect().left:e.offsetWidth,r=s?s.offsetHeight:80,a=document.createElement("div");a.classList.add("bd-toasts"),a.style.setProperty("left",n+"px"),a.style.setProperty("width",o+"px"),a.style.setProperty("bottom",r+"px"),S.bdBody.appendChild(a)}}class _{static get shouldShowAddonErrors(){return T.get("settings","addons","addonErrors")}static get ModalActions(){return g.getByProps("openModal","updateModal")}static get ModalStack(){return g.getByProps("push","update","pop","popWithKey")}static get AlertModal(){return g.getByPrototypes("handleCancel","handleSubmit","handleMinorConfirm")}static get TextElement(){return g.getByProps("Sizes","Weights")}static get ConfirmationModal(){return g.findByDisplayName("ConfirmModal")}static get Markdown(){return g.findByDisplayName("Markdown")}static default(e,t){const s=h.createElement(`
\n
\n \n
`);s.querySelector(".footer button").addEventListener("click",()=>{s.classList.add("closing"),setTimeout(()=>{s.remove()},300)}),s.querySelector(".bd-backdrop").addEventListener("click",()=>{s.classList.add("closing"),setTimeout(()=>{s.remove()},300)}),document.querySelector("#app-mount").append(s)}static alert(e,t){this.showConfirmationModal(e,t,{cancelText:""})}static showConfirmationModal(e,t,s={}){const n=this.Markdown,i=this.ConfirmationModal,o=this.ModalActions;if(t instanceof A&&(t=t.toString()),!this.ModalActions||!this.ConfirmationModal||!this.Markdown)return this.default(e,t);const r=()=>{},{onConfirm:a=r,onCancel:l=r,confirmText:d=k.Modals.okay,cancelText:c=k.Modals.cancel,danger:h=!1,key:u}=s;return Array.isArray(t)||(t=[t]),t=t.map(e=>"string"==typeof e?O.createElement(n,null,e):e),o.openModal(s=>O.createElement(i,Object.assign({header:e,red:h,confirmText:d,cancelText:c,onConfirm:a,onCancel:l},s),t),{modalKey:u})}static showAddonErrors({plugins:e=[],themes:t=[]}){if(!e||!t||!this.shouldShowAddonErrors)return;if(!e.length&&!t.length)return;const s=h.createElement(`
\n
\n \n
`),n=function(e){const t=h.createElement('
');for(const s of e){const e=h.createElement(`
\n
${s.name?s.name:s.file}
\n
${s.message}
\n \n
`);t.append(e),s.error&&e.querySelectorAll("a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),c.stacktrace("AddonError",`Error details for ${s.name?s.name:s.file}.`,s.error)}))}return t},i=[n(e),n(t)];s.querySelectorAll(".tab-bar-item").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();const t=s.querySelector(".tab-bar-item.selected");t&&h.removeClass(t,"selected"),h.addClass(e.target,"selected");const n=s.querySelector(".scroller");n.innerHTML="",n.append(i[h.index(e.target)])})),s.querySelector(".footer button").addEventListener("click",()=>{h.addClass(s,"closing"),setTimeout(()=>{s.remove()},300)}),s.querySelector(".bd-backdrop").addEventListener("click",()=>{h.addClass(s,"closing"),setTimeout(()=>{s.remove()},300)}),h.query("#app-mount").append(s),e.length?s.querySelector(".tab-bar-item").click():s.querySelectorAll(".tab-bar-item")[1].click()}static showChangelogModal(e={}){const t=g.getByProps("push","update","pop","popWithKey"),s=g.getByProps("fixed","improved"),n=g.findByDisplayName("Text"),o=g.getByProps("Child"),r=g.getByProps("Tags","default"),a=g.getModule(e=>e.defaultProps&&0==e.defaultProps.selectable),l=g.getByProps("defaultRules","parse");if(!(a&&t&&s&&n&&o&&r&&l))return c.warn("Modals","showChangelogModal missing modules");const{image:d="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:h="",changes:u=[],title:p="BandagedBD",subtitle:m="v"+i.bbdVersion,footer:y}=e,b=O.createElement,v=[e.video?b("video",{src:e.video,poster:e.poster,controls:!0,className:s.video}):b("img",{src:d})];h&&v.push(b("p",null,l.parse(h)));for(let e=0;eb("li",null,l.parse(e))));v.push(o)}const w=function(){return b(o.Child,{grow:1,shrink:1},b(r.default,{tag:r.Tags.H4},p),b(n,{size:n.Sizes.SMALL,color:n.Colors.STANDARD,className:s.date},m))},S=()=>{const e=g.getModule(e=>"Anchor"==e.displayName),s=g.getByProps("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},i=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),f.InviteActions.acceptInviteAndTransitionToInviteChannel("2HScm8j")},r=e?b(e,{onClick:i},"Join our Discord Server."):b("a",{className:`${s.anchor} ${s.anchorUnderlineOnHover}`,onClick:i},"Join our Discord Server."),a=b(n,{size:n.Sizes.SMALL,color:n.Colors.STANDARD},"Need support? ",r);return b(o.Child,{grow:1,shrink:1},y||a)},C=this.ModalActions,E=g.getByProps("hideOnFullscreen"),M=E.root;M&&(E.root=M+" bd-changelog-modal");const x=C.openModal(e=>O.createElement(a,Object.assign({className:"bd-changelog "+s.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:w,renderFooter:S},e),v)),N=C.closeModal;return C.closeModal=function(e){e!==x&&Reflect.apply(N,this,arguments),setTimeout(()=>{M&&(E.root=M)},500),C.closeModal=N},x}}class W extends Error{constructor(e,t,s,n){super(s),this.name=e,this.file=t,this.error=n}}class G extends Error{constructor(e){super(e),this.name="MetaError"}}class $ extends O.Component{constructor(e){super(e),this.onClick=this.onClick.bind(this),this.state={checked:this.props.checked||!1}}render(){return O.createElement("div",{className:"checkbox-item"},O.createElement("div",{className:"checkbox-label label-JWQiNe da-label"},this.props.text),O.createElement("div",{className:"checkbox-wrapper checkbox-3kaeSU da-checkbox checkbox-3EVISJ da-checkbox",onClick:this.onClick},O.createElement("div",{className:"checkbox-inner checkboxInner-3yjcPe da-checkboxInner"},O.createElement("input",{className:"checkbox checkboxElement-1qV33p da-checkboxElement",checked:this.state.checked,type:"checkbox"}),O.createElement("span",null)),O.createElement("span",null)))}onClick(){this.props.onChange(!this.state.checked),this.setState({checked:!this.state.checked})}}function Q(){return(Q=Object.assign||function(e){for(var t=1;t{for(const s of e){if(!(s.addedNodes.length&&s.addedNodes[0]instanceof Element))continue;const e=s.addedNodes[0];e.parentElement===document.body&&e.querySelector("#ace_settingsmenu")&&(e.id="ace_settingsmenu_container",t.disconnect())}});t.observe(document.body,{childList:!0})};const t=this.props.theme==J.defaultProps.theme?this.props.theme.split("-")[1]:this.props.theme;this.editor.setTheme("ace/theme/"+t),this.editor.session.setMode("ace/mode/"+this.props.language),this.editor.setShowPrintMargin(!1),this.editor.setFontSize(this.props.fontSize),this.editor.on("change",this.onChange)}componentWillUnmount(){this.editor.destroy()}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}onChange(){this.props.onChange&&this.props.onChange(this.value)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}buildControl(e){return"checkbox"==e.type?this.makeCheckbox(e):this.makeButton(e)}makeCheckbox(e){return O.createElement($,{text:e.label,onChange:e.onChange,checked:e.checked})}makeButton(e){return O.createElement(V,{color:"black",position:"top",text:e.tooltip},t=>O.createElement("button",Q({},t,{className:"btn btn-primary",onClick:t=>{e.onClick(t,this.value)}}),e.label))}render(){this.editor&&this.editor.resize&&this.editor.resize();const e=this.props.controls.filter(e=>"right"!=e.side).map(this.buildControl.bind(this)),t=this.props.controls.filter(e=>"right"==e.side).map(this.buildControl.bind(this));return O.createElement("div",{id:"bd-editor-panel",className:this.props.theme},O.createElement("div",{id:"bd-editor-controls"},O.createElement("div",{className:"controls-section controls-left"},e),O.createElement("div",{className:"controls-section controls-right"},t)),O.createElement("div",{className:"editor-wrapper"},O.createElement("div",{id:this.props.id,className:"editor "+this.props.theme},this.props.value)))}}class K extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm2 16H5V5h11.17L19 7.83V19zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zM6 6h9v4H6z"}))}}class X extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{viewBox:"0 0 24 24",fill:"#FFFFFF",style:{width:e,height:e},onClick:this.props.onClick},O.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),O.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}}class ee extends O.Component{render(){const e=this.props.size||"20px";return O.createElement("svg",{viewBox:"0 0 20 20",style:{width:e,height:e}},O.createElement("path",{fill:"none",d:"M0 0h20v20H0V0z"}),O.createElement("path",{d:"M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}))}}class te extends O.Component{constructor(e){super(e),this.hasUnsavedChanges=!1,this.onChange=this.onChange.bind(this),this.save=this.save.bind(this),this.openNative=this.openNative.bind(this),this.update=this.update.bind(this),this.controls=[{label:O.createElement(K,{size:"18px"}),tooltip:k.CustomCSS.save,onClick:this.save},{label:O.createElement(X,{size:"18px"}),tooltip:k.CustomCSS.openNative,onClick:this.openNative},{label:O.createElement(ee,{size:"18px"}),tooltip:k.CustomCSS.settings,onClick:"showSettings"}]}update(){this.forceUpdate()}updateEditor(e){this.editor&&(this.editor.value=e)}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}setEditorRef(e){this.editor=e,this.props.editorRef&&void 0!==this.props.editorRef.current?this.props.editorRef.current=e:this.props.editorRef&&(this.props.editorRef=e)}render(){return O.createElement(J,{ref:this.setEditorRef.bind(this),language:this.props.language,id:this.props.id||"bd-addon-editor",controls:this.controls,value:this.props.content,onChange:this.onChange})}onChange(){this.hasUnsavedChanges=!0}save(e,t){this.hasUnsavedChanges=!1,this.props.save&&this.props.save(t)}openNative(){this.props.openNative&&this.props.openNative()}}class se{static get width(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)}static get height(){return Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}class ne extends O.Component{render(){return O.createElement("svg",{viewBox:"0 0 12 12",style:{width:"18px",height:"18px"}},O.createElement("g",{className:"background",fill:"none",fillRule:"evenodd"},O.createElement("path",{d:"M0 0h12v12H0"}),O.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 ie extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e},onClick:this.props.onClick},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))}}class oe extends O.Component{constructor(e){super(e),this.state={modalOpen:!1},this.offX=0,this.offY=0,this.maxX=this.props.maxX||se.width,this.maxY=this.props.maxY||se.height,this.minX=this.props.minX||0,this.minY=this.props.minY||0,this.titlebar=O.createRef(),this.window=O.createRef(),this.close=this.close.bind(this),this.maximize=this.maximize.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragStart=this.onDragStart.bind(this),this.onDragStop=this.onDragStop.bind(this),this.onResizeStart=this.onResizeStart.bind(this)}componentDidMount(){this.window.current.addEventListener("mousedown",this.onResizeStart,!1),this.titlebar.current.addEventListener("mousedown",this.onDragStart,!1),document.addEventListener("mouseup",this.onDragStop,!1)}onResizeStart(){this.currentWidth=this.window.current.offsetWidth,this.currentHeight=this.window.current.offsetHeight}onDragStop(){document.removeEventListener("mousemove",this.onDrag,!0);const e=this.window.current.offsetWidth,t=this.window.current.offsetHeight;if(e!=this.currentWidth||t!=this.currentHeight){this.props.onResize&&this.props.onResize();const s=parseInt(this.window.current.style.left),n=parseInt(this.window.current.style.top);s+e>=this.maxX&&(this.window.current.style.width=this.maxX-s+"px"),n+t>=this.maxY&&(this.window.current.style.height=this.maxY-n+"px")}this.currentWidth=e,this.currentHeight=t}onDragStart(e){const t=this.window.current;this.offY=e.clientY-parseInt(t.offsetTop),this.offX=e.clientX-parseInt(t.offsetLeft),document.addEventListener("mousemove",this.onDrag,!0)}onDrag(e){const t=this.window.current;let s=e.clientY-this.offY;s<=this.minY&&(s=this.minY),s+this.currentHeight>=this.maxY&&(s=this.maxY-this.currentHeight);let n=e.clientX-this.offX;n<=this.minX&&(n=this.minX),n+this.currentWidth>=this.maxX&&(n=this.maxX-this.currentWidth),t.style.top=s+"px",t.style.left=n+"px"}componentWillUnmount(){this.titlebar.current.removeEventListener("mousedown",this.onDragStart,!1),document.removeEventListener("mouseup",this.onDragStop,!1)}render(){const e=this.props.center?se.height/2-this.props.height/2:this.props.top,t=this.props.center?se.width/2-this.props.width/2:this.props.left,s=`floating-window${" "+this.props.className||""}${this.props.resizable?" resizable":""}${this.state.modalOpen?" modal-open":""}`,n={height:this.props.height,width:this.props.width,left:t||0,top:e||0};return O.createElement("div",{id:this.props.id,className:s,ref:this.window,style:n},O.createElement("div",{className:"floating-window-titlebar",ref:this.titlebar},O.createElement("span",{className:"title"},this.props.title),O.createElement("div",{className:"floating-window-buttons"},O.createElement("div",{className:"button maximize-button",onClick:this.maximize},O.createElement(ie,{size:"18px"})),O.createElement("div",{className:"button close-button",onClick:this.close},O.createElement(ne,null)))),O.createElement("div",{className:"floating-window-content"},this.props.children))}maximize(){this.window.current.style.width="100%",this.window.current.style.height="100%",this.props.onResize&&this.props.onResize();const e=this.window.current.offsetWidth,t=this.window.current.offsetHeight,s=parseInt(this.window.current.style.left)+e;parseInt(this.window.current.style.top)+t>this.maxY&&(this.window.current.style.top=this.maxY-t+"px"),s>this.maxX&&(this.window.current.style.left=this.maxX-e+"px");const n=parseInt(this.window.current.style.left),i=parseInt(this.window.current.style.top);if(i{_.showConfirmationModal(k.Modals.confirmAction,this.props.confirmationText,{danger:!0,confirmText:k.Modals.close,onConfirm:()=>{e(!0)},onCancel:()=>{e(!1)}})})}}function re(){return(re=Object.assign||function(e){for(var t=1;t div[class*="app-"]');return e?e.offsetTop:0}render(){return this.state.windows.map(e=>O.createElement(oe,re({},e,{close:this.close.bind(this,e.id),minY:this.minY}),e.children))}open(e){this.setState({windows:[...this.state.windows,e]})}close(e){this.setState({windows:this.state.windows.filter(t=>(t.id==e&&t.onClose&&t.onClose(),t.id!=e))})}static get id(){return"floating-windows"}static get root(){if(this._root)return this._root;const e=document.createElement("div");return e.id=this.id,document.body.append(e),this._root=e}}var le=ae;const de=g.getByProps("AppReferencePositionLayer");class ce{static initialize(){const e=O.createRef(),t=O.createElement(le,{ref:e}),s=de?O.createElement(de.AppLayerProvider().props.layerContext.Provider,{value:[document.querySelector("#app-mount > .layerContainer-yqaFcK")]},t):t,n=h.createElement('
');S.bdBody.append(n),R.render(s,n),this.ref=e}static open(e){return this.ref||this.initialize(),this.ref.current.open(e)}}const he=f.React,ue=s(1),pe=s(2),me=s(4).Module;me.globalPaths.push(ue.resolve(s(0).remote.app.getAppPath(),"node_modules"));const ge=/[^\S\r\n]*?\r?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,fe=/^\\@/,ye=function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e};class be{get name(){return""}get moduleExtension(){return""}get extension(){return""}get addonFolder(){return""}get language(){return""}get prefix(){return"addon"}get collection(){return"settings"}get category(){return"addons"}get id(){return"autoReload"}emit(e,...t){return E.emit(`${this.prefix}-${e}`,...t)}constructor(){this.timeCache={},this.addonList=[],this.state={}}initialize(){return this.originalRequire=me._extensions[this.moduleExtension],me._extensions[this.moduleExtension]=this.getAddonRequire(),T.on(this.collection,this.category,this.id,e=>{e?this.watchAddons():this.unwatchAddons()}),this.loadAllAddons()}initializeAddon(){}getFileModification(e,t){return t}startAddon(){}stopAddon(){}loadState(){const e=w.getData(this.prefix+"s");e&&Object.assign(this.state,e)}saveState(){w.setData(this.prefix+"s",this.state)}watchAddons(){if(this.watcher)return c.error(this.name,`Already watching ${this.prefix} addons.`);c.log(this.name,`Starting to watch ${this.prefix} addons.`),this.watcher=pe.watch(this.addonFolder,{persistent:!1},async(e,t)=>{if(e&&t&&t.endsWith(this.extension)){await new Promise(e=>setTimeout(e,100));try{const s=pe.statSync(ue.resolve(this.addonFolder,t));if(!s.isFile())return;if(!s||!s.mtime||!s.mtime.getTime())return;if("number"!=typeof s.mtime.getTime())return;if(this.timeCache[t]==s.mtime.getTime())return;this.timeCache[t]=s.mtime.getTime(),"rename"==e&&this.loadAddon(t,!0),"change"==e&&this.reloadAddon(t,!0)}catch(e){if("ENOENT"!==e.code)return;delete this.timeCache[t],this.unloadAddon(t,!0)}}})}unwatchAddons(){if(!this.watcher)return c.error(this.name,`Was not watching ${this.prefix} addons.`);this.watcher.close(),delete this.watcher,c.log(this.name,`No longer watching ${this.prefix} addons.`)}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 G(k.Addons.metaNotFound)}parseOldMeta(e){const t=e.split("\n")[0],s=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//")),n=u.testJSON(s);if(!n)throw new G(k.Addons.metaError);if(!n.name)throw new G(k.Addons.missingNameData);return n.format="json",n}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],s={};let n="",i="";for(const e of t.split(ge))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){s[n]=i;const t=e.indexOf(" ");n=e.substr(1,t-1),i=e.substr(t+1)}else i+=" "+e.replace("\\n","\n").replace(fe,"@");return s[n]=i.trim(),delete s[""],s.format="jsdoc",s}getAddonRequire(){const e=this,t=this.originalRequire;return function(s,n){const i=ue.resolve(e.addonFolder,ue.basename(n));if(!pe.existsSync(i)||n!==pe.realpathSync(i))return Reflect.apply(t,this,arguments);let o=pe.readFileSync(n,"utf8");o=ye(o);const r=pe.statSync(n),a=e.extractMeta(o);a.author||(a.author=k.Addons.unknownAuthor),a.version||(a.version="???"),a.description||(a.description=k.Addons.noDescription),a.id=a.name,a.filename=ue.basename(n),a.added=r.atimeMs,a.modified=r.mtimeMs,a.size=r.size,o=e.getFileModification(s,o,a),s._compile(o,n)}}loadAddon(e,t=!1){if(void 0===e)return;try{require(ue.resolve(this.addonFolder,e))}catch(n){return new W(e,e,k.Addons.compileError,{message:n.message,stack:n.stack})}const s=require(ue.resolve(this.addonFolder,e));if(this.addonList.find(e=>e.id==s.id))return new W(s.name,e,k.Addons.alreadyExists.format({type:this.prefix,name:s.name}));const n=this.initializeAddon(s);return n||(this.addonList.push(s),t&&q.success(`${s.name} v${s.version} was loaded.`),this.emit("loaded",s.id),this.state[s.id]?this.startAddon(s):this.state[s.id]=!1)}unloadAddon(e,t=!0,s=!1){const n="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return!!n&&(this.state[n.id]&&(s?this.stopAddon(n):this.disableAddon(n)),delete require.cache[require.resolve(ue.resolve(this.addonFolder,n.filename))],this.addonList.splice(this.addonList.indexOf(n),1),this.emit("unloaded",n.id),t&&q.success(n.name+" was unloaded."),!0)}reloadAddon(e,t=!0){const s="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e,n=this.unloadAddon(s,t,!0);return n?this.loadAddon(s.filename,t):n}isLoaded(e){return!!this.addonList.find(t=>t.id==e||t.filename==e)}isEnabled(e){const t=this.addonList.find(t=>t.id==e||t.filename==e);return!!t&&this.state[t.id]}getAddon(e){return this.addonList.find(t=>t.id==e||t.filename==e)}enableAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(this.state[t.id]||(this.state[t.id]=!0,this.startAddon(t),this.saveState()))}disableAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&this.state[t.id]&&(this.state[t.id]=!1,this.stopAddon(t),this.saveState())}toggleAddon(e){this.state[e]?this.disableAddon(e):this.enableAddon(e)}loadNewAddons(){const e=pe.readdirSync(this.addonFolder),t=this.addonList.filter(t=>!e.includes(t.filename)).map(e=>e.id);return{added:e.filter(e=>!this.addonList.find(t=>t.filename==e)&&e.endsWith(this.extension)&&pe.statSync(ue.resolve(this.addonFolder,e)).isFile()),removed:t}}updateList(){const e=this.loadNewAddons();for(const t of e.added)this.loadAddon(t);for(const t of e.removed)this.unloadAddon(t)}loadAllAddons(){this.loadState();const e=[],t=pe.readdirSync(this.addonFolder);for(const s of t){if(!pe.statSync(ue.resolve(this.addonFolder,s)).isFile()||!s.endsWith(this.extension))continue;const t=this.loadAddon(s,!1);t instanceof W&&e.push(t)}return this.saveState(),T.get(this.collection,this.category,this.id)&&this.watchAddons(),e}deleteAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return pe.unlinkSync(ue.resolve(this.addonFolder,t.filename))}saveAddon(e,t){const s="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return pe.writeFileSync(ue.resolve(this.addonFolder,s.filename),t)}editAddon(e,t){const n="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e,i=ue.resolve(this.addonFolder,n.filename);return void 0===t&&(t="system"==T.get("settings","addons","editAction")),t?s(0).shell.openItem(""+i):this.openDetached(n)}openDetached(e){const t=ue.resolve(this.addonFolder,e.filename),s=pe.readFileSync(t).toString(),n=he.createRef(),i=he.createElement(te,{id:"bd-floating-editor-"+e.name,ref:n,content:s,save:this.saveAddon.bind(this,e),openNative:this.editAddon.bind(this,e,!0),language:this.language});ce.open({onClose:()=>{this.isDetached=!1},onResize:()=>{n&&n.current&&n.current.resize&&n.current.resize()},title:e.name,id:s.id,className:"floating-addon-window",height:470,width:410,center:!0,resizable:!0,children:i,confirmClose:()=>!(!n||!n.current)&&n.current.hasUnsavedChanges,confirmationText:k.Addons.confirmationText.format({name:e.name})})}}class ve extends O.Component{render(){const e=this.props.isGroup?"bd-settings-title bd-settings-group-title h5-18_1nd title-3sZWYQ size12-3R0845 height16-2Lv3qA weightSemiBold-NJexzi da-h5 da-title da-size12 da-height16 da-weightSemiBold marginBottom4-2qk4Hy da-marginBottom4 marginTop8-1DLZ1n da-marginTop8":"bd-settings-title h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi defaultColor-1_ajX0 defaultMarginh2-2LTaUL marginBottom20-32qID7",t=this.props.className?`${e} ${this.props.className}`:e;return O.createElement("h2",{className:t,onClick:()=>{this.props.onClick&&this.props.onClick()}},this.props.text,this.props.button&&O.createElement("button",{className:"bd-button bd-button-title",onClick:this.props.button.onClick},this.props.button.title),this.props.otherChildren)}}class we extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{className:this.props.className||"",onClick:this.props.onClick,fill:"#dcddde",viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),O.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}class Se extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e},onClick:this.props.onClick},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),O.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}class Ce extends O.Component{constructor(e){super(e),this.state={checked:this.props.checked},this.onChange=this.onChange.bind(this)}onChange(){this.props.disabled||(this.props.onChange(!this.state.checked),this.setState({checked:!this.state.checked}))}render(){const e=this.props.disabled?" bd-switch-disabled":"",t=this.state.checked?" bd-switch-checked":"";return O.createElement("div",{className:"bd-switch"+e+t},O.createElement("input",{type:"checkbox",id:this.props.id,className:"bd-checkbox",disabled:this.props.disabled,checked:this.state.checked,onChange:this.onChange}))}}var Ee=s(0);class Me extends O.Component{constructor(e){super(e),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?O.createElement("div",{onClick:()=>Ee.remote.getCurrentWindow().openDevTools(),className:"react-error"},"There was an unexpected Error. Click to open console for more details."):this.props.children}}const xe=Me.prototype.render;function Ne(){return(Ne=Object.assign||function(e){for(var t=1;txe});const Pe=g.getByDisplayName("Tooltip");class De extends O.Component{constructor(e){super(e),this.state={settingsOpen:!1},this.settingsPanel="",this.panelRef=O.createRef(),this.onChange=this.onChange.bind(this),this.reload=this.reload.bind(this),this.showSettings=this.showSettings.bind(this),this.closeSettings=this.closeSettings.bind(this)}reload(){this.props.reload&&(this.props.addon=this.props.reload(this.props.addon.id),this.forceUpdate())}componentDidUpdate(){this.state.settingsOpen&&(this.settingsPanel instanceof Node&&this.panelRef.current.appendChild(this.settingsPanel),setImmediate(()=>{const e=this.panelRef.current,t=e.closest(".scrollerBase-289Jih");if(!t||!((e,t)=>{const s=e.scrollTop,n=s+e.clientHeight,i=t.offsetTop,o=i+t.clientHeight;return in})(t,e))return;const s=h.offset(e),n=h.offset(t),i=t.scrollTop,o=s.top-n.top+t.scrollTop-30;h.animate({duration:300,update:function(e){t.scrollTop=o>i?i+e*(o-i):i-e*(i-o)}})}))}getString(e){return"string"==typeof e?e:e.toString()}onChange(){this.props.onChange&&this.props.onChange(this.props.addon.id),this.props.enabled=!this.props.enabled,this.forceUpdate()}showSettings(){this.props.hasSettings&&this.setState({settingsOpen:!0})}closeSettings(){this.settingsPanel instanceof Node&&(this.panelRef.current.innerHTML=""),this.setState({settingsOpen:!1})}buildTitle(e,t,s){const n=k.Addons.title.split(/({{[A-Za-z]+}})/),i=n.findIndex(e=>"{{name}}"==e);i&&(n[i]=O.createElement("span",{className:"bd-name"},e));const o=n.findIndex(e=>"{{version}}"==e);i&&(n[o]=O.createElement("span",{className:"bd-version"},t));const r=n.findIndex(e=>"{{author}}"==e);return i&&(n[r]=O.createElement("span",{className:"bd-author"},s)),n.flat()}get settingsComponent(){const e=this.props.addon,t=this.getString(e.name);try{this.settingsPanel=this.props.getSettingsPanel()}catch(e){c.stacktrace("Addon Settings","Unable to get settings panel for "+t+".",e)}const s={id:t+"-settings",className:"addon-settings",ref:this.panelRef};"string"==typeof this.settingsPanel&&(c.warn("Addon Settings","Using a DOMString is officially deprecated."),s.dangerouslySetInnerHTML=this.settingsPanel);let n=null;return"function"==typeof this.settingsPanel&&(n=O.createElement(this.settingsPanel,null)),this.settingsPanel.$$typeof&&this.settingsPanel.$$typeof===Symbol.for("react.element")&&(n=this.settingsPanel),O.createElement("div",{className:"bd-addon-card settings-open bd-switch-item"},O.createElement("div",{className:"bd-close",onClick:this.closeSettings},O.createElement(ne,null)),O.createElement("div",s,O.createElement(Me,null,n)))}buildLink(e){const t=this.props.addon[e];if(!t)return null;const s=O.createElement("a",{className:"bd-link bd-link-website",href:t,target:"_blank",rel:"noopener noreferrer"},k.Addons[e]);return"invite"==e&&(s.props.onClick=function(e){e.preventDefault(),e.stopPropagation();let s=t;const n=/\.gg\/(.*)$/;n.test(s)&&(s=s.match(n)[1]),f.LayerStack.popLayer(),f.InviteActions.acceptInviteAndTransitionToInviteChannel(s)}),s}get footer(){const e=["website","source","invite","donate","patreon"];if(!e.some(e=>this.props.addon[e])&&!this.props.hasSettings)return null;const t=e.map(this.buildLink.bind(this)).filter(e=>e);return O.createElement("div",{className:"bd-footer"},O.createElement("span",{className:"bd-links"},t.map((e,s)=>sO.createElement("div",Ne({},e,{className:"bd-addon-button",onClick:s}),t))}render(){if(this.state.settingsOpen)return this.settingsComponent;const e=this.props.addon,t=this.getString(e.name),s=this.getString(e.author),n=this.getString(e.description),i=this.getString(e.version);return O.createElement("div",{id:e.id+"-card",className:"bd-addon-card settings-closed"},O.createElement("div",{className:"bd-addon-header"},O.createElement("span",{className:"bd-title"},this.buildTitle(t,i,s)),O.createElement("div",{className:"bd-controls"},this.props.editAddon&&this.makeButton(k.Addons.editAddon,O.createElement(X,null),this.props.editAddon),this.props.deleteAddon&&this.makeButton(k.Addons.deleteAddon,O.createElement(Se,null),this.props.deleteAddon),this.props.showReloadIcon&&this.makeButton(k.Addons.reload,O.createElement(we,{className:"bd-reload bd-reload-card"}),this.reload),O.createElement(Ce,{checked:this.props.enabled,onChange:this.onChange}))),O.createElement("div",{className:"bd-description-wrap scroller-wrap fade"},O.createElement("div",{className:"bd-description scroller"},n)),this.footer)}}const Ae=De.prototype.render;Object.defineProperty(De.prototype,"render",{enumerable:!1,configurable:!1,set:function(){c.warn("AddonCard","Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins")},get:()=>Ae});class ke extends O.Component{render(){const e=this.props.size||"16px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))}}class Te extends O.Component{constructor(e){super(e),this.state={open:!1,value:this.props.value||this.props.options[0].value},this.dropdown=O.createRef(),this.onChange=this.onChange.bind(this),this.showMenu=this.showMenu.bind(this),this.hideMenu=this.hideMenu.bind(this)}showMenu(e){e.preventDefault(),this.setState({open:!0},()=>{document.addEventListener("click",this.hideMenu)})}hideMenu(){this.setState({open:!1},()=>{document.removeEventListener("click",this.hideMenu)})}onChange(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)}get selected(){return this.props.options.find(e=>e.value==this.state.value)}get options(){const e=this.selected;return O.createElement("div",{className:"bd-select-options"},this.props.options.map(t=>O.createElement("div",{className:"bd-select-option"+(e.value==t.value?" selected":""),onClick:this.onChange.bind(this,t.value)},t.label)))}render(){const e="transparent"==this.props.style?" bd-select-transparent":"",t=this.state.open?" menu-open":"";return O.createElement("div",{className:`bd-select${e}${t}`,onClick:this.showMenu,ref:this.dropdown},O.createElement("div",{className:"bd-select-value"},this.selected.label),O.createElement(ke,{className:"bd-select-arrow"}),this.state.open&&this.options)}}class Le extends O.Component{render(){const e=this.props.size||"16px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))}}class je extends O.Component{render(){return O.createElement("div",{className:"bd-search-wrapper"},O.createElement("input",{onChange:this.props.onChange,onKeyDown:this.props.onKeyDown,type:"text",className:"bd-search",placeholder:this.props.placeholder,maxLength:"50"}),O.createElement(Le,null))}}class Be extends O.Component{constructor(e){super(e),this.state={sort:"name",ascending:!0,query:""},this.sort=this.sort.bind(this),this.reverse=this.reverse.bind(this),this.search=this.search.bind(this),this.update=this.update.bind(this)}componentDidMount(){E.on(this.props.prefix+"-loaded",this.update),E.on(this.props.prefix+"-unloaded",this.update)}componentWillUnmount(){E.off(this.props.prefix+"-loaded",this.update),E.off(this.props.prefix+"-unloaded",this.update)}update(){this.forceUpdate()}reload(){this.props.refreshList&&this.props.refreshList(),this.forceUpdate()}reverse(e){this.setState({ascending:e})}sort(e){this.setState({sort:e})}search(e){this.setState({query:e.target.value.toLocaleLowerCase()})}get sortOptions(){return[{label:k.Addons.name,value:"name"},{label:k.Addons.author,value:"author"},{label:k.Addons.version,value:"version"},{label:k.Addons.added,value:"added"},{label:k.Addons.modified,value:"modified"}]}get directions(){return[{label:k.Sorting.ascending,value:!0},{label:k.Sorting.descending,value:!1}]}render(){const{title:e,folder:t,addonList:n,addonState:i,onChange:o,reload:r}=this.props,a=!T.get("settings","addons","autoReload"),l=t?{title:k.Addons.openFolder.format({type:e}),onClick:()=>{const e=s(0).shell;(e.openItem||e.openPath)(t)}}:null,d=n.sort((e,t)=>{const s=e[this.state.sort],n=t[this.state.sort];return"string"==typeof s?s.toLocaleLowerCase().localeCompare(n.toLocaleLowerCase()):s>n?1:n>s?-1:0});return this.state.ascending||d.reverse(),[O.createElement(ve,{key:"title",text:e,button:l,otherChildren:a&&O.createElement(we,{className:"bd-reload",onClick:this.reload.bind(this)})}),O.createElement("div",{className:"bd-controls bd-addon-controls"},O.createElement(je,{onChange:this.search,placeholder:k.Addons.search.format({type:this.props.title})+"..."}),O.createElement("div",{className:"bd-addon-dropdowns"},O.createElement("div",{className:"bd-select-wrapper"},O.createElement("label",{className:"bd-label"},k.Sorting.sortBy,":"),O.createElement(Te,{options:this.sortOptions,onChange:this.sort,style:"transparent"})),O.createElement("div",{className:"bd-select-wrapper"},O.createElement("label",{className:"bd-label"},k.Sorting.order,":"),O.createElement(Te,{options:this.directions,onChange:this.reverse,style:"transparent"})))),O.createElement("div",{key:"addonList",className:"bd-addon-list"},d.map(e=>{if(this.state.query){let t=e.name.toLocaleLowerCase().includes(this.state.query);if(t=t||e.author.toLocaleLowerCase().includes(this.state.query),t=t||e.description.toLocaleLowerCase().includes(this.state.query),!t)return null}const t=e.type&&"function"==typeof e.plugin.getSettingsPanel,s=t&&e.plugin.getSettingsPanel.bind(e.plugin);return O.createElement(Me,null,O.createElement(De,{editAddon:this.editAddon.bind(this,e.id),deleteAddon:this.deleteAddon.bind(this,e.id),showReloadIcon:a,key:e.id,enabled:i[e.id],addon:e,onChange:o,reload:r,hasSettings:t,getSettingsPanel:s}))}))]}editAddon(e){this.props.editAddon&&this.props.editAddon(e)}async deleteAddon(e){const t=this.props.addonList.find(t=>t.id==e);await this.confirmDelete(t)&&this.props.deleteAddon&&this.props.deleteAddon(t)}confirmDelete(e){return new Promise(t=>{_.showConfirmationModal(k.Modals.confirmAction,k.Addons.confirmDelete.format({name:e.name}),{danger:!0,confirmText:k.Addons.deleteAddon,onConfirm:()=>{t(!0)},onCancel:()=>{t(!1)}})})}}const Ie=Be.prototype.render;Object.defineProperty(Be.prototype,"render",{enumerable:!1,configurable:!1,set:function(){c.warn("AddonList","Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins")},get:()=>Ie});class ze extends O.Component{render(){return O.createElement("div",{className:"bd-divider divider-3573oO marginTop8-1DLZ1n marginBottom40-2vIwTv"})}}class Fe extends O.Component{render(){return O.createElement("div",{className:"bd-setting-item"},O.createElement("div",{className:"bd-setting-header"},O.createElement("label",{htmlFor:this.props.id,className:"bd-setting-title"},this.props.name),this.props.children),O.createElement("div",{className:"bd-setting-note"},this.props.note),O.createElement("div",{className:"bd-setting-divider"}))}}class Oe extends O.Component{constructor(e){if(super(e),this.props.button&&this.props.collapsible){const e=this.props.button.onClick;this.props.button.onClick=t=>{t.stopPropagation(),e(...arguments)}}this.props.hasOwnProperty("shown")||(this.props.shown=!0),this.container=O.createRef(),this.state={collapsed:this.props.collapsible&&!this.props.shown},this.onChange=this.onChange.bind(this),this.toggleCollapse=this.toggleCollapse.bind(this)}toggleCollapse(){const e=this.container.current,t=this.state.collapsed?300:1;e.style.setProperty("height",e.scrollHeight+"px"),e.classList.add("animating"),this.setState({collapsed:!this.state.collapsed},()=>setTimeout(()=>{e.style.setProperty("height",""),e.classList.remove("animating")},t)),this.props.onDrawerToggle&&this.props.onDrawerToggle(this.state.collapsed)}onChange(e,t){this.props.onChange&&(this.props.id?this.props.onChange(this.props.id,e,t):this.props.onChange(e,t),this.forceUpdate())}render(){const{settings:e}=this.props,t="bd-settings-group "+(this.props.collapsible?"collapsible "+(this.state.collapsed?"collapsed":"expanded"):"");return O.createElement("div",{className:t},O.createElement(ve,{text:this.props.name,collapsible:this.props.collapsible,onClick:this.toggleCollapse,button:this.props.button,isGroup:!0}),O.createElement("div",{className:"bd-settings-container",ref:this.container},e.filter(e=>!e.hidden).map(e=>{let t=null;return"dropdown"==e.type&&(t=O.createElement(Te,{disabled:e.disabled,id:e.id,options:e.options,value:e.value,onChange:this.onChange.bind(this,e.id)})),"switch"==e.type&&(t=O.createElement(Ce,{disabled:e.disabled,id:e.id,checked:e.value,onChange:this.onChange.bind(this,e.id)})),t?O.createElement(Fe,{id:e.id,key:e.id,name:e.name,note:e.note},t):null})),this.props.showDivider&&O.createElement(ze,null))}}const Re=Oe.prototype.render;Object.defineProperty(Oe.prototype,"render",{enumerable:!1,configurable:!1,set:function(){c.warn("Group","Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins")},get:()=>Re});class Ue extends O.Component{render(){const e=this.props.size||"18px";return O.createElement("svg",{viewBox:"0 0 24 24",fill:"#FFFFFF",className:this.props.className||"",style:{width:e,height:e},onClick:this.props.onClick},O.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),O.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"}))}}function He(){return(He=Object.assign||function(e){for(var t=1;te.Header&&e.Separator&&e.Item),_e=g.getByDisplayName("Tooltip");class We extends O.Component{render(){return O.createElement("div",{className:"bd-sidebar-header"},O.createElement(qe.Header,null,"BandagedBD"),O.createElement(_e,{color:"black",position:"top",text:"Changelog"},e=>O.createElement("div",He({},e,{className:"bd-changelog-button",onClick:()=>_.showChangelogModal(l)}),O.createElement(Ue,{className:"bd-icon",size:"16px"}))))}}var Ge=new class{constructor(){this.patchSections(),E.on("strings-updated",this.forceUpdate)}onDrawerToggle(e,t,s){const n=w.getBDData("drawerStates")||{};n[e]||(n[e]={}),n[e][t]=s,w.setBDData("drawerStates",n)}getDrawerState(e,t,s){const n=w.getBDData("drawerStates")||{};return n[e]&&n[e].hasOwnProperty(t)?n[e][t]:s}onChange(e){return(t,s,n)=>{const i=T.collections.length+T.panels.length;e(t,s,n);i!=T.collections.length+T.panels.length&&setTimeout(this.forceUpdate.bind(this),50)}}buildSettingsPanel(e,t,s,n,i,o=null){return s.forEach(e=>{e.settings.forEach(t=>t.value=n[e.id][t.id])}),this.getSettingsPanel(e,t,s,this.onChange(i),o)}getSettingsPanel(e,t,s,n,i=null){return[O.createElement(ve,{text:t,button:i}),s.map(t=>O.createElement(Oe,Object.assign({},t,{onChange:n,onDrawerToggle:s=>this.onDrawerToggle(e,t.id,s),shown:this.getDrawerState(e,t.id,!t.hasOwnProperty("shown")||t.shown)})))]}getAddonPanel(e,t,s,n={}){return O.createElement(Be,Object.assign({},{title:e,addonList:t,addonState:s},n))}async patchSections(){const e=await F.get("UserSettings",e=>e.prototype&&e.prototype.generateSections);L.after("SettingsManager",e.prototype,"render",e=>{e._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id="user-settings"}),L.after("SettingsManager",e.prototype,"generateSections",(e,t,s)=>{let n=s.findIndex(e=>"linux"==e.section.toLowerCase())+1;const i=e=>{s.splice(n,0,e),n++};i({section:"DIVIDER"}),i({section:"CUSTOM",element:We});for(const e of T.collections)e.disabled||i({section:e.name,label:e.name,element:()=>this.buildSettingsPanel(e.id,e.name,e.settings,T.state[e.id],T.onSettingChange.bind(T,e.id),e.button?e.button:null)});for(const t of T.panels.sort((e,t)=>e.order>t.order))t.clickListener&&(t.onClick=n=>t.clickListener(e,n,s)),i(t)}),this.forceUpdate()}forceUpdate(){const e=g.getByProps("standardSidebarView").standardSidebarView.split(" ")[0],t=document.querySelector("."+e);if(!t)return;const s=u.findInReactTree(u.getReactInstance(t),e=>e&&e.generateSections,{walkable:["return","stateNode"]});s&&s.forceUpdate()}};const $e=s(1),Qe=s(0).remote;var Ve=new class extends be{get name(){return"PluginManager"}get moduleExtension(){return".js"}get extension(){return".plugin.js"}get addonFolder(){return $e.resolve(i.dataPath,"plugins")}get prefix(){return"plugin"}get language(){return"javascript"}constructor(){super(),this.onSwitch=this.onSwitch.bind(this),this.observer=new MutationObserver(e=>{for(let t=0,s=e.length;tGe.getAddonPanel(k.Panels.plugins,this.addonList,this.state,{folder:this.addonFolder,onChange:this.togglePlugin.bind(this),reload:this.reloadPlugin.bind(this),refreshList:this.updatePluginList.bind(this),saveAddon:this.saveAddon.bind(this),editAddon:this.editAddon.bind(this),deleteAddon:this.deleteAddon.bind(this),prefix:this.prefix})}),e}updatePluginList(){return this.updateList()}loadAllPlugins(){return this.loadAllAddons()}enablePlugin(e){return this.enableAddon(e)}disablePlugin(e){return this.disableAddon(e)}togglePlugin(e){return this.toggleAddon(e)}unloadPlugin(e){return this.unloadAddon(e)}loadPlugin(e){const t=this.loadAddon(e);t&&_.showAddonErrors({themes:[t]})}reloadPlugin(e){const t=this.reloadAddon(e);return t&&_.showAddonErrors({plugins:[t]}),"string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e}initializeAddon(e){if(!e.type)return new W(e.name,e.filename,"Plugin had no exports",{message:"Plugin had no exports or no name property.",stack:""});try{const t=new(0,e.type);e.plugin=t,e.name=t.getName()||e.name,e.author=t.getAuthor()||e.author||"No author",e.description=t.getDescription()||e.description||"No description",e.version=t.getVersion()||e.version||"No version";try{"function"==typeof e.plugin.load&&e.plugin.load()}catch(t){return this.state[e.id]=!1,new W(e.name,e.filename,"load() could not be fired.",{message:t.message,stack:t.stack})}}catch(t){return new W(e.name,e.filename,"Could not be constructed.",{message:t.message,stack:t.stack})}}getFileModification(e,t,s){e._compile(t,e.filename);return u.isEmpty(e.exports)?(c.warn(this.name,s.name+", please start assigning module.exports"),t+=`\nmodule.exports = ${JSON.stringify(s)};\nmodule.exports.type = ${s.exports||s.name};`):(s.type=e.exports,e.exports=s,"")}startAddon(e){return this.startPlugin(e)}stopAddon(e){return this.stopPlugin(e)}getAddon(e){return this.getPlugin(e)}startPlugin(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;if(!t)return;const s=t.plugin;try{s.start()}catch(e){return this.state[t.id]=!1,q.error(k.Addons.couldNotStart.format({name:t.name,version:t.version})),c.stacktrace(this.name,t.name+" could not be started.",e),new W(t.name,t.filename,k.Addons.enabled.format({method:"start()"}),{message:e.message,stack:e.stack})}this.emit("started",t.id),q.show(k.Addons.enabled.format({name:t.name,version:t.version}))}stopPlugin(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;if(!t)return;const s=t.plugin;try{s.stop()}catch(e){return this.state[t.id]=!1,q.error(k.Addons.couldNotStop.format({name:t.name,version:t.version})),c.stacktrace(this.name,t.name+" could not be stopped.",e),new W(t.name,t.filename,k.Addons.enabled.format({method:"stop()"}),{message:e.message,stack:e.stack})}this.emit("stopped",t.id),q.show(k.Addons.disabled.format({name:t.name,version:t.version}))}getPlugin(e){const t=this.addonList.find(t=>t.id==e||t.filename==e);if(t)return t.plugin}setupFunctions(){Qe.getCurrentWebContents().on("did-navigate-in-page",this.onSwitch.bind(this)),this.observer.observe(document,{childList:!0,subtree:!0})}onSwitch(){this.emit("page-switch");for(let e=0;eGe.getAddonPanel(k.Panels.themes,this.addonList,this.state,{folder:this.addonFolder,onChange:this.toggleTheme.bind(this),reload:this.reloadTheme.bind(this),refreshList:this.updateThemeList.bind(this),saveAddon:this.saveAddon.bind(this),editAddon:this.editAddon.bind(this),deleteAddon:this.deleteAddon.bind(this),prefix:this.prefix})}),e}updateThemeList(){return this.updateList()}loadAllThemes(){return this.loadAllAddons()}enableTheme(e){return this.enableAddon(e)}disableTheme(e){return this.disableAddon(e)}toggleTheme(e){return this.toggleAddon(e)}unloadTheme(e){return this.unloadAddon(e)}loadTheme(e){const t=this.loadAddon(e);t&&_.showAddonErrors({themes:[t]})}reloadTheme(e){const t=this.reloadAddon(e);t&&_.showAddonErrors({themes:[t]})}getFileModification(e,t,s){return s.css=t,`module.exports = ${JSON.stringify(s)};`}startAddon(e){return this.addTheme(e)}stopAddon(e){return this.removeTheme(e)}addTheme(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(S.injectTheme(t.id,t.css),q.show(k.Addons.enabled.format({name:t.name,version:t.version})))}removeTheme(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(S.removeTheme(t.id),q.show(k.Addons.disabled.format({name:t.name,version:t.version})))}};class Je{get name(){return"Unnamed Builtin"}get collection(){return"settings"}get category(){return"general"}get id(){return"None"}async initialize(){T.get(this.collection,this.category,this.id)&&await this.enable(),E.on("setting-updated",(e,t,s,n)=>{e==this.collection&&t===this.category&&s===this.id&&(n?this.enable():this.disable())}),this.initialized=!0}registerSetting(e,t,s,n,i){return 4==arguments.length?(e=this.collection,t=arguments[0],s=arguments[1],n=arguments[2],i=arguments[3]):3==arguments.length&&(e=this.collection,t=this.category,s=arguments[0],n=arguments[1],i=arguments[2]),T.on(e,t,s,e=>{e?n():i()})}get(e,t,s){return 2==arguments.length?(e=this.collection,t=arguments[0],s=arguments[1]):1==arguments.length&&(e=this.collection,t=this.category,s=arguments[0]),T.get(e,t,s)}async enable(){this.log("Enabled");try{await this.enabled()}catch(e){this.stacktrace("Could not be enabled",e)}}async disable(){this.log("Disabled");try{await this.disabled()}catch(e){this.stacktrace("Could not be disabled",e)}}async enabled(){}async disabled(){}log(...e){c.log(this.name,...e)}warn(...e){c.warn(this.name,...e)}error(...e){c.err(this.name,...e)}stacktrace(e,t){c.stacktrace(this.name,e,t)}before(e,t,s){return L.before(this.name,e,t,s)}after(e,t,s){return L.after(this.name,e,t,s)}unpatchAll(){return L.unpatchAll(this.name)}}const Ke=g.getByDisplayName("Tooltip");class Xe extends O.Component{constructor(e){super(e),this.state={shouldAnimate:!this.animateOnHover,isFavorite:this.props.isFavorite},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onClick=this.onClick.bind(this),this.toggleFavorite=this.toggleFavorite.bind(this)}get animateOnHover(){return T.get("emotes","general","animateOnHover")}get label(){return this.props.modifier?`${this.props.name}:${this.props.modifier}`:this.props.name}get modifierClass(){return this.props.modifier?" emote"+this.props.modifier:""}onMouseEnter(){!this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!0})}onMouseLeave(){this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!1})}onClick(e){this.props.onClick&&this.props.onClick(e)}toggleFavorite(e){e.preventDefault(),e.stopPropagation(),this.state.isFavorite?E.emit("emotes-favorite-removed",this.label):E.emit("emotes-favorite-added",this.label,this.props.url),this.setState({isFavorite:!this.state.isFavorite})}render(){return O.createElement(Ke,{color:"black",position:"top",text:this.label,delay:750},e=>O.createElement("div",Object.assign({className:"emotewrapper"+(this.props.jumboable?" jumboable":""),onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onClick:this.onClick},e),O.createElement("img",{draggable:!1,className:"emote"+this.modifierClass+(this.props.jumboable?" jumboable":"")+(this.state.shouldAnimate?"":" stop-animation"),dataModifier:this.props.modifier,alt:this.label,src:this.props.url}),O.createElement("input",{className:"fav"+(this.state.isFavorite?" active":""),title:k.Emotes.favoriteAction,type:"button",onClick:this.toggleFavorite})))}}const et=s(3),tt={TwitchGlobal:new A("https://static-cdn.jtvnw.net/emoticons/v1/{{id}}/1.0"),TwitchSubscriber:new A("https://static-cdn.jtvnw.net/emoticons/v1/{{id}}/1.0"),FrankerFaceZ:new A("https://cdn.frankerfacez.com/emoticon/{{id}}/1"),BTTV:new A("https://cdn.betterttv.net/emote/{{id}}/1x")},st={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{}},nt=[],it=["twitch","subscriber","bttv","ffz"],ot=["flip","spin","pulse","spin2","spin3","1spin","2spin","3spin","tr","bl","br","shake","shake2","shake3","flap"];var rt=new class extends Je{get name(){return"Emotes"}get collection(){return"settings"}get category(){return"general"}get id(){return"emotes"}get categories(){return Object.keys(st).filter(e=>this.isCategoryEnabled(e))}get shouldDownload(){return T.get("emotes",this.category,"download")}isCategoryEnabled(e){return super.get("emotes","categories",e.toLowerCase())}get(e){return super.get("emotes","general",e)}get MessageComponent(){return g.find(e=>e.default&&e.default.displayName&&"Message"==e.default.displayName)}get Emotes(){return st}get TwitchGlobal(){return st.TwitchGlobal}get TwitchSubscriber(){return st.TwitchSubscriber}get BTTV(){return st.BTTV}get FrankerFaceZ(){return st.FrankerFaceZ}get blocklist(){return nt}get favorites(){return this.favoriteEmotes}getUrl(e,t){return tt[e].format({id:st[e][t]})}getCategory(e){return st[e]}getRemoteFile(e){return u.repoUrl(`assets/emotes/${e.toLowerCase()}.json`)}initialize(){super.initialize();const e=w.getBDData("favoriteEmotes");this.favoriteEmotes=e||{},this.addFavorite=this.addFavorite.bind(this),this.removeFavorite=this.removeFavorite.bind(this),this.onCategoryToggle=this.onCategoryToggle.bind(this),this.resetEmotes=this.resetEmotes.bind(this)}async enabled(){T.registerCollection("emotes","Emotes",o,{title:k.Emotes.clearEmotes,onClick:this.resetEmotes}),await this.getBlocklist(),await this.loadEmoteData(),E.on("emotes-favorite-added",this.addFavorite),E.on("emotes-favorite-removed",this.removeFavorite),E.on("setting-updated",this.onCategoryToggle),this.patchMessageContent()}disabled(){E.off("setting-updated",this.onCategoryToggle),E.off("emotes-favorite-added",this.addFavorite),E.off("emotes-favorite-removed",this.removeFavorite),T.removeCollection("emotes"),this.emptyEmotes(),this.cancelEmoteRender&&(this.cancelEmoteRender(),delete this.cancelEmoteRender)}onCategoryToggle(e,t,s,n){if("emotes"==e&&"categories"==t)return n?this.loadEmoteData(s):this.unloadEmoteData(s)}addFavorite(e,t){this.favoriteEmotes.hasOwnProperty(e)||(this.favoriteEmotes[e]=t),this.saveFavorites()}removeFavorite(e){this.favoriteEmotes.hasOwnProperty(e)&&(delete this.favoriteEmotes[e],this.saveFavorites())}isFavorite(e){return this.favoriteEmotes.hasOwnProperty(e)}saveFavorites(){w.setBDData("favoriteEmotes",this.favoriteEmotes)}emptyEmotes(){for(const e in st)Object.assign(st,{[e]:{}})}patchMessageContent(){this.cancelEmoteRender||(this.cancelEmoteRender=this.before(this.MessageComponent,"default",(e,t)=>{const s=t[0].childrenMessageContent.props.content;if(!s||!s.length)return;for(let e=0;e"string"==typeof e&&""==e.replace(/\s*/,"")||(!(!e.type||"BDEmote"!=e.type.name)||!!(e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName))))for(const e of s)"object"==typeof e&&("BDEmote"==e.type.name?e.props.jumboable=!0:e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName&&(e.props.children.props.jumboable=!0))}))}async getBlocklist(){try{const e="Blocklist",t=w.emotesExist(e),s=await this.isCacheValid(e),n=s||!s&&t&&!this.shouldDownload?w.getEmoteData(e):await this.downloadEmotes(e);nt.push(...n)}catch(e){}}isCacheValid(e){return new Promise(t=>{const s=w.getCacheHash("emotes",e);if(!s)return t(!1);et.head({url:this.getRemoteFile(e),headers:{"If-None-Match":s}},(e,s)=>{t(!e&&304==s.statusCode)})})}async loadEmoteData(e){e||(e=this.categories),Array.isArray(e)||(e=[e]);const t=Object.keys(st);e=e.map(e=>t.find(t=>t.toLowerCase()==e.toLowerCase())),q.show(k.Emotes.loading,{type:"info"}),this.emotesLoaded=!1;for(const t of e){const e=w.emotesExist(t),s=await this.isCacheValid(t);let n=null;if(s||!s&&e&&!this.shouldDownload){this.log(`Loading ${t} emotes from local cache.`);const e=w.getEmoteData(t);Object.keys(e).length>0&&(n=e)}n||(n=await this.downloadEmotes(t)),Object.assign(st[t],n),await new Promise(e=>setTimeout(e,1e3))}this.emotesLoaded=!0,E.dispatch("emotes-loaded"),q.show(k.Emotes.loaded,{type:"success"})}unloadEmoteData(e){e||(e=this.categories),Array.isArray(e)||(e=[e]);const t=Object.keys(st);e=e.map(e=>t.find(t=>t.toLowerCase()==e.toLowerCase()));for(const t of e)delete st[t],st[t]={}}downloadEmotes(e){const t=this.getRemoteFile(e);this.log(`Downloading ${e} from ${t}`);const s={url:t,timeout:1e4,json:!0};return new Promise(t=>{et.get(s,(s,n,i)=>{if(s||200!=n.statusCode)return this.stacktrace(`Could not download ${e} emotes.`,s),t({});for(const e in i)(e.length<4||nt.includes(e)||!i[e])&&delete i[e];w.saveEmoteData(e,i),w.setCacheHash("emotes",e,n.headers.etag),t(i),this.log("Downloaded "+e)})})}resetEmotes(){const e=Object.keys(st);this.unloadEmoteData(e);for(const t of e)w.invalidateCache("emotes",t);this.loadEmoteData()}};const at={get React(){return f.React},get ReactDOM(){return f.ReactDOM},get WindowConfigFile(){return""},get settings(){return T.collections},get emotes(){return new Proxy(rt.Emotes,{get:()=>rt.Emotes,set(){c.warn("BdApi.emotes","Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins")}})},get version(){return i.version},getAllWindowPreferences:function(){return w.getData("windowprefs")||{}},getWindowPreference:function(e){return this.getAllWindowPreferences()[e]},setWindowPreference:function(e,t){const s=this.getAllWindowPreferences();return s[e]=t,w.setData("windowprefs",s)},injectCSS:function(e,t){S.injectStyle(e,t)},clearCSS:function(e){S.removeStyle(e)},linkJS:function(e,t){return S.injectScript(e,t)},unlinkJS:function(e){S.removeScript(e)},alert:function(e,t){_.alert(e,t)},showConfirmationModal:function(e,t,s={}){return _.showConfirmationModal(e,t,s)},showToast:function(e,t={}){q.show(e,t)},findModule:function(e){return g.getModule(e)},findAllModules:function(e){return g.getModule(e,!1)},findModuleByProps:function(...e){return g.getByProps(...e)},findModuleByPrototypes:function(...e){return g.getByPrototypes(...e)},findModuleByDisplayName:function(e){return g.getByDisplayName(e)},getInternalInstance:function(e){if(e instanceof window.jQuery||e instanceof Element)return e instanceof jQuery&&(e=e[0]),u.getReactInstance(e)},loadData:function(e,t){return w.getPluginData(e,t)}};at.getData=at.loadData,at.saveData=function(e,t,s){return w.setPluginData(e,t,s)},at.setData=at.saveData,at.deleteData=function(e,t){return w.deletePluginData(e,t)},at.monkeyPatch=function(e,t,s){const{before:n,after:i,instead:o,once:r=!1}=s,a=n?"before":i?"after":o?"instead":"";if(!a)return c.err("BdApi","Must provide one of: after, before, instead");const l={originalMethod:e[t],callOriginalMethod:()=>l.originalMethod.apply(l.thisObject,l.methodArguments)};l.cancelPatch=L[a]("BdApi",e,t,(e,t,n)=>{l.thisObject=e,l.methodArguments=t,l.returnValue=n;try{Reflect.apply(s[a],null,[l]),r&&l.cancelPatch()}catch(e){}})},at.onRemoved=function(e,t){return u.onRemoved(e,t)},at.suppressErrors=function(e,t){return u.suppressErrors(e,t)},at.testJSON=function(e){return u.testJSON(e)},at.getPlugin=function(e){return c.warn("BdApi","getPlugin is deprecated. Please make use of the addon api (BdApi.Plugins)"),Ve.addonList.find(t=>t.name==e)},at.isPluginEnabled=function(e){c.warn("BdApi","isPluginEnabled is deprecated. Please make use of the addon api (BdApi.Plugins)");const t=this.getPlugin(e);return!!t&&Ve.isEnabled(t.id)},at.isThemeEnabled=function(e){c.warn("BdApi","isThemeEnabled is deprecated. Please make use of the addon api (BdApi.Themes)");const t=Ye.addonList.find(t=>t.name==e);return!!t&&Ye.isEnabled(t.id)},at.isSettingEnabled=function(e,t,s){return T.get(e,t,s)},at.enableSetting=function(e,t,s){return T.set(e,t,s,!0)},at.disableSetting=function(e,t,s){return T.set(e,t,s,!1)},at.toggleSetting=function(e,t,s){return T.set(e,t,s,!T.get(e,t,s))},at.getBDData=function(e){return w.getBDData(e)},at.setBDData=function(e,t){return w.setBDData(e,t)};const lt=e=>new class{get folder(){return e.addonFolder}isEnabled(t){return e.isEnabled(t)}enable(t){return e.enableAddon(t)}disable(t){return e.disableAddon(t)}toggle(t){return e.toggleAddon(t)}reload(t){return e.reloadAddon(t)}get(t){return e.getAddon(t)}getAll(){return e.addonList.map(t=>e.getAddon(t.id))}};at.Plugins=lt(Ve),at.Themes=lt(Ye),at.Patcher={patch:(e,t,s,n,i={})=>"string"!=typeof e?c.err("BdApi.Patcher","Parameter 0 of patch must be a string representing the caller"):"before"!==i.type&&"instead"!==i.type&&"after"!==i.type?c.err("BdApi.Patcher","options.type must be one of: before, instead, after"):L.pushChildPatch(e,t,s,n,i),before:(e,t,s,n,i={})=>at.Patcher.patch(e,t,s,n,Object.assign(i,{type:"before"})),instead:(e,t,s,n,i={})=>at.Patcher.patch(e,t,s,n,Object.assign(i,{type:"instead"})),after:(e,t,s,n,i={})=>at.Patcher.patch(e,t,s,n,Object.assign(i,{type:"after"})),unpatchAll:e=>"string"!=typeof e?c.err("BdApi.Patcher","Parameter 0 of unpatchAll must be a string representing the caller"):L.unpatchAll(e)},Object.freeze(at),Object.freeze(at.Plugins),Object.freeze(at.Themes),Object.freeze(at.Patcher);var dt=at;const ct=document.createElement("style");ct.textContent="/* BEGIN V2 LOADER */\n/* =============== */\n\n#bd-loading-icon {\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+IDwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyBoZWlnaHQ9IjEwMCUiIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7IiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWw6c3BhY2U9InByZXNlcnZlIiB3aWR0aD0iMTAwJSIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMjAwMCAyMDAwIj4gICAgPG1ldGFkYXRhIC8+ICAgIDxkZWZzPiAgICAgICAgPGZpbHRlciBpZD0ic2hhZG93MSI+ICAgICAgICA8ZmVEcm9wU2hhZG93IGR4PSIyMCIgZHk9IjAiIHN0ZERldmlhdGlvbj0iMjAiIGZsb29kLWNvbG9yPSJyZ2JhKDAsMCwwLDAuMzUpIi8+ICAgICAgICA8L2ZpbHRlcj4gICAgICAgIDxmaWx0ZXIgaWQ9InNoYWRvdzIiPiAgICAgICAgPGZlRHJvcFNoYWRvdyBkeD0iMTUiIGR5PSIwIiBzdGREZXZpYXRpb249IjIwIiBmbG9vZC1jb2xvcj0icmdiYSgyNTUsMjU1LDI1NSwwLjE1KSIvPiAgICAgICAgPC9maWx0ZXI+ICAgICAgICA8ZmlsdGVyIGlkPSJzaGFkb3czIj4gICAgICAgIDxmZURyb3BTaGFkb3cgZHg9IjEwIiBkeT0iMCIgc3RkRGV2aWF0aW9uPSIyMCIgZmxvb2QtY29sb3I9InJnYmEoMCwwLDAsMC4zNSkiLz4gICAgICAgIDwvZmlsdGVyPiAgICA8L2RlZnM+ICAgIDxnPiAgICAgICAgPHBhdGggc3R5bGU9ImZpbHRlcjogdXJsKCNzaGFkb3czKSIgZD0iTTExOTUuNDQrMTM1LjQ0MkwxMTk1LjQ0KzEzNS40NDJMOTk3LjYrMTM2LjQ0MkMxMDI0LjIrMTQ5Ljc0MisxMTcwLjM0KzE2My41NDIrMTE5My42NCsxNzkuNzQyQzEyNjQuMzQrMjI4Ljg0MisxMzE5Ljc0KzI5MS4yNDIrMTM1OC4yNCszNjUuMDQyQzEzOTguMTQrNDQxLjY0MisxNDE5Ljc0KzUzMC42NDIrMTQyMi41NCs2MjkuNjQyTDE0MjIuNTQrNjMwLjg0MkwxNDIyLjU0KzYzMi4wNDJDMTQyMi41NCs3NzMuMTQyKzE0MjIuNTQrMTIyOC4xNCsxNDIyLjU0KzEzNjkuMTRMMTQyMi41NCsxMzcwLjM0TDE0MjIuNTQrMTM3MS41NEMxNDE5Ljg0KzE0NzAuNTQrMTM5OC4yNCsxNTU5LjU0KzEzNTguMjQrMTYzNi4xNEMxMzE5Ljc0KzE3MDkuOTQrMTI2NC40NCsxNzcyLjM0KzExOTMuNjQrMTgyMS40NEMxMTcxLjA0KzE4MzcuMTQrMTAyNS43KzE4NTAuNTQrMTAwMCsxODYzLjU0TDExOTMuNTQrMTg2NC41NEMxNTM5Ljc0KzE4NjYuNDQrMTg2NC41NCsxNjkzLjM0KzE4NjQuNTQrMTI5Ni42NEwxODY0LjU0KzcxNi45NDJDMTg2Ni40NCszMTIuNDQyKzE1NDEuNjQrMTM1LjQ0MisxMTk1LjQ0KzEzNS40NDJaIiBmaWxsPSIjMTcxNzE3IiBvcGFjaXR5PSIxIi8+ICAgICAgICA8cGF0aCBzdHlsZT0iZmlsdGVyOiB1cmwoI3NoYWRvdzIpIiBkPSJNMTY5NS41NCs2MzEuNDQyQzE2ODUuODQrMjc4LjA0MisxNDA5LjM0KzEzNS40NDIrMTA1Mi45NCsxMzUuNDQyTDM2MS43NCsxMzYuNDQyTDgwMy43NCs0OTAuNDQyTDEwNjAuNzQrNDkwLjQ0MkMxMzM1LjI0KzQ5MC40NDIrMTMzNS4yNCs4MzUuMzQyKzEwNjAuNzQrODM1LjM0MkwxMDYwLjc0KzExNjQuODRDMTE1MC4yMisxMTY0Ljg0KzEyMTAuNTMrMTIwMS40OCsxMjQxLjY4KzEyNTAuODdDMTMwNi4wNysxMzUzKzEyNDUuNzYrMTUwOS42NCsxMDYwLjc0KzE1MDkuNjRMMzYxLjc0KzE4NjMuNTRMMTA1Mi45NCsxODY0LjU0QzE0MDkuMjQrMTg2NC41NCsxNjg1Ljc0KzE3MjEuOTQrMTY5NS41NCsxMzY4LjU0QzE2OTUuNTQrMTIwNS45NCsxNjUxLjA0KzEwODQuNDQrMTU3Mi42NCs5OTkuOTQyQzE2NTEuMDQrOTE1LjU0MisxNjk1LjU0Kzc5NC4wNDIrMTY5NS41NCs2MzEuNDQyWiIgZmlsbD0iIzNFODJFNSIgb3BhY2l0eT0iMSIvPiAgICAgICAgPHBhdGggc3R5bGU9ImZpbHRlcjogdXJsKCNzaGFkb3cxKSIgZD0iTTE0NjkuMjUrNjMxLjQ0MkMxNDU5LjU1KzI3OC4wNDIrMTE4My4wNSsxMzUuNDQyKzgyNi42NSsxMzUuNDQyTDEzNS40NSsxMzUuNDQyTDEzNS40NSsxMDA0QzEzNS40NSsxMDA0KzEzNS40MjcrMTI1NS4yMSszNTUuNjI2KzEyNTUuMjFDNTc1LjgyNSsxMjU1LjIxKzU3NS44NDgrMTAwNCs1NzUuODQ4KzEwMDRMNTc3LjQ1KzQ5MC40NDJMODM0LjQ1KzQ5MC40NDJDMTEwOC45NSs0OTAuNDQyKzExMDguOTUrODM1LjM0Mis4MzQuNDUrODM1LjM0Mkw2NjQuNjUrODM1LjM0Mkw2NjQuNjUrMTE2NC44NEw4MzQuNDUrMTE2NC44NEM5MjMuOTMyKzExNjQuODQrOTg0LjI0NCsxMjAxLjQ4KzEwMTUuMzkrMTI1MC44N0MxMDc5Ljc4KzEzNTMrMTAxOS40NysxNTA5LjY0KzgzNC40NSsxNTA5LjY0TDEzNS40NSsxNTA5LjY0TDEzNS40NSsxODY0LjU0TDgyNi42NSsxODY0LjU0QzExODIuOTUrMTg2NC41NCsxNDU5LjQ1KzE3MjEuOTQrMTQ2OS4yNSsxMzY4LjU0QzE0NjkuMjUrMTIwNS45NCsxNDI0Ljc1KzEwODQuNDQrMTM0Ni4zNSs5OTkuOTQyQzE0MjQuNzUrOTE1LjU0MisxNDY5LjI1Kzc5NC4wNDIrMTQ2OS4yNSs2MzEuNDQyWiIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMSIvPiAgICA8L2c+PC9zdmc+);\n}\n#bd-loading-icon {\n position: fixed;\n bottom:5px;\n right:5px;\n z-index: 2147483647;\n display: block;\n width: 20px;\n height: 20px;\n background-size: 100% 100%;\n animation: bd-loading-animation 1.5s ease-in-out infinite;\n}\n\n@keyframes bd-loading-animation {\n 0% { opacity: 0.05; }\n 50% { opacity: 0.6; }\n 100% { opacity: 0.05; }\n}\n/* =============== */\n/* END V2 LOADER */";const ht=document.createElement("div");ht.id="bd-loading-icon",ht.className="bd-loaderv2",ht.title="BandagedBD is loading...";var ut=class{static show(){document.body.appendChild(ct),document.body.appendChild(ht)}static hide(){ct&&ct.remove(),ht&&ht.remove()}};class pt extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),O.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}))}}class mt extends O.Component{constructor(e){super(e),this.hasUnsavedChanges=!1,this.onChange=this.onChange.bind(this),this.toggleLiveUpdate=this.toggleLiveUpdate.bind(this),this.updateCss=this.updateCss.bind(this),this.saveCss=this.saveCss.bind(this),this.openDetached=this.props.openDetached?this.openDetached.bind(this):null,this.openNative=this.openNative.bind(this),this.updateEditor=this.updateEditor.bind(this),this.controls=[{label:O.createElement(we,{size:"18px"}),tooltip:k.CustomCSS.update,onClick:this.updateCss},{label:O.createElement(K,{size:"18px"}),tooltip:k.CustomCSS.save,onClick:this.saveCss},{label:O.createElement(X,{size:"18px"}),tooltip:k.CustomCSS.openNative,onClick:this.openNative},{label:O.createElement(ee,{size:"18px"}),tooltip:k.CustomCSS.settings,onClick:"showSettings"},{label:k.Collections.settings.customcss.liveUpdate.name,type:"checkbox",onChange:this.toggleLiveUpdate,checked:T.get("settings","customcss","liveUpdate"),side:"right"}],this.openDetached&&this.controls.push({label:O.createElement(pt,{size:"18px"}),tooltip:k.CustomCSS.openDetached,onClick:this.openDetached,side:"right"})}componentDidMount(){E.on("customcss-updated",this.updateEditor)}componentWillUnmount(){E.off("customcss-updated",this.updateEditor)}updateEditor(e){this.editor&&(this.editor.value=e)}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}setEditorRef(e){this.editor=e,this.props.editorRef&&void 0!==this.props.editorRef.current?this.props.editorRef.current=e:this.props.editorRef&&(this.props.editorRef=e)}onChange(){this.hasUnsavedChanges=!0,this.props.onChange&&this.props.onChange(...arguments)}render(){return O.createElement(J,{ref:this.setEditorRef.bind(this),readOnly:this.props.readOnly,id:this.props.id||"bd-customcss-editor",onChange:this.onChange,controls:this.controls,value:this.props.css})}toggleLiveUpdate(e){T.set("settings","customcss","liveUpdate",e)}updateCss(e,t){this.props.update&&this.props.update(t)}saveCss(e,t){this.hasUnsavedChanges=!1,this.props.save&&this.props.save(t)}openDetached(e,t){this.props.openDetached&&this.props.openDetached(t)}openNative(){this.props.openNative&&this.props.openNative()}}const gt=s(2),ft=s(0),yt=g.getByProps("updateAccount"),bt=g.getByProps("dirtyDispatch"),vt=g.getByProps("ActionTypes").ActionTypes;var wt=new class extends Je{get name(){return"Custom CSS"}get category(){return"customcss"}get id(){return"customcss"}get startDetached(){return"detached"==T.get(this.collection,this.category,"openAction")}get nativeOpen(){return"system"==T.get(this.collection,this.category,"openAction")}constructor(){super(),this.savedCss="",this.insertedCss="",this.isDetached=!1}async enabled(){window.ace||S.injectScript("ace-script","https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js").then(()=>{window.require.original&&(window.require=window.require.original)}),T.registerPanel(this.id,k.Panels.customcss,{order:2,element:()=>[O.createElement(ve,{text:k.CustomCSS.editorTitle}),O.createElement(mt,{css:this.savedCss,save:this.saveCSS.bind(this),update:this.insertCSS.bind(this),openNative:this.openNative.bind(this),openDetached:this.openDetached.bind(this),onChange:this.onChange.bind(this)})],onClick:e=>{if(this.isDetached)return;if(this.nativeOpen)return this.openNative();if(this.startDetached)return this.openDetached();const t=u.findInRenderTree(e._reactInternalFiber,e=>e&&e.onSetSection,{walkable:["child","memoizedProps","props","children"]});t&&t.onSetSection&&t.onSetSection(this.id)}}),this.loadCSS(),this.insertCSS(this.savedCss),this.watchContent()}disabled(){T.removePanel(this.id),this.unwatchContent()}watchContent(){if(this.watcher)return this.error("Already watching content.");const e={};this.log("Starting to watch content."),this.watcher=gt.watch(w.customCSS,{persistent:!1},async(t,s)=>{if(!t||!s)return;await new Promise(e=>setTimeout(e,50));try{gt.statSync(w.customCSS)}catch(t){if("ENOENT"!==t.code)return;delete e[s],this.saveCSS("")}const n=gt.statSync(w.customCSS);if(n&&n.mtime&&n.mtime.getTime()&&"number"==typeof n.mtime.getTime()&&e[s]!=n.mtime.getTime()&&(e[s]=n.mtime.getTime(),"change"==t)){const e=w.loadCustomCSS();if(e==this.savedCss)return;this.savedCss=e,this.insertCSS(this.savedCss),E.emit("customcss-updated",this.savedCss)}})}unwatchContent(){if(!this.watcher)return this.error("Was not watching content.");this.watcher.close(),delete this.watcher,this.log("No longer watching content.")}onChange(e){T.get("settings","customcss","liveUpdate")&&(this.insertCSS(e),this.saveCSS(e))}loadCSS(){this.savedCss=w.loadCustomCSS()}insertCSS(e){void 0===e?e=this.insertedCss:this.insertedCss=e,S.updateCustomCSS(e)}saveCSS(e){void 0!==e&&(this.savedCss=e),w.saveCustomCSS(this.savedCss)}openNative(){ft.shell.openExternal("file://"+w.customCSS)}openDetached(e){const t=O.createRef(),s=O.createElement(mt,{id:"bd-floating-editor",ref:t,css:e,save:this.saveCSS.bind(this),update:this.insertCSS.bind(this),openNative:this.openNative.bind(this),onChange:this.onChange.bind(this)});ce.open({onClose:()=>{this.isDetached=!1},onResize:()=>{t&&t.current&&t.current.resize&&t.current.resize()},title:k.CustomCSS.editorTitle,id:"floating-editor-window",height:470,width:410,center:!0,resizable:!0,children:s,confirmClose:()=>!(!t||!t.current)&&t.current.hasUnsavedChanges,confirmationText:k.CustomCSS.confirmationText}),this.isDetached=!0,yt.close(),bt.dirtyDispatch({type:vt.LAYER_POP})}},St=new class extends Je{get name(){return"WindowPrefs"}get category(){return"window"}get id(){return"transparency"}enabled(){this.setWindowPreference("transparent",!0),this.setWindowPreference("backgroundColor","#00000000"),this.showModal(k.WindowPrefs.enabledInfo)}disabled(){this.deleteWindowPreference("transparent"),this.deleteWindowPreference("backgroundColor"),this.showModal(k.WindowPrefs.disabledInfo)}showModal(e){this.initialized&&_.showConfirmationModal(k.Modals.additionalInfo,e,{confirmText:k.Modals.restartNow,cancelText:k.Modals.restartLater,onConfirm:()=>{const e=s(0).remote.app;e.relaunch(),e.exit()}})}getWindowPreference(e){return(w.getData("windowprefs")||{})[e]}setWindowPreference(e,t){const s=w.getData("windowprefs")||{};s[e]=t,w.setData("windowprefs",s)}deleteWindowPreference(e){const t=w.getData("windowprefs")||{};delete t[e],w.setData("windowprefs",t)}},Ct=new class extends Je{get name(){return"24Hour"}get category(){return"general"}get id(){return"twentyFourHour"}enabled(){this.inject24Hour()}disabled(){this.unpatchAll()}inject24Hour(){const e=new RegExp("([0-9]{1,2}):([0-9]{1,2})\\s(AM|PM)"),t=(t,s,n)=>{const i=n.match(e);if(i&&4===i.length)return"AM"===i[3]?n.replace(i[0],`${"12"===i[1]?"00":i[1].padStart(2,"0")}:${i[2]}`):n.replace(i[0],`${"12"===i[1]?"12":parseInt(i[1])+12}:${i[2]}`)};this.after(f.TimeFormatter,"calendarFormat",t),this.after(f.TimeFormatter,"dateFormat",t)}};const Et=new RegExp("^(?!da-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$");var Mt=new class extends Je{get id(){return"classNormalizer"}get category(){return"general"}get name(){return"ClassNormalizer"}enabled(){this.hasPatched||(this.patchClassModules(g.getModules(this.moduleFilter.bind(this))),this.normalizeElement(document.querySelector("#app-mount")),this.hasPatched=!0,this.patchDOMMethods())}disabled(){this.hasPatched&&(this.unpatchClassModules(g.getModules(this.moduleFilter.bind(this))),this.revertElement(document.querySelector("#app-mount")),this.hasPatched=!1)}patchClassModules(e){for(const t of e)this.patchClassModule("da",t)}unpatchClassModules(e){for(const t of e)this.unpatchClassModule("da",t)}shouldIgnore(e){return!isNaN(e)||(!!(e.endsWith("px")||e.endsWith("ch")||e.endsWith("em")||e.endsWith("ms"))||(!!e.startsWith("layerContainer-")||(!(!e.startsWith("#")||7!=e.length&&4!=e.length)||!(!e.includes("calc(")&&!e.includes("rgba")))))}moduleFilter(e){if("object"!=typeof e||Array.isArray(e))return!1;if(e.__esModule)return!1;if(!Object.keys(e).length)return!1;for(const t in e){const s=e[t];if("string"!=typeof s)return!1;if(!this.shouldIgnore(s)){if(1===s.split("-").length)return!1;if(!Et.test(s.split(" ")[0]))return!1}}return!0}patchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;const i=n.split(" ");for(const n of i){const i=n.match(Et);if(!i||!i.length||i.length<2)continue;const o=i[1].split("-").map((e,t)=>t?e[0].toUpperCase()+e.slice(1):e).join("");t[s]+=` ${e}-${o}`}}}unpatchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;let i="";const o=n.split(" ");for(const t of o)t.startsWith(e+"-")||(i+=" "+t);t[s]=i.trim()}}normalizeElement(e){if(!(e instanceof Element))return;const t=e.classList;for(let s=0,n=t.length;st?e[0].toUpperCase()+e.slice(1):e).join("");e.classList.add("da-"+n)}for(const t of e.children)this.normalizeElement(t)}revertElement(e){if(!(e instanceof Element))return;e.children&&e.children.length&&this.revertElement(e.children[0]),e.nextElementSibling&&this.revertElement(e.nextElementSibling);const t=e.classList,s=[];for(let e=0;e{const o=[];t&&o.push("category="+t.replace(/ /g,"%20")),e&&o.push("term="+e.replace(/ /g,"%20")),n&&o.push("from="+n);const r="?"+o.join("&");i.get({url:`${this.endPoint}${r}${r?"&schema=new":"?schema=new"}`,json:!0},(e,t,n)=>{if(e)return s(null);const i=n.size+n.from;s({servers:n.results,size:n.size,from:n.from,total:n.total,next:i>=n.total?null:i})})})}static async join(e,t=!1){if(t)return Dt.acceptInvite(e);try{return await fetch(`${this.joinEndPoint}/${e}`,{method:"GET",credentials:"include",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"}}),!0}catch(e){return!1}}static async checkConnection(){try{const e=await fetch("https://auth.discordservers.com/info",{method:"GET",credentials:"include",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"}}),t=await e.json();return this._accessToken=t.access_token,t}catch(e){return!1}}static connect(){return new Promise(e=>{const t=new At(this.windowOptions),s="https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl="+this.connectEndPoint;t.webContents.on("did-navigate",(s,n)=>{n==this.connectEndPoint&&(t.close(),e())}),t.loadURL(s)})}static get windowOptions(){return{width:380,height:450,backgroundColor:"#282b30",show:!0,resizable:!0,maximizable:!1,minimizable:!1,alwaysOnTop:!0,frame:!1,center:!0,webPreferences:{nodeIntegration:!1}}}}const Tt=g.getByDisplayName("SettingsView");class Lt extends O.Component{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"]}constructor(e){super(e),this.state={category:"All",query:"",loading:!0,user:null,results:{servers:[],size:0,from:0,total:0,next:null}},this.changeCategory=this.changeCategory.bind(this),this.searchKeyDown=this.searchKeyDown.bind(this),this.connect=this.connect.bind(this),this.loadNextPage=this.loadNextPage.bind(this),this.join=this.join.bind(this)}componentDidMount(){this.checkConnection()}async checkConnection(){const e=await kt.checkConnection();if(!e)return this.setState({loading:!0,user:null});this.setState({user:e}),this.search()}async connect(){await kt.connect(),this.checkConnection()}searchKeyDown(e){this.state.loading||13!==e.which||this.search(e.target.value)}async search(e="",t=0){this.setState({query:e,loading:!0});const s=await kt.search({term:e,category:"All"==this.state.category?"":this.state.category,from:t});if(!s)return this.setState({results:{servers:[],size:0,from:0,total:0,next:null}});this.setState({loading:!1,results:s})}async changeCategory(e){this.state.loading||(await new Promise(t=>this.setState({category:e},t)),this.search())}loadNextPage(){this.state.loading||this.search(this.state.query,this.state.results.next)}async join(e,t=!1){return await kt.join(e,t)}get searchBox(){return O.createElement(je,{onKeyDown:this.searchKeyDown,placeholder:k.PublicServers.search+"..."})}get title(){if(!this.state.user)return k.PublicServers.notConnected;if(this.state.loading)return k.PublicServers.loading+"...";const e=this.state.results.from+1,t=this.state.results.total,s=this.state.results.next?this.state.results.next:t;let n=k.PublicServers.results.format({start:e,end:s,total:t,category:this.state.category});return this.state.query&&(n+=" "+k.PublicServers.query.format({query:this.state.query})),n}get content(){const e=this.state.user?null:{title:k.PublicServers.connect,onClick:this.connect},t="All"!=this.state.category&&this.state.user?null:this.bdServer,s=this.state.results.servers.map(e=>O.createElement(xt,{key:e.identifier,server:e,joined:kt.hasJoined(e.identifier),join:this.join,defaultAvatar:kt.getDefaultAvatar}));return[O.createElement(ve,{text:this.title,button:e}),t,s,this.state.results.next?this.nextButton:null,this.state.results.servers.length>0&&O.createElement(ve,{text:this.title})]}get nextButton(){return O.createElement("button",{type:"button",className:"bd-button bd-button-next",onClick:this.loadNextPage},this.state.loading?k.PublicServers.loading:k.PublicServers.loadMore)}get connection(){const{user:e}=this.state;return e?O.createElement("div",{id:"bd-connection"},O.createElement("div",{className:"bd-footnote"},k.PublicServers.connection.format(e)),O.createElement("button",{type:"button",className:"bd-button bd-button-reconnect",onClick:this.connect},k.PublicServers.reconnect)):O.createElement("div",{id:"bd-connection"})}get bdServer(){const e={name:"BetterDiscord",online:"7500+",members:"20000+",categories:["community","programming","support"],description:"Official BetterDiscord server for plugins, themes, support, etc",identifier:"86004744966914048",iconUrl:"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp",nativejoin:!0,invite_code:"0Tmfo5ZbORCRqbAd",pinned:!0};return O.createElement(xt,{server:e,pinned:!0,joined:kt.hasJoined(e.identifier),defaultAvatar:kt.getDefaultAvatar})}render(){const e=this.categoryButtons.map(e=>({section:e,label:e,element:()=>this.content}));return O.createElement(Tt,{onClose:this.props.close,onSetSection:this.changeCategory,section:this.state.category,sections:[{section:"HEADER",label:k.PublicServers.search},{section:"CUSTOM",element:()=>this.searchBox},{section:"HEADER",label:k.PublicServers.categories},...e,{section:"DIVIDER"},{section:"HEADER",label:O.createElement("a",{href:"https://discordservers.com",target:"_blank"},"DiscordServers.com")},{section:"DIVIDER"},{section:"CUSTOM",element:()=>this.connection}],theme:"dark"})}}const jt=g.getByProps("pushLayer");var Bt=new class extends Je{get name(){return"PublicServers"}get category(){return"general"}get id(){return"publicServers"}enabled(){const e=g.find(e=>e.default&&"NavigableGuilds"==e.default.displayName),t=g.findByDisplayName("Guilds");e||t||this.warn("Can't find GuildList component"),this.guildPatch=this.after(e||t.prototype,e?"default":"render",this._appendButton),this._appendButton()}disabled(){this.unpatchAll(),h.query("#bd-pub-li").remove()}_appendButton(){const e=f.GuildClasses.wrapper.split(" ")[0],t=h.query(`.${e} .scroller-2TZvBN >:first-child`);h.after(t,this.button)}openPublicServers(){jt.pushLayer(()=>f.React.createElement(Lt,{close:jt.popLayer}))}get button(){const e=h.createElement(`
`),t=h.createElement(`
${k.PublicServers.button}
`);return t.addEventListener("click",()=>{this.openPublicServers()}),e.append(t),e}},It=new class extends Je{get name(){return"VoiceDisconnect"}get category(){return"general"}get id(){return"voiceDisconnect"}constructor(){super(),this.beforeUnload=this.beforeUnload.bind(this)}enabled(){window.addEventListener("beforeunload",this.beforeUnload)}disabled(){window.removeEventListener("beforeunload",this.beforeUnload)}beforeUnload(){f.ChannelActions.selectVoiceChannel(null,null)}};const zt=g.getModule(e=>e.default&&e.default.displayName&&"Message"==e.default.displayName);var Ft=new class extends Je{get name(){return"ColoredText"}get category(){return"appearance"}get id(){return"coloredText"}enabled(){this.injectColoredText()}disabled(){this.unpatchAll()}injectColoredText(){this.after(zt.prototype,"render",(e,t,s)=>{this.after(s.props,"children",{after:({returnValue:t})=>{const s=t.props.children[1],n=e.props.message.colorString;s&&n&&(s.props.style={color:n})}})})}removeColoredText(){document.querySelectorAll(".markup-2BOw-j").forEach(e=>{e.style.setProperty("color","")})}},Ot=new class extends Je{get name(){return"DarkMode"}get category(){return"appearance"}get id(){return"darkMode"}enabled(){document.getElementById("app-mount").classList.add("bda-dark","bd-dark")}disabled(){document.getElementById("app-mount").classList.remove("bda-dark","bd-dark")}},Rt=new class extends Je{get name(){return"MinimalMode"}get category(){return"appearance"}get id(){return"minimalMode"}get hideChannelsID(){return"hideChannels"}get hideChannels(){return this.get(this.hideChannelsID)}constructor(){super(),this.enableHideChannels=this.enableHideChannels.bind(this),this.disableHideChannels=this.disableHideChannels.bind(this)}enabled(){document.body.classList.add("bd-minimal"),this.hideChannels&&this.enableHideChannels(),this.hideChannelCancel=this.registerSetting(this.hideChannelsID,this.enableHideChannels,this.disableHideChannels)}disabled(){document.body.classList.remove("bd-minimal"),this.hideChannels&&this.disableHideChannels(),this.hideChannelCancel&&this.hideChannelCancel()}enableHideChannels(){document.body.classList.add("bd-minimal-chan")}disableHideChannels(){document.body.classList.remove("bd-minimal-chan")}},Ut=new class extends Je{get name(){return"VoiceMode"}get category(){return"appearance"}get id(){return"voiceMode"}enabled(){document.querySelector(".chat-3bRxxu").style.setProperty("visibility","hidden"),document.querySelector(".chat-3bRxxu").style.setProperty("min-width","0px"),document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow","100000")}disabled(){document.querySelector(".chat-3bRxxu").style.setProperty("visibility",""),document.querySelector(".chat-3bRxxu").style.setProperty("min-width",""),document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow","")}};const Ht=g.getByDisplayName("VerticalScroller");class qt extends O.Component{render(){return O.createElement("div",{className:`bd-qem-${this.props.type}-container`},O.createElement(Ht,{className:"bd-em-scroller"},O.createElement("div",{className:"emote-menu-inner"},this.props.children)))}}const _t=g.getByProps("openContextMenu"),{MenuItem:Wt,MenuGroup:Gt}=g.find(e=>e.MenuRadioItem&&!e.default),$t=g.getByProps("default","MenuStyle").default,{ComponentDispatch:Qt}=g.getByProps("ComponentDispatch");class Vt extends O.Component{render(){return O.createElement("div",{className:"emote-container",onClick:this.handleOnClick.bind(this),onContextMenu:this.handleOnContextMenu.bind(this)},O.createElement("img",{src:this.props.url,alt:this.props.emote,title:this.props.emote}))}handleOnClick(){this.insertText(this.props.emote)}handleOnContextMenu(e){_t.openContextMenu(e,()=>O.createElement($t,{navId:"EmoteContextMenu",onClose:_t.closeContextMenu},O.createElement(Gt,null,O.createElement(Wt,{label:rt.isFavorite(this.props.emote)?"Remove Favorite":"Add Favorite",id:"favorite",action:this.handlefavorite.bind(this),onClose:_t.closeContextMenu}))))}handlefavorite(){_t.closeContextMenu(),rt.isFavorite(this.props.emote)?rt.removeFavorite(this.props.emote):rt.addFavorite(this.props.emote,this.props.url)}insertText(e){Qt.dispatchToLastSubscribed("INSERT_TEXT",{content:e})}}var Zt=[{id:"twitchEmotes",label:"Twitch Emotes",element:()=>O.createElement(qt,{type:"twitch"},Object.keys(rt.getCategory("TwitchGlobal")).map(e=>{const t=rt.getUrl("TwitchGlobal",e);return O.createElement(Vt,{emote:e,url:t})}))},{id:"favoriteEmotes",label:"Favorite Emotes",element:()=>O.createElement(qt,{type:"favourite"},Object.entries(rt.favorites).map(([e,t])=>O.createElement(Vt,{emote:e,url:t})))}];const Yt=g.find(e=>e.type&&"ExpressionPicker"==e.type.displayName);var Jt=new class extends Je{get name(){return"EmoteMenu"}get collection(){return"emotes"}get category(){return"general"}get id(){return"emoteMenu"}get hideEmojisID(){return"hideEmojiMenu"}get hideEmojis(){return this.get(this.hideEmojisID)}enabled(){this.before(Yt,"type",(e,[t])=>{"emoji"==t.expressionPickerView&&this.hideEmojis&&(t.expressionPickerView="gif")}),this.after(Yt,"type",(e,[t],s)=>{const n=u.getNestedProp(s,"props.children.props.children.1.props.children.0.props.children.props.children"),i=u.getNestedProp(s,"props.children.props.children.1.props.children");if(!n||!i)return s;const o=t.expressionPickerView,r=Zt.find(e=>e.id===o),a=n[0].props;n.push(...Zt.map(e=>O.createElement("div",{id:e.id+"-tab",role:"tab","aria-selected":o==e.id,className:a.className},O.createElement(a.children.type,{viewType:e.id,isActive:o==e.id,setActiveView:a.children.props.setActiveView},e.label)))),r&&(i[2]=r.element()),this.hideEmojis&&n.splice(n.findIndex(e=>"emoji-picker-tab"==e.props.id),1)})}disabled(){this.unpatchAll()}},Kt=new class extends Je{get name(){return"DeveloperMode"}get category(){return"developer"}get id(){return"developerMode"}get selectorModeID(){return"copySelector"}get selectorMode(){return this.get(this.selectorModeID)}constructor(){super(),this.copySelectorListener=this.copySelectorListener.bind(this)}enabled(){document.addEventListener("contextmenu",this.copySelectorListener)}disabled(){document.removeEventListener("contextmenu",this.copySelectorListener)}copySelectorListener(e){e.stopPropagation();const t=this.getSelector(e.target);setImmediate((function(){let s=h.query(".contextMenu-HLZMGh");if(!s){const t=h.query("#app-mount"),n=h.createElement('
');s=h.createElement('
'),n.append(s),t.append(n),n.style.top=e.clientY+"px",n.style.left=e.clientX+"px",n.style.zIndex="1002";const i=function(e){e.keyCode&&27!==e.keyCode||(n.remove(),document.removeEventListener("click",i),document.removeEventListener("contextmenu",i),document.removeEventListener("keyup",i))};document.addEventListener("click",i),document.addEventListener("contextmenu",i),document.addEventListener("keyup",i)}const n=h.createElement('
'),i=h.createElement('
');i.append(h.createElement(`
${k.Developer.copySelector}
`)),i.addEventListener("click",()=>{f.ElectronModule.copy(t),s.style.display="none"}),n.append(i),s.append(n)}))}getSelector(e){if(e.id)return"#"+e.id;const t=this.getRules(e),s=t[t.length-1];return s?s.selectorText:e.classList.length?"."+Array.from(e.classList).join("."):"."+Array.from(e.parentElement.classList).join(".")}getRules(e,t=e.ownerDocument.styleSheets){return[...t].filter(e=>!e.href||!e.href.includes("BetterDiscordApp")).map(e=>[...e.cssRules||[]]).flat().filter(t=>t&&t.selectorText&&e.matches(t.selectorText)&&t.style.length&&t.selectorText.split(", ").length<8&&!t.selectorText.split(", ").includes("*"))}},Xt=new class extends Je{get name(){return"Debugger"}get category(){return"developer"}get id(){return"debuggerHotkey"}enabled(){document.addEventListener("keydown",this.debugListener)}disabled(){document.removeEventListener("keydown",this.debugListener)}debugListener(e){if(119===e.which||118==e.which){debugger;e.preventDefault(),e.stopImmediatePropagation()}}};const es=s(0),ts=s(2),ss=s(1),ns=es.remote.BrowserWindow;var is=new class extends Je{get name(){return"ReactDevTools"}get category(){return"developer"}get id(){return"reactDevTools"}initialize(){super.initialize(),this.findExtension()}findExtension(){let e="";if(e="win32"===process.platform?ss.resolve(process.env.LOCALAPPDATA,"Google/Chrome/User Data"):"linux"===process.platform?ss.resolve(process.env.HOME,".config/google-chrome"):"darwin"===process.platform?ss.resolve(process.env.HOME,"Library/Application Support/Google/Chrome"):ss.resolve(process.env.HOME,".config/chromium"),e+="/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/",ts.existsSync(e)){const t=ts.readdirSync(e);e=ss.resolve(e,t[t.length-1])}this.extensionPath=e,this.isExtensionInstalled=ts.existsSync(e)}enabled(){if(this.isExtensionInstalled||this.findExtension(),!this.isExtensionInstalled)return _.alert(k.ReactDevTools.notFound,k.ReactDevTools.notFoundDetails);try{ns.addDevToolsExtension(this.extensionPath)?this.log("Successfully installed react devtools."):this.error("Couldn't find react devtools in chrome extensions!")}catch(e){this.error("Couldn't add the extension!")}}disabled(){this.isExtensionInstalled&&ns.removeDevToolsExtension("React Developer Tools")}};class os extends O.Component{render(){return O.createElement("svg",{className:"bd-logo "+this.props.className,height:"100%",width:this.props.size||"16px",viewBox:"0 0 2000 2000",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}},O.createElement("metadata",null),O.createElement("defs",null,O.createElement("filter",{id:"shadow1"},O.createElement("feDropShadow",{dx:"20",dy:"0",stdDeviation:"20",floodColor:"rgba(0,0,0,0.35)"})),O.createElement("filter",{id:"shadow2"},O.createElement("feDropShadow",{dx:"15",dy:"0",stdDeviation:"20",floodColor:"rgba(255,255,255,0.15)"})),O.createElement("filter",{id:"shadow3"},O.createElement("feDropShadow",{dx:"10",dy:"0",stdDeviation:"20",floodColor:"rgba(0,0,0,0.35)"}))),O.createElement("g",null,O.createElement("path",{style:{filter:"url(#shadow3)"},fill:"#171717",opacity:"1",d:"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z"}),O.createElement("path",{style:{filter:"url(#shadow2)"},fill:"#3E82E5",opacity:"1",d:"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z"}),O.createElement("path",{style:{filter:"url(#shadow1)"},fill:"#FFFFFF",opacity:"1",d:"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z"})))}}const rs=f.React,as=g.getByDisplayName("Tooltip");var ls=new class{initialize(){u.suppressErrors(this.patchSocial.bind(this),"BD Social Patch")(),u.suppressErrors(this.patchGuildPills.bind(this),"BD Guild Pills Patch")(),u.suppressErrors(this.patchGuildListItems.bind(this),"BD Guild List Items Patch")(),u.suppressErrors(this.patchGuildSeparator.bind(this),"BD Guild Separator Patch")(),u.suppressErrors(this.patchMessageHeader.bind(this),"BD Message Header Patch")(),u.suppressErrors(this.patchMemberList.bind(this),"BD Member List Patch")()}patchSocial(){if(this.socialPatch)return;const e=g.getByDisplayName("TabBar"),t=g.getByDisplayName("Anchor");e&&(this.socialPatch=L.after("ComponentPatcher",e.prototype,"render",(e,s,n)=>{const o=n.props.children;if(!o||!o.length||o.length<3)return;if("Separator"!==o[o.length-3].type.displayName)return;if(!o[o.length-2].type.toString().includes("socialLinks"))return;if(t){const e=o[o.length-2].type,s=function(){const s=e(...arguments);return s.props.children.push(f.React.createElement(t,{className:"bd-social-link",href:"https://twitter.com/BandagedBD",title:"BandagedBD",target:"_blank"},f.React.createElement(os,{size:"16px",className:"bd-social-logo"}))),s};o[o.length-2].type=s}const r=f.React.createElement("div",{className:"colorMuted-HdFt4q size12-3cLvbJ"},"Injector "+i.version),a=`(${i.hash?i.hash.substring(0,7):i.branch})`,l=f.React.createElement("div",{className:"colorMuted-HdFt4q size12-3cLvbJ"},`BBD ${i.bbdVersion} `,f.React.createElement("span",{className:"versionHash-2gXjIB da-versionHash"},a)),d=o[o.length-1].type;o[o.length-1].type=function(){const e=d(...arguments);return e.props.children.splice(e.props.children.length-1,0,r),e.props.children.splice(1,0,l),e}}))}patchGuildListItems(){if(this.guildListItemsPatch)return;const e=f.GuildClasses.listItem.split(" ")[0],t=f.GuildClasses.blobContainer.split(" ")[0],s=u.getReactInstance(document.querySelector(`.${e} .${t}`).parentElement).return.type;s&&(this.guildListItemsPatch=L.after("ComponentPatcher",s.prototype,"render",(e,t,s)=>{if(!s||!e)return;const n=e.props;return s.props.className+=" bd-guild",n.unread&&(s.props.className+=" bd-unread"),n.selected&&(s.props.className+=" bd-selected"),n.audio&&(s.props.className+=" bd-audio"),n.video&&(s.props.className+=" bd-video"),n.badge&&(s.props.className+=" bd-badge"),n.animatable&&(s.props.className+=" bd-animatable"),s}))}patchGuildPills(){if(this.guildPillPatch)return;const e=g.getModule(e=>e.default&&!e.default.displayName&&e.default.toString&&e.default.toString().includes("translate3d"));e&&(this.guildPillPatch=L.after("ComponentPatcher",e,"default",(e,t,s)=>{const n=t[0];return n.unread&&(s.props.className+=" bd-unread"),n.selected&&(s.props.className+=" bd-selected"),n.hovered&&(s.props.className+=" bd-hovered"),s}))}patchGuildSeparator(){if(this.guildSeparatorPatch)return;const e=g.getByDisplayName("Guilds"),t=g.getByProps("renderListItem");if(!t||!e)return;const s=function(){const e=t.Separator(...arguments);return e.props.className+=" bd-guild-separator",e};this.guildSeparatorPatch=L.after("ComponentPatcher",e.prototype,"render",(e,t,n)=>{const i=u.findInReactTree(n,e=>e.type&&!e.type.displayName&&"function"==typeof e.type&&u.isEmpty(e.props));i&&(i.type=s)})}patchMessageHeader(){if(this.messageHeaderPatch)return;const e=g.getByProps("MessageTimestamp"),t=g.find(e=>"Anchor"==e.displayName);t&&e&&e.default&&(this.messageHeaderPatch=L.after("ComponentPatcher",e,"default",(e,s,n)=>{const i=u.getNestedProp(s[0],"message.author"),o=u.getNestedProp(n,"props.children.1.props.children.1.props.children");o&&i&&i.id&&"249746236008169473"===i.id&&Array.isArray(o)&&o.push(rs.createElement(as,{color:"black",position:"top",text:"BandagedBD Developer"},e=>rs.createElement(t,Object.assign({className:"bd-chat-badge",href:"https://github.com/rauenzi/BetterDiscordApp",title:"BandagedBD",target:"_blank"},e),rs.createElement(os,{size:"16px",className:"bd-logo"}))))}))}patchMemberList(){if(this.memberListPatch)return;const e=g.findByDisplayName("MemberListItem"),t=g.find(e=>"Anchor"==e.displayName);t&&e&&e.prototype&&e.prototype.renderDecorators&&(this.memberListPatch=L.after("ComponentPatcher",e.prototype,"renderDecorators",(e,s,n)=>{const i=u.getNestedProp(e,"props.user"),o=u.getNestedProp(n,"props.children");o&&i&&i.id&&"249746236008169473"===i.id&&Array.isArray(o)&&o.push(rs.createElement(as,{color:"black",position:"top",text:"BandagedBD Developer"},e=>rs.createElement(t,Object.assign({className:"bd-member-badge",href:"https://github.com/rauenzi/BetterDiscordApp",title:"BandagedBD",target:"_blank"},e),rs.createElement(os,{size:"16px",className:"bd-logo"}))))}))}};const ds=s(2),cs=s(1),{ipcRenderer:hs}=s(0),us=f.GuildClasses;!function(){const e=Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype,"contentWindow").get;Object.defineProperty(HTMLIFrameElement.prototype,"contentWindow",{get:function(){const t=Reflect.apply(e,this,arguments);return new Proxy(t,{getOwnPropertyDescriptor:function(e,t){if("localStorage"!==t)return Object.getOwnPropertyDescriptor(e,t)},get:function(e,t){if("localStorage"===t)return null;const s=e[t];return"function"==typeof s?s.bind(e):s}})}}),Object.defineProperty(Reflect,"apply",{value:Reflect.apply,writable:!1,configurable:!1}),Object.defineProperty(Function.prototype,"bind",{value:Function.prototype.bind,writable:!1,configurable:!1});const t=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){const e=arguments[1];return e.toLowerCase().includes("api/webhooks")?null:Reflect.apply(t,this,arguments)}}(),function(){const e="betterdiscord/",t=s(4),n=t._load;t._load=function(t){if("betterdiscord"===t||t.startsWith(e)){if("bdapi"==t.substr(e.length))return dt}return n.apply(this,arguments)}}(),window.BdApi=dt,ut.show(),new class{constructor(){hs.invoke("bd-config","get").then(e=>{this.hasStarted||(Object.assign(i,e),this.init())})}get dependencies(){return[{name:"jquery",type:"script",url:"//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js",backup:"//cdn.jsdelivr.net/gh/jquery/jquery@2.0.0/jquery.min.js",local:null},{name:"bd-stylesheet",type:"style",url:"//betterdiscord.zerebos.com/dist/style.css",backup:"//rauenzi.github.io/BetterDiscordApp/dist/style.css",local:"{{localServer}}/BetterDiscordApp/dist/style.css",localPath:"style.css"}]}setConfig(e){this.hasStarted||Object.assign(i,e)}async init(){if(this.hasStarted)return;this.hasStarted=!0;let e=new Promise(e=>e());if(window.$&&window.jQuery||(e=this.loadDependencies()),w.initialize(),await D.initialize(),i.versioni.version&&_.showConfirmationModal(k.Startup.updateAvailable,k.Startup.updateInfo.format({version:t}),{confirmText:k.Startup.updateNow,cancelText:k.Startup.maybeLater,onConfirm:async()=>{const e=()=>{_.alert(k.Startup.updateFailed,k.Startup.manualUpdate)};try{if(!await this.updateInjector())return e();const t=s(0).remote.app;t.relaunch(),t.exit()}catch(t){e()}}}),c.log("Startup","Initializing Settings"),T.initialize(),await this.waitForGuilds(),F.initialize(),ls.initialize();for(const e in n)n[e].initialize();await e,c.log("Startup","Loading Plugins");const o=Ve.initialize();c.log("Startup","Loading Themes");const r=Ye.initialize();c.log("Startup","Removing Loading Icon"),ut.hide(),c.log("Startup","Collecting Startup Errors"),_.showAddonErrors({plugins:o,themes:r});const a=w.getBDData("version");i.bbdVersion>a&&(_.showChangelogModal(l),w.setBDData("version",i.bbdVersion))}waitForGuilds(){let e=0;return new Promise(t=>{const s=function(){e++,"complete"!=document.readyState&&setTimeout(s,100);const n=us.wrapper.split(" ")[0],o=us.listItem.split(" ")[0],r=us.blobContainer.split(" ")[0];return document.querySelectorAll(`.${n} .${o} .${r}`).length>0||e>=50?t(i.deferLoaded=!0):void setTimeout(s,100)};s()})}async loadDependencies(){for(const e of this.dependencies){if(i.local&&i.localPath&&e.localPath&&ds.existsSync(cs.resolve(i.localPath,e.localPath))){const t=ds.readFileSync(cs.resolve(i.localPath,e.localPath)).toString();S.injectStyle(e.name,t);continue}const t=u.formatString(i.local&&null!=e.local?e.local:e.url,{repo:i.repo,hash:i.hash,localServer:i.localServer});c.log("Startup",`Loading Resource (${t})`);const s=("script"==e.type?S.injectScript:S.linkStyle).bind(S);try{await s(e.name,t)}catch(n){const o=u.formatString(e.backup,{minified:i.minified?".min":""});c.stacktrace("Startup",`Could not load ${t}. Using backup ${o}`,n);try{await s(e.name,o)}catch(s){c.stacktrace("Startup",`Could not load ${t}. Using backup ${o}`,n),"jquery"===e.name&&_.alert(k.Startup.jqueryFailed,k.Startup.jqueryFailedDetails)}}}}async updateInjector(){const e=w.injectionPath;if(!e)return!1;const t=s(6),n=s(7),i=s(8),o=s(3),r=cs.resolve(e,".."),a=cs.basename(e),l="https://github.com/rauenzi/BetterDiscordApp/archive/injector.zip",d=cs.resolve(r,"injector.zip"),h=cs.resolve(r,"BetterDiscordApp-injector");c.log("InjectorUpdate","Downloading "+l);let u=await new Promise(e=>{o.get({url:l,encoding:null},async(t,s,n)=>{if(t||200!==s.statusCode)return e(!1);await new Promise(e=>ds.exists(d,e))&&await new Promise(e=>ds.rename(d,`${d}.bak${Math.round(performance.now())}`,e)),c.log("InjectorUpdate","Writing "+d),ds.writeFile(d,n,t=>e(!t))})});if(!u)return u;await new Promise(e=>ds.exists(h,e))&&await new Promise(e=>ds.rename(h,`${h}.bak${Math.round(performance.now())}`,e));const p=await new Promise((e,t)=>n.open(d,{lazyEntries:!0},(s,n)=>{if(s)return t(s);e(n)}));p.on("entry",(function(e){if(e.fileName.endsWith("/"))return p.readEntry();c.log("InjectorUpdate","Extracting "+e.fileName);const t=cs.resolve(r,e.fileName);i.sync(cs.dirname(t)),p.openReadStream(e,(function(e,s){if(e)return u=!1;s.on("end",(function(){p.readEntry()})),s.pipe(ds.createWriteStream(t))}))})),p.readEntry(),await new Promise(e=>p.once("end",e));const m=cs.resolve(r,`${a}.bak${Math.round(performance.now())}`);return await new Promise(t=>ds.rename(e,m,t)),c.log("InjectorUpdate",`Renaming ${cs.basename(h)} to ${a}`),u=await new Promise(t=>ds.rename(h,e,e=>t(!e))),u?u?(await new Promise(e=>t(m,e)),await new Promise(e=>ds.unlink(d,e)),c.log("InjectorUpdate","Injector Updated!"),u):(c.err("InjectorUpdate","Something went wrong... restoring backups."),await new Promise(e=>t(h,e)),await new Promise(t=>ds.rename(m,e,t)),u):(c.err("InjectorUpdate","Failed to rename the final directory"),u)}}}]); \ No newline at end of file diff --git a/dist/style.css b/dist/style.css index 482c0c27..8061edca 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1,2281 +1 @@ -/* stylelint-disable no-descending-specificity */ - -#bd-editor-panel { - display: flex; - flex-direction: column; -} - -#bd-editor-controls button { - margin: 0 5px 0 0; - background: none; - color: #fff; - height: 26px; - font-weight: 600; - border-radius: 3px; - display: flex; - align-items: center; -} - -#bd-editor-controls button:hover { - background: rgba(255, 255, 255, 0.05); -} - -#bd-editor-controls button svg { - fill: white; -} - -#bd-editor-controls button:last-of-type { - margin-right: 0; -} - -#bd-editor-controls { - display: flex; - align-items: center; - justify-content: space-between; - background: #272822; - color: #fff; - border: none; - box-shadow: 0 1px 0 0 #2f3129 inset; - padding: 5px; -} - -.editor-wrapper { - display: flex; -} - -.ace_editor { - line-height: normal; - font-family: Consolas, monospace; - box-sizing: border-box; - height: calc(100vh - 250px); - font-size: 14px; - width: 100%; -} - -.bd-monokai .editor .ace_gutter { - background: #2f3136; -} - -.bd-monokai .ace_editor { - background: #292b2f; -} - -.bd-monokai #bd-editor-controls { - background: #202225; -} - -.theme-light #bd-editor-controls { - background: #e8e8e8; - border: 1px solid #fff; - border-top: 1px solid #adadad; - box-shadow: inset 0 1px 0 0 white; -} - -.controls-section { - display: flex; - align-items: center; -} - -.controls-section .checkbox-inner { - width: 14px; - height: 14px; -} - -.controls-section .checkbox-inner .checkbox:checked + span::after { - left: 2px; - top: -2px; -} - -.controls-section .checkbox-label { - font-size: 14px; -} - -/* Ace Editor Settings */ - -#ace_settingsmenu_container { - background: rgba(0, 0, 0, 0.7) !important; /* stylelint-disable-line important */ -} - -body #ace_settingsmenu { - padding-top: 35px; -} - -body .ace_closeButton { - position: absolute; - top: 8px; - right: 12px; - z-index: 10000; - padding: 0; - cursor: pointer; - background: none; - border: none; -} - -body .ace_closeButton::before { - content: "✖"; - color: #36393f; -} - -body .ace_closeButton:active { - transform: translateY(2px); -} - -/* editor help text */ - -#bd-editor-controls .help-text { - margin-top: 8px; - margin-bottom: 3px; - font-size: 14px; -} - -#bd-editor-controls .help-text .inline { - background: #2f3129; - padding: 0.2em; - margin: -0.2em 0; - border-radius: 3px; -} - -/* Emoji Picker */ - -.bd-dark #bd-qem-favourite-container, -.bd-dark #bd-qem-twitch-container { - background-color: #353535; -} - -.bd-dark #bd-qem { - border-bottom: 1px solid #464646; - background: #353535; -} - -.bd-dark #bd-qem button { - background: #353535; - border-left: 1px solid #242424; - box-shadow: #424242 1px 0 0 0; - color: #fff; -} - -.bd-dark #bd-qem button.active { - background-color: #292929; -} - -.bd-dark #bd-qem button:hover { - background-color: #303030; -} - -.bd-dark .emojiPicker-3m1S-j { - background-color: #353535; -} - -.bd-dark .emojiPicker-3m1S-j .category-2U57w6 { - background-color: #353535; -} - -.bd-dark .emojiPicker-3m1S-j .header-1nkwgG .searchBar-2pWH0_ { - background-color: #2b2b2b; -} - -.bd-dark .emojiPicker-3m1S-j .searchBar-2pWH0_ input { - color: #fff; -} - -.bd-dark .emojiPicker-3m1S-j .searchBar-2pWH0_ input::-webkit-input-placeholder { - color: #fff; -} - -.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7 .emojiItem-109bjA.selected-39BZ4S { - background-color: rgba(123, 123, 123, 0.37); -} - -.bd-dark .emojiPicker-3m1S-j .dimmer-3iH-5D.visible-3k45bQ { - background-color: rgba(62, 62, 62, 0.65); -} - -.bd-dark .emojiPicker-3m1S-j .diversitySelector-tmmMv0 .popout-2nUePc { - background: #353535; - border-color: #202020; -} - -.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar, -.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-track, -.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-track-piece, -.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar, -.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-track, -.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-track-piece, -.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar, -.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar-track, -.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar-track-piece { - background-color: #303030 !important; - border-color: #303030 !important; -} - -.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-thumb, -.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-thumb, -.bd-dark .emojiPicker-3g68GS .scroller-3vODG7::-webkit-scrollbar-thumb { - border-color: #202020 !important; - background-color: #202020 !important; -} - -/* add/create server */ - -.bd-dark .theme-light .slide-2pHaq5 { - background: #36393f; -} - -.bd-dark .theme-dark .action-1lSjCi, -.bd-dark .theme-light .action-1lSjCi { - background: #2f3136; -} - -/* centered or */ - -.bd-dark .theme-dark .or-3THJsp, -.bd-dark .theme-light .or-3THJsp { - background: #2f3136; - order: 2; - height: 56px; - width: 56px; - top: 103px; - line-height: 56px; - left: calc(50% - 29px); - border-radius: 50%; - border: 2px solid #484b52; -} - -.bd-dark .create-3jownz { - order: 1; -} - -.bd-dark .join-33Tr-7 { - order: 3; -} - -.bd-dark .theme-dark .actionIcon-2IISM_, -.bd-dark .theme-light .actionIcon-2IISM_ { - filter: grayscale(100%) brightness(60%); -} - -.bd-dark .theme-light .footer-2yfCgX { - background: #2f3136; -} - -/* Region Select */ - -.bd-dark .regionSelectModal-12e-57 { - background: #36393f; -} - -.bd-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3 { - background: #2f3136; - border: 2px solid #484b52; -} - -/* Ace Editor Settings */ - -.bd-dark ~ div #ace_settingsmenu { - color: #f6f6f7; - background: #36393f; - box-shadow: 0 0 0 1px rgba(32, 34, 37, 0.6), 0 2px 10px 0 rgba(0, 0, 0, 0.2); -} - -.bd-dark ~ div #ace_settingsmenu select, -.bd-dark ~ div #ace_settingsmenu input[type="text"] { - color: #f6f6f7; - background: #2f3136; - border: 1px solid #484b52; -} - -.bd-dark ~ div .ace_closeButton::before { - color: #f6f6f7; -} - -#removemenu { - width: auto; - background: #505050; - z-index: 999999; - box-shadow: 0 0 2px #000; - padding: 2px; - left: 25px; - display: block; - cursor: pointer; - color: #fff; - position: fixed; -} - -#removemenu ul a { - text-decoration: none; - color: #fff; - padding: 3px; -} - -.emotewrapper { - position: relative; - display: inline-flex; - object-fit: contain; - margin: -0.1em 0.05em -0.2em 0.1em; - vertical-align: top; -} - -.emotewrapper.jumboable { - margin-bottom: 0; - margin-top: 0.2em; - vertical-align: -0.3em; -} - -.emote { - height: 1.45em; -} - -.emote.jumboable { - height: 2rem; -} - -.fav { - display: none; - position: absolute; - width: 15px; - height: 15px; - right: -7px; - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAzFBMVEUAAABQUFBMTExLS0tNTU1MTExNTU1NTU1MTExMTExNTU1LS0tEREBEREBEREBEREBJSUhLS0tLS0tEREBNTU1NTU1NTU1EREArKyhNTU1NTU0AAABMTExKSklMTExNTU1NTU1NTU1KSkpMTExKSkhNTU1KSkpISEZNTU1LS0tAQDxOTk5KSkpLS0tNTU1MTExMTEx/f39MTExMTExLS0pLS0tMTExNTU1NTU1LS0pNTU1NTU1NTU1NTU1NTU1NTUxNTU1NTU1NTUxMTEzB8C/5AAAAOnRSTlMAI8X96oWAgYSF68QBAg0PMCb9BIuLgQUD4N0Bh0mKhZSOQ4gcrKscaW8QRE6fmJyjAshASceG7cIpqQOxTQAAALVJREFUGFddx6FOA0EYAOGZvd07Qm6vVCAAgUUgQEDfX/YZMAigqaFN7iC5tsmPqGPUN/AvUVeoEbGOCElJz08Uzeixqu4AqomVVSNngOVjTqDGZSl3UFtPGV2ot2zaq96YM9p5Ddzcf/nTTAlj+/sNtNu8OcwkIsbPBtrUfMQeEhGQmHbmGIFMwLPzu6UMIwBNgToshgq8Nr2ki+Oy7ebDHp70LRPWB6OZgfWLWei7fJonOOsPCGA9kVlssOoAAAAASUVORK5CYII="); - border: none; - background-size: 100% 100%; - background-repeat: no-repeat; - background-color: #303030; - border-radius: 5px; - top: -7px; - cursor: pointer; -} - -.fav.active { - background-color: yellow; -} - -.emotewrapper:hover .fav { - display: block; -} - -.emojiPicker-3m1S-j { - box-shadow: none; - border-top: none; - border-radius: 0 0 5px 5px; -} - -#bd-qem { - border-radius: 5px 5px 0 0; - background: #fff; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - height: 30px; - display: flex; - flex-direction: row; - padding-right: 1px; -} - -#bd-qem button { - border-left: 1px solid #efefef; - background: transparent; - box-shadow: #cecece 1px 0 0 0; - flex-grow: 1; -} - -#bd-qem button:hover { - background: #ececec; -} - -#bd-qem-twitch { - border-radius: 5px 0 0 0; - order: 2; -} - -#bd-qem-emojis { - border-radius: 0 5px 0 0; - order: 3; -} - -#bd-qem-favourite { - order: 3; -} - -#bd-qem button.active { - background-color: #e2e2e2; -} - -#bd-qem-twitch-container, -#bd-qem-favourite-container { - width: 346px; - height: 329px; - background-color: #fff; - border-radius: 0 0 5px 5px; -} - -#bd-qem-twitch-container .scroller-wrap, -#bd-qem-favourite-container .scroller-wrap { - height: 100%; -} - -.emote-menu-inner { - padding: 5px 0 0 15px; -} - -.bd-qme-hidden #bd-qem-emojis { - display: none; -} - -.bd-em-scroller { - height: 400px; -} - -#emote-container { - padding: 10px; -} - -.emote-container { - display: inline-block; - padding: 2px; - border-radius: 5px; - width: 30px; - height: 30px; - position: relative; -} - -.emote-icon { - max-width: 100%; - max-height: 100%; - position: absolute; - margin: auto; - top: 0; - right: 0; - bottom: 0; - left: 0; - cursor: pointer; -} - -.emote.stop-animation { - animation: none; -} - -.emote-container:hover { - background: rgba(123, 123, 123, 0.37); -} - -.emoteflip, -.emotespinflip { - transform: scaleX(-1); -} - -.emotespin { - animation: 1s emote-spin infinite linear; -} - -.emote1spin { - animation: 1s emote-spin-reverse infinite linear; -} - -.emotespin2 { - animation: 0.5s emote-spin infinite linear; -} - -.emote2spin { - animation: 0.5s emote-spin-reverse infinite linear; -} - -.emotespin3 { - animation: 0.2s emote-spin infinite linear; -} - -.emote3spin { - animation: 0.2s emote-spin-reverse infinite linear; -} - -.emotepulse { - animation: 1s emote-pulse infinite linear; -} - -.emotetr { - transform: translateX(-3px); -} - -.emotebl { - transform: translateY(-3px); -} - -.emotebr { - transform: translate(-3px, -3px); -} - -.emoteshake { - animation: 1s emote-shake infinite linear; -} - -.emoteflap { - transform: scaleY(-1); -} - -.emoteshake2 { - animation: emote-shake2 0.3s linear infinite; -} - -.emoteshake3 { - animation: emote-shake3 0.1s linear infinite; -} - -@keyframes emote-shake2 { - 25% { - transform: translate(-1px, -1px); - } - - 50% { - transform: translate(-1px, 1px); - } - - 75% { - transform: translate(1px, 1px); - } - - 75% { - transform: translate(1px, -1px); - } -} - -@keyframes emote-shake3 { - 25% { - transform: translate(-1px, -1px); - } - - 50% { - transform: translate(-1px, 1px); - } - - 75% { - transform: translate(1px, 1px); - } - - 75% { - transform: translate(1px, -1px); - } -} - -@keyframes emote-spin { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(360deg); - } -} - -@keyframes emote-spin-reverse { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(-360deg); - } -} - -@keyframes emote-pulse { - 0% { - -webkit-transform: scale(1, 1); - } - - 50% { - -webkit-transform: scale(1.2, 1.2); - } - - 100% { - -webkit-transform: scale(1, 1); - } -} - -@keyframes emote-shake { - 10%, - 90% { - transform: translate3d(-1px, 0, 0); - } - - 20%, - 80% { - transform: translate3d(2px, 0, 0); - } - - 30%, - 50%, - 70% { - transform: translate3d(-4px, 0, 0); - } - - 40%, - 60% { - transform: translate3d(4px, 0, 0); - } -} - -/* Messages */ - -.bd-minimal .divider-32i8lo { - opacity: 0; -} - -/* message avatars */ - -.bd-minimal .large-3ChYtB { - max-width: 20px; - max-height: 20px; - background-size: 100%; - margin-right: 2px; - margin-top: 0; - border-radius: 0; -} - -/* message content */ - -.bd-minimal .content-3dzVd8 { - border-left: 2px solid #ebebeb; - padding-left: 2px; -} - -.bd-minimal .theme-dark .content-3dzVd8 { - border-left: 2px solid #303030; -} - -/* message username */ - -.bd-minimal .username-_4ZSMR { - font-size: small; -} - -/* message group */ - -.bd-minimal .container-1YxwTf { - padding: 5px; -} - -/* message embed */ - -.bd-minimal .embed-IeVjo6 { - padding: 2px; -} - -/* Member List */ - -.bd-minimal .membersWrap-2h-GB4 { - min-width: 0; -} - -/* member list avatars */ - -.bd-minimal .members-1998pB .small-5Os1Bb { - max-width: 15px; - max-height: 15px; - background-size: 15px 15px; -} - -/* member list avatars */ - -.bd-minimal .members-1998pB .small-5Os1Bb .status-oxiHuE { - height: 5px; - width: 5px; -} - -/* member list list item */ - -.bd-minimal .members-1998pB .member-3W1lQa { - padding: 5px; -} - -/* member list item inner */ - -.bd-minimal .members-1998pB .memberInner-2CPc3V { - transform: scale(0.9); -} - -/* member list role label */ - -.bd-minimal .members-1998pB .membersGroup-v9BXpm { - margin-top: 3px; - transform: scale(0.9); -} - -/* channel list */ - -.bd-minimal .channels-Ie2l6A { - width: 160px; -} - -/* Channel List */ - -.bd-minimal.bd-minimal-chan .channels-Ie2l6A { - display: none; -} - -/* channel list guild name */ - -.bd-minimal .channels-Ie2l6A header span { - font-size: 12px; -} - -/* channel item */ - -.bd-minimal .containerDefault-3GGEv_ { - transform: scale(0.9); -} - -/* channel name */ - -.bd-minimal .content-3at_AU { - transform: scale(0.9); -} - -/* channel icon */ - -.bd-minimal .icon-1_QxNX { - width: 14px; - height: 14px; -} - -/* Guild List */ - -.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh { - width: 20px; - height: 20px; - background-size: 100%; - font-size: 15px; - line-height: 20px; - margin: 0 12.5px 8px; -} - -/* guild link and icon */ - -.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .wrapper-25eVIn a, -.bd-minimal .listItem-2P_4kh .wrapper-25eVIn .icon-27yU2q { - width: 20px; - height: 20px; - background-size: 100%; - font-size: 15px; - line-height: 20px; -} - -/* guild inner */ - -.bd-minimal .listItem-2P_4kh .wrapper-25eVIn { - width: 20px; - height: 20px; - background-size: 100%; - font-size: 15px; - line-height: 20px; -} - -.bd-minimal .listItem-2P_4kh svg, -.bd-minimal .listItem-2P_4kh foreignObject[mask] { - mask: none; -} - -/* home icon */ - -.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .homeIcon-tEMBK1 { - width: 10px; - height: 10px; - background-size: 100%; - font-size: 15px; - line-height: 20px; -} - -/* add and search */ - -.bd-minimal .circleIconButton-jET_ig { - height: 20px; - width: 20px; -} - -.bd-minimal .circleIconButton-jET_ig svg { - height: 14px; - width: 14px; -} - -/* friends online */ - -.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .friendsOnline-_wi_fM { - margin-left: -15px; - font-size: 7px; -} - -/* public servers button */ - -.bd-minimal #bd-pub-li { - height: 16px; -} - -.bd-minimal #bd-pub-button { - font-size: 8px; - line-height: 16px; - height: 16px; -} - -/* guild list */ - -.bd-minimal .wrapper-1Rf91z, -.bd-minimal .wrapper-1Rf91z .scrollerWrap-1IAIlv, -.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG { - width: 45px; -} - -/* separator */ - -.bd-minimal .wrapper-1Rf91z .guildSeparator-3s64Iy { - margin-left: -15px; -} - -/* unread icon */ - -.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh .wrapper-sa6paO { - height: 20px; - margin-top: 0; - margin-left: -12.5px; -} - -/* audio/video */ - -.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .iconBadge-2wi9r4 { - width: 12px; - height: 12px; - background-size: 12px; -} - -/* Account Container */ - -.bd-minimal .container-2Thooq .avatarSmall-3ACRaI { - width: 15px; - height: 15px; - background-size: 15px 15px; -} - -/* status */ - -.bd-minimal .container-2Thooq .avatarSmall-3ACRaI .status-oxiHuE { - height: 5px; - width: 5px; -} - -/* username and discrim */ - -.bd-minimal .container-2Thooq .accountDetails-3k9g4n { - transform: scale(0.8); -} - -/* 3 buttons */ - -.bd-minimal .container-2Thooq .button-2b6hmh { - height: 14px; - width: 14px; - background-size: 14px 14px; - margin-left: 3px; -} - -/* 3 buttons icons */ - -.bd-minimal .container-2Thooq .button-2b6hmh svg { - height: 14px; - width: 14px; -} - -#bd-pub-li { - height: 20px; - margin-bottom: 10px; - overflow: hidden; -} - -#bd-pub-button { - border-radius: 4px; - background-color: rgb(47, 49, 54); - color: #b9bbbe; - text-align: center; - font-size: 12px; - line-height: 20px; - height: 20px; -} - -.bd-server-card .bd-server-tags { - flex: 1 1 auto; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - width: 0; - line-height: 24px; - font-size: 12px; - color: #b9bbbe; - font-weight: 700; - margin-right: 10px; -} - -/* .ui-card.ui-card-primary.bd-server-card:first-child { - margin-bottom: 13px; -} - -.ui-card.ui-card-primary.bd-server-card:first-child:after { - border: 3px solid #7289da; - content: ""; - display: block; - position: absolute; - left: 0; - right: 0; - margin-top: 4px; -} */ - -.bd-server-card.bd-server-card-pinned { - margin-bottom: 15px; -} - -.bd-server-card.bd-server-card-pinned::after { - background: #3a71c1; - content: ""; - height: 3px; - width: 100%; - display: block; - margin-top: 7px; - position: absolute; - top: 100%; -} - -.bd-server-description-container { - color: #b9bbbe; - min-height: 65px; - max-height: 65px; - border-top: 1px solid #3f4146; - border-bottom: 1px solid #3f4146; - padding-top: 5px; - font-size: 13px; -} - -.bd-server-header { - text-transform: uppercase; - letter-spacing: 0.5px; - justify-content: space-between; - font-weight: 600; -} - -.bd-server-card { - display: flex; - position: relative; - border-width: 1px; - border-style: solid; - border-radius: 5px; - background: rgba(32, 34, 37, 0.6); - border-color: #202225; - margin-bottom: 8px; -} - -.bd-server-header, -.bd-server-footer { - display: flex; - color: #b9bbbe; -} - -.bd-server-card .bd-button { - margin-top: 4px; -} - -.bd-server-content { - padding: 5px 10px; - flex: 1; -} - -.bd-server-image { - min-width: 115px; - min-height: 115px; - max-width: 115px; - max-height: 115px; -} - -.bd-server-name { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - padding-right: 15px; - max-width: 330px; - flex: 1 1 50%; -} - -.bd-layer { - -ms-flex-direction: column; - -webkit-box-direction: normal; - -webkit-box-orient: vertical; - bottom: 0; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - flex-direction: column; - left: 0; - position: absolute; - right: 0; - top: 0; -} - -/* #pubslayer .ui-tab-bar-item { - color: #b9bbbe; - padding-top: 6px; - padding-bottom: 6px; - margin-bottom: 2px; - padding: 6px 10px; - position: relative; - font-size: 16px; - line-height: 20px; - border-radius: 3px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - flex-shrink: 0; - font-weight: 500; - cursor: pointer; -} - -#pubslayer .ui-tab-bar-item:hover { - color: #f6f6f7; - background-color: hsla(216,4%,74%,.1); -} - -#pubslayer .ui-tab-bar-item.selected { - color: #fff; - background-color: #7289da; -} - -#pubslayer .ui-tab-bar-header { - color: #72767d; - padding: 6px 10px; - font-size: 12px; - line-height: 16px; - text-transform: uppercase; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - flex-shrink: 0; - font-weight: 500; -} - -#pubslayer #bd-settings-sidebar .ui-tab-bar-separator { - background-color: hsla(218,5%,47%,.3); - margin-left: 10px; - margin-right: 10px; - height: 1px; - margin-bottom: 8px; - margin-top: 8px; -} - -#pubslayer h2.ui-form-title { - color: #f6f6f7; - text-transform: uppercase; - font-weight: 600; -} - -#pubslayer h5.ui-form-title { - color: #f6f6f7; -} */ - -#pubslayer button { - background: #7289da; - color: #fff; - font-size: 14px; - font-weight: 500; - line-height: 16px; - padding: 2px 16px; - border: none; - border-radius: 3px; - transition: background-color 0.17s ease; -} - -#pubslayer button:hover { - background-color: #677bc4; -} - -#pubslayer input { - color: #f6f6f7; - background-color: rgba(0, 0, 0, 0.1); - border-color: rgba(0, 0, 0, 0.3); - padding: 10px; - height: 30px; - border-width: 1px; - border-style: solid; - border-radius: 3px; - outline: none; - transition: background-color 0.15s ease, border 0.15s ease; -} - -#bd-connection { - margin-left: 10px; -} - -.bd-footnote { - color: #b9bbbe; - font-size: 11px; -} - -.bd-button-next, -.bd-button-reconnect { - margin: 5px 10px 10px 0; - width: 100%; - min-height: 20px; -} - -.bd-reload { - cursor: pointer; - vertical-align: top; - fill: #dcddde; -} - -.bd-reload:hover { - fill: #fff; -} - -.bd-reload-header { - margin-left: 5px; -} - -.bd-reload-card { - margin-right: 5px; -} - -.bd-controls { - display: flex; -} - -.bd-addon-list { - user-select: text; -} - -.bd-addon-list .bd-addon-card { - max-height: 175px; - margin-bottom: 20px; - padding: 5px 8px; - border: 1px solid transparent; - border-radius: 5px; - overflow: hidden; -} - -.theme-dark .bd-addon-list .bd-addon-card { - background-color: rgba(32, 34, 37, 0.6); - color: #f6f6f7; - border-color: #202225; -} - -.theme-light .bd-addon-list .bd-addon-card { - background-color: #f8f9f9; - color: #4f545c; - border-color: #dcddde; -} - -.bd-addon-list .bd-addon-card.settings-open { - max-height: 800px; - overflow-y: auto; -} - -.bd-addon-list .bd-addon-header { - font-size: 12px; - font-weight: 700; - display: flex; - align-items: center; - justify-content: space-between; - padding-bottom: 5px; - border-bottom: 1px solid transparent; - overflow: hidden; -} - -.theme-dark .bd-addon-list .bd-addon-header { - color: #f6f6f7; - border-bottom-color: rgba(114, 118, 125, 0.3); -} - -.theme-light .bd-addon-list .bd-addon-header { - color: #4f545c; - border-bottom-color: rgba(185, 187, 190, 0.3); -} - -.bd-addon-list .bd-description { - word-break: break-word; - max-height: 100px; - margin: 5px 0; - padding: 5px 0; - overflow-y: auto; -} - -.theme-dark .bd-addon-list .bd-description { - color: #b9bbbe; -} - -.theme-light .bd-addon-list .bd-description { - color: #72767d; -} - -.bd-addon-list .scroller::-webkit-scrollbar-track-piece, -.bd-addon-list .scroller::-webkit-scrollbar-thumb { - border-radius: 0 !important; - border-color: transparent; -} - -.bd-addon-list .bd-footer { - font-size: 12px; - font-weight: 700; - display: flex; - align-items: center; - justify-content: space-between; - padding-top: 5px; - border-top: 1px solid transparent; - overflow: hidden; -} - -.theme-dark .bd-addon-list .bd-footer { - border-top-color: rgba(114, 118, 125, 0.3); -} - -.theme-light .bd-addon-list .bd-footer { - border-top-color: rgba(185, 187, 190, 0.3); -} - -.bd-addon-list .bd-footer button { - padding: 3px 16px; - transition: opacity 250ms ease; -} - -.bd-addon-list .bd-footer button:disabled { - opacity: 0.4; -} - -.bd-addon-list .bd-footer a { - color: #3e82e5; -} - -.bd-addon-list .bd-footer a:hover { - text-decoration: underline; -} - -.bd-controls + .bd-addon-list { - margin-top: 10px; -} - -.bd-addon-button { - cursor: pointer; -} - -.bd-addon-button + .bd-addon-button { - margin-left: 5px; -} - -.bd-search-wrapper { - padding: 3px; - border-radius: 3px; - outline: none; - border: 0; - background-color: #202225; - color: #fff; - display: flex; - align-items: center; -} - -.bd-search { - padding: 2px 3px; - background: none; - border: 0; - color: #fff; - flex: 1; -} - -.bd-search-wrapper > svg { - margin-right: 2px; -} - -.bd-addon-controls { - display: flex; - align-items: center; - justify-content: space-between; -} - -.bd-addon-controls .bd-search { - font-size: 13px; - margin: 0; - width: 200px; -} - -.bd-addon-dropdowns { - display: flex; -} - -/* Error Boundary stuff */ - -.react-error { - color: red; - font-weight: bold; - font-family: Arial, Helvetica, sans-serif; - cursor: pointer; -} - -.settings-open .bd-close { - cursor: pointer; - float: right; -} - -.bd-social-logo { - opacity: 0.6; -} - -.bd-social-link:hover .bd-social-logo { - opacity: 1; -} - -.standardSidebarView-3F1I7i .bd-versioninfo-wrapper { - bottom: 0; - left: 0; - position: fixed; - background: inherit; - right: 0; - padding: 5px; -} - -.standardSidebarView-3F1I7i .bd-versioninfo-wrapper span { - color: #b9bbbe; - font-weight: 600; - font-size: 11px; -} - -.standardSidebarView-3F1I7i .bd-versioninfo-wrapper a { - font-size: 11px; -} - -.bd-button-title { - margin-left: 10px; -} - -/* #bd-settings-sidebar .ui-tab-bar-item { - font-size: 16px; - font-weight: 500; - line-height: 20px; - text-overflow: ellipsis; - white-space: nowrap; - cursor: pointer; - flex-shrink: 0; - padding: 6px 10px; - border-radius: 3px; - position: relative; - overflow: hidden; -} -#bd-settings-sidebar .ui-tab-bar-item.selected { - cursor: default; -} -.theme-dark #bd-settings-sidebar .ui-tab-bar-item { - color: #b9bbbe; -} -.theme-dark #bd-settings-sidebar .ui-tab-bar-item:hover { - background-color: rgba(185,187,190,.1); - color: #f6f6f7; -} -.theme-dark #bd-settings-sidebar .ui-tab-bar-item.selected { - background-color: #7289da; - color: #fff; -} -.theme-light #bd-settings-sidebar .ui-tab-bar-item { - color: #72767d; -} -.theme-light #bd-settings-sidebar .ui-tab-bar-item:hover { - background-color: rgba(79,84,92,.1); - color: #4f545c; -} -.theme-light #bd-settings-sidebar .ui-tab-bar-item.selected { - background-color: #7289da; - color: #fff; -} - -#bd-settings-sidebar .ui-tab-bar-header { - font-size: 12px; - font-weight: 700; - line-height: 16px; - text-transform: uppercase; - text-overflow: ellipsis; - white-space: nowrap; - flex-shrink: 0; - padding: 6px 10px; - overflow: hidden; -} -.theme-dark #bd-settings-sidebar .ui-tab-bar-header { - color: #72767d; -} -.theme-light #bd-settings-sidebar .ui-tab-bar-header { - color: #b9bbbe; -} - -#bd-settings-sidebar .ui-tab-bar-separator { - height: 1px; - margin: 8px 10px; -} -.theme-dark #bd-settings-sidebar .ui-tab-bar-separator { - background-color: rgba(114,118,125,.3); -} -.theme-light #bd-settings-sidebar .ui-tab-bar-separator { - background-color: rgba(185,187,190,.3); -} - -.ui-flex { - display: flex; -} - -#bd-settingspane-container h2.ui-form-title { - font-size: 16px; - font-weight: 600; - line-height: 20px; - text-transform: uppercase; - display: inline-block; - margin-bottom: 20px; -} -.theme-dark #bd-settingspane-container h2.ui-form-title { - color: #f6f6f7; -} -.theme-light #bd-settingspane-container h2.ui-form-title { - color: #4f545c; -} */ - -.bd-switch { - background-color: #72767d; - border-radius: 14px; - width: 42px; - height: 24px; - opacity: 1; - overflow: hidden; - user-select: none; - position: relative; - display: block; - flex: 0 0 auto; - transition: background 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border 0.15s ease-in-out, opacity 0.15s ease-in-out; - margin-left: 10px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15); -} - -.bd-switch::before { - content: ""; - display: block; - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - z-index: 0; - opacity: 0; - background-color: #000; -} - -.bd-switch::after { - content: ""; - display: block; - position: absolute; - background-color: #fff; - z-index: 1; - width: 18px; - margin: 3px; - border-radius: 9px; - height: 18px; - left: 0; - transition: transform 0.15s ease-in-out, width 0.1s ease-in-out, left 0.1s ease-in-out; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); -} - -.bd-switch .bd-checkbox { - position: absolute; - width: 100%; - height: 100%; - opacity: 0; - padding: 0; - margin: 0; - z-index: 2; - cursor: pointer; -} - -.bd-switch-checked { - background-color: #3e82e5; -} - -.bd-switch-checked::after { - transform: translate3d(18px, 0, 0); -} - -.bd-switch-disabled { - opacity: 0.3; - cursor: not-allowed; -} - -.bd-switch-item { - flex-direction: column; - margin-top: 8px; -} - -.bd-switch-item h3 { - font-size: 16px; - font-weight: 500; - line-height: 24px; - flex: 1; -} - -.theme-dark .bd-switch-item h3 { - color: #f6f6f7; -} - -.theme-light .bd-switch-item h3 { - color: #4f545c; -} - -/* .ui-switch-item .style-description { - font-size: 14px; - font-weight: 500; - line-height: 20px; - margin-bottom: 10px; - padding-bottom: 10px; - border-bottom: 1px solid hsla(218,5%,47%,.3); -} -.theme-dark .ui-switch-item .style-description { - color: #72767d; -} -.theme-light .ui-switch-item .style-description { - color: rgba(114,118,125,.6); -} */ - -.bd-switch-item .bd-switch-wrapper { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - position: relative; - width: 44px; - height: 24px; - display: block; - flex: 0 0 auto; -} - -.bd-switch-item .bd-switch-wrapper input { - position: absolute; - opacity: 0; - cursor: pointer; - width: 100%; - height: 100%; - z-index: 1; -} - -.bd-switch-item .bd-switch-wrapper .bd-switch { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: #72767d; - border-radius: 14px; - transition: background 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border 0.15s ease-in-out; -} - -.bd-switch-item .bd-switch-wrapper .bd-switch::before { - content: ""; - display: block; - width: 18px; - height: 18px; - position: absolute; - top: 3px; - left: 3px; - bottom: 3px; - background: #f6f6f7; - border-radius: 10px; - transition: all 0.15s ease; - box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 3px 3px 0 rgba(0, 0, 0, 0.05); -} - -.bd-switch-item .bd-switch-wrapper .bd-switch.checked { - background: #7289da; -} - -.bd-switch-item .bd-switch-wrapper .bd-switch.checked::before { - transform: translateX(20px); -} - -#bd-settingspane-container .scroller-wrap { - height: 100%; -} - -#bd-settingspane-container .scroller-wrap .scroller { - display: flex; -} - -.bd-select-wrapper { - color: #f6f6f7; - font-size: 13px; - display: flex; - align-items: center; -} - -.bd-select-wrapper + .bd-select-wrapper { - margin-left: 10px; -} - -.bd-select-wrapper label { - opacity: 0.3; - margin-right: 5px; -} - -.bd-select { - position: relative; - cursor: pointer; - color: #f6f6f7; - font-size: 13px; - display: flex; - align-items: center; - justify-content: space-between; - background-color: rgba(0, 0, 0, 0.1); - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 3px; - padding: 5px 5px 5px 0; -} - -.bd-select.bd-select-transparent { - background: none; - border: none; - padding: 0; -} - -.bd-select-value { - padding-left: 12px; -} - -.bd-select-arrow { - margin-left: 10px; -} - -.bd-select .bd-select-options { - position: absolute; - background: #2f3136; - border-radius: 0 0 3px 3px; - max-height: 300px; - min-width: calc(100% + 2px); - overflow-y: auto; - box-shadow: rgba(0, 0, 0, 0.3) 0 1px 5px 0; - border: 1px solid rgba(0, 0, 0, 0.3); - border-top: 0; - margin-top: -1px; - margin-left: -1px; - z-index: 2; - top: 100%; -} - -.bd-select-transparent .bd-select-options { - border: 1px solid rgba(0, 0, 0, 0.3); - margin-top: 3px; - border-radius: 3px; -} - -.bd-select .bd-select-option { - padding: 8px 12px; - cursor: pointer; - white-space: pre; -} - -.bd-select .bd-select-option:hover, -.bd-select .bd-select-option.selected { - background: #26272b; -} - -.bd-setting-item .bd-select { - min-width: 200px; -} - -.bd-setting-item { - display: flex; - flex-direction: column; - margin-bottom: 20px; -} - -.bd-setting-header { - display: flex; - justify-content: space-between; - align-items: center; -} - -.bd-setting-header label { - font-weight: 500; - cursor: pointer; - overflow: hidden; - word-wrap: break-word; - font-size: 16px; - line-height: 24px; - color: #f6f6f7; -} - -.bd-setting-note { - color: #72767d; - margin-top: 4px; - font-size: 14px; - line-height: 20px; - font-weight: 500; -} - -.bd-setting-divider { - width: 100%; - height: 1px; - margin-top: 20px; - background-color: rgba(114, 118, 125, 0.3); -} - -.bd-settings-container { - height: auto; - overflow: hidden; - transition: height 300ms cubic-bezier(0.47, 0, 0.745, 0.715); -} - -.bd-settings-group.collapsed .bd-settings-container { - height: 0; -} - -.bd-settings-group.expanded .bd-settings-container:not(.animating) { - overflow: visible; -} - -.bd-settings-group.collapsible .bd-settings-title { - display: flex; - justify-content: space-between; - align-items: center; - order: 1; -} - -.bd-settings-group.collapsible .bd-settings-title::before { - content: ""; - background-color: rgba(114, 118, 125, 0.3); - height: 2px; - order: 2; - flex: 1; - margin: 0 10px 0 15px; -} - -.bd-settings-group.collapsible .bd-settings-title::after { - content: ""; - background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FscXVlXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSItOTUwIDUzMiAxOCAxOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAtOTUwIDUzMiAxOCAxODsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuNTtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTS05MzIsNTMydjE4aC0xOHYtMThILTkzMnoiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QxIiBwb2ludHM9Ii05MzYuNiw1MzguOCAtOTQxLDU0My4yIC05NDUuNCw1MzguOCAiLz4NCjwvc3ZnPg0K"); - height: 20px; - width: 20px; - display: inline-block; - vertical-align: bottom; - transition: transform 0.3s ease; - transform: rotate(0); - order: 3; -} - -.bd-settings-group.collapsed .bd-settings-title::after { - transition: transform 0.3s ease; - transform: rotate(90deg); -} - -.bd-settings-group ~ .bd-settings-group .bd-settings-title { - margin-top: 30px; - transition: margin-top 300ms ease; -} - -.bd-settings-group.collapsed + .bd-settings-group .bd-settings-title { - margin-top: 0; -} - -.bd-settings-title.bd-settings-group-title { - margin-bottom: 10px; -} - -.checkbox-item { - display: flex; -} - -.checkbox-item .checkbox-label { - margin-right: 8px; -} - -@keyframes open-window { - from { - transform: scale(0.9); - } - - to { - transform: none; - } -} - -.floating-window { - animation: open-window 200ms ease; - min-width: 200px; - min-height: 300px; - box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2); - display: flex; - flex-direction: column; - -webkit-app-region: no-drag; - position: fixed; - z-index: 1001; - box-sizing: border-box; -} - -.floating-window.modal-open { - z-index: 999; -} - -.floating-window.resizable { - overflow: auto; - resize: both; - padding-bottom: 10px; - background: #202225; -} - -.floating-window-titlebar { - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - background: #202225; /* #2F3129background-color: #202225; */ - color: white; - border-bottom: 1px solid #272822; -} - -.floating-window-content { - display: flex; - flex-direction: column; - background: #2f3129; - color: white; - flex: 1; -} - -.floating-window-titlebar .title { - /* font-weight: bold; */ - flex: 1; - text-align: center; - padding: 2px 0; -} - -.floating-window-buttons { - display: flex; -} - -.floating-window-buttons .button { - cursor: pointer; - padding: 0 2px; -} - -.floating-window-buttons .button svg { - fill: #dcddde; - margin-top: 1.5px; -} - -.floating-window-buttons .button:hover svg { - fill: white; -} - -.floating-window-buttons .button:hover { - background-color: #36393f; -} - -.floating-window-buttons .close-button:hover { - background-color: #f04747; -} - -.floating-window-buttons .close-button:hover svg path.fill { - fill: white; -} - -.floating-window-content #bd-editor-panel { - display: flex; - flex-direction: column; - flex: 1; -} - -.floating-window .editor-wrapper { - flex: 1; -} - -.floating-window .ace_editor { - height: auto; - flex: 1; -} - -.floating-window #bd-editor-controls { - height: auto; - background: #202225; - border: none; - box-shadow: 0 1px 0 0 #2f3129 inset; -} - -#floating-editor-window { - min-width: 340px; - min-height: 280px; - max-height: 900px; - max-width: 750px; -} - -.floating-addon-window { - min-width: 535px; - min-height: 605px; - max-height: 90%; - max-width: 90%; -} - -@keyframes bd-backdrop { - to { - opacity: 0.85; - } -} - -@keyframes bd-modal-wrapper { - to { - transform: scale(1); - opacity: 1; - } -} - -@keyframes bd-backdrop-closing { - to { - opacity: 0; - } -} - -@keyframes bd-modal-wrapper-closing { - to { - transform: scale(0.7); - opacity: 0; - } -} - -.bd-backdrop { - animation: bd-backdrop 250ms ease; - animation-fill-mode: forwards; - opacity: 0; - background-color: rgb(0, 0, 0); - transform: translateZ(0); -} - -.bd-modal-wrapper.closing .bd-backdrop { - animation: bd-backdrop-closing 200ms linear; - animation-fill-mode: forwards; - animation-delay: 50ms; - opacity: 0.85; -} - -.bd-modal-wrapper .bd-modal { - animation: bd-modal-wrapper 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275); - animation-fill-mode: forwards; - transform: scale(0.7); - transform-origin: 50% 50%; - display: flex; - align-items: center; - box-sizing: border-box; - contain: content; - justify-content: center; - top: 0; - left: 0; - bottom: 0; - right: 0; - opacity: 0; - pointer-events: none; - position: absolute; - z-index: 1000; -} - -.bd-modal-wrapper.closing .bd-modal { - animation: bd-modal-wrapper-closing 250ms cubic-bezier(0.19, 1, 0.22, 1); - animation-fill-mode: forwards; - opacity: 1; - transform: scale(1); -} - -.bd-modal-wrapper .bd-modal-inner { - display: flex; - contain: layout; - flex-direction: column; - pointer-events: auto; - border: 1px solid rgba(28, 36, 43, 0.6); - border-radius: 5px; - box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2); - overflow: hidden; - max-height: 660px; - min-height: 200px; - width: 440px; - user-select: text; -} - -.bd-modal-wrapper .bd-content-modal .bd-modal-inner { - height: 500px; - width: 700px; -} - -.bd-modal-wrapper .header { - background-color: #35393e; - box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2); - padding: 12px 20px; - z-index: 1; - color: #fff; - font-size: 16px; - font-weight: 700; - line-height: 19px; -} - -.bd-modal-wrapper .bd-modal-body { - background-color: #36393f; - color: #fff; - overflow: hidden; - display: flex; - flex-direction: column; - flex: 1; - contain: layout; - position: relative; -} - -.bd-modal-wrapper .scroller { - padding: 10px; - overflow-y: auto; -} - -.bd-modal-wrapper .bd-content-modal .bd-modal-body { - padding: 0; -} - -.bd-modal-wrapper .footer { - display: flex; - justify-content: flex-end; - padding: 10px 20px; -} - -.bd-modal-wrapper .footer button { - min-height: 32px; - min-width: 60px; - align-items: center; - display: flex; - font-size: 14px; - font-weight: 500; - justify-content: center; - line-height: 16px; - padding: 2px 16px; - user-select: none; -} - -.bd-modal-wrapper .tab-bar-container { - align-items: center; - border-bottom: 0; - background: rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1); - display: flex; - flex-direction: row; - justify-content: space-between; - margin-bottom: 15px; -} - -.bd-modal-wrapper .tab-bar.TOP { - margin: 0; - border: 0; - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; -} - -.bd-modal-wrapper .tab-bar-container .tab-bar-item { - margin: 0 15px; - padding: 15px 0; - color: #fff; - opacity: 0.5; - transition: opacity 200ms ease; - border-bottom: 2px solid transparent; -} - -.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover { - border-color: #fff; - cursor: pointer; -} - -.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected { - opacity: 1; - border-color: #fff; -} - -.bd-modal-wrapper .tab-bar.TOP .tab-bar-item + .tab-bar-item { - margin: 0; -} - -.bd-modal-wrapper .table-header { - display: flex; - justify-content: space-between; - color: #fff; - font-weight: 700; - padding-bottom: 10px; - margin: 3px 15px 0 15px; - border-bottom: 1px solid #fff; - font-size: 14px; -} - -.bd-modal-wrapper .table-column { - width: 25%; - word-wrap: break-word; -} - -.bd-modal-wrapper .table-column.column-error { - width: 50%; -} - -.bd-modal-wrapper .errors { - display: flex; - flex-direction: column; - font-size: 14px; - padding: 0 5px; -} - -.bd-modal-wrapper .error { - display: flex; - color: #fff; - border-bottom: 1px solid rgba(255, 255, 255, 0.25); - padding: 15px 0; - align-items: center; -} - -.bd-modal-wrapper .error-link { - color: #3e82e5; - font-weight: 500; -} - -.bd-modal-wrapper .bd-content-modal .scroller { - padding-top: 0; -} - -.bd-sidebar-header { - display: flex; - justify-content: space-between; -} - -.bd-sidebar-header .bd-changelog-button { - height: 16px; -} - -.bd-sidebar-header .bd-icon { - cursor: pointer; - fill: #72767d; -} - -.bd-sidebar-header .bd-icon:hover { - fill: #fff; -} - -.bd-toasts { - position: fixed; - display: flex; - top: 0; - flex-direction: column; - align-items: center; - justify-content: flex-end; - pointer-events: none; - z-index: 4000; -} - -@keyframes bd-toast-up { - from { - transform: translateY(0); - opacity: 0; - } -} - -.bd-toast { - animation: bd-toast-up 300ms ease; - transform: translateY(-10px); - background: #36393f; - padding: 10px; - border-radius: 5px; - box-shadow: 0 0 0 1px rgba(32, 34, 37, 0.6), 0 2px 10px 0 rgba(0, 0, 0, 0.2); - font-weight: 500; - color: #fff; - font-size: 14px; - opacity: 1; - margin-top: 10px; - pointer-events: none; - user-select: none; -} - -@keyframes bd-toast-down { - to { - transform: translateY(0); - opacity: 0; - } -} - -.bd-toast.closing { - animation: bd-toast-down 200ms ease; - animation-fill-mode: forwards; - opacity: 1; - transform: translateY(-10px); -} - -.bd-toast.icon { - padding-left: 30px; - background-size: 20px 20px; - background-repeat: no-repeat; - background-position: 6px 50%; -} - -.bd-toast.toast-info { - background-color: #4a90e2; -} - -.bd-toast.toast-info.icon { - background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtNmgydjZ6bTAtOGgtMlY3aDJ2MnoiLz48L3N2Zz4="); -} - -.bd-toast.toast-success { - background-color: #43b581; -} - -.bd-toast.toast-success.icon { - background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4="); -} - -.bd-toast.toast-danger, -.bd-toast.toast-error { - background-color: #f04747; -} - -.bd-toast.toast-danger.icon, -.bd-toast.toast-error.icon { - background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTEyIDJDNi40NyAyIDIgNi40NyAyIDEyczQuNDcgMTAgMTAgMTAgMTAtNC40NyAxMC0xMFMxNy41MyAyIDEyIDJ6bTUgMTMuNTlMMTUuNTkgMTcgMTIgMTMuNDEgOC40MSAxNyA3IDE1LjU5IDEwLjU5IDEyIDcgOC40MSA4LjQxIDcgMTIgMTAuNTkgMTUuNTkgNyAxNyA4LjQxIDEzLjQxIDEyIDE3IDE1LjU5eiIvPiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+"); -} - -.bd-toast.toast-warning, -.bd-toast.toast-warn { - background-color: #ffa600; - color: white; -} - -.bd-toast.toast-warning.icon, -.bd-toast.toast-warn.icon { - background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMSAyMWgyMkwxMiAyIDEgMjF6bTEyLTNoLTJ2LTJoMnYyem0wLTRoLTJ2LTRoMnY0eiIvPjwvc3ZnPg=="); -} - -.bd-button { - background-color: #3e82e5; - color: white; - border-radius: 3px; - padding: 2px 6px; -} - -.bd-button:hover { - background-color: rgb(56, 117, 206); -} - -.bd-button:active { - background-color: rgb(50, 104, 183); -} - -.bd-button.bd-button-success { - background-color: #3ac15c; -} - -.bd-button.bd-button-success:hover { - background-color: rgb(52, 174, 83); -} - -.bd-button.bd-button-success:active { - background-color: rgb(46, 154, 74); -} - -.bd-chat-badge { - vertical-align: bottom; - line-height: 1.375rem; - display: inline-block; - height: 1.25rem; -} - -.bd-member-badge { - height: 15px; - margin-left: 4px; -} +#bd-editor-panel{display:flex;flex-direction:column}#bd-editor-controls button{margin:0 5px 0 0;background:0 0;color:#fff;height:26px;font-weight:600;border-radius:3px;display:flex;align-items:center}#bd-editor-controls button:hover{background:rgba(255,255,255,.05)}#bd-editor-controls button svg{fill:#fff}#bd-editor-controls button:last-of-type{margin-right:0}#bd-editor-controls{display:flex;align-items:center;justify-content:space-between;background:#272822;color:#fff;border:0;box-shadow:0 1px 0 0 #2f3129 inset;padding:5px}.editor-wrapper{display:flex}.ace_editor{line-height:normal;font-family:Consolas,monospace;box-sizing:border-box;height:calc(100vh - 250px);font-size:14px;width:100%}.bd-monokai .editor .ace_gutter{background:#2f3136}.bd-monokai .ace_editor{background:#292b2f}.bd-monokai #bd-editor-controls{background:#202225}.theme-light #bd-editor-controls{background:#e8e8e8;border:1px solid #fff;border-top:1px solid #adadad;box-shadow:inset 0 1px 0 0 #fff}.controls-section{display:flex;align-items:center}.controls-section .checkbox-inner{width:14px;height:14px}.controls-section .checkbox-inner .checkbox:checked+span::after{left:2px;top:-2px}.controls-section .checkbox-label{font-size:14px}#ace_settingsmenu_container{background:rgba(0,0,0,.7)!important}body #ace_settingsmenu{padding-top:35px}body .ace_closeButton{position:absolute;top:8px;right:12px;z-index:10000;padding:0;cursor:pointer;background:0 0;border:0}body .ace_closeButton::before{content:"✖";color:#36393f}body .ace_closeButton:active{transform:translateY(2px)}#bd-editor-controls .help-text{margin-top:8px;margin-bottom:3px;font-size:14px}#bd-editor-controls .help-text .inline{background:#2f3129;padding:.2em;margin:-.2em 0;border-radius:3px}.bd-dark #bd-qem-favourite-container,.bd-dark #bd-qem-twitch-container{background-color:#353535}.bd-dark #bd-qem{border-bottom:1px solid #464646;background:#353535}.bd-dark #bd-qem button{background:#353535;border-left:1px solid #242424;box-shadow:#424242 1px 0 0 0;color:#fff}.bd-dark #bd-qem button.active{background-color:#292929}.bd-dark #bd-qem button:hover{background-color:#303030}.bd-dark .emojiPicker-3m1S-j{background-color:#353535}.bd-dark .emojiPicker-3m1S-j .category-2U57w6{background-color:#353535}.bd-dark .emojiPicker-3m1S-j .header-1nkwgG .searchBar-2pWH0_{background-color:#2b2b2b}.bd-dark .emojiPicker-3m1S-j .searchBar-2pWH0_ input{color:#fff}.bd-dark .emojiPicker-3m1S-j .searchBar-2pWH0_ input::-webkit-input-placeholder{color:#fff}.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7 .emojiItem-109bjA.selected-39BZ4S{background-color:rgba(123,123,123,.37)}.bd-dark .emojiPicker-3m1S-j .dimmer-3iH-5D.visible-3k45bQ{background-color:rgba(62,62,62,.65)}.bd-dark .emojiPicker-3m1S-j .diversitySelector-tmmMv0 .popout-2nUePc{background:#353535;border-color:#202020}.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar,.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-track,.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-track-piece,.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar,.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-track,.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-track-piece,.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar,.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar-track,.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar-track-piece{background-color:#303030!important;border-color:#303030!important}.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-thumb,.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-thumb,.bd-dark .emojiPicker-3g68GS .scroller-3vODG7::-webkit-scrollbar-thumb{border-color:#202020!important;background-color:#202020!important}.bd-dark .theme-light .slide-2pHaq5{background:#36393f}.bd-dark .theme-dark .action-1lSjCi,.bd-dark .theme-light .action-1lSjCi{background:#2f3136}.bd-dark .theme-dark .or-3THJsp,.bd-dark .theme-light .or-3THJsp{background:#2f3136;order:2;height:56px;width:56px;top:103px;line-height:56px;left:calc(50% - 29px);border-radius:50%;border:2px solid #484b52}.bd-dark .create-3jownz{order:1}.bd-dark .join-33Tr-7{order:3}.bd-dark .theme-dark .actionIcon-2IISM_,.bd-dark .theme-light .actionIcon-2IISM_{filter:grayscale(100%) brightness(60%)}.bd-dark .theme-light .footer-2yfCgX{background:#2f3136}.bd-dark .regionSelectModal-12e-57{background:#36393f}.bd-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3{background:#2f3136;border:2px solid #484b52}.bd-dark~div #ace_settingsmenu{color:#f6f6f7;background:#36393f;box-shadow:0 0 0 1px rgba(32,34,37,.6),0 2px 10px 0 rgba(0,0,0,.2)}.bd-dark~div #ace_settingsmenu select,.bd-dark~div #ace_settingsmenu input[type=text]{color:#f6f6f7;background:#2f3136;border:1px solid #484b52}.bd-dark~div .ace_closeButton::before{color:#f6f6f7}#removemenu{width:auto;background:#505050;z-index:999999;box-shadow:0 0 2px #000;padding:2px;left:25px;display:block;cursor:pointer;color:#fff;position:fixed}#removemenu ul a{text-decoration:none;color:#fff;padding:3px}.emotewrapper{position:relative;display:inline-flex;object-fit:contain;margin:-.1em .05em -.2em .1em;vertical-align:top}.emotewrapper.jumboable{margin-bottom:0;margin-top:.2em;vertical-align:-.3em}.emote{height:1.45em}.emote.jumboable{height:2rem}.fav{display:none;position:absolute;width:15px;height:15px;right:-7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAzFBMVEUAAABQUFBMTExLS0tNTU1MTExNTU1NTU1MTExMTExNTU1LS0tEREBEREBEREBEREBJSUhLS0tLS0tEREBNTU1NTU1NTU1EREArKyhNTU1NTU0AAABMTExKSklMTExNTU1NTU1NTU1KSkpMTExKSkhNTU1KSkpISEZNTU1LS0tAQDxOTk5KSkpLS0tNTU1MTExMTEx/f39MTExMTExLS0pLS0tMTExNTU1NTU1LS0pNTU1NTU1NTU1NTU1NTU1NTUxNTU1NTU1NTUxMTEzB8C/5AAAAOnRSTlMAI8X96oWAgYSF68QBAg0PMCb9BIuLgQUD4N0Bh0mKhZSOQ4gcrKscaW8QRE6fmJyjAshASceG7cIpqQOxTQAAALVJREFUGFddx6FOA0EYAOGZvd07Qm6vVCAAgUUgQEDfX/YZMAigqaFN7iC5tsmPqGPUN/AvUVeoEbGOCElJz08Uzeixqu4AqomVVSNngOVjTqDGZSl3UFtPGV2ot2zaq96YM9p5Ddzcf/nTTAlj+/sNtNu8OcwkIsbPBtrUfMQeEhGQmHbmGIFMwLPzu6UMIwBNgToshgq8Nr2ki+Oy7ebDHp70LRPWB6OZgfWLWei7fJonOOsPCGA9kVlssOoAAAAASUVORK5CYII=);border:0;background-size:100% 100%;background-repeat:no-repeat;background-color:#303030;border-radius:5px;top:-7px;cursor:pointer}.fav.active{background-color:#ff0}.emotewrapper:hover .fav{display:block}.emojiPicker-3m1S-j{box-shadow:none;border-top:none;border-radius:0 0 5px 5px}#bd-qem{border-radius:5px 5px 0 0;background:#fff;border-bottom:1px solid rgba(0,0,0,.1);height:30px;display:flex;flex-direction:row;padding-right:1px}#bd-qem button{border-left:1px solid #efefef;background:0 0;box-shadow:#cecece 1px 0 0 0;flex-grow:1}#bd-qem button:hover{background:#ececec}#bd-qem-twitch{border-radius:5px 0 0 0;order:2}#bd-qem-emojis{border-radius:0 5px 0 0;order:3}#bd-qem-favourite{order:3}#bd-qem button.active{background-color:#e2e2e2}#bd-qem-twitch-container,#bd-qem-favourite-container{width:346px;height:329px;background-color:#fff;border-radius:0 0 5px 5px}#bd-qem-twitch-container .scroller-wrap,#bd-qem-favourite-container .scroller-wrap{height:100%}.emote-menu-inner{padding:5px 0 0 15px}.bd-qme-hidden #bd-qem-emojis{display:none}.bd-em-scroller{height:400px}#emote-container{padding:10px}.emote-container{display:inline-block;padding:2px;border-radius:5px;width:30px;height:30px;position:relative}.emote-icon{max-width:100%;max-height:100%;position:absolute;margin:auto;top:0;right:0;bottom:0;left:0;cursor:pointer}.emote.stop-animation{animation:none}.emote-container:hover{background:rgba(123,123,123,.37)}.emoteflip,.emotespinflip{transform:scaleX(-1)}.emotespin{animation:1s emote-spin infinite linear}.emote1spin{animation:1s emote-spin-reverse infinite linear}.emotespin2{animation:.5s emote-spin infinite linear}.emote2spin{animation:.5s emote-spin-reverse infinite linear}.emotespin3{animation:.2s emote-spin infinite linear}.emote3spin{animation:.2s emote-spin-reverse infinite linear}.emotepulse{animation:1s emote-pulse infinite linear}.emotetr{transform:translateX(-3px)}.emotebl{transform:translateY(-3px)}.emotebr{transform:translate(-3px,-3px)}.emoteshake{animation:1s emote-shake infinite linear}.emoteflap{transform:scaleY(-1)}.emoteshake2{animation:emote-shake2 .3s linear infinite}.emoteshake3{animation:emote-shake3 .1s linear infinite}@keyframes emote-shake2{25%{transform:translate(-1px,-1px)}50%{transform:translate(-1px,1px)}75%{transform:translate(1px,1px)}75%{transform:translate(1px,-1px)}}@keyframes emote-shake3{25%{transform:translate(-1px,-1px)}50%{transform:translate(-1px,1px)}75%{transform:translate(1px,1px)}75%{transform:translate(1px,-1px)}}@keyframes emote-spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes emote-spin-reverse{0%{transform:rotate(0deg)}to{transform:rotate(-360deg)}}@keyframes emote-pulse{0%{-webkit-transform:scale(1,1)}50%{-webkit-transform:scale(1.2,1.2)}to{-webkit-transform:scale(1,1)}}@keyframes emote-shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}.bd-minimal .divider-32i8lo{opacity:0}.bd-minimal .large-3ChYtB{max-width:20px;max-height:20px;background-size:100%;margin-right:2px;margin-top:0;border-radius:0}.bd-minimal .content-3dzVd8{border-left:2px solid #ebebeb;padding-left:2px}.bd-minimal .theme-dark .content-3dzVd8{border-left:2px solid #303030}.bd-minimal .username-_4ZSMR{font-size:small}.bd-minimal .container-1YxwTf{padding:5px}.bd-minimal .embed-IeVjo6{padding:2px}.bd-minimal .membersWrap-2h-GB4{min-width:0}.bd-minimal .members-1998pB .small-5Os1Bb{max-width:15px;max-height:15px;background-size:15px 15px}.bd-minimal .members-1998pB .small-5Os1Bb .status-oxiHuE{height:5px;width:5px}.bd-minimal .members-1998pB .member-3W1lQa{padding:5px}.bd-minimal .members-1998pB .memberInner-2CPc3V{transform:scale(.9)}.bd-minimal .members-1998pB .membersGroup-v9BXpm{margin-top:3px;transform:scale(.9)}.bd-minimal .channels-Ie2l6A{width:160px}.bd-minimal.bd-minimal-chan .channels-Ie2l6A{display:none}.bd-minimal .channels-Ie2l6A header span{font-size:12px}.bd-minimal .containerDefault-3GGEv_{transform:scale(.9)}.bd-minimal .content-3at_AU{transform:scale(.9)}.bd-minimal .icon-1_QxNX{width:14px;height:14px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px;margin:0 12.5px 8px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .wrapper-25eVIn a,.bd-minimal .listItem-2P_4kh .wrapper-25eVIn .icon-27yU2q{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .listItem-2P_4kh .wrapper-25eVIn{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .listItem-2P_4kh svg,.bd-minimal .listItem-2P_4kh foreignObject[mask]{mask:none}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .homeIcon-tEMBK1{width:10px;height:10px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .circleIconButton-jET_ig{height:20px;width:20px}.bd-minimal .circleIconButton-jET_ig svg{height:14px;width:14px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .friendsOnline-_wi_fM{margin-left:-15px;font-size:7px}.bd-minimal #bd-pub-li{height:16px}.bd-minimal #bd-pub-button{font-size:8px;line-height:16px;height:16px}.bd-minimal .wrapper-1Rf91z,.bd-minimal .wrapper-1Rf91z .scrollerWrap-1IAIlv,.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG{width:45px}.bd-minimal .wrapper-1Rf91z .guildSeparator-3s64Iy{margin-left:-15px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh .wrapper-sa6paO{height:20px;margin-top:0;margin-left:-12.5px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .iconBadge-2wi9r4{width:12px;height:12px;background-size:12px}.bd-minimal .container-2Thooq .avatarSmall-3ACRaI{width:15px;height:15px;background-size:15px 15px}.bd-minimal .container-2Thooq .avatarSmall-3ACRaI .status-oxiHuE{height:5px;width:5px}.bd-minimal .container-2Thooq .accountDetails-3k9g4n{transform:scale(.8)}.bd-minimal .container-2Thooq .button-2b6hmh{height:14px;width:14px;background-size:14px 14px;margin-left:3px}.bd-minimal .container-2Thooq .button-2b6hmh svg{height:14px;width:14px}#bd-pub-li{height:20px;margin-bottom:10px;overflow:hidden}#bd-pub-button{border-radius:4px;background-color:#2f3136;color:#b9bbbe;text-align:center;font-size:12px;line-height:20px;height:20px}.bd-server-card .bd-server-tags{flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:0;line-height:24px;font-size:12px;color:#b9bbbe;font-weight:700;margin-right:10px}.bd-server-card.bd-server-card-pinned{margin-bottom:15px}.bd-server-card.bd-server-card-pinned::after{background:#3a71c1;content:"";height:3px;width:100%;display:block;margin-top:7px;position:absolute;top:100%}.bd-server-description-container{color:#b9bbbe;min-height:65px;max-height:65px;border-top:1px solid #3f4146;border-bottom:1px solid #3f4146;padding-top:5px;font-size:13px}.bd-server-header{text-transform:uppercase;letter-spacing:.5px;justify-content:space-between;font-weight:600}.bd-server-card{display:flex;position:relative;border-width:1px;border-style:solid;border-radius:5px;background:rgba(32,34,37,.6);border-color:#202225;margin-bottom:8px}.bd-server-header,.bd-server-footer{display:flex;color:#b9bbbe}.bd-server-card .bd-button{margin-top:4px}.bd-server-content{padding:5px 10px;flex:1}.bd-server-image{min-width:115px;min-height:115px;max-width:115px;max-height:115px}.bd-server-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-right:15px;max-width:330px;flex:1 1 50%}.bd-layer{-ms-flex-direction:column;-webkit-box-direction:normal;-webkit-box-orient:vertical;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;flex-direction:column;left:0;position:absolute;right:0;top:0}#pubslayer button{background:#7289da;color:#fff;font-size:14px;font-weight:500;line-height:16px;padding:2px 16px;border:0;border-radius:3px;transition:background-color .17s ease}#pubslayer button:hover{background-color:#677bc4}#pubslayer input{color:#f6f6f7;background-color:rgba(0,0,0,.1);border-color:rgba(0,0,0,.3);padding:10px;height:30px;border-width:1px;border-style:solid;border-radius:3px;outline:0;transition:background-color .15s ease,border .15s ease}#bd-connection{margin-left:10px}.bd-footnote{color:#b9bbbe;font-size:11px}.bd-button-next,.bd-button-reconnect{margin:5px 10px 10px 0;width:100%;min-height:20px}.bd-reload{cursor:pointer;vertical-align:top;fill:#dcddde}.bd-reload:hover{fill:#fff}.bd-reload-header{margin-left:5px}.bd-reload-card{margin-right:5px}.bd-controls{display:flex}.bd-addon-list{user-select:text}.bd-addon-list .bd-addon-card{max-height:175px;margin-bottom:20px;padding:5px 8px;border:1px solid transparent;border-radius:5px;overflow:hidden}.theme-dark .bd-addon-list .bd-addon-card{background-color:rgba(32,34,37,.6);color:#f6f6f7;border-color:#202225}.theme-light .bd-addon-list .bd-addon-card{background-color:#f8f9f9;color:#4f545c;border-color:#dcddde}.bd-addon-list .bd-addon-card.settings-open{max-height:800px;overflow-y:auto}.bd-addon-list .bd-addon-header{font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:space-between;padding-bottom:5px;border-bottom:1px solid transparent;overflow:hidden}.theme-dark .bd-addon-list .bd-addon-header{color:#f6f6f7;border-bottom-color:rgba(114,118,125,.3)}.theme-light .bd-addon-list .bd-addon-header{color:#4f545c;border-bottom-color:rgba(185,187,190,.3)}.bd-addon-list .bd-description{word-break:break-word;max-height:100px;margin:5px 0;padding:5px 0;overflow-y:auto}.theme-dark .bd-addon-list .bd-description{color:#b9bbbe}.theme-light .bd-addon-list .bd-description{color:#72767d}.bd-addon-list .scroller::-webkit-scrollbar-track-piece,.bd-addon-list .scroller::-webkit-scrollbar-thumb{border-radius:0!important;border-color:transparent}.bd-addon-list .bd-footer{font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:space-between;padding-top:5px;border-top:1px solid transparent;overflow:hidden}.theme-dark .bd-addon-list .bd-footer{border-top-color:rgba(114,118,125,.3)}.theme-light .bd-addon-list .bd-footer{border-top-color:rgba(185,187,190,.3)}.bd-addon-list .bd-footer button{padding:3px 16px;transition:opacity 250ms ease}.bd-addon-list .bd-footer button:disabled{opacity:.4}.bd-addon-list .bd-footer a{color:#3e82e5}.bd-addon-list .bd-footer a:hover{text-decoration:underline}.bd-controls+.bd-addon-list{margin-top:10px}.bd-addon-button{cursor:pointer}.bd-addon-button+.bd-addon-button{margin-left:5px}.bd-search-wrapper{padding:3px;border-radius:3px;outline:0;border:0;background-color:#202225;color:#fff;display:flex;align-items:center}.bd-search{padding:2px 3px;background:0 0;border:0;color:#fff;flex:1}.bd-search-wrapper>svg{margin-right:2px}.bd-addon-controls{display:flex;align-items:center;justify-content:space-between}.bd-addon-controls .bd-search{font-size:13px;margin:0;width:200px}.bd-addon-dropdowns{display:flex}.react-error{color:red;font-weight:700;font-family:Arial,Helvetica,sans-serif;cursor:pointer}.settings-open .bd-close{cursor:pointer;float:right}.bd-social-logo{opacity:.6}.bd-social-link:hover .bd-social-logo{opacity:1}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper{bottom:0;left:0;position:fixed;background:inherit;right:0;padding:5px}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper span{color:#b9bbbe;font-weight:600;font-size:11px}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper a{font-size:11px}.bd-button-title{margin-left:10px}.bd-switch{background-color:#72767d;border-radius:14px;width:42px;height:24px;opacity:1;overflow:hidden;user-select:none;position:relative;display:block;flex:0 0 auto;transition:background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out,opacity .15s ease-in-out;margin-left:10px;box-shadow:inset 0 1px 1px rgba(0,0,0,.15)}.bd-switch::before{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;z-index:0;opacity:0;background-color:#000}.bd-switch::after{content:"";display:block;position:absolute;background-color:#fff;z-index:1;width:18px;margin:3px;border-radius:9px;height:18px;left:0;transition:transform .15s ease-in-out,width .1s ease-in-out,left .1s ease-in-out;box-shadow:0 2px 4px rgba(0,0,0,.3)}.bd-switch .bd-checkbox{position:absolute;width:100%;height:100%;opacity:0;padding:0;margin:0;z-index:2;cursor:pointer}.bd-switch-checked{background-color:#3e82e5}.bd-switch-checked::after{transform:translate3d(18px,0,0)}.bd-switch-disabled{opacity:.3;cursor:not-allowed}.bd-switch-item{flex-direction:column;margin-top:8px}.bd-switch-item h3{font-size:16px;font-weight:500;line-height:24px;flex:1}.theme-dark .bd-switch-item h3{color:#f6f6f7}.theme-light .bd-switch-item h3{color:#4f545c}.bd-switch-item .bd-switch-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;width:44px;height:24px;display:block;flex:0 0 auto}.bd-switch-item .bd-switch-wrapper input{position:absolute;opacity:0;cursor:pointer;width:100%;height:100%;z-index:1}.bd-switch-item .bd-switch-wrapper .bd-switch{position:absolute;top:0;right:0;bottom:0;left:0;background:#72767d;border-radius:14px;transition:background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out}.bd-switch-item .bd-switch-wrapper .bd-switch::before{content:"";display:block;width:18px;height:18px;position:absolute;top:3px;left:3px;bottom:3px;background:#f6f6f7;border-radius:10px;transition:all .15s ease;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05)}.bd-switch-item .bd-switch-wrapper .bd-switch.checked{background:#7289da}.bd-switch-item .bd-switch-wrapper .bd-switch.checked::before{transform:translateX(20px)}#bd-settingspane-container .scroller-wrap{height:100%}#bd-settingspane-container .scroller-wrap .scroller{display:flex}.bd-select-wrapper{color:#f6f6f7;font-size:13px;display:flex;align-items:center}.bd-select-wrapper+.bd-select-wrapper{margin-left:10px}.bd-select-wrapper label{opacity:.3;margin-right:5px}.bd-select{position:relative;cursor:pointer;color:#f6f6f7;font-size:13px;display:flex;align-items:center;justify-content:space-between;background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.3);border-radius:3px;padding:5px 5px 5px 0}.bd-select.bd-select-transparent{background:0 0;border:0;padding:0}.bd-select-value{padding-left:12px}.bd-select-arrow{margin-left:10px}.bd-select .bd-select-options{position:absolute;background:#2f3136;border-radius:0 0 3px 3px;max-height:300px;min-width:calc(100% + 2px);overflow-y:auto;box-shadow:rgba(0,0,0,.3) 0 1px 5px 0;border:1px solid rgba(0,0,0,.3);border-top:0;margin-top:-1px;margin-left:-1px;z-index:2;top:100%}.bd-select-transparent .bd-select-options{border:1px solid rgba(0,0,0,.3);margin-top:3px;border-radius:3px}.bd-select .bd-select-option{padding:8px 12px;cursor:pointer;white-space:pre}.bd-select .bd-select-option:hover,.bd-select .bd-select-option.selected{background:#26272b}.bd-setting-item .bd-select{min-width:200px}.bd-setting-item{display:flex;flex-direction:column;margin-bottom:20px}.bd-setting-header{display:flex;justify-content:space-between;align-items:center}.bd-setting-header label{font-weight:500;cursor:pointer;overflow:hidden;word-wrap:break-word;font-size:16px;line-height:24px;color:#f6f6f7}.bd-setting-note{color:#72767d;margin-top:4px;font-size:14px;line-height:20px;font-weight:500}.bd-setting-divider{width:100%;height:1px;margin-top:20px;background-color:rgba(114,118,125,.3)}.bd-settings-container{height:auto;overflow:hidden;transition:height 300ms cubic-bezier(.47,0,.745,.715)}.bd-settings-group.collapsed .bd-settings-container{height:0}.bd-settings-group.expanded .bd-settings-container:not(.animating){overflow:visible}.bd-settings-group.collapsible .bd-settings-title{display:flex;justify-content:space-between;align-items:center;order:1}.bd-settings-group.collapsible .bd-settings-title::before{content:"";background-color:rgba(114,118,125,.3);height:2px;order:2;flex:1;margin:0 10px 0 15px}.bd-settings-group.collapsible .bd-settings-title::after{content:"";background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FscXVlXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSItOTUwIDUzMiAxOCAxOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAtOTUwIDUzMiAxOCAxODsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuNTtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTS05MzIsNTMydjE4aC0xOHYtMThILTkzMnoiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QxIiBwb2ludHM9Ii05MzYuNiw1MzguOCAtOTQxLDU0My4yIC05NDUuNCw1MzguOCAiLz4NCjwvc3ZnPg0K);height:20px;width:20px;display:inline-block;vertical-align:bottom;transition:transform .3s ease;transform:rotate(0);order:3}.bd-settings-group.collapsed .bd-settings-title::after{transition:transform .3s ease;transform:rotate(90deg)}.bd-settings-group~.bd-settings-group .bd-settings-title{margin-top:30px;transition:margin-top 300ms ease}.bd-settings-group.collapsed+.bd-settings-group .bd-settings-title{margin-top:0}.bd-settings-title.bd-settings-group-title{margin-bottom:10px}.checkbox-item{display:flex}.checkbox-item .checkbox-label{margin-right:8px}@keyframes open-window{0%{transform:scale(.9)}to{transform:none}}.floating-window{animation:open-window 200ms ease;min-width:200px;min-height:300px;box-shadow:0 2px 10px 0 rgba(0,0,0,.2);display:flex;flex-direction:column;-webkit-app-region:no-drag;position:fixed;z-index:1001;box-sizing:border-box}.floating-window.modal-open{z-index:999}.floating-window.resizable{overflow:auto;resize:both;padding-bottom:10px;background:#202225}.floating-window-titlebar{width:100%;display:flex;justify-content:space-between;align-items:center;background:#202225;color:#fff;border-bottom:1px solid #272822}.floating-window-content{display:flex;flex-direction:column;background:#2f3129;color:#fff;flex:1}.floating-window-titlebar .title{flex:1;text-align:center;padding:2px 0}.floating-window-buttons{display:flex}.floating-window-buttons .button{cursor:pointer;padding:0 2px}.floating-window-buttons .button svg{fill:#dcddde;margin-top:1.5px}.floating-window-buttons .button:hover svg{fill:#fff}.floating-window-buttons .button:hover{background-color:#36393f}.floating-window-buttons .close-button:hover{background-color:#f04747}.floating-window-buttons .close-button:hover svg path.fill{fill:#fff}.floating-window-content #bd-editor-panel{display:flex;flex-direction:column;flex:1}.floating-window .editor-wrapper{flex:1}.floating-window .ace_editor{height:auto;flex:1}.floating-window #bd-editor-controls{height:auto;background:#202225;border:0;box-shadow:0 1px 0 0 #2f3129 inset}#floating-editor-window{min-width:340px;min-height:280px;max-height:900px;max-width:750px}.floating-addon-window{min-width:535px;min-height:605px;max-height:90%;max-width:90%}@keyframes bd-backdrop{to{opacity:.85}}@keyframes bd-modal-wrapper{to{transform:scale(1);opacity:1}}@keyframes bd-backdrop-closing{to{opacity:0}}@keyframes bd-modal-wrapper-closing{to{transform:scale(.7);opacity:0}}.bd-backdrop{animation:bd-backdrop 250ms ease;animation-fill-mode:forwards;opacity:0;background-color:#000;transform:translateZ(0)}.bd-modal-wrapper.closing .bd-backdrop{animation:bd-backdrop-closing 200ms linear;animation-fill-mode:forwards;animation-delay:50ms;opacity:.85}.bd-modal-wrapper .bd-modal{animation:bd-modal-wrapper 250ms cubic-bezier(.175,.885,.32,1.275);animation-fill-mode:forwards;transform:scale(.7);transform-origin:50% 50%;display:flex;align-items:center;box-sizing:border-box;contain:content;justify-content:center;top:0;left:0;bottom:0;right:0;opacity:0;pointer-events:none;position:absolute;z-index:1000}.bd-modal-wrapper.closing .bd-modal{animation:bd-modal-wrapper-closing 250ms cubic-bezier(.19,1,.22,1);animation-fill-mode:forwards;opacity:1;transform:scale(1)}.bd-modal-wrapper .bd-modal-inner{display:flex;contain:layout;flex-direction:column;pointer-events:auto;border:1px solid rgba(28,36,43,.6);border-radius:5px;box-shadow:0 2px 10px 0 rgba(0,0,0,.2);overflow:hidden;max-height:660px;min-height:200px;width:440px;user-select:text}.bd-modal-wrapper .bd-content-modal .bd-modal-inner{height:500px;width:700px}.bd-modal-wrapper .header{background-color:#35393e;box-shadow:0 2px 3px 0 rgba(0,0,0,.2);padding:12px 20px;z-index:1;color:#fff;font-size:16px;font-weight:700;line-height:19px}.bd-modal-wrapper .bd-modal-body{background-color:#36393f;color:#fff;overflow:hidden;display:flex;flex-direction:column;flex:1;contain:layout;position:relative}.bd-modal-wrapper .scroller{padding:10px;overflow-y:auto}.bd-modal-wrapper .bd-content-modal .bd-modal-body{padding:0}.bd-modal-wrapper .footer{display:flex;justify-content:flex-end;padding:10px 20px}.bd-modal-wrapper .footer button{min-height:32px;min-width:60px;align-items:center;display:flex;font-size:14px;font-weight:500;justify-content:center;line-height:16px;padding:2px 16px;user-select:none}.bd-modal-wrapper .tab-bar-container{align-items:center;border-bottom:0;background:rgba(0,0,0,.2);box-shadow:0 2px 3px 0 rgba(0,0,0,.1);display:flex;flex-direction:row;justify-content:space-between;margin-bottom:15px}.bd-modal-wrapper .tab-bar.TOP{margin:0;border:0;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.bd-modal-wrapper .tab-bar-container .tab-bar-item{margin:0 15px;padding:15px 0;color:#fff;opacity:.5;transition:opacity 200ms ease;border-bottom:2px solid transparent}.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover{border-color:#fff;cursor:pointer}.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected{opacity:1;border-color:#fff}.bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item{margin:0}.bd-modal-wrapper .table-header{display:flex;justify-content:space-between;color:#fff;font-weight:700;padding-bottom:10px;margin:3px 15px 0 15px;border-bottom:1px solid #fff;font-size:14px}.bd-modal-wrapper .table-column{width:25%;word-wrap:break-word}.bd-modal-wrapper .table-column.column-error{width:50%}.bd-modal-wrapper .errors{display:flex;flex-direction:column;font-size:14px;padding:0 5px}.bd-modal-wrapper .error{display:flex;color:#fff;border-bottom:1px solid rgba(255,255,255,.25);padding:15px 0;align-items:center}.bd-modal-wrapper .error-link{color:#3e82e5;font-weight:500}.bd-modal-wrapper .bd-content-modal .scroller{padding-top:0}.bd-sidebar-header{display:flex;justify-content:space-between}.bd-sidebar-header .bd-changelog-button{height:16px}.bd-sidebar-header .bd-icon{cursor:pointer;fill:#72767d}.bd-sidebar-header .bd-icon:hover{fill:#fff}.bd-toasts{position:fixed;display:flex;top:0;flex-direction:column;align-items:center;justify-content:flex-end;pointer-events:none;z-index:4000}@keyframes bd-toast-up{0%{transform:translateY(0);opacity:0}}.bd-toast{animation:bd-toast-up 300ms ease;transform:translateY(-10px);background:#36393f;padding:10px;border-radius:5px;box-shadow:0 0 0 1px rgba(32,34,37,.6),0 2px 10px 0 rgba(0,0,0,.2);font-weight:500;color:#fff;font-size:14px;opacity:1;margin-top:10px;pointer-events:none;user-select:none}@keyframes bd-toast-down{to{transform:translateY(0);opacity:0}}.bd-toast.closing{animation:bd-toast-down 200ms ease;animation-fill-mode:forwards;opacity:1;transform:translateY(-10px)}.bd-toast.icon{padding-left:30px;background-size:20px 20px;background-repeat:no-repeat;background-position:6px 50%}.bd-toast.toast-info{background-color:#4a90e2}.bd-toast.toast-info.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtNmgydjZ6bTAtOGgtMlY3aDJ2MnoiLz48L3N2Zz4=)}.bd-toast.toast-success{background-color:#43b581}.bd-toast.toast-success.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}.bd-toast.toast-danger,.bd-toast.toast-error{background-color:#f04747}.bd-toast.toast-danger.icon,.bd-toast.toast-error.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTEyIDJDNi40NyAyIDIgNi40NyAyIDEyczQuNDcgMTAgMTAgMTAgMTAtNC40NyAxMC0xMFMxNy41MyAyIDEyIDJ6bTUgMTMuNTlMMTUuNTkgMTcgMTIgMTMuNDEgOC40MSAxNyA3IDE1LjU5IDEwLjU5IDEyIDcgOC40MSA4LjQxIDcgMTIgMTAuNTkgMTUuNTkgNyAxNyA4LjQxIDEzLjQxIDEyIDE3IDE1LjU5eiIvPiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+)}.bd-toast.toast-warning,.bd-toast.toast-warn{background-color:#ffa600;color:#fff}.bd-toast.toast-warning.icon,.bd-toast.toast-warn.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMSAyMWgyMkwxMiAyIDEgMjF6bTEyLTNoLTJ2LTJoMnYyem0wLTRoLTJ2LTRoMnY0eiIvPjwvc3ZnPg==)}.bd-button{background-color:#3e82e5;color:#fff;border-radius:3px;padding:2px 6px}.bd-button:hover{background-color:#3875ce}.bd-button:active{background-color:#3268b7}.bd-button.bd-button-success{background-color:#3ac15c}.bd-button.bd-button-success:hover{background-color:#34ae53}.bd-button.bd-button-success:active{background-color:#2e9a4a}.bd-chat-badge{vertical-align:bottom;line-height:1.375rem;display:inline-block;height:1.25rem}.bd-member-badge{height:15px;margin-left:4px}.bd-changelog-modal{width:650px}.bd-changelog-modal video{width:100%;border-radius:20px} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 39378098..ec3bb600 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,7 @@ gulp.task("build-css", buildCSS); gulp.task("minify-css", minifyCSS); gulp.task("watch-css", function() { - return gulp.watch(["./src/styles/index.css"], minifyCSS); + return gulp.watch(["./src/styles/*.css", "./src/styles/**/*.css"], minifyCSS); }); function runBuild(minified) { @@ -17,7 +17,7 @@ function runBuild(minified) { if (minified) plugins.push(postcssCSSO({restructure: false})); return gulp.src("./src/styles/index.css") .pipe(postcss(plugins)) - .pipe(rename(minified ? "style.min.css" : "style.css")) + .pipe(rename("style.css")) .pipe(gulp.dest("./dist")); } diff --git a/package.json b/package.json index f1570781..434d29a8 100644 --- a/package.json +++ b/package.json @@ -2,32 +2,32 @@ "name": "bandagedbd", "version": "1.0.0", "description": "Enhances Discord adding functionality and themes.", - "main": "js/main.js", + "main": "src/index.js", "scripts": { "build": "webpack --progress --colors", "watch": "webpack --progress --colors --watch", - "build-prod": "webpack --progress --colors --mode production -o dist/index.min.js --devtool none", + "build-prod": "webpack --progress --colors --mode production -o dist/remote.js --devtool none", "lint-js": "eslint --ext .jsx,.js src/", + "build-css": "gulp build-css", "watch-css": "gulp watch-css", - "minify-css": "gulp minify-css", - "lint-css": "stylelint src/styles/*.css && stylelint src/styles/**/*.css && stylelint dist/style.css", - "dist": "npm run minify", - "minify": "npm run build-prod && npm run minify-css", - "build-all": "npm run build && npm run build-prod && npm run build-css && npm run minify-css", + "build-prod-css": "gulp minify-css", + "lint-css": "stylelint src/styles/*.css && stylelint src/styles/**/*.css", + + "prod": "npm run build-prod && npm run build-prod-css", "lint": "npm run lint-js && npm run lint-css", - "test": "mocha --require @babel/register --recursive \"./tests/*.js\"" + "test": "mocha --require @babel/register --recursive \"./tests/*.js\"", + "deploy": "npm run prod" }, "repository": { "type": "git", "url": "git+https://github.com/rauenzi/BetterDiscordApp.git" }, "author": "rauenzi", - "license": "MIT", "bugs": { "url": "https://github.com/rauenzi/BetterDiscordApp/issues" }, - "homepage": "https://github.com/rauenzi/BetterDiscordApp#readme", + "homepage": "https://github.com/rauenzi/BetterDiscordApp", "devDependencies": { "@babel/core": "^7.10.5", "@babel/preset-env": "^7.10.4", diff --git a/src/builtins/developer/reactdevtools.js b/src/builtins/developer/reactdevtools.js index e4227043..e2631b3e 100644 --- a/src/builtins/developer/reactdevtools.js +++ b/src/builtins/developer/reactdevtools.js @@ -37,9 +37,14 @@ export default new class ReactDevTools extends Builtin { if (!this.isExtensionInstalled) this.findExtension(); if (!this.isExtensionInstalled) return Modals.alert(Strings.ReactDevTools.notFound, Strings.ReactDevTools.notFoundDetails); - const didInstall = BrowserWindow.addDevToolsExtension(this.extensionPath); - if (didInstall) this.log("Successfully installed react devtools."); - else this.error("Couldn't find react devtools in chrome extensions!"); + try { + const didInstall = BrowserWindow.addDevToolsExtension(this.extensionPath); + if (didInstall) this.log("Successfully installed react devtools."); + else this.error("Couldn't find react devtools in chrome extensions!"); + } + catch (err) { + this.error("Couldn't add the extension!"); + } } disabled() { diff --git a/src/builtins/emotes/emotes.js b/src/builtins/emotes/emotes.js index 2de3fc69..e3cf69c2 100644 --- a/src/builtins/emotes/emotes.js +++ b/src/builtins/emotes/emotes.js @@ -21,7 +21,7 @@ const Emotes = { FrankerFaceZ: {} }; -const blacklist = []; +const blocklist = []; const overrides = ["twitch", "subscriber", "bttv", "ffz"]; const modifiers = ["flip", "spin", "pulse", "spin2", "spin3", "1spin", "2spin", "3spin", "tr", "bl", "br", "shake", "shake2", "shake3", "flap"]; @@ -44,7 +44,7 @@ export default new class EmoteModule extends Builtin { get TwitchSubscriber() {return Emotes.TwitchSubscriber;} get BTTV() {return Emotes.BTTV;} get FrankerFaceZ() {return Emotes.FrankerFaceZ;} - get blacklist() {return blacklist;} + get blocklist() {return blocklist;} get favorites() {return this.favoriteEmotes;} getUrl(category, name) {return EmoteURLs[category].format({id: Emotes[category][name]});} @@ -63,7 +63,7 @@ export default new class EmoteModule extends Builtin { async enabled() { Settings.registerCollection("emotes", "Emotes", EmoteConfig, {title: Strings.Emotes.clearEmotes, onClick: this.resetEmotes}); - await this.getBlacklist(); + await this.getBlocklist(); await this.loadEmoteData(); Events.on("emotes-favorite-added", this.addFavorite); @@ -129,7 +129,7 @@ export default new class EmoteModule extends Builtin { let emoteModifier = emoteSplit[1] ? emoteSplit[1] : ""; let emoteOverride = emoteModifier.slice(0); - if (emoteName.length < 4 || blacklist.includes(emoteName)) continue; + if (emoteName.length < 4 || blocklist.includes(emoteName)) continue; if (!modifiers.includes(emoteModifier) || !Settings.get("emotes", "general", "modifiers")) emoteModifier = ""; if (!overrides.includes(emoteOverride)) emoteOverride = ""; else emoteModifier = emoteOverride; @@ -177,14 +177,14 @@ export default new class EmoteModule extends Builtin { }); } - async getBlacklist() { + async getBlocklist() { try { - const category = "Blacklist"; + const category = "Blocklist"; const exists = DataStore.emotesExist(category); const valid = await this.isCacheValid(category); const useCache = (valid) || (!valid && exists && !this.shouldDownload); const list = useCache ? DataStore.getEmoteData(category) : await this.downloadEmotes(category); - blacklist.push(...list); + blocklist.push(...list); } catch (err) { // TODO: Log this @@ -253,7 +253,7 @@ export default new class EmoteModule extends Builtin { } for (const emote in parsedData) { - if (emote.length < 4 || blacklist.includes(emote) || !parsedData[emote]) { + if (emote.length < 4 || blocklist.includes(emote) || !parsedData[emote]) { delete parsedData[emote]; continue; } diff --git a/src/data/changelog.js b/src/data/changelog.js index 2d669acb..e6187dd4 100644 --- a/src/data/changelog.js +++ b/src/data/changelog.js @@ -1,28 +1,36 @@ export default { - description: "Don't be shocked, this modal is supposed to be here.", + video: "https://i.zackrauen.com/EEM6Nor0XW.mp4", + poster: "https://i.imgur.com/tNGALts.jpeg", + description: "The rewrite you didn't even know about is finally here.", changes: [ { title: "What's New?", items: [ - "**BandagedBD will now keep you updated with changelogs!** I will try to only show a changelog when there's more than a tiny or internal change.", - "**Twitter (@BandagedBD)** I created a Twitter to try and provide support and such for those without access to the server. https://Twitter.com/BandagedBD" - ] - }, - { - title: "Fixes", - type: "fixed", - items: [ - "**Colored Text** option should work again.", - "**Emotes** should show up in chat.", - "Fixed a bug where BBD attempted to patch the TabBar module incorrectly. (Thanks, DevilBro)" + "**Everything** is entirely rewritten, for better or worse.", + "**Emotes and CustomCSS** can be completely turned off for those not interested. It saves on memory too but not loading those components.", + "**Floating editors** for both custom css and plugins/themes are now available. (See video above)", + "**Settings panels** are completely new and sleek. They are also highly extensible for potential future features :eyes:", + "**Translations** are now integrated starting with only a couple languages, but feel free to contribute your own!", + "**Emote menu** now uses React Patching and properly integrates into the new Emoji Picker. (Thanks Strencher#1044!)" ] }, { title: "Minor Stuff", type: "improved", items: [ - "**Colour->Color.** Swapped to using English-US spelling by default to be consistent, and to potentially be prepared for localization.", - "**Versions simplified.** The BandagedBD version now integrates into Discord's at the bottom-left of settings instead of randomly being a part of the setting list." + "**Patcher API** was added to `BdApi` under `BdApi.Patcher`. The old `BdApi.monkeyPatch` was patched to use the Patcher as well. This allows plugins and patches to play nice with one another.", + "**jQuery** usage was totally eliminated and is now ___deprecated___ for plugins.", + "**General performance** improvements throughout the app, from startup to emotes to addons.", + "**Exporting** by plugins is now highly encouraged over trying to match your meta name and class name." + ] + }, + { + title: "Fixes", + type: "fixed", + items: [ + "There are a lot of little issues that this rewrite fixes.", + "I forgot to write them down", + "But I'm sure many more will be found soon" ] } ] diff --git a/src/modules/core.js b/src/modules/core.js index 105a2b1b..783942b2 100644 --- a/src/modules/core.js +++ b/src/modules/core.js @@ -43,10 +43,10 @@ export default class Core { { name: "bd-stylesheet", type: "style", - url: "//cdn.staticaly.com/gh/{{repo}}/BetterDiscordApp/{{hash}}/dist/style.min.css", - backup: "//rauenzi.github.io/BetterDiscordApp/dist/style.min.css", - local: "{{localServer}}/BetterDiscordApp/dist/style.min.css", - localPath: "style.min.css" + url: "//betterdiscord.zerebos.com/dist/style.css", + backup: "//rauenzi.github.io/BetterDiscordApp/dist/style.css", + local: "{{localServer}}/BetterDiscordApp/dist/style.css", + localPath: "style.css" } ]; } diff --git a/src/modules/datastore.js b/src/modules/datastore.js index 0f873d07..981b59b3 100644 --- a/src/modules/datastore.js +++ b/src/modules/datastore.js @@ -32,6 +32,46 @@ export default new class DataStore { this.data[file.split(".")[0]] = __non_webpack_require__(path.resolve(this.dataFolder, file)); } this.cacheData = Utilities.testJSON(fs.readFileSync(this.cacheFile).toString()) || {}; + + this.convertOldData(); // Convert old data if it exists (routine checks existence and removes existence) + } + + convertOldData() { + const oldFile = path.join(Config.dataPath, "bdstorage.json"); + if (!fs.existsSync(oldFile)) return; + + const oldData = __non_webpack_require__(oldFile); // got the data + fs.renameSync(oldFile, `${oldFile}.bak`); // rename file after grabbing data to prevent loop + const setChannelData = (channel, key, value, ext = "json") => fs.writeFileSync(path.resolve(this.baseFolder, channel, `${key}.${ext}`), JSON.stringify(value, null, 4)); + const channels = ["stable", "canary", "ptb"]; + const customcss = atob(oldData.bdcustomcss); + const favoriteEmotes = oldData.bdfavemotes ? JSON.parse(atob(oldData.bdfavemotes)) : ""; + for (const channel of channels) { + if (!fs.existsSync(path.resolve(this.baseFolder, channel))) fs.mkdirSync(path.resolve(this.baseFolder, channel)); + const channelData = oldData.settings[channel]; + if (!channelData) continue; + const oldSettings = channelData.settings; + const newSettings = { + general: {publicServers: oldSettings["bda-gs-1"], voiceDisconnect: oldSettings["bda-dc-0"], twentyFourHour: oldSettings["bda-gs-6"], classNormalizer: oldSettings["fork-ps-4"], showToasts: oldSettings["fork-ps-2"]}, + appearance: {voiceMode: oldSettings["bda-gs-4"], minimalMode: oldSettings["bda-gs-2"], hideChannels: oldSettings["bda-gs-3"], darkMode: oldSettings["bda-gs-5"], coloredText: oldSettings["bda-gs-7"]}, + addons: {addonErrors: oldSettings["fork-ps-1"], autoScroll: oldSettings["fork-ps-3"], autoReload: oldSettings["fork-ps-5"]}, + developer: {debuggerHotkey: oldSettings["bda-gs-8"], copySelector: oldSettings["fork-dm-1"], reactDevTools: oldSettings.reactDevTools} + }; + + const newEmotes = { + general: {download: oldSettings["fork-es-3"], emoteMenu: oldSettings["bda-es-0"], hideEmojiMenu: !oldSettings["bda-es-9"], showNames: oldSettings["bda-es-6"], modifiers: oldSettings["bda-es-8"], animateOnHover: oldSettings["fork-es-2"]}, + categories: {twitchglobal: oldSettings["bda-es-7"], twitchsubscriber: oldSettings["bda-es-7"], frankerfacez: oldSettings["bda-es-1"], bttv: oldSettings["bda-es-2"]} + }; + + setChannelData(channel, "settings", newSettings); // settingsCookie + setChannelData(channel, "emotes", newEmotes); // emotes (from settingsCookie) + setChannelData(channel, "plugins", channelData.plugins); // pluginCookie + setChannelData(channel, "themes", channelData.themes); // themeCookie + setChannelData(channel, "misc", {favoriteEmotes}); // favorite emotes + fs.writeFileSync(path.resolve(this.baseFolder, channel, "custom.css"), customcss); // customcss + } + + this.initialize(); // Reinitialize data store with the converted data } get injectionPath() { diff --git a/src/modules/utilities.js b/src/modules/utilities.js index 31fccd8d..8c02990c 100644 --- a/src/modules/utilities.js +++ b/src/modules/utilities.js @@ -1,11 +1,10 @@ -import {Config} from "data"; import Logger from "./logger"; import DOM from "./domtools"; export default class Utilities { static repoUrl(path) { - return `https://cdn.staticaly.com/gh/${Config.repo}/BetterDiscordApp/${Config.hash}/${path}`; + return `https://betterdiscord.zerebos.com/${path}`; } /** diff --git a/src/styles/index.css b/src/styles/index.css index 1a573702..7425a063 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -15,3 +15,12 @@ height: 15px; margin-left: 4px; } + +.bd-changelog-modal { + width: 650px; +} + +.bd-changelog-modal video { + width: 100%; + border-radius: 20px; +} \ No newline at end of file diff --git a/src/ui/modals.js b/src/ui/modals.js index 86516b6c..22523a4f 100644 --- a/src/ui/modals.js +++ b/src/ui/modals.js @@ -176,7 +176,7 @@ export default class Modals { const {image = "https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5", description = "", changes = [], title = "BandagedBD", subtitle = `v${Config.bbdVersion}`, footer} = options; const ce = React.createElement; - const changelogItems = [ce("img", {src: image})]; + const changelogItems = [options.video ? ce("video", {src: options.video, poster: options.poster, controls: true, className: ChangelogClasses.video}) : ce("img", {src: image})]; if (description) changelogItems.push(ce("p", null, MarkdownParser.parse(description))); for (let c = 0; c < changes.length; c++) { const entry = changes[c]; @@ -206,15 +206,27 @@ export default class Modals { const defaultFooter = ce(TextElement, {size: TextElement.Sizes.SMALL, color: TextElement.Colors.STANDARD}, "Need support? ", supportLink); return ce(FlexChild.Child, {grow: 1, shrink: 1}, footer ? footer : defaultFooter); }; - - return ModalStack.push(Changelog, { - className: ChangelogClasses.container, - selectable: true, - onScroll: _ => _, - onClose: _ => _, - renderHeader: renderHeader, - renderFooter: renderFooter, - children: changelogItems + + const ModalActions = this.ModalActions; + const OriginalModalClasses = WebpackModules.getByProps("hideOnFullscreen"); + const originalRoot = OriginalModalClasses.root; + if (originalRoot) OriginalModalClasses.root = `${originalRoot} bd-changelog-modal`; + const key = ModalActions.openModal(props => { + return React.createElement(Changelog, Object.assign({ + className: `bd-changelog ${ChangelogClasses.container}`, + selectable: true, + onScroll: _ => _, + onClose: _ => _, + renderHeader: renderHeader, + renderFooter: renderFooter, + }, props), changelogItems); }); + const closeModal = ModalActions.closeModal; + ModalActions.closeModal = function(k) { + if (k !== key) Reflect.apply(closeModal, this, arguments); + setTimeout(() => {if (originalRoot) OriginalModalClasses.root = originalRoot;}, 1000); + ModalActions.closeModal = closeModal; + }; + return key; } } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index cdbb0020..296c4ed2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,7 +8,7 @@ module.exports = { devtool: "eval-source-map", entry: "./src/index.js", output: { - filename: "index.js", + filename: "remote.js", path: path.resolve(__dirname, "dist") }, externals: { @@ -56,7 +56,7 @@ module.exports = { minimizer: [ new TerserPlugin({ terserOptions: { - compress: {drop_debugger:false} + compress: {drop_debugger: false} } }) ]