Lightcord/BetterDiscordApp/dist/index.min.js.map

1 line
606 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["webpack://BetterDiscord/webpack/bootstrap","webpack://BetterDiscord/external \"electron\"","webpack://BetterDiscord/external \"path\"","webpack://BetterDiscord/external \"fs\"","webpack://BetterDiscord/external \"crypto\"","webpack://BetterDiscord/external \"node-fetch\"","webpack://BetterDiscord/external \"events\"","webpack://BetterDiscord/external \"module\"","webpack://BetterDiscord/./src/0globals.js","webpack://BetterDiscord/./src/modules/webpackModules.js","webpack://BetterDiscord/./src/modules/dataStore.js","webpack://BetterDiscord/./src/modules/bdEvents.js","webpack://BetterDiscord/./src/modules/pluginModule.js","webpack://BetterDiscord/./src/ui/tooltip.js","webpack://BetterDiscord/./src/ui/tooltipWrap.js","webpack://BetterDiscord/./src/modules/pluginCertifier.js","webpack://BetterDiscord/./src/modules/contentManager.js","webpack://BetterDiscord/./src/modules/domtools.js","webpack://BetterDiscord/./src/modules/themeModule.js","webpack://BetterDiscord/./src/modules/v2.js","webpack://BetterDiscord/./src/modules/utils.js","webpack://BetterDiscord/./src/modules/settingsPanelSidebar.js","webpack://BetterDiscord/./src/modules/coloredText.js","webpack://BetterDiscord/./src/modules/24hour.js","webpack://BetterDiscord/./src/ui/settingsTitle.js","webpack://BetterDiscord/./src/ui/tabBarSeparator.js","webpack://BetterDiscord/./src/ui/publicservers/serverCard.js","webpack://BetterDiscord/./src/modules/hooks.js","webpack://BetterDiscord/./src/ui/publicservers/publicServers.js","webpack://BetterDiscord/./src/svg/bug_hunter.jsx","webpack://BetterDiscord/./src/svg/circus.jsx","webpack://BetterDiscord/./src/modules/distant.js","webpack://BetterDiscord/./src/modules/Layers.jsx","webpack://BetterDiscord/./src/modules/publicServers.js","webpack://BetterDiscord/./src/modules/voiceMode.js","webpack://BetterDiscord/./src/modules/classNormalizer.js","webpack://BetterDiscord/./src/modules/devMode.js","webpack://BetterDiscord/./src/ui/components/switch.jsx","webpack://BetterDiscord/./src/ui/switch.js","webpack://BetterDiscord/./src/ui/margintop.jsx","webpack://BetterDiscord/./src/ui/settingsGroup.jsx","webpack://BetterDiscord/./src/ui/sectionedSettingsPanel.js","webpack://BetterDiscord/./src/ui/checkbox.js","webpack://BetterDiscord/./src/ui/cssEditorDetached.js","webpack://BetterDiscord/./src/ui/cssEditor.js","webpack://BetterDiscord/./src/ui/errorBoundary.js","webpack://BetterDiscord/./src/ui/contentColumn.js","webpack://BetterDiscord/./src/ui/reloadIcon.js","webpack://BetterDiscord/./src/ui/xSvg.js","webpack://BetterDiscord/./src/ui/icons/edit.jsx","webpack://BetterDiscord/./src/ui/icons/delete.jsx","webpack://BetterDiscord/./src/ui/addoncard.jsx","webpack://BetterDiscord/./src/ui/icons/downarrow.jsx","webpack://BetterDiscord/./src/ui/components/dropdown.jsx","webpack://BetterDiscord/./src/ui/icons/search.jsx","webpack://BetterDiscord/./src/ui/components/search.jsx","webpack://BetterDiscord/./src/ui/addonlist.jsx","webpack://BetterDiscord/./src/modules/CustomRichPresence.js","webpack://BetterDiscord/./src/ui/presenceSettings.jsx","webpack://BetterDiscord/./src/ui/AccountInfos.jsx","webpack://BetterDiscord/./src/modules/AntiAdDM.js","webpack://BetterDiscord/./src/modules/blurPrivate.js","webpack://BetterDiscord/./src/modules/disableTyping.js","webpack://BetterDiscord/./src/ui/ApiPreview.jsx","webpack://BetterDiscord/./src/ui/icons/history.jsx","webpack://BetterDiscord/./src/modules/popoutWindow.js","webpack://BetterDiscord/./src/ui/components/textinput.jsx","webpack://BetterDiscord/./src/ui/TextInputSetting.jsx","webpack://BetterDiscord/./src/modules/settingsPanel.js","webpack://BetterDiscord/./src/ui/bdLogo.js","webpack://BetterDiscord/./src/svg/Lightcord.jsx","webpack://BetterDiscord/./src/modules/emojiModule.js","webpack://BetterDiscord/./src/modules/core.js","webpack://BetterDiscord/./src/modules/bdApi.js","webpack://BetterDiscord/./src/localStorageFix.js","webpack://BetterDiscord/./src/index.js","webpack://BetterDiscord/./src/loadingIcon.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","minimumDiscordVersion","currentDiscordVersion","window","DiscordNative","remoteApp","getVersion","minSupportedVersion","bbdVersion","bbdChangelog","description","changes","title","type","items","settings","id","info","implemented","hidden","cat","category","experimental","process","platform","default","defaultCookie","settingsCookie","settingsRPC","defaultRPC","Date","now","lightcordSettings","defaultLightcordSettings","bdpluginErrors","bdthemeErrors","bdConfig","BetterDiscordConfig","bdthemes","bdplugins","pluginCookie","themeCookie","req","webpackJsonp","push","__extra_id__","find","filter","mod","findAll","findByProps","propNames","every","prop","undefined","findByPrototypes","protoNames","protoProp","findByDisplayName","displayName","Lightcord","BetterDiscord","WebpackModules","fs","path","releaseChannel","globals","app","getReleaseChannel","dataPath","env","APPDATA","join","HOME","XDG_CONFIG_HOME","constructor","this","data","stable","canary","ptb","pluginData","DataStore","initialize","existsSync","BDFile","writeFileSync","JSON","stringify","parse","readFileSync","settingsFile","__non_webpack_require__","unlinkSync","assign","setBDData","err","console","error","Utils","alert","_injectionPath","_configFile","resolve","injectionPath","_BDFile","_settingsFile","getPluginFile","pluginName","ContentManager","pluginsFolder","getSettingGroup","setSettingGroup","getBDData","getPluginData","setPluginData","deletePluginData","EventEmitter","super","BDEvents","dispatch","eventName","args","emit","off","eventAction","removeListener","PluginModule","loadPlugins","async","loadPluginData","splice","plugins","keys","length","plugin","getName","load","file","filename","message","stack","start","showToast","Promise","setTimeout","savePluginData","remote","getCurrentWebContents","on","channelSwitch","startPlugin","reload","stopPlugin","stop","enablePlugin","enable","disablePlugin","disable","togglePlugin","toggle","loadPlugin","loadContent","showContentErrors","values","log","unloadPlugin","filenameOrName","bdplugin","unloadContent","delete","fullPath","reloadPlugin","enabled","reloadContent","edit","shell","openExternal","updatePluginList","results","loadNewContent","added","removed","saved","newMessage","onMessage","onSwitch","rawObserver","e","observer","TooltipClasses","TooltipLayers","getTooltipClasses","getTooltipLayers","getClass","sideOrColor","upperCase","toUpperCase","slice","tooltipClass","classExists","toPx","EmulatedTooltip","node","text","options","style","side","preventFlip","disabled","attachEvents","jQuery","label","toLowerCase","element","document","createElement","className","layer","disabledPointerEvents","tooltipElement","tooltip","labelElement","tooltipContent","pointerElement","tooltipPointer","append","addEventListener","show","MutationObserver","mutations","forEach","mutation","nodes","Array","from","removedNodes","directMatch","indexOf","parentMatch","some","parent","contains","hide","disconnect","observe","body","subtree","childList","querySelector","removeDa","BDModules","popouts","layerContainer","getBoundingClientRect","top","offsetHeight","screenHeight","left","offsetWidth","screenWidth","remove","_className","textContent","container","canShowAbove","showAbove","showBelow","canShowBelow","canShowLeft","showLeft","showRight","canShowRight","classList","add","setProperty","centerHorizontally","centerVertically","nodecenter","React","Component","props","BDV2","reactDom","findDOMNode","Tooltip","componentWillUnmount","render","children","cache","cache2","PluginCertifier","patch","attachment","nextTick","getElementById","url","startsWith","endsWith","nodeFetch","headers","electron","sendSync","then","res","status","Error","hash","crypto","Buffer","alloc","chunk","concat","update","hashResult","digest","hashToUrl","checkHash","result","div","childNodes","flowerStarModule","flowerStarContainer","childModule","childContainer","suspect","parentNode","borderColor","nextNode","child","tagName","preventDefault","stopImmediatePropagation","showConfirmationModal","harm","confirmText","cancelText","danger","onCancel","onConfirm","href","includes","react","tooltipWrap","width","height","svg","viewBox","x","y","mask","fill","pointerEvents","official","span","display","float","flowerStar","stroke","color","onClick","link","getKeyedArray","content","buffer","installPath","contentManager","_pluginsFolder","_themesFolder","catch","cursor","fill-rule","class","renderToElements","elem","processAttachment","isTrusted","tests","threats","checkViruses","resultCallback","removeCallback","isHarmful","no_comments","toString","replace","trim","test","removeComment","scrpt","exec","split","pop","json","processFile","__path","isFromLoader","createReadStream","addonCache","timestamp","saveAddonCache","basename","obj","arr","k","save","generateKey","encryptSettingsCache","cipher","encrypted","final","Api","ensureExported","ObjectStorage","localStorageModule","localStorage","impl","set","btoa","setInterval","val","safeJSONParse","atob","isArray","Module","globalPaths","MetaError","originalJSRequire","_extensions","originalCSSRequire","splitRegex","escapedAtRegex","hasPatched","timeCache","watchers","patchExtensions","getContentRequire","realpathSync","loadAddonCertifierCache","dataStore","decipher","decrypted","decryptSettingsCache","watchContent","contentType","isPlugin","baseFolder","themesFolder","fileEnding","watch","persistent","eventType","statSync","code","pluginModule","themeModule","unloadTheme","isFile","stats","mtime","getTime","loadTheme","reloadTheme","unwatchContent","close","extractMeta","firstLine","parseOldMeta","parseNewMeta","meta","rawMeta","substring","lastIndexOf","parsed","testJSON","format","block","out","field","accum","line","charAt","substr","self","originalRequire","possiblePath","Reflect","apply","arguments","stripBOM","atimeMs","modified","mtimeMs","size","css","_compile","isEmpty","warn","makePlaceholderPlugin","getAuthor","getDescription","source","website","escapeID","isLoaded","cantUnload","basedir","files","readdirSync","contentList","map","f","errors","loadAllContent","loadThemes","DOMTools","head","script","src","onload","timing","_","duration","performance","requestAnimationFrame","animate","time","timeFraction","progress","selector","parseHTML","NodeList","nodeType","query","baseElement","querySelectorAll","html","fragment","template","innerHTML","cloneNode","textNode","createTextNode","spanElement","nodeValue","classes","flat","classname","indicator","oldName","newName","thisNode","thatNode","prepend","targetNode","insertBefore","nextSibling","newNode","nextElementSibling","next","matches","previous","previousElementSibling","num","indexInParent","parentElement","parents","closest","attribute","global","getComputedStyle","parseInt","clientWidth","clientHeight","_listeners","event","delegate","callback","namespace","hasDelegate","eventFunc","target","cancel","removeEventListener","listeners","newCancel","findIndex","matchFilter","listener","defaultFilter","list","__offAll","onMount","wrappedCallback","unsubscribe","subscribe","addedNodes","onMountChange","onUnmount","elements","domWrapper","appendChild","Element","DOM","ThemeModule","loadThemeData","themes","theme","addStyle","unescape","saveThemeData","enableTheme","bdEvents","version","disableTheme","removeStyle","toggleTheme","bdtheme","updateThemeList","editorDetached","protect","theModule","isDefault","clear","sort","getToken","getEmail","showToken","proxy","Proxy","getOwnPropertyDescriptor","func","__proto__","findByUniqueProperties","internal","getInternalInstance","V2","joinBD1","InviteActions","acceptInviteAndTransitionToInviteChannel","leaveBD1","GuildActions","leaveGuild","joinBD2","leaveBD2","joinLC","leaveLC","anchor","anchorUnderlineOnHover","guildsWrapper","wrapper","unreadMentionsBar","guilds","guildsError","selected","pill","blobContainer","defaultProps","search","submit","activateRagingDemon","dismiss","openDM","userId","selfId","UserStore","getCurrentUser","privateChannelId","ChannelStore","getDMFromUserId","PrivateChannelActions","selectPrivateChannel","ChannelActions","openPrivateChannel","parseSettings","reduce","setting","Math","max","documentElement","innerWidth","innerHeight","_windowConfigFile","transparent","frame","charCodeAt","channelTextArea","titleWrapper","textarea","focus","selectionStart","selectionEnd","execCommand","moduleName","groupCollapsed","groupEnd","string","replacement","RegExp","method","params","what","methodName","before","after","instead","once","silent","force","origMethod","canceled","thisObject","methodArguments","cancelPatch","originalMethod","callOriginalMethod","returnValue","tempRet","suppressErrors","__monkeyPatched","__originalMethod","sidebar","hasNotice","form","bottom","toastWrapper","icon","timeout","toastElem","innerText","modalModule","modal","inner","hideOnFullscreen","headerModule","header","responsiveWidthMobile","footer2Module","focusLock","backdrop","backdropWithLayer","footer","addClass","closingListeners","onClose","pluginErrors","themeErrors","generateTab","el","tabs","removeClass","scroller","index","click","ModalStack","ChangelogClasses","TextElement","FlexChild","Titles","Changelog","selectable","MarkdownParser","image","subtitle","ce","changelogItems","entry","margin","marginTop","renderHeader","Child","grow","shrink","tag","Tags","H4","Sizes","SMALL","Colors","STANDARD","date","renderFooter","Anchor","AnchorClasses","joinSupportServer","stopPropagation","supportLink","defaultFooter","onScroll","ModalActions","Markdown","ConfirmationModal","emptyFunction","openModal","red","modalKey","V2_SettingsPanel_Sidebar","panels","register","panel","component","getComponent","Settings","devMode","section","LCitems","LCDevItems","injectColoredText","cancelColoredText","MessageComponent","monkeyPatch","childrenMessageContent","messageContent","originalType","roleColor","colorString","removeColoredText","classNameMarkup","markup","inject24Hour","cancel24Hour","twelveHour","convert","matched","match","padStart","cancelCozy","TimeFormatter","cancelCompact","remove24Hour","V2C_SettingsTitle","reactComponent","V2C_TabBarSeparator","V2C_ServerCard","server","iconUrl","fallback","state","imageError","joined","guildList","identifier","cardModule","card","cardPrimary","flexModule","flexChild","_horizontalReverse","wrapModule","noWrap","streamerModeEnabled","marginBottom8","pinned","ref","onError","handleError","draggable","horizontal","members","flex","categories","minHeight","backgroundColor","setState","useState","SettingsView","V2C_PublicServers","setInitialState","changeCategory","searchKeyDown","checkConnection","connect","GuildStore","AvatarDefaults","SortedGuildStore","hooks","componentDidMount","selectedCategory","loading","servers","connection","user","categorySlugs","fetch","searchEndPoint","end","term","categoryButtons","total","serverCard","acceptInvite","invite_code","joinEndPoint","credentials","windowOptions","round","screenX","screenY","win","joinWindow","webContents","loadURL","setMenuBarVisibility","resizable","maximizable","minimizable","alwaysOnTop","center","webPreferences","nodeIntegration","getFlattenedGuildIds","defaultList","DEFAULT_AVATARS","ServerCard","online","nativejoin","floor","random","response","onSetSection","sections","searchInput","getThis","setValue","marginLeft","serchinput","refs","searchinput","onKeyDown","onChange","placeholder","maxLength","which","notConnected","columnModule","contentColumnDefault","contentColumn","SettingsTitle","bdServer","marginBottom","lineHeight","forceUpdate","useEffect","TabBarSeparator","fontSize","username","discriminator","padding","BugHunterBadge","Circus","xmlns","cx","cy","uuidv4","awaitingBadgesPromises","badgesToFetch","_cache","badges","DistantServer","newPromise","badge","Constants","defaultUsers","fetchedBadges","users","handleRequest","Routes","responseBody","promise","user_id","LightcordError","route","SERVER_URL","Authorization","reject","scopes","layers","Layers","inject","isInjected","classNameLayers","v2","ReactInstance","FindReact","createLayer","getLayer","lay","LayerModules","Layer","animation","Value","keydown","ev","componentWillEnter","toValue","componentWillLeave","interpolation","interpolate","inputRange","outputRange","opacity","transform","scale","Div","__SECRET_EMOTION__","position","right","overflow","WebkitBoxOrient","WebkitBoxDirection","msFlexDirection","flexDirection","zIndex","paddingTop","_appendButton","V2_PublicServers","rootId","btn","guildClasses","listItem","circleButtonMask","classNametutorialContainer","downloadProgress","tutorialContainer","button","addButton","guildPatch","GuildList","webpackModules","GuildListOld","removeButton","randClass","ClassNormalizer","unpatchClassModules","moduleFilter","revertElement","patchClassModules","normalizeElement","patchDOMMethods","patchClassModule","unpatchClassModule","shouldIgnore","isNaN","baseClassName","componentName","classNames","normalClass","camelCase","newString","clen","newClass","toRemove","DOMTokenList","token","tokens","debugListener","copySelectorListener","startDebugListener","startCopySelector","stopDebugListener","stopCopySelector","getSelector","classLayer","classItems","menu","cm","cmWrap","styleFlexible","accommodateScrollbar","clientY","clientX","setAttribute","scrollerClasses","scrollerWrap","scrollerThemed","themeGhostHairline","removeCM","keyCode","cmg","cmi","item","labelContainer","colorDefault","NativeModule","copy","queryAll","focused","separator","scrollHeight","names","unshift","ownerDocument","entries","Switch","checked","switch","Components","inputs","classnames","getClassName","SwitchItem","beta","userSettingsVoice","formModule","switchItem","betaClassNames","marginModule","marginTop60","MarginTop","V2C_SettingsGroup","renderOldSettings","buttonComponent","componentDidCatch","errInfo","FormSection","FormText","hideBorder","note","tooltipNote","setImmediate","V2C_SectionedSettingsPanel","SettingsGroup","V2C_Checkbox","checkboxElement","checkbox","checkboxInner","V2C_CssEditorDetached","updateCss","saveCss","editor","ace","setTheme","session","setMode","setShowPrintMargin","setFontSize","destroy","updateLineCount","lineCount","lines","lineNumbers","indentUnit","scrollbarStyle","_ccss","ccss","_root","injectRoot","detachedRoot","insertAfter","Checkbox","borderRadius","borderRight","borderLeft","saveSettings","attach","unmountComponentAtNode","root","getValue","V2C_CssEditor","detachedEditor","detach","detached","componentDidUpdate","prevProps","prevState","codeMirror","arg","droot","injectDetachedRoot","BDErrorBoundary","hasError","originalRender","configurable","V2C_ContentColumn","V2C_ReloadIcon","V2C_XSvg","fillRule","Edit","Delete","anchorClasses","V2C_PluginCard","showSettings","hasSettings","addon","getSettingsPanel","settingsPanel","reloads","trusted","closeSettings","panelRef","current","settingsOpen","settingspanel","cardNode","cTop","scrollTop","cBottom","eTop","offsetTop","eBottom","isHidden","thisNodeOffset","offset","containerOffset","original","endPoint","getString","XSvg","dangerouslySetInnerHTML","__html","buildTitle","author","nameIndex","versionIndex","authorIndex","LayerStack","popLayer","makeLink","makeButton","action","unmounted","links","invite","tester","donate","patreon","settingsComponent","authorId","authorLink","isScanning","DownArrow","Select","open","dropdown","createRef","showMenu","hideMenu","opt","isOpen","Search","onFocus","onBlur","CardList","ascending","isPlugins","cookie","manager","reverse","onAddonChanges","openFolder","openPath","openItem","confirmDelete","BdApi","toLocaleLowerCase","getProps","getAddons","sortedAddons","a","b","cap","first","second","localeCompare","rendered","renderCheckUpdates","ZeresPluginLibrary","PluginUpdates","checkAll","tooltipIsShowing","onMouseLeave","Button","look","hoverColor","onRightClick","checkUpdateButton","refreshIcon","addonCards","sortOptions","directions","dispatcher","Dispatcher","ActionTypes","pid","game","application_id","details","timestamps","assets","large_image","small_image","sendGame","LOCAL_ACTIVITY_UPDATE","socketId","activity","formatedGame","applicationId","getAssets","V2C_PresenceSettingsModules","V2C_PresenceSettings","preview","isfetching","fetchAssets","assetComponents","Set","updateWhenFetched","comp","defaultSetting","RPCProps","CustomRichPresence","asset","updatePreview","marginBottom20","optionsComponents","RpcPreview","ohgodohfuck","_optionsComponents","InputText","InputNumber","InputChoice","choices","inputTextModules","InputNumberModules","InputChoiceModules","PureComponent","removeKeybind","defaultMarginh5","colorStandard","size32","_horizontal","inputMini","size16","size20","input","TextInput","lastEdited","isTiming","rowModule","marginModule2","colorModule","sizeModule","inputModule","sizeModule2","row","size14","h5","Divider","colorTransparent","clipboard","Dropdown","emptyClasses","popoutModules","UserPopoutComponent","PopoutProps","profileModules","UserProfileComponent","ProfileProps","connectedProfileStore","DividerModules","divider","dividerDefault","active","changeTab","tab","setActive","Tab","rpc","isActive","Profile","Popout","PresenceErrorCatcher","emptyStateImage","emptyState","emptyStateHeader","emptyStateSubtext","role","tabindex","UserPopout","userModule","render1","guildId","channelId","disableUserProfileLink","_UserPopout","popout","excludeProperties","UserProfile","render2","render3","render4","profile","scrollbarModule1","scrollbarGhostHairline","GuildModule","getGuilds","relationShipModule","getRelationships","sessionModule","getSessions","V2C_AccountInfos","CodeContent","getProfileValue","language","getStatistics","getSessionValue","sessionsRaw","sessions","sessionId","clientInfo","os","client","activities","repeat","createdAt","avatarURL","avatar","getAvatarURL","getDate","getMonth","getFullYear","getHours","getMinutes","getSeconds","flags","hasPremiumSubscription","email","mfaEnabled","mobile","phone","verified","nsfwAllowed","relations","friends","isFriend","blocked","isBlocked","hightlightJS","highlight","messageModule1","messageModule2","listLanguages","DiscordModules","ChannelModule","getChannel","hasChannel","addRelationship","DMModule","closePrivateChannel","antiDM","bot","guild_id","channel","channel_id","EmbedsContains","location","embeds","embed","fields","selectors","standardSidebarView","defaultClassName","selects","userSettingsAccount","paymentSourceRow","subText","descriptionWrapper","viewBody","userSettingsSecurity","getSelectors","startTyping","typingModule","stopTyping","DisableTyping","ApiPreview","states","allComponents","general","AlertBox","compName","compPath","ComponentPreview","AllPreviews","getStrForProp","lang","String","$$typeof","for","generateCode","openTag","propStrings","childrenProp","str","propObject","isLast","childrenData","help","success","SettingSubTitle","searchable","Tabs","ErrorCatcher","CodeBlock","History","windows","Map","init","popoutModule","getWindow","applyThemes","removeThemes","themeName","existing","removeAttribute","emitChange","TextInputSetting","BDSidebarHeader","sidebarComponents","Separator","Header","Item","changelogButton","showChangelogModal","isClearingCache","updateSettings","registerComponents","makeComponent","lightcordComponent","PresenceComponent","AccountInfosComponent","ApiPreviewComponent","coreComponent","customCssComponent","renderAddonPane","getSettings","publicServersModule","voiceMode","tfHour","coloredText","setWindowPreference","dMode","callRingingBeat","settingsStore","showCurrentGame","updateRemoteSettings","ipcRenderer","AntiAdDM","blurPrivate","disableTyping","appSettings","relaunch","popoutWindow","core","methods","NotificationsUseShim","loadSettings","renderSidebar","SectionedSettingsPanel","coreSettings","isChecked","ipc","send","actual","clearable","invoke","argv","clearCache","PresenceSettings","CssEditor","ContentList","prefix","SettingComponent","BDLogo","clipRule","strokeLinecap","strokeLinejoin","LightcordLogo","x1","y1","x2","y2","gradientTransform","gradientUnits","stopColor","EmojiRegex","CustomEmojiModule","CustomEmoji","EmojiModuleApi","getCustomEmojiById","AutocompleteModule","AutoCompletionTemplates","getAutocompleteOptions","EmojiModuleQuery","queryEmojiResults","Messages","EMOJI_MATCHING","guildModule","getGuild","isFetching","emojiSearch","getDisambiguatedEmojiContext","LIGHTCORD_EMOJIS","arg1","arg2","condition","setEmojiUsable","queryResults","renderResults","D","emojis","EMOJI","Emoji","emoji","uniqueName","sentinel","guild","getPlainText","isAnimated","animated","managed","originalName","getRawText","cancelEmojiRender","cancelEmoteRender","getNestedProp","newContent","hasParsed","raw","words","word","emojiId","jumboable","shift","u","onHover","R","Title","classNameLayer","classNameSocialLinks","classNameModal","EmojiFilterModule","isEmojiDisabled","isUsable","usable","surrogates","diversity","Core","setConfig","config","hasStarted","setMethods","ED","WebSocket","patchAttributes","initSettings","checkForGuilds","initializeSettings","getElementsByClassName","initObserver","previousVersion","EmojiModule","patchSocial","patchGuildPills","patchGuildListItems","patchGuildSeparator","patchMessageHeader","patchMemberList","patchAttachment","haveInstalledDefault","logo","attribsPatchs","cancelPatchAttributes","DiscordTag","DiscordTagComp","badgeDiv","TooltipWrap","applyBadges","timesChecked","blob","deferLoaded","readyState","injectExternals","getPredicateSections","settingModule","poped","mlen","animating","socialLinks","getAttribute","socialPatch","TabBar","socialModule1","newOne","returnVal","classNameColorMuted","sizes","classNameVersionHash","colorMuted","versionHash","branch","buildInfo","additional","size12","commit","originalVersions","chat","blockDiv","distant","getBadges","scope","div2","guildListItemsPatch","GuildClasses","getGuildClasses","listItemClass","blobClass","GuildComponent","return","guildData","unread","audio","video","animatable","guildPillPatch","guildPill","hovered","guildSeparatorPatch","Guilds","guildComponents","GuildSeparator","AttachmentPatch","Attachment","messageHeaderPatch","MessageHeader","memberListPatch","MemberListItem","renderDecorators","updateInjector","ReactDom","ReactComponent","WindowConfigFile","getAllWindowPreferences","getWindowPreference","addScript","removeScript","mainCore","protos","getData","loadData","saveData","setData","deleteData","onRemoved","isPluginEnabled","isThemeEnabled","isSettingEnabled","enableSetting","disableSetting","toggleSetting","makeAddonAPI","folder","isEnabled","getAll","Plugins","Themes","contentWindowGetter","HTMLIFrameElement","contentWindow","writable","Function","oOpen","XMLHttpRequest","localStorageFix","v2Loader","loadingIcon","deprecateGlobal","globalKeys","Globals","CoreWrapper"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OA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D,UAAUotC,KACvC0hB,eAAe9uD,UAAUotC,KAAO,WAC5B,MAAMx6B,EAAMgM,UAAU,GACtB,OAAIhM,EAAInF,cAAcgI,SAAS,gBAAwB,KAChDiJ,QAAQC,MAAMkwC,EAAO7pD,KAAM4Z,YC1B1CmwC,GCFe,MACX,MAAMC,EAAWrhD,SAASC,cAAc,OACxCohD,EAASnhD,UAAY,cACrBmhD,EAAShuD,MAAQ,2BACjB2M,SAAS+B,KAAKmW,YAAYmpC,IDD9BC,GAEA,MAAMC,GAAkB,CAACvvD,EAAKN,KAC1BP,OAAOC,eAAewB,OAAQZ,EAAK,CAC/BV,IAAG,KACCsH,GAAM8Y,KAAK,oBAAsB,IAAG1f,iEAC7BN,MAQb8vD,GAAarwD,OAAO2J,KAAK2mD,GAC/B,IAAK,MAAMzvD,KAAOwvD,GAAYD,GAAgBvvD,EAAKyvD,EAAQzvD,IAc3DuvD,GAAgB,OAAQp9C,IACxBo9C,GAAgB,eAAgBxyC,GAChCwyC,GAAgB,cAAevyC,IAC/BuyC,GAAgB,QAAS3oD,IACzB2oD,GAAgB,WAAYvnD,GAC5BunD,GAAgB,gBAAiB7kB,IACjC6kB,GAAgB,YAAa5pD,GAC7B4pD,GAAgB,iBAAkBjoD,IAClCioD,GAAgB,kBAAmBtuB,IAEnCrgC,OAAOkuC,MAAQA,GAGfygB,GAAgB,WAAYjI,IAGb,MAAMoI,GACjBtqD,YAAYvC,EAAU4+C,GAClB6F,GAAKC,UAAU1kD,GACfykD,GAAKI,WAAWjG,GAGpB/C,OAEI4I,GAAK5I","file":"index.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","module.exports = require(\"electron\");","module.exports = require(\"path\");","module.exports = require(\"fs\");","module.exports = require(\"crypto\");","module.exports = require(\"node-fetch\");","module.exports = require(\"events\");","module.exports = require(\"module\");","export const minimumDiscordVersion = \"0.0.308\";\nexport const currentDiscordVersion = (window.DiscordNative && window.DiscordNative.remoteApp && window.DiscordNative.remoteApp.getVersion && window.DiscordNative.remoteApp.getVersion()) || \"0.0.308\";\nexport const minSupportedVersion = \"0.3.0\";\nexport const bbdVersion = \"0.3.5\";\nexport const bbdChangelog = {\n description: \"Big things are coming.\",\n changes: [\n {\n title: \"Bug Fixes\",\n type: \"fixed\",\n items: [\n \"Some fixes related to showing modals in the `BdApi`.\",\n \"Fixed the open folder buttons for plugins and themes\"\n ]\n }\n ]\n};\n\nexport const settings = {\n \"Custom css live update\": {id: \"bda-css-0\", info: \"\", implemented: true, hidden: true, cat: \"core\"},\n \"Custom css auto udpate\": {id: \"bda-css-1\", info: \"\", implemented: true, hidden: true, cat: \"core\"},\n \"BetterDiscord Blue\": {id: \"bda-gs-b\", info: \"Replace Discord blue with BD Blue\", implemented: false, hidden: false, cat: \"core\"},\n\n /* Core */\n /* ====== */\n \"Public Servers\": {id: \"bda-gs-1\", info: \"Display public servers button\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Minimal Mode\": {id: \"bda-gs-2\", info: \"Hide elements and reduce the size of elements.\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Voice Mode\": {id: \"bda-gs-4\", info: \"Only show voice chat\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Hide Channels\": {id: \"bda-gs-3\", info: \"Hide channels in minimal mode\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Dark Mode\": {id: \"bda-gs-5\", info: \"Make certain elements dark by default(wip)\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Voice Disconnect\": {id: \"bda-dc-0\", info: \"Disconnect from voice server when closing Discord\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"24 Hour Timestamps\": {id: \"bda-gs-6\", info: \"Replace 12hr timestamps with proper ones\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Colored Text\": {id: \"bda-gs-7\", info: \"Make text color the same as role color\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n \"Normalize Classes\": {id: \"fork-ps-4\", info: \"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\n\n /* Content */\n \"Content Error Modal\": {id: \"fork-ps-1\", info: \"Shows a modal with plugin/theme errors\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Scan Plugins\": {id: \"fork-ps-6\", info: \"Scan plugins for any threat that can be hidden inside.\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Show Toasts\": {id: \"fork-ps-2\", info: \"Shows a small notification for important information\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Scroll To Settings\": {id: \"fork-ps-3\", info: \"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Automatic Loading\": {id: \"fork-ps-5\", info: \"Automatically loads, reloads, and unloads plugins and themes\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Enable Edit Button\": {id: \"fork-ps-7\", info: \"Enable an Edit Button on the plugin and theme panel.\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\n \"Themes in Popout Window\": {id: \"lightcord-9\", info: \"Enable themes in Popout Window. (For example, when detaching screenshare.)\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\", experimental: true},\n\n /* Developer */\n \"Developer Mode\": \t {id: \"bda-gs-8\", info: \"Developer Mode Toggle\", implemented: true, hidden: false, cat: \"core\", category: \"developer settings\"},\n \"Copy Selector\":\t\t\t {id: \"fork-dm-1\", info: \"Adds a \\\"Copy Selector\\\" option to context menus when developer mode is active\", implemented: true, hidden: false, cat: \"core\", category: \"developer settings\"},\n\n /** Lightcord */\n \"Disable BetterDiscord\": {id: \"bd-disable\", info: \"Disable Betterdiscord (plugins, themes, etc) (Not implemented).\", implemented: false, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Blur Personal Information\": {id: \"lightcord-6\", info: \"Blur sensitive informations like email, payment infos and more.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Calling Ring Beat\": {id: \"lightcord-2\", info: \"Enable Discord's special calling beat.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Developer Options\": {id: \"lightcord-1\", info: \"Enable Discord's & Lightcord's Internal Developer Options. This allow the \\\"Experiments\\\" tab, the \\\"Developer Options\\\" tab and the \\\"Lightcord Api\\\" section.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Ad Block\": {id: \"lightcord-4\", info: \"Block any BOT that dms you with an invite link. Even in an embed.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Enable Lightcord Servers\": {id: \"lightcord-5\", info: \"Enable Lightcord's servers. Disabling this will disable custom badges.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Disable typing\": {id: \"lightcord-7\", info: \"Don't let other see you're typing.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\n \"Lightcord Tabs\": {id: \"lightcord-8\", info: \"Allows you to launch multiple instances of Lightcord in the same window.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\", experimental: true},\n \"Use Notification Shim\": {id: \"lightcord-10\", info: \"Basically don't use Windows's Notifications.\", implemented: true, hidden: process.platform !== \"win32\", cat: \"lightcord\", category: \"Lightcord\"},\n \"Emoji Prefix\": {id: \"lightcord-11\", info: \"Change the prefix used for free nitros emojis. Please put only one character. Default: .\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\", default: \".\"},\n\n /** Lightcord Window */\n \"Always-on-Top\": {id: \"lightcord-3\", info: \"Enable the window's Always-on-Top mode, where Lightcord stays on top of other applications.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Window\"},\n \"No Window Bounds\": {id: \"no_window_bound\", info: \"Disable Window Bounds. Can be useful if you use a window manager.\", implemented: true, hidden: process.platform !== \"linux\", cat: \"lightcord\", category: \"Window\"},\n \"Enable Glasstron\": {id: \"enable_glasstron\", info: \"Enable Glasstron. If you're not using transparent themes, this can reduce lag.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Window\"},\n \n /** RichPresence */\n \"Enable\": {id: \"lightcord-presence-1\", info: \"Enable RichPresence below.\", implemented: true, hidden: false, cat: \"status\"}\n};\n\nexport const defaultCookie = {\n \"bda-gs-1\": true,\n \"bda-gs-2\": false,\n \"bda-gs-3\": false,\n \"bda-gs-4\": false,\n \"bda-gs-5\": true,\n \"bda-gs-6\": false,\n \"bda-gs-7\": false,\n \"bda-gs-8\": false,\n \"bda-es-0\": true,\n \"bda-es-1\": true,\n \"bda-es-2\": true,\n \"bda-es-4\": false,\n \"bda-es-6\": true,\n \"bda-es-7\": true,\n \"bda-gs-b\": false,\n \"bda-es-8\": true,\n \"bda-dc-0\": false,\n \"bda-css-0\": false,\n \"bda-css-1\": false,\n \"bda-es-9\": true,\n \"fork-dm-1\": false,\n \"fork-ps-1\": true,\n \"fork-ps-2\": true,\n \"fork-ps-3\": true,\n \"fork-ps-4\": true,\n \"fork-ps-5\": true,\n \"fork-ps-6\": true,\n \"fork-ps-7\": false,\n \"fork-es-2\": false,\n \"fork-es-3\": true,\n \"fork-wp-1\": false,\n \"fork-wp-2\": false,\n \"fork-beta\": true,\n \"lightcord-1\": false,\n \"lightcord-2\": true,\n \"lightcord-presence-1\": false,\n \"lightcord-3\": false,\n \"lightcord-4\": false,\n \"lightcord-5\": true,\n \"lightcord-6\": true,\n \"lightcord-7\": false,\n \"lightcord-8\": false,\n \"lightcord-9\": false,\n \"lightcord-10\": false,\n \"no_window_bound\": false,\n};\n\n\nexport const settingsCookie = {};\n\nexport const settingsRPC = {};\nexport const defaultRPC = {\n \"name\": \"Lightcord\",\n \"application_id\": \"711416957718757418\",\n \"state\": \"Lightcord Client\",\n \"details\": \"Browsing Discord\",\n \"timestamps.start\": Date.now(),\n \"assets.small\": null,\n \"assets.large\": \"712323821037682791\"\n}\n\nexport const lightcordSettings = {};\nexport const defaultLightcordSettings = {};\n\nexport const bdpluginErrors = [];\nexport const bdthemeErrors = []; // define for backwards compatibility\n\nexport const bdConfig = Object.create(BetterDiscordConfig);\n\nexport const bdthemes = {};\nexport const bdplugins = {};\n\nexport const pluginCookie = {};\nexport const themeCookie = {};","const req = webpackJsonp.push([[], {__extra_id__: (module, exports, req) => module.exports = req}, [[\"__extra_id__\"]]]);\r\ndelete req.m.__extra_id__;\r\ndelete req.c.__extra_id__;\r\nconst find = (filter) => {\r\n for (const i in req.c) {\r\n if (req.c.hasOwnProperty(i)) {\r\n const m = req.c[i].exports;\r\n if (m && m.__esModule && m.default && filter(m.default)) return m.default;\r\n if (m && filter(m))\treturn m;\r\n }\r\n }\r\n // console.warn(\"Cannot find loaded module in cache\");\r\n return null;\r\n};\r\n\r\nconst findAll = (filter) => {\r\n const modules = [];\r\n for (const i in req.c) {\r\n if (req.c.hasOwnProperty(i)) {\r\n const m = req.c[i].exports;\r\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(m.default);\r\n else if (m && filter(m)) modules.push(m);\r\n }\r\n }\r\n return modules;\r\n};\r\n\r\nconst findByProps = (...propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\r\nconst findByPrototypes = (...protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\r\nconst findByDisplayName = (displayName) => find(module => module.displayName === displayName);\r\n\r\nlet mod = {find, findAll, findByProps, findByPrototypes, findByDisplayName};\r\nexport default mod\r\n\r\nwindow.Lightcord.BetterDiscord.WebpackModules = mod","import Utils from \"./utils\";\nimport ContentManager from \"./contentManager\";\n\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst releaseChannel = DiscordNative.globals ? DiscordNative.globals.releaseChannel : DiscordNative.app ? DiscordNative.app.getReleaseChannel() : \"stable\";\n\nlet dataPath = \"\";\nif (process.platform === \"win32\") dataPath = process.env.APPDATA;\nelse if (process.platform === \"darwin\") dataPath = path.join(process.env.HOME, \"Library\", \"Preferences\");\nelse dataPath = process.env.XDG_CONFIG_HOME ? process.env.XDG_CONFIG_HOME : path.join(process.env.HOME, \".config\");\ndataPath = path.join(dataPath, \"BetterDiscord\");\n\nexport default new class DataStore {\n constructor() {\n this.data = {settings: {stable: {}, canary: {}, ptb: {}}};\n this.pluginData = {};\n window.Lightcord.BetterDiscord.DataStore = this\n }\n\n initialize() {\n try {\n if (!fs.existsSync(this.BDFile)) fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\n const data = JSON.parse(fs.readFileSync(this.BDFile, \"utf-8\"))\n if (data.hasOwnProperty(\"settings\")) this.data = data;\n if (!fs.existsSync(this.settingsFile)) return;\n let settings = __non_webpack_require__(this.settingsFile);\n fs.unlinkSync(this.settingsFile);\n if (settings.hasOwnProperty(\"settings\")) settings = Object.assign({stable: {}, canary: {}, ptb: {}}, {[releaseChannel]: settings});\n else settings = Object.assign({stable: {}, canary: {}, ptb: {}}, settings);\n this.setBDData(\"settings\", settings);\n }\n catch (err) {\n console.error(err);\n Utils.alert(\"Corrupt Storage\", \"The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.\");\n }\n }\n\n get injectionPath() {\n return this._injectionPath = null;\n }\n\n get configFile() {return this._configFile || (this._configFile = path.resolve(this.injectionPath, \"betterdiscord\", \"config.json\"));}\n get BDFile() {return this._BDFile || (this._BDFile = path.resolve(dataPath, \"bdstorage.json\"));}\n get settingsFile() {return this._settingsFile || (this._settingsFile = path.resolve(dataPath, \"bdsettings.json\"));}\n getPluginFile(pluginName) {return path.resolve(ContentManager.pluginsFolder, pluginName + \".config.json\");}\n\n getSettingGroup(key) {\n return this.data.settings[releaseChannel][key] || null;\n }\n\n setSettingGroup(key, data) {\n this.data.settings[releaseChannel][key] = data;\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\n }\n\n getBDData(key) {\n return this.data[key] || \"\";\n }\n\n setBDData(key, value) {\n this.data[key] = value;\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\n }\n\n getPluginData(pluginName, key) {\n if (this.pluginData[pluginName] !== undefined) return this.pluginData[pluginName][key];\n if (!fs.existsSync(this.getPluginFile(pluginName))) return undefined;\n this.pluginData[pluginName] = JSON.parse(fs.readFileSync(this.getPluginFile(pluginName)));\n return this.pluginData[pluginName][key];\n }\n\n setPluginData(pluginName, key, value) {\n if (value === undefined) return;\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\n this.pluginData[pluginName][key] = value;\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"utf-8\");\n }\n\n deletePluginData(pluginName, key) {\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\n delete this.pluginData[pluginName][key];\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"utf-8\");\n }\n};","/* BDEvents */\nconst EventEmitter = require(\"events\");\nexport default new class BDEvents extends EventEmitter {\n constructor(){\n super()\n window.Lightcord.BetterDiscord.BDEvents = this\n }\n dispatch(eventName, ...args) {this.emit(eventName, ...args);}\n off(eventName, eventAction) {this.removeListener(eventName, eventAction);}\n};","import {bdpluginErrors, pluginCookie, settingsCookie, bdplugins} from \"../0globals\";\nimport ContentManager from \"./contentManager\";\nimport DataStore from \"./dataStore\";\nimport BDEvents from \"./bdEvents\";\nimport Utils from \"./utils\";\n\nclass PluginModule {\n constructor(){\n window.Lightcord.BetterDiscord.PluginModule = this\n }\n get folder() {return ContentManager.pluginsFolder;}\n}\n\nPluginModule.prototype.loadPlugins = async function () {\n this.loadPluginData();\n bdpluginErrors.splice(0, 0, ...(await ContentManager.loadPlugins()));\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n let plugin, name;\n\n try {\n plugin = bdplugins[plugins[i]].plugin;\n name = plugin.getName();\n if (plugin.load && typeof(plugin.load) == \"function\") plugin.load();\n } catch (err) {\n pluginCookie[name] = false;\n Utils.err(\"Plugins\", name + \" could not be loaded.\", err);\n bdpluginErrors.push({name: name, file: bdplugins[plugins[i]].filename, message: \"load() could not be fired.\", error: {message: err.message, stack: err.stack}});\n continue;\n }\n\n if (!pluginCookie[name]) pluginCookie[name] = false;\n\n if (pluginCookie[name]) {\n try {\n plugin.start();\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin.getName()} v${plugin.getVersion()} has started.`);\n } catch (err) {\n pluginCookie[name] = false;\n Utils.err(\"Plugins\", name + \" could not be started.\", err);\n bdpluginErrors.push({name: name, file: bdplugins[plugins[i]].filename, message: \"start() could not be fired.\", error: {message: err.message, stack: err.stack}});\n }\n }\n\n await new Promise((resolve) => setTimeout(resolve, 10))\n }\n this.savePluginData();\n\n require(\"electron\").remote.getCurrentWebContents().on(\"did-navigate-in-page\", this.channelSwitch.bind(this));\n // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"plugin\");\n};\n\nPluginModule.prototype.startPlugin = function(plugin, reload = false) {\n try {\n bdplugins[plugin].plugin.start();\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} has started.`);\n }\n catch (err) {\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} could not be started.`, {type: \"error\"});\n pluginCookie[plugin] = false;\n this.savePluginData();\n Utils.err(\"Plugins\", plugin + \" could not be started.\", err);\n }\n};\n\nPluginModule.prototype.stopPlugin = function(plugin, reload = false) {\n try {\n bdplugins[plugin].plugin.stop();\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} has stopped.`);\n }\n catch (err) {\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${bdplugins[plugin].plugin.getName()} v${bdplugins[plugin].plugin.getVersion()} could not be stopped.`, {type: \"error\"});\n Utils.err(\"Plugins\", bdplugins[plugin].plugin.getName() + \" could not be stopped.\", err);\n }\n};\n\nPluginModule.prototype.enablePlugin = function (plugin, reload = false) {\n if (pluginCookie[plugin]) return;\n pluginCookie[plugin] = true;\n this.savePluginData();\n this.startPlugin(plugin, reload);\n};\n\nPluginModule.prototype.enable = function (plugin, reload = false) {\n return this.enablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.disablePlugin = function (plugin, reload = false) {\n if (!pluginCookie[plugin]) return;\n pluginCookie[plugin] = false;\n this.savePluginData();\n this.stopPlugin(plugin, reload);\n};\n\nPluginModule.prototype.disable = function (plugin, reload = false) {\n return this.disablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.togglePlugin = function (plugin) {\n if (pluginCookie[plugin]) this.disablePlugin(plugin);\n else this.enablePlugin(plugin);\n};\n\nPluginModule.prototype.toggle = function (plugin, reload = false) {\n return this.togglePlugin(plugin, reload);\n};\n\nPluginModule.prototype.loadPlugin = async function(filename) {\n const error = await ContentManager.loadContent(filename, \"plugin\");\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${filename} could not be loaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n const plugin = Object.values(bdplugins).find(p => (console.log(p.filename, filename)) || p.filename == filename).plugin;\n try { if (plugin.load && typeof(plugin.load) == \"function\") plugin.load();}\n catch (err) {if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [err]});}\n Utils.log(\"ContentManager\", `${plugin.getName()} v${plugin.getVersion()} was loaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin.getName()} v${plugin.getVersion()} was loaded.`, {type: \"success\"});\n BDEvents.dispatch(\"plugin-loaded\", plugin.getName());\n};\n\nPluginModule.prototype.unloadPlugin = function(filenameOrName) {\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return;\n const plugin = bdplugin.plugin.getName();\n if (pluginCookie[plugin]) this.disablePlugin(plugin, true);\n const error = ContentManager.unloadContent(bdplugins[plugin].filename, \"plugin\");\n delete bdplugins[plugin];\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} could not be unloaded. It may have not been loaded yet.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${plugin} could not be unloaded. It may have not been loaded yet.`, error);\n }\n Utils.log(\"ContentManager\", `${plugin} was unloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} was unloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"plugin-unloaded\", plugin);\n};\n\nPluginModule.prototype.delete = function(filenameOrName) {\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return;\n this.unloadPlugin(bdplugin.filename);\n const fullPath = require(\"path\").resolve(ContentManager.pluginsFolder, bdplugin.filename);\n require(\"fs\").unlinkSync(fullPath);\n};\n\nPluginModule.prototype.reloadPlugin = async function(filenameOrName) {\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return this.loadPlugin(filenameOrName);\n const plugin = bdplugin.plugin.getName();\n const enabled = pluginCookie[plugin];\n if (enabled) this.stopPlugin(plugin, true);\n const error = await ContentManager.reloadContent(bdplugins[plugin].filename, \"plugin\");\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({plugins: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} could not be reloaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${plugin} could not be reloaded.`, error);\n }\n if (bdplugins[plugin].plugin.load && typeof(bdplugins[plugin].plugin.load) == \"function\") bdplugins[plugin].plugin.load();\n if (enabled) this.startPlugin(plugin, true);\n Utils.log(\"ContentManager\", `${plugin} v${bdplugins[plugin].plugin.getVersion()} was reloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${plugin} v${bdplugins[plugin].plugin.getVersion()} was reloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"plugin-reloaded\", plugin);\n};\n\nPluginModule.prototype.reload = function(name) {\n return this.reloadPlugin(name);\n};\n\nPluginModule.prototype.edit = function(filenameOrName) {\n const bdplugin = Object.values(bdplugins).find(p => p.filename == filenameOrName) || bdplugins[filenameOrName];\n if (!bdplugin) return;\n const fullPath = require(\"path\").resolve(ContentManager.pluginsFolder, bdplugin.filename);\n require(\"electron\").shell.openExternal(`${fullPath}`);\n};\n\nPluginModule.prototype.updatePluginList = function() {\n const results = ContentManager.loadNewContent(\"plugin\");\n for (const filename of results.added) this.loadPlugin(filename);\n for (const name of results.removed) this.unloadPlugin(name);\n};\n\nPluginModule.prototype.loadPluginData = function () {\n const saved = DataStore.getSettingGroup(\"plugins\");\n if (saved) {\n Object.assign(pluginCookie, saved);\n }\n};\n\nPluginModule.prototype.savePluginData = function () {\n DataStore.setSettingGroup(\"plugins\", pluginCookie);\n};\n\nPluginModule.prototype.newMessage = function () {\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n const plugin = bdplugins[plugins[i]].plugin;\n if (!pluginCookie[plugin.getName()]) continue;\n if (typeof plugin.onMessage === \"function\") {\n try { plugin.onMessage(); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to fire onMessage for \" + plugin.getName() + \".\", err); }\n }\n }\n};\n\nPluginModule.prototype.channelSwitch = function () {\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n const plugin = bdplugins[plugins[i]].plugin;\n if (!pluginCookie[plugin.getName()]) continue;\n if (typeof plugin.onSwitch === \"function\") {\n try { plugin.onSwitch(); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to fire onSwitch for \" + plugin.getName() + \".\", err); }\n }\n }\n};\n\nPluginModule.prototype.rawObserver = function(e) {\n const plugins = Object.keys(bdplugins);\n for (let i = 0; i < plugins.length; i++) {\n const plugin = bdplugins[plugins[i]].plugin;\n if (!pluginCookie[plugin.getName()]) continue;\n if (typeof plugin.observer === \"function\") {\n try { plugin.observer(e); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to fire observer for \" + plugin.getName() + \".\", err); }\n }\n }\n};\n\nexport default new PluginModule();","/**\n * Tooltip that automatically show and hide themselves on mouseenter and mouseleave events.\n * Will also remove themselves if the node to watch is removed from DOM through\n * a MutationObserver.\n *\n * Note this is not using Discord's internals but normal DOM manipulation and emulates\n * Discord's own tooltips as closely as possible.\n *\n * @module EmulatedTooltip\n * @version 0.0.1\n */\n\nimport Utils from \"../modules/utils\";\nimport WebpackModules from \"../modules/webpackModules\";\nlet TooltipClasses\nfunction getTooltipClasses(){\n\tif(TooltipClasses)return TooltipClasses\n\treturn TooltipClasses = WebpackModules.findByProps(\"tooltip\", \"tooltipBlack\");\n}\nlet TooltipLayers\nfunction getTooltipLayers(){\n\tif(TooltipLayers)return TooltipLayers\n\treturn TooltipLayers = WebpackModules.findByProps(\"layer\", \"layerContainer\");\n}\n\nconst getClass = function(sideOrColor) {\n const upperCase = sideOrColor[0].toUpperCase() + sideOrColor.slice(1);\n const tooltipClass = getTooltipClasses()[`tooltip${upperCase}`];\n if (tooltipClass) return tooltipClass;\n return null;\n};\n\nconst classExists = function(sideOrColor) {\n return getClass(sideOrColor) ? true : false;\n};\n\nconst toPx = function(value) {\n return `${value}px`;\n};\n\nexport default class EmulatedTooltip {\n\t/**\n\t *\n\t * @constructor\n\t * @param {(HTMLElement|jQuery)} node - DOM node to monitor and show the tooltip on\n\t * @param {string} tip - string to show in the tooltip\n\t * @param {object} options - additional options for the tooltip\n\t * @param {string} [options.style=black] - correlates to the discord styling/colors (black, brand, green, grey, red, yellow)\n\t * @param {string} [options.side=top] - can be any of top, right, bottom, left\n\t * @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen\n * @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover\n * @param {boolean} [options.attachEvents=true] - whether the tooltip should listen to mouseenter and mouseleave events.\n\t */\n\tconstructor(node, text, options = {}) {\n\t\tconst {style = \"black\", side = \"top\", preventFlip = false, disabled = false, attachEvents = true} = options;\n\t\tthis.node = node instanceof jQuery ? node[0] : node;\n this.label = text;\n this.style = style.toLowerCase();\n\t\tthis.side = side.toLowerCase();\n this.preventFlip = preventFlip;\n this.disabled = disabled;\n\n if (!classExists(this.side)) return Utils.err(\"EmulatedTooltip\", `Side ${this.side} does not exist.`);\n\t\tif (!classExists(this.style)) return Utils.err(\"EmulatedTooltip\", `Style ${this.style} does not exist.`);\n\t\t\n\t\tthis.element = document.createElement(\"div\");\n\t\tthis.element.className = getTooltipLayers().layer + \" \" + getTooltipLayers().disabledPointerEvents;\n\n\t\tthis.tooltipElement = document.createElement(\"div\");\n\t\tthis.tooltipElement.className = `${getTooltipClasses().tooltip} ${getClass(this.style)}`;\n\n\t\tthis.labelElement = document.createElement(\"div\");\n\t\tthis.labelElement.className = getTooltipClasses().tooltipContent\n\n\t\tconst pointerElement = document.createElement(\"div\");\n\t\tpointerElement.className = getTooltipClasses().tooltipPointer;\n\n\t\tthis.tooltipElement.append(pointerElement);\n\t\tthis.tooltipElement.append(this.labelElement);\n\t\tthis.element.append(this.tooltipElement);\n\n\t\tif(attachEvents){\n\t\t\tthis.node.addEventListener(\"mouseenter\", () => {\n\t\t\t\tif (this.disabled) return;\n\t\t\t\tthis.show();\n\t\n\t\t\t\tconst observer = new MutationObserver((mutations) => {\n\t\t\t\t\tmutations.forEach((mutation) => {\n\t\t\t\t\t\tconst nodes = Array.from(mutation.removedNodes);\n\t\t\t\t\t\tconst directMatch = nodes.indexOf(this.node) > -1;\n\t\t\t\t\t\tconst parentMatch = nodes.some(parent => parent.contains(this.node));\n\t\t\t\t\t\tif (directMatch || parentMatch) {\n\t\t\t\t\t\t\tthis.hide();\n\t\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\n\t\t\t\tobserver.observe(document.body, {subtree: true, childList: true});\n\t\t\t});\n\t\n\t\t\tthis.node.addEventListener(\"mouseleave\", () => {\n\t\t\t\tthis.hide();\n\t\t\t});\n\t\t}\n }\n\n /** Container where the tooltip will be appended. */\n get container() { \n\t\treturn document.querySelector(\".\"+Utils.removeDa(BDModules.get(e => e.popouts)[0].popouts)+\" ~ .\"+Utils.removeDa(BDModules.get(e => e.layerContainer)[0].layerContainer)); \n\t}\n /** Boolean representing if the tooltip will fit on screen above the element */\n get canShowAbove() { return this.node.getBoundingClientRect().top - this.element.offsetHeight >= 0; }\n /** Boolean representing if the tooltip will fit on screen below the element */\n get canShowBelow() { return this.node.getBoundingClientRect().top + this.node.offsetHeight + this.element.offsetHeight <= Utils.screenHeight; }\n /** Boolean representing if the tooltip will fit on screen to the left of the element */\n get canShowLeft() { return this.node.getBoundingClientRect().left - this.element.offsetWidth >= 0; }\n /** Boolean representing if the tooltip will fit on screen to the right of the element */\n\tget canShowRight() { return this.node.getBoundingClientRect().left + this.node.offsetWidth + this.element.offsetWidth <= Utils.screenWidth; }\n\n /** Hides the tooltip. Automatically called on mouseleave. */\n\thide() {\n this.element.remove();\n this.tooltipElement.className = this._className;\n\t}\n\n /** Shows the tooltip. Automatically called on mouseenter. Will attempt to flip if position was wrong. */\n\tshow() {\n this.tooltipElement.className = `${getTooltipClasses().tooltip} ${getClass(this.style)}`;\n\t\tthis.labelElement.textContent = this.label;\n\t\tthis.container.append(this.element);\n\n\t\tif (this.side == \"top\") {\n\t\t\tif (this.canShowAbove || (!this.canShowAbove && this.preventFlip)) this.showAbove();\n\t\t\telse this.showBelow();\n\t\t}\n\n\t\tif (this.side == \"bottom\") {\n\t\t\tif (this.canShowBelow || (!this.canShowBelow && this.preventFlip)) this.showBelow();\n\t\t\telse this.showAbove();\n\t\t}\n\n\t\tif (this.side == \"left\") {\n\t\t\tif (this.canShowLeft || (!this.canShowLeft && this.preventFlip)) this.showLeft();\n\t\t\telse this.showRight();\n\t\t}\n\n\t\tif (this.side == \"right\") {\n\t\t\tif (this.canShowRight || (!this.canShowRight && this.preventFlip)) this.showRight();\n\t\t\telse this.showLeft();\n\t\t}\n\t}\n\n /** Force showing the tooltip above the node. */\n\tshowAbove() {\n\t\tthis.tooltipElement.classList.add(getClass(\"top\"));\n\t\tthis.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top - this.element.offsetHeight - 10));\n\t\tthis.centerHorizontally();\n\t}\n\n /** Force showing the tooltip below the node. */\n\tshowBelow() {\n\t\tthis.tooltipElement.classList.add(getClass(\"bottom\"));\n\t\tthis.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top + this.node.offsetHeight + 10));\n\t\tthis.centerHorizontally();\n\t}\n\n /** Force showing the tooltip to the left of the node. */\n\tshowLeft() {\n\t\tthis.tooltipElement.classList.add(getClass(\"left\"));\n\t\tthis.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left - this.element.offsetWidth - 10));\n\t\tthis.centerVertically();\n\t}\n\n /** Force showing the tooltip to the right of the node. */\n\tshowRight() {\n\t\tthis.tooltipElement.classList.add(getClass(\"right\"));\n\t\tthis.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left + this.node.offsetWidth + 10));\n\t\tthis.centerVertically();\n\t}\n\n\tcenterHorizontally() {\n const nodecenter = this.node.getBoundingClientRect().left + (this.node.offsetWidth / 2);\n this.element.style.setProperty(\"left\", toPx(nodecenter - (this.element.offsetWidth / 2)));\n\t}\n\n\tcenterVertically() {\n\t\tconst nodecenter = this.node.getBoundingClientRect().top + (this.node.offsetHeight / 2);\n\t\tthis.element.style.setProperty(\"top\", toPx(nodecenter - (this.element.offsetHeight / 2)));\n\t}\n}","import BDV2 from \"../modules/v2\";\nimport Tooltip from \"./tooltip\";\n\nexport default class extends React.Component {\n constructor(props) {\n super(props);\n }\n\n async componentDidMount() {\n const {style = \"black\", side = \"top\", text = \"\"} = this.props;\n this.node = BDV2.reactDom.findDOMNode(this);\n this.tooltip = new Tooltip(this.node, text, {style, side});\n }\n\n componentWillUnmount() {\n this.tooltip.hide();\n delete this.tooltip;\n }\n\n render() {\n return this.props.children;\n }\n}","import nodeFetch from \"node-fetch\"\nimport * as electron from \"electron\"\nimport * as crypto from \"crypto\"\nimport BDV2 from \"./v2\"\nimport tooltipWrap from \"../ui/tooltipWrap\"\nimport Utils from \"./utils\"\nimport { createReadStream, writeFileSync } from \"fs\"\nimport { basename, join } from \"path\"\nimport contentManager from \"./contentManager\"\nimport { addonCache } from \"./contentManager\"\n\nconst cache = {}\nconst cache2 = {}\n\nexport default new class PluginCertifier {\n constructor(){\n window.Lightcord.BetterDiscord.PluginCertifier = this\n }\n\n patch(attachment, id){\n process.nextTick(() => {\n processAttachment(attachment, id)\n })\n }\n\n start(){\n\n }\n\n isTrusted(hash){\n return cache[hash] && !cache[hash].suspect\n }\n}\n\nconst tests = [\n [/token/gi, 0, 0],\n [/email/gi, 0, 0],\n [/mfa\\./gi, 0, 0],\n [/2fa/gi, 0, 0],\n [/phone/gi, 0, 0],\n [/child_process/gi, 0, 0],\n [/localStorage/gi, 0, 0],\n [/getGlobal/gi, 0, 0],\n [/BrowserWindow/gi, 0, 0],\n [/system32/gi, 0, 0],\n [/password/gi, 0, 0],\n [/eval/gi, 0, 0],\n [/WebAssembly/gi, 0, 0],\n [/XMLHttpRequest(\\.|\\[[\"'`])prototype/gi, 0, 0],\n [/window\\.fetch( +)?=/gi, 0, 0],\n /** Obfuscation / hidden / workarounds */\n [/([\"'`]\\+)[\"'`]\\w[\"'`]/gi, 1, 1],\n [/[\"'`]\\w[\"'`](\\+[\"'`])/gi, 1, 1],\n [/\\${[\"'`]\\w+[\"'`]}/gi, 1, 1],\n /** hexadecimal */\n [/_0x\\w{4}\\('0x[\\dabcdef]+'\\)/g, 1, 1],\n [/_0x\\w{4}\\('0x[\\dabcdef]+'( +)?,( +)?'[^']{4}'\\)/g, 1, 1], // _0x8db7('0x0', 'x1]f')\n /** mangled */\n [/\\w+\\('0x[\\dabcdef]+'\\)/g, 1, 1], // b('0x0')\n [/\\w+\\('0x[\\dabcdef]+'( +)?,( +)?'[^']{4}'\\)/g, 1, 1], // b('0x0', 'x1]f')\n /** string array at start */\n [/^var [\\w\\d_$]+=\\[\"/gi, 1, 1]\n]\n\nconst threats = [\n \"Account Stealer/Virus\",\n \"Obfuscation/Hidden code\"\n]\n\nexport function checkViruses(hash, data, resultCallback, removeCallback, filename){\n data = data.toString(\"utf8\")\n let isHarmful = false\n /**\n * @type {string}\n */\n const no_comments = data.replace(/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/gm, \"\").trim()// removing all comments from plugins (remove meta and other.)\n\n for(const [test, type, removeComment] of tests){\n const scrpt = removeComment === 1 ? no_comments : data\n if(test.exec(scrpt)){\n isHarmful = threats[type]\n console.log(`${hashToUrl[hash].split(\"/\").pop()} failed at test`, test, \". Marked as\", threats[type])\n break\n }\n }\n\n if(!isHarmful)return removeCallback(hash)\n cache[hash] = {\n suspect: true,\n name: hashToUrl[hash].split(\"/\").pop(),\n type: hashToUrl[hash].endsWith(\".js\") ? \"Plugin\" : \"Theme\",\n harm: isHarmful,\n hash: hash,\n filename\n }\n \n console.log(`Found potentially dangerous ${cache[hash].type.toLowerCase()}: ${cache[hash].name}`)\n\n resultCallback(cache[hash])\n}\n\nconst hashToUrl = {}\n\nexport function checkHash(hash, data, filename, resultCallback, removeCallback){\n console.log(`File: ${filename} hash: ${hash}`)\n if(!cache[hash]){\n nodeFetch(\"https://cdn.jsdelivr.net/gh/Lightcord/filehashes@master/hashes/\"+hash, { // Using node-fetch to bypass cors\n headers: {\n \"User-Agent\": electron.ipcRenderer.sendSync(\"LIGHTCORD_GET_USER_AGENT\") // have to set user-agent\n }\n }).then(async res => {\n if(res.status !== 200){\n if(filename.endsWith(\".theme.css\"))return removeCallback(hash)\n try{\n checkViruses(hash, data, resultCallback, removeCallback, filename)\n }catch(e){\n console.error(e)\n removeCallback()\n }\n return\n }\n const result = await res.json()\n result.hash = hash\n result.filename = filename\n\n cache[hash] = result\n\n resultCallback(result)\n }).catch((err) => {\n console.error(`Could not read from github. ${err}`)\n if(filename.endsWith(\".theme.css\"))return removeCallback(hash)\n checkViruses(hash, data, resultCallback, removeCallback, filename)\n })\n }else{\n const result = cache[hash]\n\n resultCallback(result)\n }\n}\n\nexport function processFile(__path, resultCallback, removeCallback = (hash) => {}, isFromLoader = false){ \n const hash = crypto.createHash(\"sha256\")\n let data = Buffer.alloc(0)\n\n createReadStream(__path).on(\"data\", chunk => {\n data = Buffer.concat([data, chunk])\n hash.update(chunk)\n }).on(\"end\", () => {\n const hashResult = hash.digest(\"hex\")\n\n hashToUrl[hashResult] = __path\n\n if(isFromLoader && addonCache[hashResult]){\n let value = addonCache[hashResult]\n if(value.timestamp < (Date.now() - 6.048e+8)){\n delete addonCache[hashResult]\n contentManager.saveAddonCache()\n }else{\n resultCallback(value.result)\n return\n }\n }\n\n checkHash(hashResult, data, basename(__path), resultCallback, removeCallback)\n })\n}\n\nexport function processAttachment(attachment, id){\n if(!document.getElementById(id))return\n if(!attachment.url.startsWith(\"https://cdn.discordapp.com/\"))return document.getElementById(id).remove()\n if(!attachment.filename.endsWith(\".plugin.js\") && !attachment.filename.endsWith(\".theme.css\"))return document.getElementById(id).remove()\n\n nodeFetch(attachment.url, {\n headers: {\n \"User-Agent\": electron.ipcRenderer.sendSync(\"LIGHTCORD_GET_USER_AGENT\")\n }\n }).then(res => {\n if(res.status !== 200)throw new Error(\"File doesn't exist.\")\n const hash = crypto.createHash(\"sha256\")\n let data = Buffer.alloc(0)\n res.body.on(\"data\", chunk => {\n data = Buffer.concat([data, chunk])\n hash.update(chunk)\n })\n res.body.on(\"end\", () => {\n const hashResult = hash.digest(\"hex\")\n\n cache2[attachment.url] = hashResult\n hashToUrl[hashResult] = attachment.url\n\n checkHash(hashResult, data, attachment.filename, (result) => {\n renderToElements(id, result, attachment.filename)\n }, () => {\n let elem = document.getElementById(id)\n if(elem)elem.remove()\n })\n })\n }).catch(()=>{})\n}\n\nlet flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0]\nlet childModule = BDModules.get(e => e.childContainer)[0]\n\n/**\n * \n * @param {HTMLDivElement[]} elements \n * @param {{type: \"Theme\"|\"Plugin\", name: string, official?: boolean}|{suspect:true, type: \"Theme\"|\"Plugin\", name: string, harm: string}} result\n */\nfunction renderToElements(id, result, filename){\n const div = document.getElementById(id)\n if(!div || div.childNodes.length > 0)return // already certified/div does not exist anymore.\n\n if(!flowerStarModule)flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0]\n if(!childModule)childModule = BDModules.get(e => e.childContainer)[0]\n \n if(result.suspect){\n try{\n div.parentNode.style.borderColor = \"rgb(240, 71, 71)\"\n /**\n * \n * @param {HTMLElement} node \n */\n let nextNode = (node) => {\n for(let child of node.children){\n if(child.tagName === \"A\"){\n child.addEventListener(\"click\", (e) => {\n e.preventDefault()\n e.stopImmediatePropagation()\n\n Utils.showConfirmationModal(\n \"Are you sure you want to download this ?\", \n \"The \"+result.type.toLowerCase()+\" **\"+filename+\"** might be dangerous **(\"+result.harm+\")**. \\n\\n**We don't recommand to download it**. However, you can still do it below.\", \n {\n confirmText: \"Download Anyway\",\n cancelText: \"Don't !\",\n danger: true,\n onCancel: () => {},\n onConfirm: () => {\n electron.ipcRenderer.sendSync(\"LIGHTCORD_OPEN_EXTERNAL\", child.href)\n }\n }\n )\n })\n }else if([\"div\"].includes(child.tagName.toLowerCase())){\n nextNode(child)\n }\n }\n }\n nextNode(div.parentNode)\n }catch(e){\n console.error(e)\n }\n BDV2.reactDom.render(BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" is potentially dangerous.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}},\n BDV2.react.createElement(\"svg\", {className: BDModules.get(e => e.svg)[0].svg, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 40 32\"},\n BDV2.react.createElement(\"rect\", {\n x:\"0\",\n y:\"0\",\n width:\"32\",\n height:\"32\",\n mask:\"url(#svg-mask-avatar-status-round-32)\",\n fill:\"#f04747\",\n mask:\"url(#svg-mask-status-dnd)\",\n className:BDModules.get(e => e.pointerEvents)[0].pointerEvents\n })\n )\n )\n ), div)\n }else if(!result.official){\n div.parentNode.style.borderColor = \"#4087ed\"\n let span = BDV2.react.createElement(\"span\", {style: {display: \"inherit\"}}, [\n BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" is certified by Lightcord.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\", float: \"left\"}},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"},\n BDV2.react.createElement(\"path\", {fill:\"#4f545c\", \"fill-rule\":\"evenodd\",d:\"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z\"})\n ),\n BDV2.react.createElement(\"div\", {className: childModule.childContainer}, \n BDV2.react.createElement(\"svg\", {\"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"}, \n BDV2.react.createElement(\"path\", {fill:\"#ffffff\",d:\"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z\"})\n )\n )\n )\n ),\n BDV2.react.createElement(tooltipWrap, {text: \"Install this \"+result.type.toLowerCase()+\" on Lightcord.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}, onClick(){\n Utils.showConfirmationModal(\n \"Are you sure you want to download this \"+result.type.toLowerCase()+\" ?\", \n \"Lightcord will automatically install and launch this \"+result.type.toLowerCase()+\". You don't have anything to do.\", \n {\n confirmText: \"Download and Install\",\n cancelText: \"I've changed my mind\",\n danger: false,\n onCancel: () => {},\n onConfirm: () => {\n let link = getKeyedArray(cache2).find(e => e[1] === result.hash)[0]\n console.log(link)\n nodeFetch(link)\n .then(async res => {\n if(res.status !== 200)throw new Error(\"Status was not 200\")\n let content = await res.buffer()\n let installPath = join(result.type === \"Plugin\" ? contentManager._pluginsFolder : contentManager._themesFolder, result.filename)\n console.log(installPath)\n writeFileSync(installPath, content)\n Utils.showToast(result.type+\" succesfully installed.\")\n }).catch(err => {\n err = err instanceof Error ? err : new Error(err)\n Utils.showToast(err.message, {\n type: \"error\"\n })\n })\n }\n }\n )\n }},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 24 24\",style:{\n color: \"rgb(67, 181, 129)\",\n cursor: \"pointer\"\n }},\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M0 0h24v24H0z\"></path>\n <path class=\"fill\" fill=\"currentColor\" d=\"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z\"></path>\n </g>\n )\n )\n )\n ])\n BDV2.reactDom.render(span, div)\n }else{\n div.parentNode.style.borderColor = \"#4087ed\"\n let span = BDV2.react.createElement(\"span\", {style: {display: \"inherit\"}}, [\n BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" was made by the developers of Lightcord.\", style:\"brand\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\", float: \"left\"}},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\",stroke:\"#36393f\",style:{color:\"#4087ed\"}},\n BDV2.react.createElement(\"path\", {fill:\"currentColor\", \"fill-rule\":\"evenodd\",d:\"m16 7.6c0 .79-1.28 1.38-1.52 2.09s.44 2 0 2.59-1.84.35-2.46.8-.79 1.84-1.54 2.09-1.67-.8-2.47-.8-1.75 1-2.47.8-.92-1.64-1.54-2.09-2-.18-2.46-.8.23-1.84 0-2.59-1.54-1.3-1.54-2.09 1.28-1.38 1.52-2.09-.44-2 0-2.59 1.85-.35 2.48-.8.78-1.84 1.53-2.12 1.67.83 2.47.83 1.75-1 2.47-.8.91 1.64 1.53 2.09 2 .18 2.46.8-.23 1.84 0 2.59 1.54 1.3 1.54 2.09z\"})\n ),\n BDV2.react.createElement(\"div\", {className: childModule.childContainer}, \n BDV2.react.createElement(\"svg\", {\"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"}, \n BDV2.react.createElement(\"path\", {fill:\"#ffffff\",d:\"M10.7,5.28a2.9,2.9,0,0,0-2.11.86.11.11,0,0,0,0,.16l1.05.94a.11.11,0,0,0,.15,0,1.27,1.27,0,0,1,.9-.33c.65,0,.65.73.65.73a.64.64,0,0,1-.65.65,1.73,1.73,0,0,1-1.18-.54c-.31-.26-.36-.32-.73-.66S7.06,5.28,5.65,5.28A2.26,2.26,0,0,0,3.37,7.56,2.59,2.59,0,0,0,3.82,9a2.18,2.18,0,0,0,1.83.89,2.94,2.94,0,0,0,2.1-.81.11.11,0,0,0,0-.16L6.74,8A.11.11,0,0,0,6.6,8a1.58,1.58,0,0,1-.94.29h0A.71.71,0,0,1,5,7.56H5a.63.63,0,0,1,.65-.64c.71,0,1.42.75,1.94,1.27.75.76,1.66,1.79,3.11,1.74A2.28,2.28,0,0,0,13,7.64a2.59,2.59,0,0,0-.45-1.47A2.14,2.14,0,0,0,10.7,5.28Z\"})\n )\n )\n )\n ),\n BDV2.react.createElement(tooltipWrap, {text: \"Install this \"+result.type.toLowerCase()+\" on Lightcord.\"}, \n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}, onClick(){\n Utils.showConfirmationModal(\n \"Are you sure you want to download this \"+result.type.toLowerCase()+\" ?\", \n \"Lightcord will automatically download and load this \"+result.type.toLowerCase()+\". You must enable it in the settings.\", \n {\n confirmText: \"Download and Install\",\n cancelText: \"I've changed my mind\",\n danger: false,\n onCancel: () => {},\n onConfirm: () => {\n let link = getKeyedArray(cache2).find(e => e[1] === result.hash)[0]\n \n nodeFetch(link)\n .then(async res => {\n if(res.status !== 200)throw new Error(\"Status was not 200\")\n let content = await res.buffer()\n let installPath = join(result.type === \"Plugin\" ? contentManager._pluginsFolder : contentManager._themesFolder, result.filename)\n \n writeFileSync(installPath, content)\n Utils.showToast(result.type+\" succesfully installed.\")\n }).catch(err => {\n err = err instanceof Error ? err : new Error(err)\n Utils.showToast(err.message, {\n type: \"error\"\n })\n })\n }\n }\n )\n }},\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 24 24\",style:{\n color: \"rgb(67, 181, 129)\",\n cursor: \"pointer\"\n }},\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M0 0h24v24H0z\"></path>\n <path class=\"fill\" fill=\"currentColor\" d=\"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z\"></path>\n </g>\n )\n )\n )\n ])\n BDV2.reactDom.render(span, div)\n }\n}\n\nfunction getKeyedArray(obj){\n let arr = []\n Object.keys(obj).forEach(k => {\n arr.push([k, obj[k]])\n })\n return arr\n}\n\nlet key = null\nlet save = null\n\nwindow.Lightcord.Api.ensureExported(m=>m.ObjectStorage)\n.then(localStorageModule => {\n let localStorage = localStorageModule.impl\n save = function(){\n localStorage.set(\"PluginCertifierKeyEncryption__\", btoa(JSON.stringify(key)))\n }\n setInterval(() => {\n save()\n }, 100000);\n try{\n let val = safeJSONParse(atob(localStorage.get(\"PluginCertifierKeyEncryption__\")))\n if(val instanceof Error || !Array.isArray(val) || val.length !== 2 || val.find(e => typeof e !== \"string\") || Buffer.from(val[0], \"base64\").length !== 16 || Buffer.from(val[1], \"base64\").length !== 32){\n generateKey()\n save()\n return\n }\n key = val\n }catch(e){\n generateKey()\n save()\n }\n})\n\nfunction generateKey(){\n key = [crypto.randomBytes(16).toString(\"base64\"), crypto.randomBytes(32).toString(\"base64\")]\n}\n\nfunction safeJSONParse(json){\n try{\n return JSON.parse(json)\n }catch(e){\n return e instanceof Error ? new Error(e) : e\n }\n}\n\nexport function decryptSettingsCache(data){\n try{\n let decipher = crypto.createDecipheriv(\"aes-256-cbc\", Buffer.from(key[1], \"base64\"), Buffer.from(key[0], \"base64\"))\n let decrypted = decipher.update(Buffer.from(data, \"base64\"));\n decrypted = Buffer.concat([decrypted, decipher.final()]);\n return decrypted.toString(\"utf8\")\n }catch(e){\n return \"{}\"\n }\n}\nexport function encryptSettingsCache(data){\n let args = [Buffer.from(key[1], \"base64\"), Buffer.from(key[0], \"base64\")]\n \n let cipher = crypto.createCipheriv('aes-256-cbc', ...args);\n let encrypted = cipher.update(Buffer.from(data, \"utf8\"));\n encrypted = Buffer.concat([encrypted, cipher.final()]);\n return encrypted.toString(\"base64\")\n}","import {bdConfig, bdplugins, bdthemes, settingsCookie} from \"../0globals\";\nimport pluginModule from \"./pluginModule\";\nimport themeModule from \"./themeModule\";\nimport Utils from \"./utils\";\nimport dataStore from \"./dataStore\";\nimport { encryptSettingsCache, decryptSettingsCache, processFile } from \"./pluginCertifier\";\nimport * as electron from \"electron\"\n\nconst path = require(\"path\");\nconst fs = require(\"fs\");\nconst Module = require(\"module\").Module;\nModule.globalPaths.push(path.resolve(electron.ipcRenderer.sendSync(\"LIGHTCORD_GET_APP_PATH\"), \"node_modules\"));\nclass MetaError extends Error {\n constructor(message) {\n super(message);\n this.name = \"MetaError\";\n }\n}\nconst originalJSRequire = Module._extensions[\".js\"];\nconst originalCSSRequire = Module._extensions[\".css\"] ? Module._extensions[\".css\"] : () => {return null;};\nconst splitRegex = /[^\\S\\r\\n]*?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n\nexport let addonCache = {}\n\nlet hasPatched = false\nexport default new class ContentManager {\n\n constructor() {\n this.timeCache = {};\n this.watchers = {};\n }\n\n patchExtensions(){\n if(hasPatched)return\n hasPatched = true\n Module._extensions[\".js\"] = this.getContentRequire(\"plugin\");\n Module._extensions[\".css\"] = this.getContentRequire(\"theme\");\n }\n\n get pluginsFolder() {return this._pluginsFolder || (this._pluginsFolder = fs.realpathSync(path.resolve(bdConfig.dataPath + \"plugins/\")));}\n get themesFolder() {return this._themesFolder || (this._themesFolder = fs.realpathSync(path.resolve(bdConfig.dataPath + \"themes/\")));}\n\n loadAddonCertifierCache(){\n if(typeof dataStore.getSettingGroup(\"PluginCertifierHashes\") !== \"string\"){\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(\"{}\"))\n }else{\n try{\n addonCache = JSON.parse(decryptSettingsCache(dataStore.getSettingGroup(\"PluginCertifierHashes\")))\n }catch(e){\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(\"{}\"))\n addonCache = {}\n }\n }\n Object.keys(addonCache)\n .forEach(key => {\n let value = addonCache[key]\n if(!value || typeof value !== \"object\" || Array.isArray(value))return delete addonCache[key]\n\n let props = [{\n key: \"timestamp\",\n type: \"number\"\n }, {\n key: \"result\",\n type: \"object\"\n }, {\n key: \"hash\",\n type: \"string\"\n }]\n for(let prop of props){\n if(!(prop.key in value) || typeof value[prop.key] !== prop.type){\n delete addonCache[key]\n return\n }\n }\n if(value.hash !== key){\n delete addonCache[key]\n return\n }\n if(value.result.suspect){ // refetch from remote to be sure you're up to date.\n delete addonCache[key]\n return\n }\n })\n this.saveAddonCache()\n }\n\n saveAddonCache(){\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(JSON.stringify(addonCache)))\n }\n\n watchContent(contentType) {\n if (this.watchers[contentType]) return;\n const isPlugin = contentType === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n this.watchers[contentType] = fs.watch(baseFolder, {persistent: false}, async (eventType, filename) => {\n if (!eventType || !filename || !filename.endsWith(fileEnding)) return;\n await new Promise(r => setTimeout(r, 50));\n try {fs.statSync(path.resolve(baseFolder, filename));}\n catch (err) {\n if (err.code !== \"ENOENT\") return;\n delete this.timeCache[filename];\n if (isPlugin) return pluginModule.unloadPlugin(filename);\n return themeModule.unloadTheme(filename);\n }\n if (!fs.statSync(path.resolve(baseFolder, filename)).isFile()) return;\n const stats = fs.statSync(path.resolve(baseFolder, filename));\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\n if (typeof(stats.mtime.getTime()) !== \"number\") return;\n if (this.timeCache[filename] == stats.mtime.getTime()) return;\n this.timeCache[filename] = stats.mtime.getTime();\n if (eventType == \"rename\") {\n if (isPlugin) await pluginModule.loadPlugin(filename);\n else await themeModule.loadTheme(filename);\n }\n if (eventType == \"change\") {\n if (isPlugin) await pluginModule.reloadPlugin(filename);\n else await themeModule.reloadTheme(filename);\n }\n });\n }\n\n unwatchContent(contentType) {\n if (!this.watchers[contentType]) return;\n this.watchers[contentType].close();\n delete this.watchers[contentType];\n }\n\n extractMeta(content) {\n const firstLine = content.split(\"\\n\")[0];\n const hasOldMeta = firstLine.includes(\"//META\");\n if (hasOldMeta) return this.parseOldMeta(content);\n const hasNewMeta = firstLine.includes(\"/**\");\n if (hasNewMeta) return this.parseNewMeta(content);\n throw new MetaError(\"META was not found.\");\n }\n\n parseOldMeta(content) {\n const meta = content.split(\"\\n\")[0];\n const rawMeta = meta.substring(meta.lastIndexOf(\"//META\") + 6, meta.lastIndexOf(\"*//\"));\n if (meta.indexOf(\"META\") < 0) throw new MetaError(\"META was not found.\");\n const parsed = Utils.testJSON(rawMeta);\n if (!parsed) throw new MetaError(\"META could not be parsed.\");\n if (!parsed.name) throw new MetaError(\"META missing name data.\");\n parsed.format = \"json\";\n return parsed;\n }\n\n parseNewMeta(content) {\n const block = content.split(\"/**\", 2)[1].split(\"*/\", 1)[0];\n const out = {};\n let field = \"\";\n let accum = \"\";\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n out[field] = accum;\n const l = line.indexOf(\" \");\n field = line.substr(1, l - 1);\n accum = line.substr(l + 1);\n }\n else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n out[field] = accum.trim();\n delete out[\"\"];\n out.format = \"jsdoc\";\n return out;\n }\n\n getContentRequire(type) {\n const isPlugin = type === \"plugin\";\n const self = this;\n const originalRequire = isPlugin ? originalJSRequire : originalCSSRequire;\n return function(module, filename) {\n const baseFolder = isPlugin ? self.pluginsFolder : self.themesFolder;\n const possiblePath = path.resolve(baseFolder, path.basename(filename));\n if (!fs.existsSync(possiblePath) || filename !== fs.realpathSync(possiblePath)) return Reflect.apply(originalRequire, this, arguments);\n let content = fs.readFileSync(filename, \"utf8\");\n content = Utils.stripBOM(content);\n\n const stats = fs.statSync(filename);\n const meta = self.extractMeta(content);\n meta.filename = path.basename(filename);\n meta.added = stats.atimeMs;\n meta.modified = stats.mtimeMs;\n meta.size = stats.size;\n if (!isPlugin) {\n meta.css = content;\n if (meta.format == \"json\") meta.css = meta.css.split(\"\\n\").slice(1).join(\"\\n\");\n content = `module.exports = ${JSON.stringify(meta)};`;\n }\n if (isPlugin) {\n module._compile(content, module.filename);\n const didExport = !Utils.isEmpty(module.exports);\n if (didExport) {\n meta.type = module.exports;\n module.exports = meta;\n content = \"\";\n }\n else {\n Utils.warn(\"Module Not Exported\", `${meta.name}, please start setting module.exports`);\n content += `\\nmodule.exports = ${JSON.stringify(meta)};\\nmodule.exports.type = ${meta.exports || meta.name};`;\n }\n }\n module._compile(content, filename);\n };\n }\n\n makePlaceholderPlugin(data) {\n return {plugin: {\n start: () => {},\n getName: () => {return data.name || data.filename;},\n getAuthor: () => {return \"???\";},\n getDescription: () => {return data.message ? data.message : \"This plugin was unable to be loaded. Check the author's page for updates.\";},\n getVersion: () => {return \"???\";}\n },\n name: data.name || data.filename,\n filename: data.filename,\n source: data.source ? data.source : \"\",\n website: data.website ? data.website : \"\"\n };\n }\n\n async loadContent(filename, type) {\n if (typeof(filename) === \"undefined\" || typeof(type) === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n if(settingsCookie[\"fork-ps-6\"]){\n let result = await new Promise(resolve => {\n processFile(path.resolve(baseFolder, filename), (result) => {\n console.log(result)\n resolve(result)\n }, (hash) => {\n resolve({\n suspect: false,\n hash: hash,\n filename: filename,\n name: filename\n })\n }, true)\n })\n if(result){\n addonCache[result.hash] = {\n timestamp: Date.now(),\n hash: result.hash,\n result: result\n }\n this.saveAddonCache()\n if(result.suspect){\n return {\n name: filename,\n file: filename,\n message: \"This plugin might be dangerous (\"+result.harm+\").\",\n error: new Error(\"This plugin might be dangerous (\"+result.harm+\").\")\n }\n }\n }\n }\n\n try {__non_webpack_require__(path.resolve(baseFolder, filename));}\n catch (error) {return {name: filename, file: filename, message: \"Could not be compiled.\", error: {message: error.message, stack: error.stack}};}\n const content = __non_webpack_require__(path.resolve(baseFolder, filename));\n if(!content.name)return {name: filename, file: filename, message: \"Cannot escape the ID.\", error: new Error(\"Cannot read property 'replace' of undefined\")}\n content.id = Utils.escapeID(content.name);\n //if(!id)return {name: filename, file: filename, message: \"Invalid ID\", error: new Error(\"Please fix the name of \"+filename+\". BetterDiscord can't escape an ID.\")}\n if (isPlugin) {\n if (!content.type) return;\n try {\n content.plugin = new content.type();\n delete bdplugins[content.plugin.getName()];\n bdplugins[content.plugin.getName()] = content;\n }\n catch (error) {return {name: filename, file: filename, message: \"Could not be constructed.\", error: {message: error.message, stack: error.stack}};}\n }\n else {\n delete bdthemes[content.name];\n bdthemes[content.name] = content;\n }\n } \n\n unloadContent(filename, type) {\n if (typeof(filename) === \"undefined\" || typeof(type) === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n try {\n delete __non_webpack_require__.cache[__non_webpack_require__.resolve(path.resolve(baseFolder, filename))];\n }\n catch (err) {return {name: filename, file: filename, message: \"Could not be unloaded.\", error: {message: err.message, stack: err.stack}};}\n }\n\n isLoaded(filename, type) {\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n try {__non_webpack_require__.cache[__non_webpack_require__.resolve(path.resolve(baseFolder, filename))];}\n catch (err) {return false;}\n return true;\n }\n\n async reloadContent(filename, type) {\n const cantUnload = this.unloadContent(filename, type);\n if (cantUnload) return cantUnload;\n return await this.loadContent(filename, type);\n }\n\n loadNewContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const files = fs.readdirSync(basedir);\n const contentList = Object.values(isPlugin ? bdplugins : bdthemes);\n const removed = contentList.filter(t => !files.includes(t.filename)).map(c => isPlugin ? c.plugin.getName() : c.name);\n const added = files.filter(f => !contentList.find(t => t.filename == f) && f.endsWith(fileEnding) && fs.statSync(path.resolve(basedir, f)).isFile());\n return {added, removed};\n }\n\n async loadAllContent(type) {\n this.patchExtensions()\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const errors = [];\n const files = fs.readdirSync(basedir);\n\n for (const filename of files) {\n if (!fs.statSync(path.resolve(basedir, filename)).isFile() || !filename.endsWith(fileEnding)) continue;\n const error = await this.loadContent(filename, type);\n if (error) errors.push(error);\n }\n\n return errors;\n }\n\n loadPlugins() {return this.loadAllContent(\"plugin\");}\n loadThemes() {return this.loadAllContent(\"theme\");}\n};\n\n/**\n * Don't expose contentManager - could be dangerous for now\n */","/**\n * Copyright 2018 Zachary Rauen\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is furnished\n * to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * \n * From: https://github.com/rauenzi/BDPluginLibrary\n */\n\n/**\n * @interface\n * @name Offset\n * @property {number} top - Top offset of the target element.\n * @property {number} right - Right offset of the target element.\n * @property {number} bottom - Bottom offset of the target element.\n * @property {number} left - Left offset of the target element.\n * @property {number} height - Outer height of the target element.\n * @property {number} width - Outer width of the target element.\n */\n\n /**\n * Function that automatically removes added listener.\n * @callback module:DOMTools~CancelListener\n */\n \nexport default class DOMTools {\n\n static escapeID(id) {\n return id.replace(/^[^a-z]+|[^\\w-]+/gi, \"-\");\n }\n\n /**\n\t * Adds a style to the document.\n\t * @param {string} id - identifier to use as the element id\n\t * @param {string} css - css to add to the document\n\t */\n\tstatic addStyle(id, css) {\n\t\tdocument.head.append(DOMTools.createElement(`<style id=\"${id}\">${css}</style>`));\n\t}\n\n\t/**\n\t * Removes a style from the document.\n\t * @param {string} id - original identifier used\n\t */\n\tstatic removeStyle(id) {\n\t\tconst element = document.getElementById(id);\n\t\tif (element) element.remove();\n\t}\n\n\t/**\n\t * Adds/requires a remote script to be loaded\n\t * @param {string} id - identifier to use for this script\n\t * @param {string} url - url from which to load the script\n\t * @returns {Promise} promise that resolves when the script is loaded\n\t */\n\tstatic addScript(id, url) {\n\t\treturn new Promise(resolve => {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.id = id;\n\t\t\tscript.src = url;\n\t\t\tscript.type = \"text/javascript\";\n\t\t\tscript.onload = resolve;\n\t\t\tdocument.head.append(script);\n\t\t});\n\t}\n\n\t/**\n\t * Removes a remote script from the document.\n\t * @param {string} id - original identifier used\n\t */\n\tstatic removeScript(id) {\n id = this.escapeID(id);\n\t\tconst element = document.getElementById(id);\n\t\tif (element) element.remove();\n }\n \n // https://javascript.info/js-animation\n static animate({timing = _ => _, update, duration}) {\n const start = performance.now();\n \n requestAnimationFrame(function animate(time) {\n // timeFraction goes from 0 to 1\n let timeFraction = (time - start) / duration;\n if (timeFraction > 1) timeFraction = 1;\n \n // calculate the current animation state\n const progress = timing(timeFraction);\n \n update(progress); // draw it\n \n if (timeFraction < 1) {\n requestAnimationFrame(animate);\n }\n \n });\n }\n\n /**\n * This is my shit version of not having to use `$` from jQuery. Meaning\n * that you can pass a selector and it will automatically run {@link module:DOMTools.query}.\n * It also means that you can pass a string of html and it will perform and return `parseHTML`.\n * @see module:DOMTools.parseHTML\n * @see module:DOMTools.query\n * @param {string} selector - Selector to query or HTML to parse\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - Either the result of `parseHTML` or `query`\n */\n static Q(selector) {\n const element = this.parseHTML(selector);\n const isHTML = element instanceof NodeList ? Array.from(element).some(n => n.nodeType === 1) : element.nodeType === 1;\n if (isHTML) return element;\n return this.query(selector);\n }\n\n /**\n * Essentially a shorthand for `document.querySelector`. If the `baseElement` is not provided\n * `document` is used by default.\n * @param {string} selector - Selector to query\n * @param {Element} [baseElement] - Element to base the query from\n * @returns {(Element|null)} - The found element or null if not found\n */\n static query(selector, baseElement = document) {\n return baseElement.querySelector(selector);\n }\n\n /**\n * Essentially a shorthand for `document.querySelectorAll`. If the `baseElement` is not provided\n * `document` is used by default.\n * @param {string} selector - Selector to query\n * @param {Element} [baseElement] - Element to base the query from\n * @returns {Array<Element>} - Array of all found elements\n */\n static queryAll(selector, baseElement = document) {\n return baseElement.querySelectorAll(selector);\n }\n\n /**\n * Parses a string of HTML and returns the results. If the second parameter is true,\n * the parsed HTML will be returned as a document fragment {@see https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment}.\n * This is extremely useful if you have a list of elements at the top level, they can then be appended all at once to another node.\n * \n * If the second parameter is false, then the return value will be the list of parsed\n * nodes and there were multiple top level nodes, otherwise the single node is returned.\n * @param {string} html - HTML to be parsed\n * @param {boolean} [fragment=false] - Whether or not the return should be the raw `DocumentFragment`\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - The result of HTML parsing\n */\n static parseHTML(html, fragment = false) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n const node = template.content.cloneNode(true);\n if (fragment) return node;\n return node.childNodes.length > 1 ? node.childNodes : node.childNodes[0];\n }\n\n /** Alternate name for {@link module:DOMTools.parseHTML} */\n static createElement(html, fragment = false) {return this.parseHTML(html, fragment);}\n \n /**\n * Takes a string of html and escapes it using the brower's own escaping mechanism.\n * @param {String} html - html to be escaped\n */\n static escapeHTML(html) {\n const textNode = document.createTextNode(\"\");\n const spanElement = document.createElement(\"span\");\n spanElement.append(textNode);\n textNode.nodeValue = html;\n return spanElement.innerHTML;\n }\n\n /**\n * Adds a list of classes from the target element.\n * @param {Element} element - Element to edit classes of\n * @param {...string} classes - Names of classes to add\n * @returns {Element} - `element` to allow for chaining\n */\n static addClass(element, ...classes) {\n classes = classes.flat().filter(c => c);\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\n classes = classes.flat().filter(c => c);\n element.classList.add(...classes);\n return element;\n }\n\n /**\n * Removes a list of classes from the target element.\n * @param {Element} element - Element to edit classes of\n * @param {...string} classes - Names of classes to remove\n * @returns {Element} - `element` to allow for chaining\n */\n static removeClass(element, ...classes) {\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\n classes = classes.flat().filter(c => c);\n element.classList.remove(...classes);\n return element;\n }\n\n /**\n * When only one argument is present: Toggle class value;\n * i.e., if class exists then remove it and return false, if not, then add it and return true.\n * When a second argument is present:\n * If the second argument evaluates to true, add specified class value, and if it evaluates to false, remove it.\n * @param {Element} element - Element to edit classes of\n * @param {string} classname - Name of class to toggle\n * @param {boolean} [indicator] - Optional indicator for if the class should be toggled\n * @returns {Element} - `element` to allow for chaining\n */\n static toggleClass(element, classname, indicator) {\n classname = classname.toString().split(\" \").filter(c => c);\n if (typeof(indicator) !== \"undefined\") classname.forEach(c => element.classList.toggle(c, indicator));\n else classname.forEach(c => element.classList.toggle(c));\n return element;\n }\n\n /**\n * Checks if an element has a specific class\n * @param {Element} element - Element to edit classes of\n * @param {string} classname - Name of class to check\n * @returns {boolean} - `true` if the element has the class, `false` otherwise.\n */\n static hasClass(element, classname) {\n return classname.toString().split(\" \").filter(c => c).every(c => element.classList.contains(c));\n }\n\n /**\n * Replaces one class with another\n * @param {Element} element - Element to edit classes of\n * @param {string} oldName - Name of class to replace\n * @param {string} newName - New name for the class\n * @returns {Element} - `element` to allow for chaining\n */\n static replaceClass(element, oldName, newName) {\n element.classList.replace(oldName, newName);\n return element;\n }\n\n /**\n * Appends `thisNode` to `thatNode`\n * @param {Node} thisNode - Node to be appended to another node\n * @param {Node} thatNode - Node for `thisNode` to be appended to\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static appendTo(thisNode, thatNode) {\n if (typeof(thatNode) == \"string\") thatNode = this.query(thatNode);\n if (!thatNode) return null;\n thatNode.append(thisNode);\n return thisNode;\n }\n\n /**\n * Prepends `thisNode` to `thatNode`\n * @param {Node} thisNode - Node to be prepended to another node\n * @param {Node} thatNode - Node for `thisNode` to be prepended to\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static prependTo(thisNode, thatNode) {\n if (typeof(thatNode) == \"string\") thatNode = this.query(thatNode);\n if (!thatNode) return null;\n thatNode.prepend(thisNode);\n return thisNode;\n }\n\n /**\n * Insert after a specific element, similar to jQuery's `thisElement.insertAfter(otherElement)`.\n * @param {Node} thisNode - The node to insert\n * @param {Node} targetNode - Node to insert after in the tree\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static insertAfter(thisNode, targetNode) {\n targetNode.parentNode.insertBefore(thisNode, targetNode.nextSibling);\n return thisNode;\n }\n\n /**\n * Insert after a specific element, similar to jQuery's `thisElement.after(newElement)`.\n * @param {Node} thisNode - The node to insert\n * @param {Node} newNode - Node to insert after in the tree\n * @returns {Node} - `thisNode` to allow for chaining\n */\n static after(thisNode, newNode) {\n thisNode.parentNode.insertBefore(newNode, thisNode.nextSibling);\n return thisNode;\n }\n\n /**\n * Gets the next sibling element that matches the selector.\n * @param {Element} element - Element to get the next sibling of\n * @param {string} [selector=\"\"] - Optional selector\n * @returns {Element} - The sibling element\n */\n static next(element, selector = \"\") {\n return selector ? element.querySelector(\"+ \" + selector) : element.nextElementSibling;\n }\n\n /**\n * Gets all subsequent siblings.\n * @param {Element} element - Element to get next siblings of\n * @returns {NodeList} - The list of siblings\n */\n static nextAll(element) {\n return element.querySelectorAll(\"~ *\");\n }\n\n /**\n * Gets the subsequent siblings until an element matches the selector.\n * @param {Element} element - Element to get the following siblings of\n * @param {string} selector - Selector to stop at\n * @returns {Array<Element>} - The list of siblings\n */\n static nextUntil(element, selector) {\n const next = []; \n while (element.nextElementSibling && !element.nextElementSibling.matches(selector)) next.push(element = element.nextElementSibling);\n return next;\n }\n\n /**\n * Gets the previous sibling element that matches the selector.\n * @param {Element} element - Element to get the previous sibling of\n * @param {string} [selector=\"\"] - Optional selector\n * @returns {Element} - The sibling element\n */\n static previous(element, selector = \"\") {\n const previous = element.previousElementSibling;\n if (selector) return previous && previous.matches(selector) ? previous : null;\n return previous;\n }\n\n /**\n * Gets all preceeding siblings.\n * @param {Element} element - Element to get preceeding siblings of\n * @returns {NodeList} - The list of siblings\n */\n static previousAll(element) {\n const previous = [];\n while (element.previousElementSibling) previous.push(element = element.previousElementSibling);\n return previous;\n }\n\n /**\n * Gets the preceeding siblings until an element matches the selector.\n * @param {Element} element - Element to get the preceeding siblings of\n * @param {string} selector - Selector to stop at\n * @returns {Array<Element>} - The list of siblings\n */\n static previousUntil(element, selector) {\n const previous = []; \n while (element.previousElementSibling && !element.previousElementSibling.matches(selector)) previous.push(element = element.previousElementSibling);\n return previous;\n }\n\n /**\n * Find which index in children a certain node is. Similar to jQuery's `$.index()`\n * @param {HTMLElement} node - The node to find its index in parent\n * @returns {number} Index of the node\n */\n static indexInParent(node) {\n const children = node.parentNode.childNodes;\n let num = 0;\n for (let i = 0; i < children.length; i++) {\n if (children[i] == node) return num;\n if (children[i].nodeType == 1) num++;\n }\n return -1;\n }\n\n /** Shorthand for {@link module:DOMTools.indexInParent} */\n static index(node) {return this.indexInParent(node);}\n\n /**\n * Gets the parent of the element if it matches the selector,\n * otherwise returns null.\n * @param {Element} element - Element to get parent of\n * @param {string} [selector=\"\"] - Selector to match parent\n * @returns {(Element|null)} - The sibling element or null\n */\n static parent(element, selector = \"\") {\n return !selector || element.parentElement.matches(selector) ? element.parentElement : null;\n }\n\n /**\n * Gets all children of Element that match the selector if provided.\n * @param {Element} element - Element to get all children of\n * @param {string} selector - Selector to match the children to\n * @returns {Array<Element>} - The list of children\n */\n static findChild(element, selector) {\n return element.querySelector(\":scope > \" + selector);\n }\n\n /**\n * Gets all children of Element that match the selector if provided.\n * @param {Element} element - Element to get all children of\n * @param {string} selector - Selector to match the children to\n * @returns {Array<Element>} - The list of children\n */\n static findChildren(element, selector) {\n return element.querySelectorAll(\":scope > \" + selector);\n }\n\n /**\n * Gets all ancestors of Element that match the selector if provided.\n * @param {Element} element - Element to get all parents of\n * @param {string} [selector=\"\"] - Selector to match the parents to\n * @returns {Array<Element>} - The list of parents\n */\n static parents(element, selector = \"\") {\n const parents = [];\n if (selector) while (element.parentElement && element.parentElement.closest(selector)) parents.push(element = element.parentElement.closest(selector));\n else while (element.parentElement) parents.push(element = element.parentElement);\n return parents;\n }\n\n /**\n * Gets the ancestors until an element matches the selector.\n * @param {Element} element - Element to get the ancestors of\n * @param {string} selector - Selector to stop at\n * @returns {Array<Element>} - The list of parents\n */\n static parentsUntil(element, selector) {\n const parents = [];\n while (element.parentElement && !element.parentElement.matches(selector)) parents.push(element = element.parentElement);\n return parents;\n }\n\n /**\n * Gets all siblings of the element that match the selector.\n * @param {Element} element - Element to get all siblings of\n * @param {string} [selector=\"*\"] - Selector to match the siblings to\n * @returns {Array<Element>} - The list of siblings\n */\n static siblings(element, selector = \"*\") {\n return Array.from(element.parentElement.children).filter(e => e != element && e.matches(selector));\n }\n\n /**\n * Sets or gets css styles for a specific element. If `value` is provided\n * then it sets the style and returns the element to allow for chaining,\n * otherwise returns the style. \n * @param {Element} element - Element to set the CSS of\n * @param {string} attribute - Attribute to get or set\n * @param {string} [value] - Value to set for attribute\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\n */\n static css(element, attribute, value) {\n if (typeof(value) == \"undefined\") return global.getComputedStyle(element)[attribute];\n element.style[attribute] = value;\n return element;\n }\n\n /**\n * Sets or gets the width for a specific element. If `value` is provided\n * then it sets the width and returns the element to allow for chaining,\n * otherwise returns the width. \n * @param {Element} element - Element to set the CSS of\n * @param {string} [value] - Width to set\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\n */\n static width(element, value) {\n if (typeof(value) == \"undefined\") return parseInt(getComputedStyle(element).width);\n element.style.width = value;\n return element;\n }\n\n /**\n * Sets or gets the height for a specific element. If `value` is provided\n * then it sets the height and returns the element to allow for chaining,\n * otherwise returns the height. \n * @param {Element} element - Element to set the CSS of\n * @param {string} [value] - Height to set\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\n */\n static height(element, value) {\n if (typeof(value) == \"undefined\") return parseInt(getComputedStyle(element).height);\n element.style.height = value;\n return element;\n }\n\n /**\n * Sets the inner text of an element if given a value, otherwise returns it.\n * @param {Element} element - Element to set the text of\n * @param {string} [text] - Content to set\n * @returns {string} - Either the string set by this call or the current text content of the node.\n */\n static text(element, text) {\n if (typeof(text) == \"undefined\") return element.textContent;\n return element.textContent = text;\n }\n\n /**\n * Returns the innerWidth of the element.\n * @param {Element} element - Element to retrieve inner width of\n * @return {number} - The inner width of the element.\n */\n static innerWidth(element) {\n return element.clientWidth;\n }\n\n /**\n * Returns the innerHeight of the element.\n * @param {Element} element - Element to retrieve inner height of\n * @return {number} - The inner height of the element.\n */\n static innerHeight(element) {\n return element.clientHeight;\n }\n\n /**\n * Returns the outerWidth of the element.\n * @param {Element} element - Element to retrieve outer width of\n * @return {number} - The outer width of the element.\n */\n static outerWidth(element) {\n return element.offsetWidth;\n }\n\n /**\n * Returns the outerHeight of the element.\n * @param {Element} element - Element to retrieve outer height of\n * @return {number} - The outer height of the element.\n */\n static outerHeight(element) {\n return element.offsetHeight;\n }\n\n /**\n * Gets the offset of the element in the page.\n * @param {Element} element - Element to get offset of\n * @return {Offset} - The offset of the element\n */\n static offset(element) {\n return element.getBoundingClientRect();\n }\n\n static get listeners() { return this._listeners || (this._listeners = {}); }\n\n /**\n * This is similar to jQuery's `on` function and can *hopefully* be used in the same way.\n * \n * Rather than attempt to explain, I'll show some example usages.\n * \n * The following will add a click listener (in the `myPlugin` namespace) to `element`.\n * `DOMTools.on(element, \"click.myPlugin\", () => {console.log(\"clicked!\");});`\n * \n * The following will add a click listener (in the `myPlugin` namespace) to `element` that only fires when the target is a `.block` element.\n * `DOMTools.on(element, \"click.myPlugin\", \".block\", () => {console.log(\"clicked!\");});`\n * \n * The following will add a click listener (without namespace) to `element`.\n * `DOMTools.on(element, \"click\", () => {console.log(\"clicked!\");});`\n * \n * The following will add a click listener (without namespace) to `element` that only fires once.\n * `const cancel = DOMTools.on(element, \"click\", () => {console.log(\"fired!\"); cancel();});`\n * \n * @param {Element} element - Element to add listener to\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\n * @param {(string|callable)} delegate - Selector to run on element to listen to\n * @param {callable} [callback] - Function to fire on event\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\n */\n static on(element, event, delegate, callback) {\n const [type, namespace] = event.split(\".\");\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? callback : function(event) {\n if (event.target.matches(delegate)) {\n callback(event);\n }\n };\n\n element.addEventListener(type, eventFunc);\n const cancel = () => {\n element.removeEventListener(type, eventFunc);\n };\n if (namespace) {\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\n const newCancel = () => {\n cancel();\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\n };\n this.listeners[namespace].push({\n event: type,\n element: element,\n cancel: newCancel\n });\n return newCancel;\n }\n return cancel;\n }\n\n /**\n * Functionality for this method matches {@link module:DOMTools.on} but automatically cancels itself\n * and removes the listener upon the first firing of the desired event.\n * \n * @param {Element} element - Element to add listener to\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\n * @param {(string|callable)} delegate - Selector to run on element to listen to\n * @param {callable} [callback] - Function to fire on event\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\n */\n static once(element, event, delegate, callback) {\n const [type, namespace] = event.split(\".\");\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? function(event) {\n callback(event);\n element.removeEventListener(type, eventFunc);\n } : function(event) {\n if (!event.target.matches(delegate)) return;\n callback(event);\n element.removeEventListener(type, eventFunc);\n };\n\n element.addEventListener(type, eventFunc);\n const cancel = () => {\n element.removeEventListener(type, eventFunc);\n };\n if (namespace) {\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\n const newCancel = () => {\n cancel();\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\n };\n this.listeners[namespace].push({\n event: type,\n element: element,\n cancel: newCancel\n });\n return newCancel;\n }\n return cancel;\n }\n\n static __offAll(event, element) {\n const [type, namespace] = event.split(\".\");\n let matchFilter = listener => listener.event == type, defaultFilter = _ => _;\n if (element) matchFilter = l => l.event == type && l.element == element, defaultFilter = l => l.element == element;\n const listeners = this.listeners[namespace] || [];\n const list = type ? listeners.filter(matchFilter) : listeners.filter(defaultFilter);\n for (let c = 0; c < list.length; c++) list[c].cancel();\n }\n \n /**\n * This is similar to jQuery's `off` function and can *hopefully* be used in the same way.\n * \n * Rather than attempt to explain, I'll show some example usages.\n * \n * The following will remove a click listener called `onClick` (in the `myPlugin` namespace) from `element`.\n * `DOMTools.off(element, \"click.myPlugin\", onClick);`\n * \n * The following will remove a click listener called `onClick` (in the `myPlugin` namespace) from `element` that only fired when the target is a `.block` element.\n * `DOMTools.off(element, \"click.myPlugin\", \".block\", onClick);`\n * \n * The following will remove a click listener (without namespace) from `element`.\n * `DOMTools.off(element, \"click\", onClick);`\n * \n * The following will remove all listeners in namespace `myPlugin` from `element`.\n * `DOMTools.off(element, \".myPlugin\");`\n * \n * The following will remove all click listeners in namespace `myPlugin` from *all elements*.\n * `DOMTools.off(\"click.myPlugin\");`\n * \n * The following will remove all listeners in namespace `myPlugin` from *all elements*.\n * `DOMTools.off(\".myPlugin\");`\n * \n * @param {(Element|string)} element - Element to remove listener from\n * @param {string} [event] - Event to listen to with option namespace (e.g. \"event.namespace\")\n * @param {(string|callable)} [delegate] - Selector to run on element to listen to\n * @param {callable} [callback] - Function to fire on event\n * @returns {Element} - The original element to allow for chaining\n */\n static off(element, event, delegate, callback) {\n if (typeof(element) == \"string\") return this.__offAll(element);\n const [type, namespace] = event.split(\".\");\n if (namespace) return this.__offAll(event, element);\n\n const hasDelegate = delegate && callback;\n if (!callback) callback = delegate;\n const eventFunc = !hasDelegate ? callback : function(event) {\n if (event.target.matches(delegate)) {\n callback(event);\n }\n };\n\n element.removeEventListener(type, eventFunc);\n return element;\n }\n\n /**\n * Adds a listener for when the node is added/removed from the document body.\n * The listener is automatically removed upon firing.\n * @param {HTMLElement} node - node to wait for\n * @param {callable} callback - function to be performed on event\n * @param {boolean} onMount - determines if it should fire on Mount or on Unmount\n */\n static onMountChange(node, callback, onMount = true) {\n const wrappedCallback = () => {\n this.observer.unsubscribe(wrappedCallback);\n callback();\n };\n this.observer.subscribe(wrappedCallback, mutation => {\n const nodes = Array.from(onMount ? mutation.addedNodes : mutation.removedNodes);\n const directMatch = nodes.indexOf(node) > -1;\n const parentMatch = nodes.some(parent => parent.contains(node));\n return directMatch || parentMatch;\n });\n return node;\n }\n\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `true` */\n static onMount(node, callback) { return this.onMountChange(node, callback); }\n\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `false` */\n static onUnmount(node, callback) { return this.onMountChange(node, callback, false); }\n\n /** Alias for {@link module:DOMTools.onMount} */\n static onAdded(node, callback) { return this.onMount(node, callback); }\n\n /** Alias for {@link module:DOMTools.onUnmount} */\n static onRemoved(node, callback) { return this.onUnmount(node, callback, false); }\n\n /**\n * Helper function which combines multiple elements into one parent element\n * @param {Array<HTMLElement>} elements - array of elements to put into a single parent\n */\n static wrap(elements) {\n const domWrapper = this.parseHTML(`<div class=\"dom-wrapper\"></div>`);\n for (let e = 0; e < elements.length; e++) domWrapper.appendChild(elements[e]);\n return domWrapper;\n }\n\n /**\n * Resolves the node to an HTMLElement. This is mainly used by library modules.\n * @param {(jQuery|Element)} node - node to resolve\n */\n static resolveElement(node) {\n if (!(node instanceof jQuery) && !(node instanceof Element)) return undefined;\n return node instanceof jQuery ? node[0] : node;\n }\n}\n\nwindow.Lightcord.BetterDiscord.DOM = DOMTools","import {bdthemeErrors, themeCookie, settingsCookie, bdthemes} from \"../0globals\";\nimport ContentManager from \"./contentManager\";\nimport DataStore from \"./dataStore\";\nimport BDEvents from \"./bdEvents\";\nimport Utils from \"./utils\";\nimport DOM from \"./domtools\";\nimport bdEvents from \"./bdEvents\";\n\nclass ThemeModule {\n constructor(){\n window.Lightcord.BetterDiscord.ThemeModule = this\n }\n get folder() {return ContentManager.themesFolder;}\n}\n\nThemeModule.prototype.loadThemes = async function () {\n this.loadThemeData();\n bdthemeErrors.splice(0, 0, ...(await ContentManager.loadThemes()));\n const themes = Object.keys(bdthemes);\n\n for (let i = 0; i < themes.length; i++) {\n const theme = bdthemes[themes[i]];\n if (!themeCookie[theme.name]) themeCookie[theme.name] = false;\n if (themeCookie[theme.name]) DOM.addStyle(DOM.escapeID(theme.id), unescape(theme.css));\n\n await new Promise((resolve) => setTimeout(resolve, 10))\n }\n for (const theme in themeCookie) {\n if (!bdthemes[theme]) delete themeCookie[theme];\n }\n this.saveThemeData();\n // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"theme\");\n};\n\nThemeModule.prototype.enableTheme = function(name, reload = false) {\n themeCookie[name] = true;\n this.saveThemeData();\n const theme = bdthemes[name];\n DOM.addStyle(DOM.escapeID(theme.id), unescape(theme.css));\n bdEvents.dispatch(\"theme-enabled\")\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${theme.name} v${theme.version} has been applied.`);\n};\n\nThemeModule.prototype.enable = function (name, reload = false) {\n return this.enableTheme(name, reload);\n};\n\nThemeModule.prototype.disableTheme = function(name, reload = false) {\n themeCookie[name] = false;\n this.saveThemeData();\n const theme = bdthemes[name];\n DOM.removeStyle(DOM.escapeID(theme.id));\n bdEvents.dispatch(\"theme-disabled\")\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${theme.name} v${theme.version} has been disabled.`);\n};\n\nThemeModule.prototype.disable = function (name, reload = false) {\n return this.disableTheme(name, reload);\n};\n\nThemeModule.prototype.toggleTheme = function(theme) {\n if (themeCookie[theme]) this.disableTheme(theme);\n else this.enableTheme(theme);\n};\n\nThemeModule.prototype.toggle = function (name) {\n return this.toggleTheme(name);\n};\n\nThemeModule.prototype.loadTheme = async function(filename) {\n const error = await ContentManager.loadContent(filename, \"theme\");\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${filename} could not be loaded. It may not have been loaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n const theme = Object.values(bdthemes).find(p => p.filename == filename);\n Utils.log(\"ContentManager\", `${theme.name} v${theme.version} was loaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme.name} v${theme.version} was loaded.`, {type: \"success\"});\n BDEvents.dispatch(\"theme-loaded\", theme.name);\n};\n\nThemeModule.prototype.unloadTheme = function(filenameOrName) {\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdtheme) return;\n const theme = bdtheme.name;\n if (themeCookie[theme]) this.disableTheme(theme, true);\n const error = ContentManager.unloadContent(bdthemes[theme].filename, \"theme\");\n delete bdthemes[theme];\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} could not be unloaded. It may have not been loaded yet.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${theme} could not be unloaded. It may have not been loaded yet.`, error);\n }\n Utils.log(\"ContentManager\", `${theme} was unloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} was unloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"theme-unloaded\", theme);\n};\n\nThemeModule.prototype.delete = function(filenameOrName) {\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdtheme) return;\n this.unloadTheme(bdtheme.filename);\n const fullPath = require(\"path\").resolve(ContentManager.themesFolder, bdtheme.filename);\n require(\"fs\").unlinkSync(fullPath);\n};\n\nThemeModule.prototype.reloadTheme = async function(filenameOrName) {\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdtheme) return this.loadTheme(filenameOrName);\n const theme = bdtheme.name;\n const error = await ContentManager.reloadContent(bdthemes[theme].filename, \"theme\");\n if (themeCookie[theme]) this.disableTheme(theme, true), this.enableTheme(theme, true);\n if (error) {\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} could not be reloaded.`, {type: \"error\"});\n return Utils.err(\"ContentManager\", `${theme} could not be reloaded.`, error);\n }\n Utils.log(\"ContentManager\", `${theme} v${bdthemes[theme].version} was reloaded.`);\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} v${bdthemes[theme].version} was reloaded.`, {type: \"success\"});\n BDEvents.dispatch(\"theme-reloaded\", theme);\n};\n\nThemeModule.prototype.reload = function(name) {\n return this.reloadTheme(name);\n};\n\nThemeModule.prototype.edit = function(filenameOrName) {\n const bdplugin = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\n if (!bdplugin) return;\n const fullPath = require(\"path\").resolve(ContentManager.themesFolder, bdplugin.filename);\n require(\"electron\").shell.openExternal(`${fullPath}`);\n};\n\nThemeModule.prototype.updateThemeList = function() {\n const results = ContentManager.loadNewContent(\"theme\");\n for (const filename of results.added) this.loadTheme(filename);\n for (const name of results.removed) this.unloadTheme(name);\n};\n\nThemeModule.prototype.loadThemeData = function() {\n const saved = DataStore.getSettingGroup(\"themes\");\n if (saved) {\n Object.assign(themeCookie, saved);\n }\n};\n\nThemeModule.prototype.saveThemeData = function () {\n DataStore.setSettingGroup(\"themes\", themeCookie);\n};\n\nexport default new ThemeModule();","import {settings} from \"../0globals\";\nimport themeModule from \"./themeModule\";\n\nexport default new class V2 {\n\n constructor() {\n this.editorDetached = false;\n this.WebpackModules = (() => {\n const req = webpackJsonp.push([[], {__extra_id__: (module, exports, req) => module.exports = req}, [[\"__extra_id__\"]]]);\n delete req.m.__extra_id__;\n delete req.c.__extra_id__;\n\n const shouldProtect = theModule => {\n if (theModule.remove && theModule.set && theModule.clear && theModule.get && !theModule.sort) return true;\n if (theModule.getToken || theModule.getEmail || theModule.showToken) return true;\n return false;\n };\n\n const protect = (theModule, isDefault) => {\n let mod = !isDefault ? theModule.default : theModule\n if(!mod)return theModule\n if (mod.remove && mod.set && mod.clear && mod.get && !mod.sort) return null;\n if (!mod.getToken && !mod.getEmail && !mod.showToken)return theModule\n\n const proxy = new Proxy(mod, {\n getOwnPropertyDescriptor: function(obj, prop) {\n if (prop === \"getToken\" || prop === \"getEmail\" || prop === \"showToken\") return undefined;\n return Object.getOwnPropertyDescriptor(obj, prop);\n },\n get: function(obj, func) {\n if (func == \"getToken\" && obj.getToken) return () => \"mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa\";\n if (func == \"getEmail\" && obj.getEmail) return () => \"puppet11112@gmail.com\";\n if (func == \"showToken\" && obj.showToken) return () => true;\n if (func == \"__proto__\" && obj.__proto__) return proxy;\n \n return obj[func];\n }\n });\n\n if(!isDefault){\n return Object.assign({}, theModule, {default: proxy})\n }\n\n return proxy;\n };\n\n const find = (filter) => {\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) return protect(m.default, true);\n if (m && filter(m))\treturn protect(m, false);\n }\n }\n // console.warn(\"Cannot find loaded module in cache\");\n return null;\n };\n\n const findAll = (filter) => {\n const modules = [];\n for (const i in req.c) {\n if (req.c.hasOwnProperty(i)) {\n const m = req.c[i].exports;\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(protect(m.default, true));\n else if (m && filter(m)) modules.push(protect(m, false));\n }\n }\n return modules;\n };\n\n const findByUniqueProperties = (propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\n const findByPrototypes = (protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\n const findByDisplayName = (displayName) => find(module => module.displayName === displayName);\n\n return {find, findAll, findByUniqueProperties, findByPrototypes, findByDisplayName};\n })();\n\n this.internal = {\n react: this.WebpackModules.findByUniqueProperties([\"Component\", \"PureComponent\", \"Children\", \"createElement\", \"cloneElement\"]),\n reactDom: this.WebpackModules.findByUniqueProperties([\"findDOMNode\"])\n };\n this.getInternalInstance = e => e[Object.keys(e).find(k => k.startsWith(\"__reactInternalInstance\"))];\n window.Lightcord.BetterDiscord.V2 = this\n }\n\n initialize() {\n\n }\n\n joinBD1() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"0Tmfo5ZbORCRqbAd\");}\n leaveBD1() {this.GuildActions.leaveGuild(\"86004744966914048\");}\n\n joinBD2() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"2HScm8j\");}\n leaveBD2() {this.GuildActions.leaveGuild(\"280806472928198656\");}\n\n joinLC() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"7eFff2A\");}\n leaveLC() {this.GuildActions.leaveGuild(\"705908350218666117\");}\n\n /**\n * @type {typeof React}\n */\n get react() {return this.internal.react;}\n /**\n * @type {typeof React}\n */\n get React() {return this.internal.react;}\n /**\n * @type {typeof import(\"react-dom\")}\n */\n get reactDom() {return this.internal.reactDom;}\n /**\n * @type {typeof import(\"react-dom\")}\n */\n get ReactDom() {return this.internal.reactDom;}\n /**\n * @type {typeof React.Component}\n */\n get reactComponent() {return this.internal.react.Component;}\n /**\n * @type {typeof React.Component}\n */\n get ReactComponent() {return this.internal.react.Component;}\n\n get anchorClasses() {return this.WebpackModules.findByUniqueProperties([\"anchorUnderlineOnHover\"]) || {anchor: \"anchor-3Z-8Bb\", anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"};}\n get slateEditorClasses() {return this.WebpackModules.findByUniqueProperties([\"slateTextArea\"]);}\n get messageClasses() {return this.WebpackModules.findByUniqueProperties([\"message\", \"containerCozy\"]);}\n get guildClasses() {\n\t\tconst guildsWrapper = BDModules.get(e => e.wrapper && e.unreadMentionsBar)[0];\n const guilds = BDModules.get(e => e.guildsError && e.selected)[0]\n const pill = BDModules.get(e => e.blobContainer)[0]\n return Object.assign({}, guildsWrapper, guilds, pill);\n\t}\n\n get MessageContentComponent() {return this.WebpackModules.find(m => m.defaultProps && m.defaultProps.hasOwnProperty(\"disableButtons\"));}\n get MessageComponent() {return this.WebpackModules.find(m => m.default && m.default.displayName && m.default.displayName == \"Message\");}\n get TimeFormatter() {return this.WebpackModules.findByUniqueProperties([\"dateFormat\"]);}\n get TooltipWrapper() {return this.WebpackModules.findByDisplayName(\"Tooltip\");}\n get NativeModule() {return this.WebpackModules.findByUniqueProperties([\"setBadge\"]);}\n get InviteActions() {return this.WebpackModules.findByUniqueProperties([\"acceptInvite\"]);}\n get GuildActions() {return this.WebpackModules.findByUniqueProperties([\"leaveGuild\"]);}\n get Tooltips() {return this.WebpackModules.find(m => m.hide && m.show && !m.search && !m.submit && !m.search && !m.activateRagingDemon && !m.dismiss);}\n get KeyGenerator() {return this.WebpackModules.find(m => m.toString && /\"binary\"/.test(m.toString()));}\n get LayerStack() {return this.WebpackModules.findByUniqueProperties([\"popLayer\"]);}\n get UserStore() {return this.WebpackModules.findByUniqueProperties([\"getCurrentUser\"]);}\n get ChannelStore() {return this.WebpackModules.findByUniqueProperties([\"getChannel\"]);}\n get ChannelActions() {return this.WebpackModules.findByUniqueProperties([\"openPrivateChannel\"]);}\n get PrivateChannelActions() {return this.WebpackModules.findByUniqueProperties([\"selectPrivateChannel\"]);}\n\n openDM(userId) {\n const selfId = this.UserStore.getCurrentUser().id;\n if (selfId == userId) return;\n const privateChannelId = this.ChannelStore.getDMFromUserId(userId);\n if (privateChannelId) return this.PrivateChannelActions.selectPrivateChannel(privateChannelId);\n this.ChannelActions.openPrivateChannel(selfId, userId);\n }\n\n parseSettings(cat) {\n return Object.keys(settings).reduce((arr, key) => {\n const setting = settings[key];\n if (setting.cat === cat && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n } return arr;\n }, []);\n }\n\n};","import {bbdVersion} from \"../0globals\";\nimport WebpackModules from \"./webpackModules\";\nimport BDV2 from \"./v2\";\nimport DOM from \"./domtools\";\nexport default class Utils {\n /** Document/window width */\n static get screenWidth() { return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); }\n /** Document/window height */\n static get screenHeight() { return Math.max(document.documentElement.clientHeight, window.innerHeight || 0); }\n\n static get WindowConfigFile() {\n return this._windowConfigFile = null;\n }\n\n static getAllWindowPreferences() {\n return {\n transparent: true,\n frame: false\n };\n }\n \n static getWindowPreference(key) {\n if (key === \"transparent\") return true;\n if (key === \"frame\") return false;\n return null;\n }\n \n static setWindowPreference(key, value) {\n if (key === \"transparent\") return true;\n if (key === \"frame\") return false;\n return null;\n }\n\n static stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n }\n\n static getTextArea() {\n return DOM.query(\".\"+removeDa(BDModules.get(e => e.channelTextArea && e.titleWrapper)[0].channelTextArea)+\" textarea\");\n }\n\n static insertText(textarea, text) {\n textarea.focus();\n textarea.selectionStart = 0;\n textarea.selectionEnd = textarea.value.length;\n document.execCommand(\"insertText\", false, text);\n }\n\n static escapeID(id) {\n return id.replace(/^[^a-z]+|[^\\w-]+/gi, \"-\");\n }\n\n static log(moduleName, message) {\n console.log(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: #3a71c1; font-weight: 700;\", \"color: #3a71c1;\", \"\");\n }\n\n static warn(moduleName, message) {\n console.warn(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: #E8A400; font-weight: 700;\", \"color: #E8A400;\", \"\");\n }\n\n static err(moduleName, message, error) {\n console.log(`%c[BandagedBD]%c [${moduleName}]%c ${message}`, \"color: red; font-weight: 700;\", \"color: red;\", \"\");\n if (error) {\n console.groupCollapsed(\"%cError: \" + error.message, \"color: red;\");\n console.error(error.stack);\n console.groupEnd();\n }\n }\n\n /**\n * Format strings with placeholders (`{{placeholder}}`) into full strings.\n * Quick example: `PluginUtilities.formatString(\"Hello, {{user}}\", {user: \"Zerebos\"})`\n * would return \"Hello, Zerebos\".\n * @param {string} string - string to format\n * @param {object} values - object literal of placeholders to replacements\n * @returns {string} the properly formatted string\n */\n static formatString(string, values) {\n for (const val in values) {\n let replacement = values[val];\n if (Array.isArray(replacement)) replacement = JSON.stringify(replacement);\n if (typeof(replacement) === \"object\" && replacement !== null) replacement = replacement.toString();\n string = string.replace(new RegExp(`{{${val}}}`, \"g\"), replacement);\n }\n return string;\n }\n\n static escape(s) {\n return s.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n }\n\n static testJSON(data) {\n try {\n return JSON.parse(data);\n }\n catch (err) {\n return false;\n }\n }\n\n static isEmpty(obj) {\n if (obj == null || obj == undefined || obj == \"\") return true;\n if (typeof(obj) !== \"object\") return false;\n if (Array.isArray(obj)) return obj.length == 0;\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) return false;\n }\n return true;\n }\n\n static suppressErrors(method, message) {\n return (...params) => {\n try { return method(...params);\t}\n catch (e) { this.err(\"SuppressedError\", \"Error occurred in \" + message, e); }\n };\n }\n\n static monkeyPatch(what, methodName, options) {\n const {before, after, instead, once = false, silent = false, force = false} = options;\n const displayName = options.displayName || what.displayName || what[methodName].displayName || what.name || what.constructor.displayName || what.constructor.name;\n if (!silent) console.log(\"patch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n if (!what[methodName]) {\n if (force) what[methodName] = function() {};\n else return console.error(methodName, \"does not exist for\", displayName); // eslint-disable-line no-console\n }\n const origMethod = what[methodName];\n let canceled = false\n const cancel = () => {\n if (!silent) console.log(\"unpatch\", methodName, \"of\", displayName); // eslint-disable-line no-console\n //what[methodName] = origMethod;\n canceled = true // this allow to monkeypatch more than one time.\n };\n what[methodName] = function() {\n if(canceled){\n return origMethod.call(this, ...arguments)\n }\n const data = {\n thisObject: this,\n methodArguments: arguments,\n cancelPatch: cancel,\n originalMethod: origMethod,\n callOriginalMethod: () => data.returnValue = data.originalMethod.apply(data.thisObject, data.methodArguments)\n };\n if (instead) {\n const tempRet = Utils.suppressErrors(instead, \"`instead` callback of \" + what[methodName].displayName)(data);\n if (tempRet !== undefined) data.returnValue = tempRet;\n }\n else {\n if (before) Utils.suppressErrors(before, \"`before` callback of \" + what[methodName].displayName)(data);\n data.callOriginalMethod();\n if (after) Utils.suppressErrors(after, \"`after` callback of \" + what[methodName].displayName)(data);\n }\n if (once) cancel();\n return data.returnValue;\n };\n Object.assign(what[methodName], origMethod);\n what[methodName].__monkeyPatched = true;\n what[methodName].displayName = displayName;\n if (!what[methodName].__originalMethod) {\n what[methodName].__originalMethod = origMethod;\n what[methodName].toString = function() {return origMethod.toString();};\n }\n return cancel;\n }\n\n static onRemoved(node, callback) {\n const observer = new MutationObserver((mutations) => {\n for (let m = 0; m < mutations.length; m++) {\n const mutation = mutations[m];\n const nodes = Array.from(mutation.removedNodes);\n const directMatch = nodes.indexOf(node) > -1;\n const parentMatch = nodes.some(parent => parent.contains(node));\n if (directMatch || parentMatch) {\n observer.disconnect();\n callback();\n }\n }\n });\n\n observer.observe(document.body, {subtree: true, childList: true});\n }\n\n static getNestedProp(obj, path) {\n return path.split(/\\s?\\.\\s?/).reduce(function(obj, prop) {\n return obj && obj[prop];\n }, obj);\n }\n\n /**\n * This shows a toast similar to android towards the bottom of the screen.\n *\n * @param {string} content The string to show in the toast.\n * @param {object} options Options object. Optional parameter.\n * @param {string} options.type Changes the type of the toast stylistically and semantically. Choices: \"\", \"info\", \"success\", \"danger\"/\"error\", \"warning\"/\"warn\". Default: \"\"\n * @param {boolean} options.icon Determines whether the icon should show corresponding to the type. A toast without type will always have no icon. Default: true\n * @param {number} options.timeout Adjusts the time (in ms) the toast should be shown for before disappearing automatically. Default: 3000\n */\n static showToast(content, options = {}) {\n if (!document.querySelector(\".bd-toasts\")) {\n const container = document.querySelector(\".\"+removeDa(BDModules.get(e => e.sidebar && e.hasNotice)[0].sidebar)+\" + div\") || null;\n const form = container ? container.querySelector(\"form\") : null;\n const bottom = form ? form.offsetHeight : 80;\n const toastWrapper = document.createElement(\"div\");\n toastWrapper.classList.add(\"bd-toasts\");\n toastWrapper.style.setProperty(\"bottom\", bottom+\"px\");\n document.querySelector(\"#app-mount\").appendChild(toastWrapper);\n }\n const toastWrapper = document.querySelector(\".bd-toasts\")\n const {type = \"\", icon = true, timeout = 3000} = options;\n const toastElem = document.createElement(\"div\");\n toastElem.classList.add(\"bd-toast\");\n if (type) toastElem.classList.add(\"toast-\" + type);\n if (type && icon) toastElem.classList.add(\"icon\");\n toastElem.innerText = content;\n toastWrapper.appendChild(toastElem);\n toastWrapper.style.setProperty(\"left\", `calc(50% - ${toastWrapper.offsetWidth / 2}px)`);\n setTimeout(() => {\n toastElem.classList.add(\"closing\");\n setTimeout(() => {\n toastElem.remove();\n if (!document.querySelectorAll(\".bd-toasts .bd-toast\").length) document.querySelector(\".bd-toasts\").remove();\n }, 300);\n }, timeout);\n }\n\n static alert(title, content) {\n let modalModule = BDModules.get(e => e.modal && e.inner && !e.hideOnFullscreen)[0]\n let headerModule = BDModules.get(e => e.header && e.responsiveWidthMobile && e.hideOnFullscreen)[0]\n let footer2Module = BDModules.get(e => e.header && e.responsiveWidthMobile && e.focusLock)[0]\n const modal = DOM.createElement(`<div class=\"bd-modal-wrapper theme-dark\">\n <div class=\"bd-backdrop ${BDModules.get(e => e.backdrop && e.backdropWithLayer)[0].backdrop}\"></div>\n <div class=\"bd-modal ${modalModule.modal}\">\n <div class=\"bd-modal-inner ${modalModule.inner}\">\n <div class=\"header ${headerModule.header}\">\n <div class=\"title\">${title}</div>\n </div>\n <div class=\"bd-modal-body\">\n <div class=\"scroller-wrap fade\">\n <div class=\"scroller\">\n ${content}\n </div>\n </div>\n </div>\n <div class=\"footer ${headerModule.footer} ${footer2Module.footer}\">\n <button type=\"button\">Okay</button>\n </div>\n </div>\n </div>\n </div>`);\n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { \n modal.remove(); \n closingListeners.forEach((listener) => {\n try{\n listener()\n }catch(e){\n console.error(e)\n }\n })\n }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { \n modal.remove(); \n closingListeners.forEach((listener) => {\n try{\n listener()\n }catch(e){\n console.error(e)\n }\n })\n }, 300);\n });\n DOM.query(\"#app-mount\").append(modal);\n const closingListeners = []\n return {\n close: () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { \n modal.remove(); \n closingListeners.forEach((listener) => {\n try{\n listener()\n }catch(e){\n console.error(e)\n }\n })\n }, 300);\n },\n onClose: (listener) => {\n closingListeners.push(listener)\n }\n }\n }\n\n static showContentErrors({plugins: pluginErrors = [], themes: themeErrors = []}) {\n if (!pluginErrors || !themeErrors) return;\n if (!pluginErrors.length && !themeErrors.length) return;\n let modalModule = BDModules.get(e => e.modal && e.inner && !e.hideOnFullscreen)[0]\n let headerModule = BDModules.get(e => e.header && e.responsiveWidthMobile && e.hideOnFullscreen)[0]\n let footer2Module = BDModules.get(e => e.header && e.responsiveWidthMobile && e.focusLock)[0]\n const modal = DOM.createElement(`<div class=\"bd-modal-wrapper theme-dark\">\n <div class=\"bd-backdrop ${BDModules.get(e => e.backdrop && e.backdropWithLayer)[0].backdrop}\"></div>\n <div class=\"bd-modal bd-content-modal ${modalModule.modal}\">\n <div class=\"bd-modal-inner ${modalModule.inner}\">\n <div class=\"header ${headerModule.header}\"><div class=\"title\">Content Errors</div></div>\n <div class=\"bd-modal-body\">\n <div class=\"tab-bar-container\">\n <div class=\"tab-bar TOP\">\n <div class=\"tab-bar-item\">Plugins</div>\n <div class=\"tab-bar-item\">Themes</div>\n </div>\n </div>\n <div class=\"table-header\">\n <div class=\"table-column column-name\">Name</div>\n <div class=\"table-column column-message\">Message</div>\n <div class=\"table-column column-error\">Error</div>\n </div>\n <div class=\"scroller-wrap fade\">\n <div class=\"scroller\">\n \n </div>\n </div>\n </div>\n <div class=\"footer ${headerModule.footer} ${footer2Module.footer}\">\n <button type=\"button\">Okay</button>\n </div>\n </div>\n </div>\n </div>`);\n \n function generateTab(errors) {\n const container = DOM.createElement(`<div class=\"errors\">`);\n for (const err of errors) {\n const error = DOM.createElement(`<div class=\"error\">\n <div class=\"table-column column-name\">${err.name ? err.name : err.file}</div>\n <div class=\"table-column column-message\">${err.message}</div>\n <div class=\"table-column column-error\"><a class=\"error-link\" href=\"\">${err.error ? err.error.message : \"\"}</a></div>\n </div>`);\n container.append(error);\n if (err.error) {\n error.querySelectorAll(\"a\").forEach(el => el.addEventListener(\"click\", (e) => {\n e.preventDefault();\n Utils.err(\"ContentManager\", `Error details for ${err.name ? err.name : err.file}.`, err.error);\n }));\n }\n }\n return container;\n }\n \n const tabs = [generateTab(pluginErrors), generateTab(themeErrors)];\n \n modal.querySelectorAll(\".tab-bar-item\").forEach(el => el.addEventListener(\"click\", (e) => {\n e.preventDefault();\n const selected = modal.querySelector(\".tab-bar-item.selected\");\n if (selected) DOM.removeClass(selected, \"selected\");\n DOM.addClass(e.target, \"selected\");\n const scroller = modal.querySelector(\".scroller\");\n scroller.innerHTML = \"\";\n scroller.append(tabs[DOM.index(e.target)]);\n }));\n \n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { modal.remove(); }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n DOM.addClass(modal, \"closing\");\n setTimeout(() => { modal.remove(); }, 300);\n });\n DOM.query(\"#app-mount\").append(modal);\n if (pluginErrors.length) modal.querySelector(\".tab-bar-item\").click();\n else modal.querySelectorAll(\".tab-bar-item\")[1].click();\n }\n\n static showChangelogModal(options = {}) {\n const ModalStack = WebpackModules.findByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n const ChangelogClasses = WebpackModules.findByProps(\"fixed\", \"improved\");\n const TextElement = WebpackModules.findByDisplayName(\"Text\");\n const FlexChild = WebpackModules.findByProps(\"Child\");\n const Titles = WebpackModules.findByProps(\"Tags\", \"default\");\n const Changelog = WebpackModules.find(m => m.defaultProps && m.defaultProps.selectable == false);\n const MarkdownParser = WebpackModules.findByProps(\"defaultRules\", \"parse\");\n if (!Changelog || !ModalStack || !ChangelogClasses || !TextElement || !FlexChild || !Titles || !MarkdownParser) return;\n \n const {\n image = \"https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5\", \n description = \"\", \n changes = [], \n title = \"BandagedBD\", \n subtitle = `v${bbdVersion}`, \n footer\n } = options;\n const ce = BDV2.React.createElement;\n const changelogItems = [ce(\"img\", {src: image})];\n if (description) changelogItems.push(ce(\"p\", null, MarkdownParser.parse(description)));\n for (let c = 0; c < changes.length; c++) {\n const entry = changes[c];\n const type = ChangelogClasses[entry.type] ? ChangelogClasses[entry.type] : ChangelogClasses.added;\n const margin = c == 0 ? ChangelogClasses.marginTop : \"\";\n changelogItems.push(ce(\"h1\", {className: `${type} ${margin}`,}, entry.title));\n const list = ce(\"ul\", null, entry.items.map(i => ce(\"li\", null, MarkdownParser.parse(i))));\n changelogItems.push(list);\n }\n const renderHeader = function() {\n return ce(FlexChild.Child, {grow: 1, shrink: 1},\n ce(Titles.default, {tag: Titles.Tags.H4}, title),\n ce(TextElement,{size: TextElement.Sizes.SMALL, color: TextElement.Colors.STANDARD, className: ChangelogClasses.date}, subtitle)\n );\n };\n \n const renderFooter = () => {\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n const AnchorClasses = WebpackModules.findByProps(\"anchorUnderlineOnHover\") || {anchor: \"anchor-3Z-8Bb\", anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"};\n const joinSupportServer = (click) => {\n click.preventDefault();\n click.stopPropagation();\n ModalStack.pop();\n BDV2.joinBD2();\n };\n const supportLink = Anchor ? ce(Anchor, {onClick: joinSupportServer}, \"Join our Discord Server.\") : ce(\"a\", {className: `${AnchorClasses.anchor} ${AnchorClasses.anchorUnderlineOnHover}`, onClick: joinSupportServer}, \"Join our Discord Server.\");\n const defaultFooter = ce(TextElement,{size: TextElement.Sizes.SMALL, color: TextElement.Colors.STANDARD}, \"Need support? \", supportLink);\n return ce(FlexChild.Child, {grow: 1, shrink: 1}, footer ? footer : defaultFooter);\n };\n\n return ModalStack.push(function(props) {\n return ce(Changelog, Object.assign({\n className: ChangelogClasses.container,\n selectable: true,\n onScroll: _ => _,\n onClose: _ => _,\n renderHeader: renderHeader,\n renderFooter: renderFooter,\n children: changelogItems\n }, props));\n });\n }\n\n /**\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\n * @param {string} title - title of the modal\n * @param {(string|ReactElement|Array<string|ReactElement>)} children - a single or mixed array of react elements and strings. Every string is wrapped in Discord's `Markdown` component so strings will show and render properly.\n * @param {object} [options] - options to modify the modal\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\n * @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned\n * @returns {string} - the key used for this modal\n */\n static showConfirmationModal(title, content, options = {}) {\n const ModalActions = WebpackModules.findByProps(\"openModal\", \"updateModal\");\n const Markdown = WebpackModules.findByDisplayName(\"Markdown\");\n const ConfirmationModal = WebpackModules.findByDisplayName(\"ConfirmModal\");\n if (!ModalActions || !ConfirmationModal || !Markdown) return Utils.alert(title, content);\n\n const emptyFunction = () => {};\n const {onConfirm = emptyFunction, onCancel = emptyFunction, confirmText = \"Okay\", cancelText = \"Cancel\", danger = false, key = undefined} = options;\n\n if (!Array.isArray(content)) content = [content];\n content = content.map(c => typeof(c) === \"string\" ? BDV2.React.createElement(Markdown, null, c) : c);\n return ModalActions.openModal(props => {\n return BDV2.React.createElement(ConfirmationModal, Object.assign({\n header: title,\n red: danger,\n confirmText: confirmText,\n cancelText: cancelText,\n onConfirm: onConfirm,\n onCancel: onCancel\n }, props), content);\n }, {modalKey: key});\n }\n\n static get removeDa(){\n return removeDa\n }\n}\n\nfunction removeDa(className){\n if(!className)return className\n return className.split(\" \").filter(e => !e.startsWith(\"da-\")).join(\" \")\n}\n\nUtils.showToast = Utils.suppressErrors(Utils.showToast, \"Could not show toast.\");\n\nwindow.Lightcord.BetterDiscord.Utils = Utils","export default class V2_SettingsPanel_Sidebar {\n\n constructor() {\n this.panels = {}\n }\n\n register(panel, component){\n this.panels[panel] = component\n }\n\n getComponent(panel, sidebar){\n return this.panels[panel](sidebar)\n }\n\n get items() {\n return [{\n text: \"BetterDiscord Settings\", \n id: \"core\"\n }, {\n text: \"Plugins\", \n id: \"plugins\"\n }, {\n text: \"Themes\", \n id: \"themes\"\n }, {\n text: \"Custom CSS\", \n id: \"customcss\"\n }];\n }\n\n get LCitems(){\n let items = [\n {\n text: \"Lightcord Settings\",\n id: \"lightcord\"\n }, {\n text: \"RichPresence\", \n id: \"status\"\n }, {\n text: \"Account Info\",\n id: \"accountinfo\"\n }\n ]\n return items\n }\n\n get LCDevItems(){\n let items = []\n if(!window.Lightcord.Settings.devMode)return items\n items.push(...[\n {\n section: \"DIVIDER\"\n },\n {\n section: \"HEADER\",\n label: \"Lightcord Api\"\n },\n {\n text: \"Components Preview\",\n id: \"lcapipreview\"\n }\n ])\n return items\n }\n\n render(sidebar) {\n return [\n {\n section: \"HEADER\",\n label: \"Lightcord\"\n },\n ...this.LCitems.map(e => {\n return {\n section: e.id,\n label: e.text,\n element: this.getComponent(e.id, sidebar)\n }\n }),\n ...this.LCDevItems.map(e => {\n if(e.section)return e\n return {\n section: e.id,\n label: e.text,\n element: this.getComponent(e.id, sidebar)\n }\n }),\n {\n section: \"DIVIDER\"\n },\n {\n section: \"CUSTOM\",\n element: this.getComponent(\"BDChangelogTitle\")\n },\n ...this.items.map(e => {\n return {\n section: e.id,\n label: e.text,\n element: this.getComponent(e.id, sidebar)\n }\n }),\n {\n section: \"DIVIDER\"\n }\n ]\n }\n}\n\n/**\n * No need to export settingsPanelSidebar on window\n */","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"./v2\";\r\nimport Utils from \"./utils\";\r\n\r\nexport default new class ColoredText {\r\n injectColoredText() {\r\n if (this.cancelColoredText) return;\r\n if (!BDV2.MessageComponent) return;\r\n\r\n this.cancelColoredText = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\r\n const props = data.methodArguments[0];\r\n if (!props || !props.childrenMessageContent) return;\r\n const messageContent = props.childrenMessageContent;\r\n\r\n if (!messageContent.type || !messageContent.type.type || messageContent.type.type.displayName != \"MessageContent\") return;\r\n const originalType = messageContent.type.type;\r\n if (originalType.__originalMethod) return; // Don't patch again\r\n messageContent.type.type = function(props) {\r\n const returnValue = originalType(props);\r\n const roleColor = settingsCookie[\"bda-gs-7\"] ? props.message.colorString || \"\" : \"\";\r\n returnValue.props.style = {color: roleColor};\r\n return returnValue;\r\n };\r\n\r\n messageContent.type.type.__originalMethod = originalType;\r\n Object.assign(messageContent.type.type, originalType);\r\n }});\r\n }\r\n\r\n removeColoredText() {\r\n let classNameMarkup = BDModules.get(e => e.markup)[0].markup\r\n document.querySelectorAll(\".\"+classNameMarkup.split(\" \")[0]).forEach(elem => {\r\n elem.style.setProperty(\"color\", \"\");\r\n });\r\n }\r\n};","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"./v2\";\r\nimport Utils from \"./utils\";\r\n\r\nexport default new class TFHour {\r\n inject24Hour() {\r\n if (this.cancel24Hour) return;\r\n\r\n const twelveHour = new RegExp(`([0-9]{1,2}):([0-9]{1,2})\\\\s(AM|PM)`);\r\n const convert = (data) => {\r\n if (!settingsCookie[\"bda-gs-6\"]) return;\r\n const matched = data.returnValue.match(twelveHour);\r\n if (!matched || matched.length !== 4) return;\r\n if (matched[3] === \"AM\") return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"00\" : matched[1].padStart(2, \"0\")}:${matched[2]}`);\r\n return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"12\" : parseInt(matched[1]) + 12}:${matched[2]}`);\r\n };\r\n\r\n const cancelCozy = Utils.monkeyPatch(BDV2.TimeFormatter, \"calendarFormat\", {after: convert}); // Called in Cozy mode\r\n const cancelCompact = Utils.monkeyPatch(BDV2.TimeFormatter, \"dateFormat\", {after: convert}); // Called in Compact mode\r\n this.cancel24Hour = () => {cancelCozy(); cancelCompact();}; // Cancel both\r\n }\r\n\r\n remove24Hour() {\r\n if (this.cancel24Hour) this.cancel24Hour();\r\n }\r\n};","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_SettingsTitle extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n//h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi da-h2 da-title da-size16 da-height20 da-weightSemiBold defaultColor-1_ajX0 da-defaultColor marginTop60-3PGbtK da-marginTop60 marginBottom20-32qID7 da-marginBottom20\r\n render() {\r\n return BDV2.react.createElement(\r\n \"h2\",\r\n {className: \"ui-form-title h2 margin-reset margin-bottom-20\"},\r\n this.props.text\r\n );\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_TabBarSeparator extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\"div\", {className: \"ui-tab-bar-separator margin-top-8 margin-bottom-8\"});\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\r\n\r\nexport default class V2C_ServerCard extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n if (!this.props.server.iconUrl) this.props.server.iconUrl = this.props.fallback;\r\n this.state = {\r\n imageError: false,\r\n joined: this.props.guildList.includes(this.props.server.identifier)\r\n };\r\n }\r\n\r\n render() {\r\n const {server} = this.props;\r\n let cardModule = BDModules.get(e => e.card && e.cardPrimary)[0]\r\n let flexModule = BDModules.get(e => e.flexChild && e._horizontalReverse)[0]\r\n let wrapModule = BDModules.get(e => e.noWrap && !e.streamerModeEnabled)[0]\r\n return BDV2.react.createElement(\r\n \"div\", // cardPrimary-1Hv-to\r\n {className: `${cardModule.card} ${cardModule.cardPrimary} ${BDModules.get(e => e.marginBottom8)[0].marginBottom8} bd-server-card${server.pinned ? \" bd-server-card-pinned\" : \"\"}`},\r\n // BDV2.react.createElement(\r\n // \"div\",\r\n // { className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2yIZo0 alignStretch-1hwxMa noWrap-3jynv6\" },\r\n BDV2.react.createElement(\"img\", {ref: \"img\", className: \"bd-server-image\", src: server.iconUrl, onError: this.handleError.bind(this), draggable: false}),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: flexModule.flexChild+\" bd-server-content\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap+\" bd-server-header\"},\r\n BDV2.react.createElement(\r\n \"h5\",\r\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-name\"},\r\n server.name\r\n ),\r\n BDV2.react.createElement(\r\n \"h5\",\r\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-member-count\"},\r\n server.members,\r\n \" Members\"\r\n )\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y bd-server-description-container\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"scroller-2FKFPG scroller bd-server-description\"},\r\n server.description\r\n )\r\n )\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-footer\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"flexChild-faoVW3 bd-server-tags\", style: {flex: \"1 1 auto\"}},\r\n server.categories.join(\", \")\r\n ),\r\n this.state.joined && BDV2.react.createElement(\r\n \"button\",\r\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN colorGreen-29iAKY\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#3ac15c\"}},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n \"Joined\"\r\n )\r\n ),\r\n server.error && BDV2.react.createElement(\r\n \"button\",\r\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN disabled-9aF2ug\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#c13a3a\"}},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n \"Error\"\r\n )\r\n ),\r\n !server.error && !this.state.joined && BDV2.react.createElement(\r\n \"button\",\r\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN\", style: {minHeight: \"12px\", marginTop: \"4px\"}, onClick: () => {this.join();}},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n \"Join\"\r\n )\r\n )\r\n )\r\n )\r\n // )\r\n );\r\n }\r\n\r\n handleError() {\r\n this.props.server.iconUrl = this.props.fallback;\r\n this.setState({imageError: true});\r\n }\r\n\r\n join() {\r\n this.props.join(this);\r\n //this.setState({joined: true});\r\n }\r\n}","import BDV2 from \"./v2\"\nconst {useState} = BDV2.react\n\n\nexport function useForceUpdate(){\n return useState()[1];\n}","import BDV2 from \"../../modules/v2\";\n\nimport SettingsTitle from \"../settingsTitle\";\nimport TabBarSeparator from \"../tabBarSeparator\";\n\nimport ServerCard from \"./serverCard\";\nimport { useForceUpdate } from \"../../modules/hooks\";\n\nlet SettingsView\nexport default class V2C_PublicServers extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n this.setInitialState();\n this.close = this.close.bind(this);\n this.changeCategory = this.changeCategory.bind(this);\n this.search = this.search.bind(this);\n this.searchKeyDown = this.searchKeyDown.bind(this);\n this.checkConnection = this.checkConnection.bind(this);\n this.join = this.join.bind(this);\n this.connect = this.connect.bind(this);\n\n this.GuildStore = BDV2.WebpackModules.findByUniqueProperties([\"getGuilds\"]);\n this.AvatarDefaults = BDV2.WebpackModules.findByUniqueProperties([\"getUserAvatarURL\", \"DEFAULT_AVATARS\"]);\n this.InviteActions = BDV2.WebpackModules.findByUniqueProperties([\"acceptInvite\"]);\n this.SortedGuildStore = BDV2.WebpackModules.findByUniqueProperties([\"getSortedGuilds\"]);\n\n this.hooks = []\n }\n\n componentDidMount() {\n this.checkConnection();\n }\n\n setInitialState() {\n this.state = {\n selectedCategory: -1,\n title: \"Loading...\",\n loading: true,\n servers: [],\n next: null,\n connection: {\n state: 0,\n user: null\n },\n section: this.categorySlugs[0],\n theme: \"dark\"\n };\n }\n\n close() {\n this.props.close()\n }\n\n search(query, clear) {\n const self = this;\n fetch(`${self.searchEndPoint}${query}${query ? \"&schema=new\" : \"?schema=new\"}`, {\n method: \"get\"\n }).then(async res => {\n if(res.status !== 200)throw await res.text()\n let data = await res.json()\n \n let servers = data.results.reduce((arr, server) => {\n server.joined = false;\n arr.push(server);\n // arr.push(<ServerCard server={server} join={self.join}/>);\n return arr;\n }, []);\n\n if (!clear) {\n servers = self.state.servers.concat(servers);\n }\n else {\n //servers.unshift(self.bdServer);\n }\n\n let end = data.size + data.from;\n data.next = `?from=${end}`;\n if (self.state.term) data.next += `&term=${self.state.term}`;\n if (self.state.selectedCategory) data.next += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\n if (end >= data.total) {\n end = data.total;\n data.next = null;\n }\n\n let title = `Showing 1-${end} of ${data.total} results in ${self.categoryButtons[self.state.selectedCategory]}`;\n if (self.state.term) title += ` for ${self.state.term}`;\n\n self.setState({\n loading: false,\n title: title,\n servers: servers,\n next: data.next\n });\n }).catch((err) => {\n console.error(err)\n return self.setState({\n loading: false,\n title: \"Failed to load servers. Check console for details\"\n });\n })\n }\n\n async join(serverCard) {\n if (serverCard.props.pinned) return this.InviteActions.acceptInvite(serverCard.props.invite_code);\n\n await fetch(`${this.joinEndPoint}/${serverCard.props.server.identifier}`,{\n method: \"GET\",\n credentials: \"include\",\n mode: \"cors\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n serverCard.setState({joined: true});\n }\n\n connect() {\n const self = this;\n const options = self.windowOptions;\n options.x = Math.round(window.screenX + window.innerWidth / 2 - options.width / 2);\n options.y = Math.round(window.screenY + window.innerHeight / 2 - options.height / 2);\n\n const win = self.joinWindow = new (require(\"electron\").remote.BrowserWindow)(options);\n const url = \"https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info\";\n win.webContents.on(\"did-navigate\", (event, url) => {\n if (url != \"https://auth.discordservers.com/info\") return;\n win.close();\n self.checkConnection();\n });\n win.loadURL(url);\n win.setMenuBarVisibility(false)\n }\n\n get windowOptions() {\n return {\n width: 500,\n height: 550,\n backgroundColor: \"#282b30\",\n show: true,\n resizable: false,\n maximizable: false,\n minimizable: false,\n alwaysOnTop: true,\n frame: true,\n center: false,\n webPreferences: {\n nodeIntegration: false\n }\n };\n }\n\n get bdServer() {\n const server = {\n name: \"BetterDiscord\",\n online: \"30000+\",\n members: \"70000+\",\n categories: [\"community\", \"programming\", \"support\"],\n description: \"Official BetterDiscord server for support etc\",\n identifier: \"86004744966914048\",\n iconUrl: \"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp\",\n nativejoin: true,\n invite_code: \"0Tmfo5ZbORCRqbAd\",\n pinned: true\n };\n const server2 = {\n name: \"Lightcord\",\n online: \"100+\",\n members: \"300+\",\n categories: [\"community\", \"programming\", \"support\"],\n description: \"Official Lightcord server for support etc\",\n identifier: \"705908350218666117\",\n iconUrl: \"https://github.com/lightcord.png\",\n nativejoin: true,\n invite_code: \"7eFff2A\",\n pinned: true\n };\n const guildList = this.SortedGuildStore.getFlattenedGuildIds();\n const defaultList = this.AvatarDefaults.DEFAULT_AVATARS;\n return [\n BDV2.react.createElement(ServerCard, {server: server2, pinned: true, join: this.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]}),\n BDV2.react.createElement(ServerCard, {server: server, pinned: true, join: this.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]})\n ]\n }\n\n get searchEndPoint() {\n return \"https://search.discordservers.com\";\n }\n\n get joinEndPoint() {\n return \"https://j.discordservers.com\";\n }\n\n get connectEndPoint() {\n return \"https://join.discordservers.com/connect\";\n }\n\n async checkConnection() {\n const self = this;\n try {\n const response = await fetch(`https://auth.discordservers.com/info`,{\n method: \"GET\",\n credentials: \"include\",\n mode: \"cors\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n const text = await response.text()\n if(!text){\n self.setState({\n title: \"Not connected to discordservers.com!\",\n loading: true,\n selectedCategory: -1,\n connection: {\n state: 1,\n user: null\n }\n });\n return\n }\n const data = JSON.parse(text)\n self.setState({\n selectedCategory: 0,\n connection: {\n state: 2,\n user: data\n }\n });\n self.search(\"\", true);\n }\n catch (error) {\n console.error(error)\n self.setState({\n title: \"Not connected to discordservers.com!\",\n loading: true,\n selectedCategory: -1,\n connection: {\n state: 1,\n user: null\n }\n });\n }\n }\n\n render() {\n this.hooks.forEach((e) => e())\n SettingsView = SettingsView || BDV2.WebpackModules.findByDisplayName(\"SettingsView\")\n return BDV2.react.createElement(\"div\", {id: \"pubslayerroot\"}, \n BDV2.react.createElement(\"div\", {id: \"pubslayer\"}, BDV2.react.createElement(SettingsView, {\n onSetSection: (section) => {\n this.changeCategory(this.categorySlugs.indexOf(section))\n },\n sections: this.sections,\n onClose: this.close,\n section: this.state.section\n }))\n );\n }\n\n get sections(){\n let sections = []\n sections.push({\n section: \"HEADER\",\n label: \"Public Servers\"\n }, {\n section: \"DIVIDER\"\n }, {\n section: \"CUSTOM\",\n element: this.searchInput.bind(null, () => this, this.searchKeyDown)\n }, {\n section: \"DIVIDER\"\n }, {\n section: \"HEADER\",\n label: \"Categories\"\n }, ...this.categoryButtons.map((value, index) => {\n return {\n section: this.categorySlugs[index],\n label: value,\n element: this.content.bind(null, () => this)\n }\n }), {\n section: \"DIVIDER\"\n }, {\n section: \"CUSTOM\",\n element: this.footer\n }, {\n section: \"CUSTOM\",\n element: this.connection.bind(null, () => this)\n })\n return sections\n }\n \n searchInput(getThis, searchKeyDown) {\n const [value, setValue] = BDV2.react.useState(\"\")\n return BDV2.react.createElement(\n \"div\",\n {className: \"ui-form-item\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-text-input flex-vertical\", style: {width: \"172px\", marginLeft: \"10px\"}},\n BDV2.react.createElement(\"input\", {\n ref: (serchinput) => (getThis().refs.searchinput = serchinput), \n onKeyDown: searchKeyDown, \n onChange: (e) => {\n setValue(e.target.value)\n }, \n type: \"text\", \n className: \"input default\", \n placeholder: \"Search...\", \n maxLength: \"50\",\n value: value\n })\n )\n );\n }\n\n searchKeyDown(e) {\n const self = this;\n if (self.state.loading || e.which !== 13) return;\n self.setState({\n loading: true,\n title: \"Loading...\",\n term: e.target.value\n });\n let query = `?term=${e.target.value}`;\n if (self.state.selectedCategory !== 0) {\n query += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\n }\n self.search(query, true);\n }\n\n get categorySlugs(){\n return this.categoryButtons.map(e => e.toLowerCase().replace(/[^\\w\\d]+/g, \"_\"))\n }\n\n get categoryButtons() {\n return [\"All\", \"FPS Games\", \"MMO Games\", \"Strategy Games\", \"MOBA Games\", \"RPG Games\", \"Tabletop Games\", \"Sandbox Games\", \"Simulation Games\", \"Music\", \"Community\", \"Language\", \"Programming\", \"Other\"];\n }\n\n changeCategory(id) {\n const self = this;\n if (self.state.loading) return;\n self.setState({\n loading: true,\n selectedCategory: id,\n title: \"Loading...\",\n term: null,\n section: self.categorySlugs[id]\n });\n if (id === 0) {\n self.search(\"\", true);\n return;\n }\n self.search(`?category=${self.categoryButtons[id]}`, true);\n }\n\n content(getThis) {\n const self = getThis();\n self.useState()\n const guildList = self.SortedGuildStore.getFlattenedGuildIds();\n const defaultList = self.AvatarDefaults.DEFAULT_AVATARS;\n if (self.state.connection.state === 1) return BDV2.react.createElement(self.notConnected.bind(null, getThis));\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0]\n return [BDV2.react.createElement(\n \"div\",\n {ref: (ref) => {\n (self.refs.content = ref)\n }, key: \"pc\", className: columnModule.contentColumn+\" \"+columnModule.contentColumn+\" content-column default\"},\n BDV2.react.createElement(SettingsTitle, {text: self.state.title}),\n self.bdServer,\n self.state.servers.map((server) => {\n return BDV2.react.createElement(ServerCard, {key: server.identifier, server: server, join: self.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]});\n }),\n self.state.next && BDV2.react.createElement(\n \"button\",\n {type: \"button\", onClick: () => {\n if (self.state.loading) return;self.setState({loading: true}); self.search(self.state.next, false);\n }, className: \"ui-button filled brand small grow\", style: {width: \"100%\", marginTop: \"10px\", marginBottom: \"10px\"}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n self.state.loading ? \"Loading\" : \"Load More\"\n )\n ),\n self.state.servers.length > 0 && BDV2.react.createElement(SettingsTitle, {text: self.state.title})\n )];\n }\n\n notConnected(getThis) {\n const self = getThis();\n //return BDV2.react.createElement(SettingsTitle, { text: self.state.title });\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0]\n return [BDV2.react.createElement(\n \"div\",\n {key: \"ncc\", ref: (ref) => (self.refs.content = ref), className: columnModule.contentColumn+\" \"+columnModule.contentColumn+\" content-column default\"},\n BDV2.react.createElement(\n \"h2\",\n {className: \"ui-form-title h2 margin-reset margin-bottom-20\"},\n \"Not connected to discordservers.com!\",\n BDV2.react.createElement(\n \"button\",\n {\n onClick: self.connect,\n type: \"button\",\n className: \"ui-button filled brand small grow\",\n style: {\n display: \"inline-block\",\n minHeight: \"18px\",\n marginLeft: \"10px\",\n lineHeight: \"14px\"\n }\n },\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Connect\"\n )\n )\n ), self.bdServer\n )];\n }\n\n footer() {\n return BDV2.react.createElement(\n \"div\",\n {className: \"ui-tab-bar-header\"},\n BDV2.react.createElement(\n \"a\",\n {href: \"https://discordservers.com\", target: \"_blank\"},\n \"Discordservers.com\"\n )\n );\n }\n\n useState(){\n const forceUpdate = useForceUpdate()\n BDV2.React.useEffect(() => {\n const listener = () => {\n forceUpdate()\n }\n this.hooks.push(listener)\n return () => {\n const index = this.hooks.findIndex(e => e===listener)\n if(index < 0)return\n this.hooks.splice(index, 1)\n }\n }, [])\n }\n\n connection(getThis) {\n const self = getThis();\n self.useState()\n const {connection} = self.state;\n if (connection.state !== 2) return BDV2.react.createElement(\"span\", null);\n\n return BDV2.react.createElement(\n \"span\",\n null,\n BDV2.react.createElement(TabBarSeparator, null),\n BDV2.react.createElement(\n \"span\",\n {style: {color: \"#b9bbbe\", fontSize: \"10px\", marginLeft: \"10px\"}},\n \"Connected as: \",\n `${connection.user.username}#${connection.user.discriminator}`\n ),\n BDV2.react.createElement(\n \"div\",\n {style: {padding: \"5px 10px 0 10px\"}},\n BDV2.react.createElement(\n \"button\",\n {style: {width: \"100%\", minHeight: \"20px\"}, type: \"button\", className: \"ui-button filled brand small grow\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\", onClick: self.connect},\n \"Reconnect\"\n )\n )\n )\n );\n }\n}","export default class BugHunterBadge extends React.Component {\r\n render(){\r\n const props = this.props\r\n\r\n return (\r\n <svg viewBox=\"0 0 31.3 29.5\" {...props.svg} height=\"100%\">\r\n <path d=\"M22.8 1s12 8.2 7.4 19.7S16.6 29 20 25.6s-4-5.6-8.7-10L22.8 1\" fill=\"rgba(227,6,19,.6)\" />\r\n <path d=\"M22.1 12.3c-2.5 3.2-6.1 4.8-8.9 4.3L3.6 28.8c-.7.9-1.9 1-2.8.3-.9-.7-1-1.9-.4-2.8L10 14.1c-1.3-2.5-.6-6.4 2-9.7 3.2-4 8-5.5 10.8-3.4s2.4 7.2-.7 11.3z\" fill=\"#e30613\" />\r\n </svg>\r\n )\r\n } \r\n}","export default class Circus extends React.Component {\r\n render(){\r\n return (<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\" {...this.props.svg} height=\"100%\">\r\n <path\r\n fill=\"#DD2E44\"\r\n d=\"M33 33a2 2 0 01-2 2H5a2 2 0 01-2-2l1-12h28l1 12z\"\r\n ></path>\r\n <path\r\n fill=\"#EA596E\"\r\n d=\"M13 35c-.792-1.875-1.75-3.291-3.417-4.666 1.75-1.459 4.542-5.5 5.25-8.292s2.75 8.125 2.042 10.625S13 35 13 35zm10.303 0c.791-1.875 1.75-3.291 3.416-4.666-1.75-1.459-4.541-5.5-5.25-8.292-.707-2.792-2.75 8.125-2.04 10.625.708 2.5 3.874 2.333 3.874 2.333z\"\r\n ></path>\r\n <path\r\n fill=\"#BE1931\"\r\n d=\"M3.728 24.263A2.5 2.5 0 008 22.5c0-.565-.195-1.081-.511-1.5H4l-.272 3.263zm28.544 0L32 21h-3.489A2.482 2.482 0 0028 22.5a2.5 2.5 0 004.272 1.763z\"\r\n ></path>\r\n <circle cx=\"14\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <circle cx=\"22\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <circle cx=\"10\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <circle cx=\"26\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <path d=\"M23 35H13s2-6 2-13h6c0 7 2 13 2 13zM17 2h2v7h-2z\"></path>\r\n <path\r\n fill=\"#55ACEE\"\r\n d=\"M18.838.206C17.667.042 17 .318 17 1.418v1c0 1.1.865 1.753 1.923 1.451l5.154-.901c1.715-.343 1.548-1.593.085-1.884L18.838.206z\"\r\n ></path>\r\n <path\r\n fill=\"#CCD6DD\"\r\n d=\"M18 6l-.081.123C10.938 16.981 3 15.015 3 19v2.5a2.5 2.5 0 004.95.5H12a2 2 0 004 0h4a2 2 0 004 0h4.05a2.5 2.5 0 004.95-.5V19c0-4-8-2-15-13z\"\r\n ></path>\r\n <g fill=\"#F5F8FA\">\r\n <path d=\"M17.948 6.078l-.03.045C17.132 11.619 10.811 16.126 8 18v4a2 2 0 004 0v-4c.982-.982 5.813-6.787 5.984-11.732-.01-.064-.027-.126-.036-.19zm.08.398C18.324 11.374 23.031 17.031 24 18v4a2 2 0 004 0v-4c-2.75-1.833-8.953-6.19-9.972-11.524z\"></path>\r\n <path d=\"M17.984 6.27C17.922 8.346 17.606 16.394 16 18v4a2 2 0 004 0v-4c-1.564-1.564-1.905-9.241-1.979-11.559-.011-.057-.027-.113-.037-.171z\"></path>\r\n </g>\r\n </svg>\r\n )\r\n } \r\n}","import BugHunterBadge from \"../svg/bug_hunter\"\nimport nodeFetch from \"node-fetch\"\nimport { settingsCookie } from \"../0globals\";\nimport Circus from \"../svg/circus\";\n\nexport function uuidv4() { // Generate UUID (No crypto rng)\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n} \n\nconst awaitingBadgesPromises = {}\nlet badgesToFetch = []\n\nexport default new class DistantServer {\n constructor(){\n this._cache = {\n badges: {\n\n }\n }\n window.Lightcord.BetterDiscord.DistantServer = this\n }\n\n get cache(){\n return this._cache\n }\n\n set cache(data){\n if(typeof data !== \"object\" || typeof this._cache !== \"object\")return this._cache = data\n return this._cache = Object.assign(this._cache, data)\n }\n\n /**\n * Get custom badges from the user ID.\n * @param {string} user The user ID \n * @returns {Promise<Constants[\"badges\"]>}\n */\n async getBadges(user){\n if(this.cache.badges[user])return this.cache.badges[user]\n if(awaitingBadgesPromises[user])return awaitingBadgesPromises[user]\n\n let resolve\n const newPromise = new Promise((res) => (resolve = res))\n awaitingBadgesPromises[user] = newPromise\n\n const badges = []\n for(let badge of Constants.badges){\n if(badge.defaultUsers.includes(user))badges.push(badge)\n }\n const fetchedBadges = await new Promise((resolve) => {\n if(!settingsCookie[\"lightcord-5\"])return resolve([])\n badgesToFetch.push([user, resolve])\n setTimeout(() => {\n let users = badgesToFetch\n if(users.length === 0)return\n badgesToFetch = []\n handleRequest(Routes.badges, \"POST\", JSON.stringify(users.map(e => e[0])))\n .then(async res => {\n if(res.status !== 200){// Couldn't fetch badges: server error\n users.forEach(data => {\n data[1]([])// resolve no badge fetched\n })\n }\n const responseBody = await res.json()\n \n for(let user of responseBody){\n let promise = users.find(promise => promise[0] === user.user_id)\n promise[1](user.badges)\n }\n }).catch((err) => {// Couldn't fetch badges: error\n if(!(err instanceof LightcordError))console.error(err)\n users.forEach(data => {\n data[1]([])// resolve no badge fetched\n })\n })\n }, 0)\n })\n for(let badge of fetchedBadges){\n if(!Constants.badges.find(e => e.id === badge))continue // We do not have the Component, skip it.\n if(badges.find(e => e.id === badge))continue // Already inserted.\n badges.push(Constants.badges.find(e => e.id === badge))\n }\n this.cache = {\n badges: Object.assign(this.cache.badges, {[user]: badges})\n }\n setTimeout(() => {\n delete this.cache.badges[user]\n }, 600000);\n\n resolve(badges)\n delete awaitingBadgesPromises[user]\n return badges\n }\n}\n\nconst handleRequest = function(route, method, data){\n if(!settingsCookie[\"lightcord-5\"]){\n return Promise.reject(new LightcordError(\"The current settings blocked the request.\"))\n }\n return nodeFetch(`${Constants.SERVER_URL}/api/v1${route}`, {\n method,\n headers: {\n \"CLIENT\": \"Lightcord\",\n \"Authorization\": window.Lightcord.Api.Authorization || \"None::Anonymous\"\n },\n ...(data ? {\n body: data\n } : {})\n })\n}\n\nclass LightcordError extends Error {\n constructor(){\n super(...arguments)\n this.name = \"LightcordError\"\n }\n}\n\nexport const Constants = {\n SERVER_URL: \"https://lightcord.org\",\n badges: [ // TODO: Add more badges + server side svg\n {\n name: \"Lightcord Bug Hunter\",\n id: \"f04698f5-816b-41e3-bd01-92291193d7a5\",\n defaultUsers: [\n \"696481194443014174\",\n \"696003456611385396\"\n ],\n scopes: [],\n component: BugHunterBadge,\n href: \"https://github.com/lightcord/lightcord/wiki/badges#bug_hunter\"\n }, {\n name: \"Buffoon\",\n id: \"06904d31-65b4-41ec-a50c-8658bbd1af96\",\n defaultUsers: [\n \"389016895543705602\",\n \"664600134528663565\",\n \"625350657829896224\"\n ],\n scopes: [],\n component: Circus,\n href: \"https://youtu.be/EJtb6z-dlT8?t=145\"\n }\n ]\n}\n\nexport const Routes = {\n badges: `/users/badges`\n}","import Utils from \"./utils\";\nimport v2 from \"./v2\";\nimport { uuidv4 } from \"./distant\";\nimport { timingSafeEqual } from \"crypto\";\n\nexport default new class Layers {\n constructor(){\n this.layers = []\n window.Lightcord.BetterDiscord.Layers = this\n }\n\n get isInjected(){\n return !!document.querySelector(\"div.Layers.injected\")\n }\n\n inject(){\n if(this.isInjected)return\n let [\n classNameLayers\n ] = [\n Utils.removeDa(v2.WebpackModules.find(e => e.layers && e.layer).layers)\n ]\n const layers = document.querySelector(\".\"+classNameLayers);\n if (!layers) return false;\n const ReactInstance = Lightcord.Api.Utils.FindReact(layers, 1)\n if(!ReactInstance)return layers\n this.ReactInstance = ReactInstance\n let render = ReactInstance.render\n ReactInstance.render = () => {\n let returnValue = render.call(ReactInstance)\n let classList = returnValue.props.children[1].props.className.split(\" \")\n classList.push(\"Layers\")\n classList.push(\"injected\")\n returnValue.props.children[1].props.className = classList.join(\" \")\n\n this.layers.forEach(layer => {\n returnValue.props.children[1].props.children.push(layer[1])\n })\n\n return returnValue\n }\n ReactInstance.forceUpdate()\n }\n\n createLayer(children, props = {}){\n let id = uuidv4()\n let layer = null\n this.layers.push([id, <Layer {...props} getLayer={lay => {\n layer = lay\n }} key={id} id={id} remove={() => {\n let index = this.layers.findIndex(e => e[0] === id)\n if(index === -1)return\n this.layers.splice(index, 1)\n layer = null\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\n this.inject()\n }}>{children}</Layer>])\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\n this.inject()\n return {\n remove: () => {\n if(!layer){\n let index = this.layers.findIndex(e => e[0] === id)\n if(index === -1)return\n this.layers.splice(index, 1)\n layer = null\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\n this.inject()\n }else{\n layer.remove()\n }\n }\n }\n }\n}\n\n\nlet LayerModules\nexport class Layer extends React.Component {\n constructor(){\n super(...arguments)\n this.state = {\n animation: new this.modules[0].default.Value(0)\n } \n this.props.getLayer(this)\n this.keydown = this.keydown.bind(this)\n }\n\n keydown(e){\n if (e.which === 27) {\n this.remove()\n }\n }\n\n get modules(){\n return LayerModules || (LayerModules = [\n v2.WebpackModules.find(e => e.default && e.default.Value && e.default.div)\n ])\n }\n\n componentWillUnmount(){\n window.removeEventListener(\"keydown\", this.keydown)\n }\n\n componentDidMount(ev){\n window.addEventListener(\"keydown\", this.keydown)\n }\n\n remove(){\n this.props.remove()\n }\n\n componentWillEnter(ev){\n this.modules[0].default.timing(this.state.animation, {\n toValue: 1,\n duration: 100\n }).start(ev)\n }\n\n componentWillLeave(ev){\n this.modules[0].default.timing(this.state.animation, {\n toValue: 0,\n duration: 100\n }).start(ev)\n }\n\n render(){\n let interpolation = this.state.animation.interpolate({\n inputRange: [0, 1],\n outputRange: [1.07, 1]\n })\n let style = {\n opacity: this.state.animation,\n transform: [{\n scale: interpolation\n }]\n }\n let Div = this.modules[0].default.div\n return <Div className={[__SECRET_EMOTION__.css({\n backgroundColor:\"var(--background-primary)\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n display: \"flex\",\n overflow: \"hidden\",\n WebkitBoxOrient: \"vertical\",\n WebkitBoxDirection: \"normal\",\n msFlexDirection: \"column\",\n flexDirection: \"column\",\n zIndex: 101\n }),process.platform===\"win32\"?__SECRET_EMOTION__.css({\n top: \"-22px\",\n paddingTop: \"22px\"\n }):null,...(this.props.className?this.props.className.split(\" \"):[])].filter(e=>e).join(\" \") || null} style={style}>\n {this.props.children(() => {\n this.remove()\n })}\n </Div>\n }\n}\nLayer.defaultProps = {\n id: null,\n children: null\n}","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"./v2\";\nimport webpackModules from \"./webpackModules\";\nimport Utils from \"./utils\";\nimport DOM from \"./domtools\";\n\nimport V2C_PublicServers from \"../ui/publicservers/publicServers\";\nimport Layers from \"./Layers\";\n\nexport default new class V2_PublicServers {\n\n constructor() {\n this._appendButton = this._appendButton.bind(this);\n window.Lightcord.BetterDiscord.V2_PublicServers = this\n }\n\n render() {\n Layers.createLayer((close) => {\n return BDV2.react.createElement(V2C_PublicServers, {rootId: \"pubslayerroot\", close})\n })\n }\n\n get button() {\n const btn = DOM.createElement(`<div id=\"bd-pub-li\" class=\"${BDV2.guildClasses.listItem}\">`);\n if (!settingsCookie[\"bda-gs-1\"]) btn.style.display = \"none\";\n const label = DOM.createElement(`<div id=\"bd-pub-button\" class=\"${\"wrapper-25eVIn \" + BDV2.guildClasses.circleButtonMask}\">public</div>`);\n label.addEventListener(\"click\", () => {this.render();});\n btn.append(label);\n return btn;\n }\n\n _appendButton() {\n let [\n classNametutorialContainer\n ] = [\n Utils.removeDa(BDModules.get(e => e.downloadProgress && e.tutorialContainer)[0].tutorialContainer)\n ]\n if (DOM.query(\"#bd-pub-li\")) return;\n const guilds = DOM.query(`div.${classNametutorialContainer} > div`);\n DOM.after(guilds, this.button);\n }\n\n addButton() {\n if (this.guildPatch) return;\n const GuildList = webpackModules.find(m => m.default && m.default.displayName == \"NavigableGuilds\");\n const GuildListOld = webpackModules.findByDisplayName(\"Guilds\");\n if (!GuildList && !GuildListOld) Utils.warn(\"PublicServer\", \"Can't find GuildList component\");\n this.guildPatch = Utils.monkeyPatch(GuildList ? GuildList : GuildListOld.prototype, GuildList ? \"default\" : \"render\", {after: this._appendButton});\n this._appendButton();\n }\n\n removeButton() {\n this.guildPatch();\n delete this.guildPatch;\n const button = DOM.query(\"#bd-pub-li\");\n if (button) button.remove();\n }\n};","import DOM from \"./domtools\";\r\n\r\nconst style = `\r\n .container-2Rl01u {\r\n display: none!important;\r\n }\r\n\r\n .chat-3bRxxu {\r\n display: none!important;\r\n }\r\n\r\n .sidebar-2K8pFh {\r\n flex-grow: 1!important;\r\n }\r\n`;\r\n\r\nexport default new class VoiceMode {\r\n start() {\r\n DOM.addStyle(\"VoiceMode\", style);\r\n }\r\n\r\n stop() {\r\n DOM.removeStyle(\"VoiceMode\");\r\n }\r\n};","import WebpackModules from \"./webpackModules\";\n\nconst normalizedPrefix = \"da\";\nconst randClass = new RegExp(`^(?!${normalizedPrefix}-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$`);\n\nexport default new class ClassNormalizer {\n constructor(){\n window.Lightcord.BetterDiscord.ClassNormalizer = this\n }\n stop() {\n if (!this.hasPatched) return;\n this.unpatchClassModules(WebpackModules.findAll(this.moduleFilter.bind(this)));\n this.revertElement(document.querySelector(\"#app-mount\"));\n this.hasPatched = false;\n }\n\n start() {\n if (this.hasPatched) return;\n this.patchClassModules(WebpackModules.findAll(this.moduleFilter.bind(this)));\n this.normalizeElement(document.querySelector(\"#app-mount\"));\n this.hasPatched = true;\n this.patchDOMMethods();\n }\n\n patchClassModules(modules) {\n for (const module of modules) {\n this.patchClassModule(normalizedPrefix, module);\n }\n }\n\n unpatchClassModules(modules) {\n for (const module of modules) {\n this.unpatchClassModule(normalizedPrefix, module);\n }\n }\n\n shouldIgnore(value) {\n if (!isNaN(value)) return true;\n if (value.endsWith(\"px\") || value.endsWith(\"ch\") || value.endsWith(\"em\") || value.endsWith(\"ms\")) return true;\n if (value.startsWith(\"layerContainer-\")) return true;\n if (value.startsWith(\"#\") && (value.length == 7 || value.length == 4)) return true;\n if (value.includes(\"calc(\") || value.includes(\"rgba\")) return true;\n return false;\n }\n\n moduleFilter(module) {\n if (typeof module !== \"object\" || Array.isArray(module)) return false;\n if (module.__esModule) return false;\n if (!Object.keys(module).length) return false;\n for (const baseClassName in module) {\n const value = module[baseClassName];\n if (typeof value !== \"string\") return false;\n if (this.shouldIgnore(value)) continue;\n if (value.split(\"-\").length === 1) return false;\n if (!randClass.test(value.split(\" \")[0])) return false;\n }\n\n return true;\n }\n\n patchClassModule(componentName, classNames) {\n for (const baseClassName in classNames) {\n const value = classNames[baseClassName];\n if (this.shouldIgnore(value)) continue;\n const classList = value.split(\" \");\n for (const normalClass of classList) {\n const match = normalClass.match(randClass);\n if (!match || !match.length || match.length < 2) continue; // Shouldn't ever happen since they passed the moduleFilter, but you never know\n const camelCase = match[1].split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\n classNames[baseClassName] += ` ${componentName}-${camelCase}`;\n }\n }\n }\n\n unpatchClassModule(componentName, classNames) {\n for (const baseClassName in classNames) {\n const value = classNames[baseClassName];\n if (this.shouldIgnore(value)) continue;\n let newString = \"\";\n const classList = value.split(\" \");\n for (const normalClass of classList) {\n if (normalClass.startsWith(`${componentName}-`)) continue;\n newString += ` ${normalClass}`;\n }\n classNames[baseClassName] = newString.trim();\n }\n }\n\n normalizeElement(element) {\n if (!(element instanceof Element)) return;\n const classes = element.classList;\n for (let c = 0, clen = classes.length; c < clen; c++) {\n if (!randClass.test(classes[c])) continue;\n const match = classes[c].match(randClass)[1];\n const newClass = match.split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\n element.classList.add(`${normalizedPrefix}-${newClass}`);\n }\n for (const child of element.children) this.normalizeElement(child);\n }\n\n revertElement(element) {\n if (!(element instanceof Element)) return;\n if (element.children && element.children.length) this.revertElement(element.children[0]);\n if (element.nextElementSibling) this.revertElement(element.nextElementSibling);\n const classes = element.classList;\n const toRemove = [];\n for (let c = 0; c < classes.length; c++) {\n if (classes[c].startsWith(`${normalizedPrefix}-`)) toRemove.push(classes[c]);\n }\n element.classList.remove(...toRemove);\n }\n\n patchDOMMethods() {\n const contains = DOMTokenList.prototype.contains;\n DOMTokenList.prototype.contains = function(token) {\n // const tokens = token.split(\" \");\n return Reflect.apply(contains, this, [token.split(\" \")[0]]);\n // return tokens.every(t => contains.call(this, t));\n };\n\n const add = DOMTokenList.prototype.add;\n DOMTokenList.prototype.add = function(...tokens) {\n for (let t = 0; t < tokens.length; t++) {\n tokens[t] = tokens[t].split(\" \")[0];\n }\n return Reflect.apply(add, this, tokens);\n };\n\n const remove = DOMTokenList.prototype.remove;\n DOMTokenList.prototype.remove = function(...tokens) {\n for (let t = 0; t < tokens.length; t++) {\n tokens[t] = tokens[t].split(\" \")[0];\n }\n return Reflect.apply(remove, this, tokens);\n };\n }\n\n};","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"./v2\";\nimport DOM from \"./domtools\";\nimport Utils from \"./utils\";\n\nexport default new class DevMode {\n constructor() {\n this.debugListener = this.debugListener.bind(this);\n this.copySelectorListener = this.copySelectorListener.bind(this);\n }\n\n start() {\n this.startDebugListener();\n if (settingsCookie[\"fork-dm-1\"]) this.startCopySelector();\n }\n \n stop() {\n this.stopDebugListener();\n this.stopCopySelector();\n }\n\n startDebugListener() {\n this.stopDebugListener();\n document.addEventListener(\"keydown\", this.debugListener);\n }\n\n stopDebugListener() {\n document.removeEventListener(\"keydown\", this.debugListener);\n }\n\n startCopySelector() {\n this.stopCopySelector();\n document.addEventListener(\"contextmenu\", this.copySelectorListener);\n }\n\n stopCopySelector() {\n document.removeEventListener(\"contextmenu\", this.copySelectorListener);\n }\n\n debugListener(e) {\n if (e.which === 119 || e.which == 118) {//F8\n console.log(\"%c[%cDevMode%c] %cBreak/Resume\", \"color: red;\", \"color: #303030; font-weight:700;\", \"color:red;\", \"\");\n debugger; // eslint-disable-line no-debugger\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n copySelectorListener(e) {\n try{\n e.stopPropagation();\n const selector = this.getSelector(e.target);\n \n let [\n classLayer, \n classItems\n ] = [\n BDModules.get((e) => e.layer && typeof e.layer === \"string\" && e.disabledPointerEvents)[0],\n BDModules.get((e) => e.menu)[0]\n ]\n \n function attach() {\n if(!classItems || !classLayer.layer)return console.log(classItems, classLayer.layer)\n\n let cm = DOM.query(\".\"+Utils.removeDa(classItems.menu));\n if (!cm) {\n const container = DOM.query(\"#app-mount > .\"+Utils.removeDa(classLayer.layerContainer));\n const cmWrap = DOM.createElement(`<div class=\"${classLayer.layer}\">`);\n cm = DOM.createElement(`<div class=\"${classItems.menu} ${classItems.styleFlexible} ${classItems.accommodateScrollbar} bd-context-menu\" style=\"\"></div>`);\n cmWrap.append(cm);\n container.append(cmWrap);\n cmWrap.style.top = e.clientY + \"px\";\n cmWrap.style.left = e.clientX + \"px\";\n cmWrap.setAttribute(\"role\", \"menu\")\n cmWrap.setAttribute(\"tabindex\", \"-1\")\n cmWrap.id = \"bd-copy-selector-context\"\n cmWrap.setAttribute(\"aria-label\", \"Copy Selector Actions\")\n\n const scrollerClasses = BDModules.get((e) => e.scrollerWrap)[0]\n const scrollerWrap = DOM.createElement(`<div class=\"${scrollerClasses.scrollerWrap} ${scrollerClasses.scrollerThemed} ${scrollerClasses.themeGhostHairline}\"></div>`)\n const scroller = DOM.createElement(`<div class=\"${BDModules.get(e => e.scroller)[0].scroller} ${classItems.scroller}\"></div>`)\n scrollerWrap.append(scroller)\n cm.append(scrollerWrap)\n\n const removeCM = function(e) {\n if (e.keyCode && e.keyCode !== 27) return;\n cmWrap.remove();\n document.removeEventListener(\"click\", removeCM);\n document.removeEventListener(\"contextmenu\", removeCM);\n document.removeEventListener(\"keyup\", removeCM);\n };\n document.addEventListener(\"click\", removeCM);\n document.addEventListener(\"contextmenu\", removeCM);\n document.addEventListener(\"keyup\", removeCM);\n }\n const cmWrap = cm.parentElement\n \n const scroller = cm.childNodes[0].childNodes[0]\n const cmg = DOM.createElement(`<div role=\"group\"></div>`);\n /**\n * @type {HTMLElement}\n */\n const cmi = DOM.createElement(`<div class=\"${classItems.item} ${classItems.labelContainer} ${classItems.colorDefault}\" role=\"menuitem\" id=\"bd-copy-selector-item-cm\"></div>`);\n cmi.append(DOM.createElement(`<div class=\"${classItems.label}\">Copy Selector</div>`));\n cmi.addEventListener(\"click\", () => {\n BDV2.NativeModule.copy(selector);\n cmWrap.style.display = \"none\"\n });\n cmi.addEventListener(\"mouseover\", (e) => {\n let elements = DOM.queryAll(\"div[role=menuitem].\"+Utils.removeDa(classItems.focused))\n elements && elements.forEach(elem => elem.classList.remove(classItems.focused))\n cmi.classList.add(classItems.focused)\n })\n cmi.addEventListener(\"mouseout\", (e) => {\n cmi.classList.remove(classItems.focused)\n })\n cmg.append(cmi);\n if(scroller.childNodes.length){ // apend a separator\n const separator = DOM.createElement(`<div role=\"separator\" class=\"${classItems.separator}\"></div>`)\n scroller.append(separator)\n }\n scroller.append(cmg);\n if(cmWrap.clientHeight < cmWrap.scrollHeight){\n console.log(\"overflowing \"+cmWrap.style.top)\n cmWrap.style.top = (cmWrap.style.top - cmg.clientHeight) + \"px\";\n console.log(\"overflowing\"+cmWrap.style.top)\n }\n }\n \n setTimeout(attach, 1);\n }catch(e){\n console.error(e)\n }\n }\n\n getSelector(element) {\n if (element.id) return `#${element.id}`;\n /**\n * \n * @param {HTMLElement} el \n */\n function fullPath(el){\n var names = [];\n while (el.parentNode){\n if (el.id){\n names.unshift('#'+el.id);\n break;\n }else{\n if (el==el.ownerDocument.documentElement) names.unshift(el.tagName.toLowerCase()+Array.from(el.classList.entries()).map(e => \".\"+e).join(\"\"));\n else{\n for (var c=1,e=el;e.previousElementSibling;e=e.previousElementSibling,c++);\n names.unshift(el.tagName.toLowerCase()+((typeof el.className === \"string\" && el.className) || \"\").split(\" \").filter(e => !!e).map(e => \".\"+e).join(\"\")+\":nth-child(\"+c+\")\");\n }\n el=el.parentNode;\n }\n }\n return names.join(\" > \");\n }\n return fullPath(element)\n }\n};","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Switch extends React.Component {\n constructor(props) {\n super(props);\n this.state = {checked: this.props.checked};\n this.onChange = this.onChange.bind(this);\n this.switch = <Lightcord.Api.Components.inputs.Switch onChange={this.onChange} value={this.state.checked} />\n }\n\n onChange(value) {\n if (this.props.disabled) return;\n this.props.onChange(value);\n this.setState({checked: value});\n }\n\n render() {\n return this.switch\n }\n}","import BDV2 from \"../modules/v2\";\nimport Switch from \"./components/switch\";\n\nlet classnames = []\nfunction getClassName(name){\n let className = classnames.find(e => e.startsWith(name+\"-\"))\n if(className)return className\n className = BDModules.get(e => e[name])[0][name]\n classnames.push(className)\n return className\n}\n\nexport default class SwitchItem extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n }\n\n onChange() {\n this.props.checked = !this.props.checked;\n this.props.onChange(this.props.id, this.props.checked);\n }\n\n render() {\n let {text, info} = this.props.data;\n if(this.props.data.experimental){\n if(!classnames.find(e => e.startsWith(\"beta-\"))){\n classnames.push(BDModules.get(e => e.beta && (!e.container && !e.userSettingsVoice))[0].beta)\n }\n info = [\n info,\n React.createElement(\"sup\", {className: getClassName(\"beta\")}, \"(EXPERIMENTAL)\")\n ]\n }\n return BDV2.react.createElement(\"div\", {className: \"ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item\"},\n BDV2.react.createElement(\"div\", {className: \"ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap\"},\n BDV2.react.createElement(\"h3\", {key: \"title\", className: \"ui-form-title h3 margin-reset margin-reset ui-flex-child\"}, text),\n BDV2.react.createElement(Switch, {key: \"switch\", onChange: this.onChange, checked: this.props.checked})\n ),\n BDV2.react.createElement(\"div\", {className: \"ui-form-text style-description margin-top-4\", style: {flex: \"1 1 auto\"}}, info)\n );\n }\n}","let marginModule = BDModules.get(e => e.marginTop60)[0]\r\n\r\nexport default class MarginTop extends React.Component {\r\n render(){\r\n if(!marginModule)marginModule = BDModules.get(e => e.marginTop60)[0]\r\n return <div className={marginModule.marginTop60}></div>\r\n }\r\n}","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"../modules/v2\";\n\nimport SettingsTitle from \"./settingsTitle\";\nimport Switch from \"./switch\";\nimport MarginTop from \"./margintop\";\n\nlet formModule\nlet switchItem\nlet betaClassNames\nexport default class V2C_SettingsGroup extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n error: false\n }\n }\n\n renderOldSettings() {\n const {title, settings, button} = this.props;\n const buttonComponent = button ? BDV2.react.createElement(\"button\", {key: \"title-button\", className: \"bd-pfbtn\", onClick: button.onClick}, button.title) : null;\n return [BDV2.react.createElement(SettingsTitle, {text: title}),\n buttonComponent,\n settings.map(setting => {\n return BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: settingsCookie[setting.id], onChange: (id, checked) => {\n this.props.onChange(id, checked);\n this.forceUpdate()\n }});\n })];\n }\n\n componentDidCatch(err, errInfo){\n console.log(err, errInfo)\n this.setState({\n error: true\n })\n }\n\n render(){\n if(this.state.error){\n try{\n return this.renderOldSettings()\n }catch(e){\n console.error(e)\n return null\n }\n }else{\n try{\n if(!formModule)formModule = BDV2.WebpackModules.find(e => e.FormSection)\n if(!switchItem)switchItem = BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"SwitchItem\")\n if(!betaClassNames)betaClassNames = BDV2.WebpackModules.find(e => e.beta && (!e.container && !e.userSettingsVoice))\n \n let children = []\n if(this.props.description){\n children.push(<formModule.FormText type=\"description\" selectable={false}>\n {this.props.description}\n </formModule.FormText>, <MarginTop></MarginTop>)\n }\n children.push(...this.props.settings.map(setting => {\n let info = [\n setting.text\n ]\n if(setting.experimental){\n info.push(<sup className={betaClassNames.beta}>(EXPERIMENTAL)</sup>)\n }\n return <switchItem.default onChange={(ev) => {\n this.props.onChange(setting.id, ev.target.checked);\n this.forceUpdate()\n }} key={setting.id} value={settingsCookie[setting.id]} className={__SECRET_EMOTION__.css({\n marginBottom: \"20px\"\n })} disabled={false} hideBorder={false}\n note={setting.info} tooltipNote={null}>\n {info}\n </switchItem.default>\n }))\n return <formModule.FormSection tag=\"h2\" title={this.props.title}>\n {children}\n </formModule.FormSection>\n }catch(e){\n console.error(e)\n setImmediate(()=>{\n this.setState({\n error: true\n })\n })\n return null\n }\n }\n }\n}","import BDV2 from \"../modules/v2\";\r\n\r\nimport SettingsGroup from \"./settingsGroup\";\r\nimport MarginTop from \"./margintop\";\r\n\r\nexport default class V2C_SectionedSettingsPanel extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return this.props.sections.map((section, i) => {\r\n return [\r\n i !== 0 ? BDV2.react.createElement(MarginTop, {}) : null,\r\n BDV2.react.createElement(SettingsGroup, Object.assign({}, section, {onChange: this.props.onChange}))\r\n ]\r\n })\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_Checkbox extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n this.onClick = this.onClick.bind(this);\r\n this.setInitialState();\r\n }\r\n\r\n setInitialState() {\r\n this.state = {\r\n checked: this.props.checked || false\r\n };\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\r\n \"li\",\r\n null,\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"checkbox \"+BDModules.get(e => e.checkboxElement)[0].checkbox, onClick: this.onClick},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"checkbox-inner \"+BDModules.get(e => e.checkboxInner)[0].checkboxInner},\r\n BDV2.react.createElement(\"input\", {className: BDModules.get(e => e.checkboxElement)[0].checkboxElement, checked: this.state.checked, onChange: () => {}, type: \"checkbox\"}),\r\n BDV2.react.createElement(\"span\", null)\r\n ),\r\n BDV2.react.createElement(\r\n \"span\",\r\n null,\r\n this.props.text\r\n )\r\n )\r\n );\r\n }\r\n\r\n onClick() {\r\n this.props.onChange(this.props.id, !this.state.checked);\r\n this.setState({\r\n checked: !this.state.checked\r\n });\r\n }\r\n}","import {settingsCookie} from \"../0globals\";\nimport Settings from \"../modules/settingsPanel\";\nimport BDV2 from \"../modules/v2\";\nimport DataStore from \"../modules/dataStore\";\nimport DOM from \"../modules/domtools\";\nimport Utils from \"../modules/utils\"\n\nimport Checkbox from \"./checkbox\";\n\nexport default class V2C_CssEditorDetached extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n const self = this;\n self.onClick = self.onClick.bind(self);\n self.updateCss = self.updateCss.bind(self);\n self.saveCss = self.saveCss.bind(self);\n self.onChange = self.onChange.bind(self);\n }\n\n componentDidMount() {\n DOM.addClass(DOM.query(\"#app-mount\"), \"bd-detached-editor\");\n BDV2.editorDetached = true;\n // this.updateLineCount();\n this.editor = ace.edit(\"bd-customcss-editor-detached\");\n this.editor.setTheme(\"ace/theme/discord\");\n this.editor.session.setMode(\"ace/mode/css\");\n this.editor.setShowPrintMargin(false);\n this.editor.setFontSize(14);\n this.editor.on(\"change\", () => {\n if (!settingsCookie[\"bda-css-0\"]) return;\n this.saveCss();\n this.updateCss();\n });\n\n }\n\n componentWillUnmount() {\n DOM.removeClass(DOM.query(\"#app-mount\"), \"bd-detached-editor\");\n BDV2.editorDetached = false;\n this.editor.destroy();\n }\n\n updateLineCount() {\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\n if (lineCount == this.props.lines) return;\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\n this.props.lines = lineCount;\n }\n\n get options() {\n return {\n lineNumbers: true,\n mode: \"css\",\n indentUnit: 4,\n theme: \"material\",\n scrollbarStyle: \"simple\"\n };\n }\n\n get css() {\n const _ccss = DataStore.getBDData(\"bdcustomcss\");\n let ccss = \"\";\n if (_ccss && _ccss !== \"\") {\n ccss = Buffer.from(_ccss, \"base64\").toString(\"utf8\");\n }\n return ccss;\n }\n\n get root() {\n const _root = DOM.query(\"#bd-customcss-detach-container\");\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.detachedRoot;\n }\n return _root;\n }\n\n injectRoot() {\n const app = DOM.query(\".app, .\"+Utils.removeDa(BDModules.get(e => e.app && e.layers)[0].app));\n if (!app) return false;\n DOM.insertAfter(DOM.createElement(`<div id=\"bd-customcss-detach-container\">`), app);\n return true;\n }\n\n render() {\n const self = this;\n return BDV2.react.createElement(\n \"div\",\n {className: \"bd-detached-css-editor\", id: \"bd-customcss-detach-editor\"},\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-innerpane\"},\n BDV2.react.createElement(\"div\", {className: \"editor-wrapper\"},\n BDV2.react.createElement(\"div\", {id: \"bd-customcss-editor-detached\", className: \"editor\", ref: \"editor\"}, self.css)\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-attach-controls\"},\n BDV2.react.createElement(\n \"ul\",\n {className: \"checkbox-group\"},\n BDV2.react.createElement(Checkbox, {id: \"live-update\", text: \"Live Update\", onChange: self.onChange, checked: settingsCookie[\"bda-css-0\"]})\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-detach-controls-button\"},\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"3px 0 0 3px\", borderRight: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"update\");\n }},\n \"Update\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0\", borderLeft: \"1px solid #2d2d2d\", borderRight: \"1px solid #2d2d2d\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"save\");\n }},\n \"Save\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0 3px 3px 0\", borderLeft: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"attach\");\n }},\n \"Attach\"\n ),\n BDV2.react.createElement(\n \"span\",\n {style: {fontSize: \"10px\", marginLeft: \"5px\"}},\n \"Unsaved changes are lost on attach\"\n )\n )\n )\n )\n );\n }\n\n onChange(id, checked) {\n switch (id) {\n case \"live-update\":\n settingsCookie[\"bda-css-0\"] = checked;\n Settings.saveSettings();\n break;\n }\n }\n\n onClick(id) {\n const self = this;\n switch (id) {\n case \"attach\":\n if (DOM.query(\"#editor-detached\")) self.props.attach();\n BDV2.reactDom.unmountComponentAtNode(self.root);\n self.root.remove();\n break;\n case \"update\":\n self.updateCss();\n break;\n case \"save\":\n self.saveCss();\n break;\n }\n }\n\n updateCss() {\n DOM.removeStyle(\"customcss\");\n DOM.addStyle(\"customcss\", this.editor.session.getValue());\n }\n\n saveCss() {\n DataStore.setBDData(\"bdcustomcss\", Buffer.from(this.editor.session.getValue(), \"utf-8\").toString(\"base64\"));\n }\n}","import {settingsCookie} from \"../0globals\";\nimport Settings from \"../modules/settingsPanel\";\nimport BDV2 from \"../modules/v2\";\nimport DataStore from \"../modules/dataStore\";\nimport DOM from \"../modules/domtools\";\nimport Utils from \"../modules/utils\"\n\nimport SettingsTitle from \"./settingsTitle\";\nimport Checkbox from \"./checkbox\";\nimport V2C_CssEditorDetached from \"./cssEditorDetached\";\n\nexport default class V2C_CssEditor extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n const self = this;\n self.props.lines = 0;\n self.setInitialState();\n self.attach = self.attach.bind(self);\n self.detachedEditor = BDV2.react.createElement(V2C_CssEditorDetached, {attach: self.attach});\n self.onClick = self.onClick.bind(self);\n self.updateCss = self.updateCss.bind(self);\n self.saveCss = self.saveCss.bind(self);\n self.detach = self.detach.bind(self);\n }\n\n setInitialState() {\n this.state = {\n detached: this.props.detached || BDV2.editorDetached\n };\n }\n\n componentDidMount() {\n // this.updateLineCount();\n this.editor = ace.edit(\"bd-customcss-editor\");\n this.editor.setTheme(\"ace/theme/discord\");\n this.editor.session.setMode(\"ace/mode/css\");\n this.editor.setShowPrintMargin(false);\n this.editor.setFontSize(14);\n this.editor.on(\"change\", () => {\n if (!settingsCookie[\"bda-css-0\"]) return;\n this.saveCss();\n this.updateCss();\n });\n }\n\n componentWillUnmount() {\n this.editor.destroy();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const self = this;\n if (prevState.detached && !self.state.detached) {\n BDV2.reactDom.unmountComponentAtNode(self.detachedRoot);\n }\n }\n\n codeMirror() {\n }\n\n get options() {\n return {\n lineNumbers: true,\n mode: \"css\",\n indentUnit: 4,\n theme: \"material\",\n scrollbarStyle: \"simple\"\n };\n }\n\n get css() {\n const _ccss = DataStore.getBDData(\"bdcustomcss\");\n let ccss = \"\";\n if (_ccss && _ccss !== \"\") {\n ccss = Buffer.from(_ccss, \"base64\").toString(\"utf8\");\n }\n return ccss;\n }\n\n updateLineCount() {\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\n if (lineCount == this.props.lines) return;\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\n this.props.lines = lineCount;\n }\n\n render() {\n const self = this;\n\n const {detached} = self.state;\n return [\n detached && BDV2.react.createElement(\n \"div\",\n {id: \"editor-detached\"},\n BDV2.react.createElement(SettingsTitle, {text: \"Custom CSS Editor\"}),\n BDV2.react.createElement(\n \"h3\",\n null,\n \"Editor Detached\"\n ),\n BDV2.react.createElement(\n \"button\",\n {className: \"btn btn-primary\", onClick: () => {\n self.attach();\n }},\n \"Attach\"\n )\n ),\n !detached && BDV2.react.createElement(\n \"div\",\n null,\n BDV2.react.createElement(SettingsTitle, {text: \"Custom CSS Editor\"}),\n BDV2.react.createElement(\"div\", {className: \"editor-wrapper\"},\n BDV2.react.createElement(\"div\", {id: \"bd-customcss-editor\", className: \"editor\", ref: \"editor\"}, self.css)\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-attach-controls\"},\n BDV2.react.createElement(\n \"ul\",\n {className: \"checkbox-group\"},\n BDV2.react.createElement(Checkbox, {id: \"live-update\", text: \"Live Update\", onChange: this.onChange, checked: settingsCookie[\"bda-css-0\"]})\n ),\n BDV2.react.createElement(\n \"div\",\n {id: \"bd-customcss-detach-controls-button\"},\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"3px 0 0 3px\", borderRight: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"update\");\n }},\n \"Update\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0\", borderLeft: \"1px solid #2d2d2d\", borderRight: \"1px solid #2d2d2d\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"save\");\n }},\n \"Save\"\n ),\n BDV2.react.createElement(\n \"button\",\n {style: {borderRadius: \"0 3px 3px 0\", borderLeft: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\n self.onClick(\"detach\");\n }},\n \"Detach\"\n ),\n BDV2.react.createElement(\n \"span\",\n {style: {fontSize: \"10px\", marginLeft: \"5px\"}},\n \"Unsaved changes are lost on detach\"\n ),\n BDV2.react.createElement(\"div\", {className: \"help-text\"},\n \"Press \",\n BDV2.react.createElement(\"code\", {className: \"inline\"}, \"ctrl\"),\n \"+\",\n BDV2.react.createElement(\"span\", {className: \"inline\"}, \",\"),\n \" with the editor focused to access the editor's settings.\"\n )\n )\n )\n )\n ]\n }\n\n onClick(arg) {\n const self = this;\n switch (arg) {\n case \"update\":\n self.updateCss();\n break;\n case \"save\":\n self.saveCss();\n break;\n case \"detach\":\n self.detach();\n break;\n }\n }\n\n onChange(id, checked) {\n switch (id) {\n case \"live-update\":\n settingsCookie[\"bda-css-0\"] = checked;\n Settings.saveSettings();\n break;\n }\n }\n\n updateCss() {\n DOM.removeStyle(\"customcss\");\n DOM.addStyle(\"customcss\", this.editor.session.getValue());\n }\n\n saveCss() {\n DataStore.setBDData(\"bdcustomcss\", Buffer.from(this.editor.session.getValue(), \"utf-8\").toString(\"base64\"));\n }\n\n detach() {\n const self = this;\n self.setState({\n detached: true\n });\n const droot = self.detachedRoot;\n if (!droot) {\n console.log(\"FAILED TO INJECT ROOT: .app\");\n return;\n }\n BDV2.reactDom.render(self.detachedEditor, droot);\n }\n\n get detachedRoot() {\n const _root = DOM.query(\"#bd-customcss-detach-container\");\n if (!_root) {\n if (!this.injectDetachedRoot()) return null;\n return this.detachedRoot;\n }\n return _root;\n }\n\n injectDetachedRoot() {\n const app = DOM.query(\".app, .\"+Utils.removeDa(BDModules.get(e => e.app && e.layers)[0].app));\n if (!app) return false;\n DOM.insertAfter(DOM.createElement(`<div id=\"bd-customcss-detach-container\">`), app);\n return true;\n }\n\n attach() {\n const self = this;\n self.setState({\n detached: false\n });\n }\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class BDErrorBoundary extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n this.state = {hasError: false};\r\n }\r\n\r\n componentDidCatch() {\r\n this.setState({hasError: true});\r\n }\r\n\r\n render() {\r\n if (this.state.hasError) return BDV2.react.createElement(\"div\", {className: \"react-error\"}, \"Component Error\"); \r\n return this.props.children; \r\n }\r\n}\r\n\r\nconst originalRender = BDErrorBoundary.prototype.render;\r\nObject.defineProperty(BDErrorBoundary.prototype, \"render\", {\r\n enumerable: false,\r\n configurable: false,\r\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\r\n get: () => originalRender\r\n}); ","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_ContentColumn extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n static get displayName() {return \"ContentColumn\";}\r\n\r\n render() {\r\n //let contentModule = BDModules.get(e => e.contentColumn)[0]\r\n let title = this.props.title ? BDV2.react.createElement(\"h2\", {className: \"ui-form-title h2 margin-reset margin-bottom-20\"}, this.props.title) : null\r\n return [\r\n title,\r\n this.props.children\r\n ]\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: contentModule.contentColumn + \" \"+contentModule.contentColumnDefault+\" content-column default\", style: {padding: \"60px 40px 0px\"}},\r\n title,\r\n this.props.children\r\n );\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_ReloadIcon extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\"svg\", {\r\n xmlns: \"http://www.w3.org/2000/svg\",\r\n viewBox: \"0 0 24 24\",\r\n fill: \"#dcddde\",\r\n className: \"bd-reload \" + this.props.className,\r\n onClick: this.props.onClick,\r\n style: {width: this.props.size || \"24px\", height: this.props.size || \"24px\"}\r\n },\r\n BDV2.react.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\"}),\r\n BDV2.react.createElement(\"path\", {fill: \"none\", d: \"M0 0h24v24H0z\"})\r\n );\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_XSvg extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\r\n \"svg\",\r\n {xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 12 12\", style: {width: \"18px\", height: \"18px\"}},\r\n BDV2.react.createElement(\r\n \"g\",\r\n {className: \"background\", fill: \"none\", fillRule: \"evenodd\"},\r\n BDV2.react.createElement(\"path\", {d: \"M0 0h12v12H0\"}),\r\n BDV2.react.createElement(\"path\", {className: \"fill\", fill: \"#dcddde\", d: \"M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6\"})\r\n )\r\n );\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Edit extends React.Component {\n render() {\n const size = this.props.size || \"24px\";\n return <svg className={this.props.className || \"\"} viewBox=\"0 0 24 24\" fill=\"var(--text-normal)\" style={{width: size, height: size}} onClick={this.props.onClick}>\n <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\" />\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n </svg>;\n }\n}","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Delete extends React.Component {\n render() {\n const size = this.props.size || \"24px\";\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}} onClick={this.props.onClick}>\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><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\"/>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"/>\n </svg>;\n }\n}","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"../modules/v2\";\nimport Utils from \"../modules/utils\";\nimport DOM from \"../modules/domtools\";\n\nimport XSvg from \"./xSvg\";\nimport ReloadIcon from \"./reloadIcon\";\nimport EditIcon from \"./icons/edit\";\nimport DeleteIcon from \"./icons/delete\";\nimport Switch from \"./components/switch\";\nimport TooltipWrap from \"./tooltipWrap\";\nimport { processFile } from \"../modules/pluginCertifier\";\nimport contentManager from \"../modules/contentManager\";\nimport { resolve } from \"path\";\n\nconst React = BDV2.React;\nconst anchorClasses = BDV2.anchorClasses;\n\nexport default class V2C_PluginCard extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n this.showSettings = this.showSettings.bind(this);\n this.setInitialState();\n this.hasSettings = this.props.addon.plugin && typeof(this.props.addon.plugin.getSettingsPanel) === \"function\";\n this.settingsPanel = \"\";\n\n this.edit = this.edit.bind(this);\n this.delete = this.delete.bind(this);\n this.reload = this.reload.bind(this);\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.enabled,\n settings: false,\n reloads: 0,\n trusted: false\n };\n }\n\n showSettings() {\n if (!this.hasSettings) return;\n this.setState({settings: true});\n }\n\n closeSettings() {\n this.panelRef.current.innerHTML = \"\";\n this.setState({settingsOpen: false});\n }\n\n componentDidUpdate() {\n if (!this.state.settings) return;\n if (typeof this.settingsPanel === \"object\") {\n this.refs.settingspanel.appendChild(this.settingsPanel);\n }\n\n if (!settingsCookie[\"fork-ps-3\"]) return;\n setImmediate(() => {\n const isHidden = (container, element) => {\n if(!container){\n console.error(new Error(`Container is undefined.`))\n return false\n }\n const cTop = container.scrollTop;\n const cBottom = cTop + container.clientHeight;\n const eTop = element.offsetTop;\n const eBottom = eTop + element.clientHeight;\n return (eTop < cTop || eBottom > cBottom);\n };\n\n const thisNode = this.refs.cardNode;\n const container = thisNode.closest(\"div[class*=\\\"contentRegionScroller-\\\"]\")\n if (!isHidden(container, thisNode)) return;\n const thisNodeOffset = DOM.offset(thisNode);\n const containerOffset = DOM.offset(container);\n const original = container.scrollTop;\n const endPoint = thisNodeOffset.top - containerOffset.top + container.scrollTop - 30;\n DOM.animate({\n duration: 300,\n update: function(progress) {\n if (endPoint > original) container.scrollTop = original + (progress * (endPoint - original));\n else container.scrollTop = original - (progress * (original - endPoint));\n }\n });\n });\n }\n\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n get settingsComponent() {\n try { this.settingsPanel = this.props.addon.plugin.getSettingsPanel(); }\n catch (err) { Utils.err(\"Plugins\", \"Unable to get settings panel for \" + this.name + \".\", err); }\n\n return BDV2.react.createElement(\"div\", {className: \"bd-card bd-addon-card settings-open ui-switch-item\", ref: \"cardNode\"},\n BDV2.react.createElement(\"div\", {style: {\"float\": \"right\", \"cursor\": \"pointer\"}, onClick: () => {\n this.refs.settingspanel.innerHTML = \"\";\n this.setState({settings: false});\n }},\n BDV2.react.createElement(XSvg, null)\n ),\n typeof this.settingsPanel === \"object\" && BDV2.react.createElement(\"div\", {id: `plugin-settings-${this.name}`, className: \"plugin-settings\", ref: \"settingspanel\"}),\n typeof this.settingsPanel !== \"object\" && BDV2.react.createElement(\"div\", {id: `plugin-settings-${this.name}`, className: \"plugin-settings\", ref: \"settingspanel\", dangerouslySetInnerHTML: {__html: this.settingsPanel}})\n );\n }\n\n buildTitle(name, version, author) {\n const title = \"{{name}} v{{version}} by {{author}}\".split(/({{[A-Za-z]+}})/);\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\n if (nameIndex) title[nameIndex] = React.createElement(\"span\", {className: \"name bda-name\"}, name);\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\n if (nameIndex) title[versionIndex] = React.createElement(\"span\", {className: \"version bda-version\"}, version);\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\n if (nameIndex) {\n const props = {className: \"author bda-author\"};\n if (author.link || author.id) {\n props.className += ` ${anchorClasses.anchor} ${anchorClasses.anchorUnderlineOnHover}`;\n props.target = \"_blank\";\n\n if (author.link) props.href = author.link;\n if (author.id) props.onClick = () => {BDV2.LayerStack.popLayer(); BDV2.openDM(author.id);};\n }\n title[authorIndex] = React.createElement(author.link || author.id ? \"a\" : \"span\", props, author.name);\n }\n return title.flat();\n }\n\n makeLink(title, url) {\n const props = {className: \"bda-link bda-link-website\", target: \"_blank\"};\n if (typeof(url) == \"string\") props.href = url;\n if (typeof(url) == \"function\") props.onClick = (event) => {event.preventDefault(); event.stopPropagation(); url();};\n return BDV2.react.createElement(\"a\", props, title);\n }\n\n makeButton(title, children, action) {\n return <TooltipWrap color=\"black\" side=\"top\" text={title}>\n <div className=\"bd-addon-button\" onClick={action}>{children}</div>\n </TooltipWrap>;\n }\n\n componentWillUnmount(){\n this.unmounted = true\n }\n\n get links() {\n const links = [];\n const addon = this.props.addon;\n if (addon.website) links.push(this.makeLink(\"Website\", addon.website));\n if (addon.source) links.push(this.makeLink(\"Source\", addon.source));\n if (addon.invite) {\n links.push(this.makeLink(\"Support Server\", () => {\n const tester = /\\.gg\\/(.*)$/;\n let code = addon.invite;\n if (tester.test(code)) code = code.match(tester)[1];\n BDV2.LayerStack.popLayer();\n BDV2.InviteActions.acceptInviteAndTransitionToInviteChannel(code);\n }));\n }\n if (addon.donate) links.push(this.makeLink(\"Donate\", addon.donate));\n if (addon.patreon) links.push(this.makeLink(\"Patreon\", addon.patreon));\n return links;\n }\n\n get footer() {\n const links = this.links;\n return (links.length || this.hasSettings) && BDV2.react.createElement(\"div\", {className: \"bd-card-footer bda-footer\"},\n BDV2.react.createElement(\"span\", {className: \"bd-addon-links bda-links\"},\n ...(links.map((element, index) => index < links.length - 1 ? [element, \" | \"] : element).flat())\n ),\n this.hasSettings && BDV2.react.createElement(\"button\", {onClick: this.showSettings, className: \"bd-button bda-settings-button\", disabled: !this.state.checked}, \"Settings\")\n );\n }\n\n onChange() {\n this.props.toggle && this.props.toggle(this.name);\n this.setState({checked: !this.state.checked});\n }\n\n edit() {this.props.edit(this.name);}\n delete() {this.props.remove(this.name);}\n reload() {this.props.reload(this.name);}\n\n get name() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() : this.props.addon.name);}\n get author() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);}\n get description() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);}\n get version() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);}\n\n render() {\n if (this.state.settings) return this.settingsComponent;\n const {authorId, authorLink} = this.props.addon;\n\n const style = {}\n if(settingsCookie[\"fork-ps-6\"]){\n if(!this.isScanning){\n this.isScanning = true\n processFile(resolve(this.props.addon.filename.endsWith(\".plugin.js\") ? contentManager.pluginsFolder : contentManager.themesFolder, this.props.addon.filename), (result) => {\n if(this.unmounted)return\n \n this.setState({\n isTrusted: result.suspect ? \"suspect\" : true\n })\n }, () => {})\n }else{\n if(this.state.isTrusted === true){\n style.borderColor = \"#4087ed\"\n }\n if(this.state.isTrusted === \"suspect\"){\n style.borderColor = \"rgb(240, 71, 71)\"\n }\n }\n }\n \n return BDV2.react.createElement(\"div\", {className: \"bd-card bd-addon-card settings-closed ui-switch-item\", style},\n BDV2.react.createElement(\"div\", {className: \"bd-addon-header bda-header\"},\n BDV2.react.createElement(\"div\", {className: \"bd-card-title bda-header-title\"}, this.buildTitle(this.name, this.version, {name: this.author, id: authorId, link: authorLink})),\n BDV2.react.createElement(\"div\", {className: \"bd-addon-controls bda-controls\"},\n this.props.edit && this.makeButton(\"Edit\", <EditIcon className=\"bd-icon\" />, this.edit),\n this.props.remove && this.makeButton(\"Delete\", <DeleteIcon className=\"bd-icon\" />, this.delete),\n this.props.reload && this.makeButton(\"Reload\", <ReloadIcon className=\"bd-icon\" />, this.reload),\n React.createElement(Switch, {onChange: this.onChange, checked: this.state.checked})\n )\n ),\n BDV2.react.createElement(\"div\", {className: \"bd-scroller-wrap bda-description-wrap scroller-wrap fade\"},\n BDV2.react.createElement(\"div\", {className: \"bd-scroller bd-addon-description bda-description scroller\"}, this.description)\n ),\n this.footer\n );\n }\n}\n\nconst originalRender = V2C_PluginCard.prototype.render;\nObject.defineProperty(V2C_PluginCard.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\n get: () => originalRender\n});","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class DownArrow extends React.Component {\n render() {\n const size = this.props.size || \"16px\";\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}}>\n <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\"/>\n </svg>;\n }\n}","import BDV2 from \"../../modules/v2\";\r\nimport Arrow from \"../icons/downarrow\";\r\n\r\nconst React = BDV2.React;\r\n\r\n\r\nexport default class Select extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {open: false, value: this.props.value || this.props.options[0].value};\r\n this.dropdown = React.createRef();\r\n this.onChange = this.onChange.bind(this);\r\n this.showMenu = this.showMenu.bind(this);\r\n this.hideMenu = this.hideMenu.bind(this);\r\n }\r\n\r\n showMenu(event) {\r\n event.preventDefault();\r\n this.setState({open: true}, () => {\r\n document.addEventListener(\"click\", this.hideMenu);\r\n });\r\n }\r\n\r\n hideMenu() {\r\n this.setState({open: false}, () => {\r\n document.removeEventListener(\"click\", this.hideMenu);\r\n });\r\n }\r\n\r\n onChange(value) {\r\n this.setState({value});\r\n if (this.props.onChange) this.props.onChange(value);\r\n }\r\n\r\n get selected() {return this.props.options.find(o => o.value == this.state.value);}\r\n\r\n get options() {\r\n const selected = this.selected;\r\n return <div className=\"bd-select-options\">\r\n {this.props.options.map(opt => \r\n <div className={`bd-select-option${selected.value == opt.value ? \" selected\" : \"\"}`} onClick={this.onChange.bind(this, opt.value)}>{opt.label}</div>\r\n )}\r\n </div>;\r\n }\r\n\r\n render() {\r\n const style = this.props.style == \"transparent\" ? \" bd-select-transparent\" : \"\";\r\n const isOpen = this.state.open ? \" menu-open\" : \"\";\r\n return <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\r\n <div className=\"bd-select-value\">{this.selected.label}</div>\r\n <Arrow className=\"bd-select-arrow\" />\r\n {this.state.open && this.options}\r\n </div>;\r\n }\r\n}\r\n\r\n// return <div className=\"bd-select-wrap\">\r\n// <label className=\"bd-label\">{this.props.label}</label>\r\n// <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\r\n// <div className=\"bd-select-controls\">\r\n// <div className=\"bd-select-value\">{this.selected.label}</div>\r\n// <Arrow className=\"bd-select-arrow\" />\r\n// </div>\r\n// </div>\r\n// {this.state.open && this.options}\r\n// </div>;","import BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class Search extends React.Component {\n render() {\n const size = this.props.size || \"16px\";\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}}>\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\"/>\n <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\"/>\n </svg>;\n }\n}","import BDV2 from \"../../modules/v2\";\nimport SearchIcon from \"../icons/search\";\n\nconst React = BDV2.React;\n\nexport default class Search extends React.Component {\n constructor(props){\n super(props)\n this.state = {\n focused: false\n }\n }\n render() {\n const className = [\"bd-search-wrapper\"]\n if(this.state.focused)className.push(\"focused\")\n return <div className={className.join(\" \")}>\n <input onChange={this.props.onChange} onKeyDown={this.props.onKeyDown} type=\"text\" \n className=\"bd-search\" placeholder={this.props.placeholder} maxLength=\"50\" \n onFocus={() => {\n this.setState({focused: true})\n }} onBlur={() => {\n this.setState({focused: false})\n }}/>\n <SearchIcon />\n </div>;\n }\n}","import ErrorBoundary from \"./errorBoundary\";\nimport ContentColumn from \"./contentColumn\";\nimport ReloadIcon from \"./reloadIcon\";\nimport AddonCard from \"./addoncard\";\nimport Dropdown from \"./components/dropdown\";\nimport Search from \"./components/search\";\n\nimport {settingsCookie, pluginCookie, themeCookie, bdplugins, bdthemes} from \"../0globals\";\nimport ContentManager from \"../modules/contentManager\";\nimport BDV2 from \"../modules/v2\";\nimport pluginModule from \"../modules/pluginModule\";\nimport themeModule from \"../modules/themeModule\";\nimport WebpackModules from \"../modules/webpackModules\";\nimport BdApi from \"../modules/bdApi\";\nimport Utils from \"../modules/utils\";\nimport TooltipWrap from \"./tooltipWrap\";\nimport bdEvents from \"../modules/bdEvents\";\nimport EmulatedTooltip from \"./tooltip\";\n\nconst Tooltip = WebpackModules.findByDisplayName(\"Tooltip\");\n\nconst React = BDV2.react;\n\nexport default class CardList extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n this.state = {sort: \"name\", ascending: true, query: \"\"};\n this.isPlugins = this.props.type == \"plugins\";\n this.cookie = this.isPlugins ? pluginCookie : themeCookie;\n this.manager = this.isPlugins ? pluginModule : themeModule;\n\n this.sort = this.sort.bind(this);\n this.reverse = this.reverse.bind(this);\n this.search = this.search.bind(this);\n\n this.onAddonChanges = function(){\n this.forceUpdate()\n }\n this.onAddonChanges = this.onAddonChanges.bind(this)\n }\n\n componentDidMount(){\n const type = (this.isPlugins ? \"plugin\" : \"theme\") + \"-\"\n bdEvents.on(`${type}loaded`, this.onAddonChanges)\n bdEvents.on(`${type}unloaded`, this.onAddonChanges)\n bdEvents.on(`${type}reloaded`, this.onAddonChanges)\n }\n\n componentWillUnmount(){\n const type = (this.isPlugins ? \"plugin\" : \"theme\") + \"-\"\n bdEvents.off(`${type}loaded`, this.onAddonChanges)\n bdEvents.off(`${type}unloaded`, this.onAddonChanges)\n bdEvents.off(`${type}reloaded`, this.onAddonChanges)\n }\n\n openFolder() {\n const shell = require(\"electron\").shell;\n const open = shell.openPath || shell.openItem;\n open(this.isPlugins ? ContentManager.pluginsFolder : ContentManager.themesFolder);\n }\n\n edit(name) {\n console.log(name);\n this.manager.edit(name);\n }\n\n async delete(name) {\n const shouldDelete = await this.confirmDelete(name);\n if (!shouldDelete) return;\n this.manager.delete(name);\n }\n\n confirmDelete(name) {\n return new Promise(resolve => {\n BdApi.showConfirmationModal(\"Are You Sure?\", `Are you sure you want to delete ${name}?`, {\n danger: true,\n confirmText: \"Delete\",\n onConfirm: () => {resolve(true);},\n onCancel: () => {resolve(false);}\n });\n });\n }\n\n get sortOptions() {\n return [\n {label: \"Name\", value: \"name\"},\n {label: \"Author\", value: \"author\"},\n {label: \"Version\", value: \"version\"},\n {label: \"Recently Added\", value: \"added\"},\n {label: \"Last Modified\", value: \"modified\"},\n {label: \"File Size\", value: \"size\"},\n ];\n }\n\n get directions() {\n return [\n {label: \"Ascending\", value: true},\n {label: \"Descending\", value: false}\n ];\n }\n\n reverse(value) {\n this.setState({ascending: value});\n }\n\n sort(value) {\n this.setState({sort: value});\n }\n\n search(event) {\n this.setState({query: event.target.value.toLocaleLowerCase()});\n }\n\n getProps(addon) {\n return {\n key: this.getName(addon),\n enabled: this.cookie[this.getName(addon)],\n toggle: this.manager.toggle.bind(this.manager),\n edit: settingsCookie[\"fork-ps-7\"] ? this.edit.bind(this) : null,\n remove: this.delete.bind(this),\n addon: addon,\n hash: addon.hash\n };\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n get list(){\n return this.props.type === \"plugins\" ? Object.values(bdplugins) : Object.values(bdthemes);\n }\n\n getAddons() {\n const sortedAddons = this.list.sort((a, b) => {\n const cap = this.state.sort.charAt(0).toUpperCase() + this.state.sort.slice(1);\n const first = a.plugin && a.plugin[`get${cap}`] ? this.getString(a.plugin[`get${cap}`]()) : this.getString(a[this.state.sort]);\n const second = b.plugin && b.plugin[`get${cap}`] ? this.getString(b.plugin[`get${cap}`]()) : this.getString(b[this.state.sort]);\n if (typeof(first) == \"string\") return first.toLocaleLowerCase().localeCompare(second.toLocaleLowerCase());\n if (first > second) return 1;\n if (second > first) return -1;\n return 0;\n });\n if (!this.state.ascending) sortedAddons.reverse();\n const rendered = [];\n for (let a = 0; a < sortedAddons.length; a++) {\n const addon = sortedAddons[a];\n if (this.state.query) {\n let matches = null;\n const name = this.getName(addon);\n const author = this.getAuthor(addon);\n const description = this.getDescription(addon);\n const version = this.getVersion(addon);\n if (name) matches = name.toLocaleLowerCase().includes(this.state.query);\n if (author) matches = matches || author.toLocaleLowerCase().includes(this.state.query);\n if (description) matches = matches || description.toLocaleLowerCase().includes(this.state.query);\n if (version) matches = matches || version.toLocaleLowerCase().includes(this.state.query);\n if (!matches) continue;\n }\n const props = this.getProps(addon);\n rendered.push(<ErrorBoundary><AddonCard {...props} reload={!settingsCookie[\"fork-ps-5\"] && this.manager.reload.bind(this.manager)} /></ErrorBoundary>);\n }\n return rendered;\n }\n\n getName(addon) {return this.getString(addon.plugin ? addon.plugin.getName() : addon.name);}\n getAuthor(addon) {return this.getString(addon.plugin ? addon.plugin.getAuthor() : addon.author);}\n getDescription(addon) {return this.getString(addon.plugin ? addon.plugin.getDescription() : addon.description);}\n getVersion(addon) {return this.getString(addon.plugin ? addon.plugin.getVersion() : addon.version);}\n\n renderCheckUpdates(){\n if(!window.ZeresPluginLibrary)return null\n if(!window.PluginUpdates)return null\n if(typeof window.PluginUpdates.checkAll !== \"function\")return null\n if(!this.isPlugins)return null\n\n let tooltipIsShowing = false\n let tooltip\n return <TooltipWrap text=\"Checks for updates of plugins that support this feature. Right-click for a list.\">\n <span style={{marginLeft: \"10px\"}} onMouseLeave={() => {\n tooltipIsShowing = false\n tooltip.hide()\n }}>\n <Lightcord.Api.Components.inputs.Button ref=\"checkUpdateButton\" color=\"brand\" look=\"filled\" size=\"min\" hoverColor=\"default\" onClick={() => {\n try{\n Utils.showToast(\"Plugin update check in progress.\", {type: \"info\"})\n window.PluginUpdates.checkAll()\n .then(() => {\n Utils.showToast(\"Plugin update check complete.\", {type: \"success\"})\n }).catch(err => {\n console.error(err)\n Utils.showToast(\"An error occured while checking update.\", {type: \"error\"})\n })\n }catch(e){\n console.error(e)\n Utils.showToast(\"An error occured while checking update.\", {type: \"error\"})\n }\n }} wrapper={false} disabled={false} onRightClick={() => {\n if(!this.refs.checkUpdateButton)return\n if (!window.PluginUpdates || !window.PluginUpdates.plugins) return;\n if(tooltipIsShowing)return\n tooltip = new EmulatedTooltip(this.refs.checkUpdateButton.refs.original.refs.button, Object.values(window.PluginUpdates.plugins).map(p => p.name).join(\", \"), {\n side: \"bottom\",\n attachEvents: false\n })\n tooltip.show()\n tooltipIsShowing = true\n }}>\n Check for Updates\n </Lightcord.Api.Components.inputs.Button>\n </span>\n </TooltipWrap>\n }\n\n render() {\n const refreshIcon = <Tooltip color=\"black\" position=\"top\" text=\"Reload List\">\n {(props) => \n <ReloadIcon {...props} className=\"bd-icon bd-reload bd-reload-header\" size=\"18px\" onClick={async () => {\n if (this.isPlugins) pluginModule.updatePluginList();\n else themeModule.updateThemeList();\n this.forceUpdate();\n }} />\n }</Tooltip>;\n const addonCards = this.getAddons();\n\n return <ContentColumn title={`${this.props.type.toUpperCase()}—${addonCards.length}`}>\n <Lightcord.Api.Components.inputs.Button key=\"folder-button\" color=\"brand\" \n look=\"filled\" size=\"min\" hoverColor=\"default\" onClick={this.openFolder.bind(this)} wrapper={false}\n style={{\n marginLeft: \"10px\"\n }}>\n Open {this.isPlugins ? \"Plugin\" : \"Theme\"} Folder\n </Lightcord.Api.Components.inputs.Button>\n {this.renderCheckUpdates()}\n {!settingsCookie[\"fork-ps-5\"] && refreshIcon}\n <div className=\"bd-controls bd-addon-controls\">\n <Search onChange={this.search} placeholder={`Search ${this.props.type}...`} />\n <div className=\"bd-addon-dropdowns\">\n <div className=\"bd-select-wrapper\">\n <label className=\"bd-label\">Sort by:</label>\n <Dropdown options={this.sortOptions} onChange={this.sort} style=\"transparent\" />\n </div>\n <div className=\"bd-select-wrapper\">\n <label className=\"bd-label\">Order:</label>\n <Dropdown options={this.directions} onChange={this.reverse} style=\"transparent\" />\n </div>\n \n </div>\n </div>\n <div className=\"bda-slist bd-addon-list\">{addonCards}</div>\n </ContentColumn>\n }\n}\n\nconst originalRender = CardList.prototype.render;\nObject.defineProperty(CardList.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\n get: () => originalRender\n});","import {settingsRPC, defaultRPC} from \"../0globals\";\r\n\r\nconst dispatcher = BDModules.get(m=>m.Dispatcher&&m.default&&m.default.dispatch)[0].default\r\nconst ActionTypes = BDModules.get(m=>m.ActionTypes)[0].ActionTypes\r\n\r\nconst socketId = \"lightcord-spoof-socket\"\r\nconst pid = process.pid\r\n\r\nexport default new class CustomRichPresence {\r\n constructor(){\r\n this.enabled = false\r\n\r\n this.game = settingsRPC\r\n }\r\n \r\n get formatedGame(){\r\n if(!this.game)return null\r\n if(this.enabled === false)return null\r\n let game = {\r\n name: this.game.name || defaultRPC.name,\r\n application_id: this.game.application_id || defaultRPC.application_id,\r\n details: this.game.details || undefined,\r\n state: this.game.state || undefined,\r\n timestamps: this.game[\"timestamps.start\"] ? {\r\n start: this.game[\"timestamps.start\"]\r\n } : undefined,\r\n assets: this.game[\"assets.large\"] ? {\r\n large_image: this.game[\"assets.large\"],\r\n small_image: this.game[\"assets.small\"] || undefined\r\n } : undefined\r\n }\r\n return game\r\n }\r\n\r\n sendGame(){\r\n dispatcher.dispatch({\r\n type: ActionTypes.LOCAL_ACTIVITY_UPDATE,\r\n socketId,\r\n pid,\r\n activity: this.formatedGame\r\n }) \r\n }\r\n\r\n enable() {\r\n if(this.enabled)return\r\n this.enabled = true\r\n console.log(\"Enabling custom RichPresence\")\r\n\r\n this.set(settingsRPC || Object.create(defaultRPC))\r\n\r\n this.sendGame()\r\n }\r\n\r\n disable() {\r\n if(!this.enabled)return\r\n this.enabled = false\r\n console.log(\"Disabling custom RichPresence\")\r\n\r\n this.sendGame()\r\n }\r\n\r\n async fetchAssets(applicationId){\r\n let assets = await BDModules.get(e => e.getAssets)[0].getAssets(applicationId)\r\n if(assets.undefined && typeof assets.undefined === \"number\"){\r\n throw new Error(\"Unknown Application\")\r\n }\r\n return assets\r\n }\r\n\r\n set(activity){\r\n this.game = activity\r\n\r\n this.sendGame()\r\n }\r\n}","import BDV2 from \"../modules/v2\";\nimport V2C_SettingsTitle from \"./settingsTitle\";\nimport V2C_SettingsGroup from \"./settingsGroup\";\nimport dataStore from \"../modules/dataStore\";\nimport { defaultRPC, settingsRPC } from \"../0globals\";\nimport CustomRichPresence from \"../modules/CustomRichPresence\"\nimport { remote } from \"electron\";\nimport MarginTop from \"./margintop\";\nimport Utils from \"../modules/utils\";\n\nconst React = BDV2.React;\n\nlet V2C_PresenceSettingsModules\nexport default class V2C_PresenceSettings extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n data: dataStore.getSettingGroup(\"rpc\") || defaultRPC,\n assets: []\n }\n\n this.preview = null\n this.isfetching = false\n if(this.state.data.application_id){\n this.fetchAssets()\n }\n\n this.assetComponents = new Set()\n }\n\n updateWhenFetched(comp){\n this.assetComponents.add(comp)\n }\n\n /**\n * \n * @param {InputText} setting \n */\n onChange(setting, value){\n let defaultSetting = RPCProps.find(e => e.id === setting.props.id)\n\n this.setState({\n data: Object.assign(settingsRPC, this.state.data, {\n [defaultSetting.id]: !!value ? value : null\n }),\n assets: this.state.assets\n })\n if(setting.props.id === \"application_id\"){\n this.fetchAssets()\n }\n\n dataStore.setSettingGroup(\"rpc\", settingsRPC);\n this.preview.forceUpdate()\n CustomRichPresence.set(settingsRPC)\n }\n\n fetchAssets(){\n if(this.isfetching === true){\n let app = this.state.data.application_id\n setTimeout(() => {\n if(this.state.data.application_id !== app){\n return\n }\n this.fetchAssets()\n }, 5000);\n }\n if(!this.state.data.application_id){\n this.setState({\n data: this.state.data,\n assets: []\n })\n this.forceUpdate()\n this.assetComponents.forEach(e => e.forceUpdate())\n return\n }\n this.isfetching = true\n CustomRichPresence.fetchAssets(this.state.data.application_id)\n .then(assets => {\n this.isfetching = false\n this.setState({\n data: this.state.data,\n assets: Object.keys(assets).map(k => {\n let asset = assets[k]\n return {\n id: asset.id,\n name: asset.name,\n type: asset.type\n }\n })\n })\n this.forceUpdate()\n this.assetComponents.forEach(e => e.forceUpdate())\n }).catch(() => {\n this.isfetching = false\n this.setState({\n data: this.state.data,\n assets: []\n })\n this.forceUpdate()\n this.assetComponents.forEach(e => e.forceUpdate())\n })\n }\n\n updatePreview(data){\n this.setState({\n data\n })\n }\n\n get modules(){\n return V2C_PresenceSettingsModules || (V2C_PresenceSettingsModules = [\n BDModules.get(e => e.marginBottom20)[0]\n ])\n }\n\n render() {\n let [\n marginModule\n ] = this.modules\n return [\n <V2C_SettingsGroup title=\"RichPresence Settings\" settings={this.props.settings} onChange={this.props.onChange}/>,\n <MarginTop />,\n <V2C_SettingsTitle text=\"RichPresence\"/>,\n <div>\n {/** options */}\n {this.optionsComponents}\n </div>,\n <div>\n <MarginTop />\n <V2C_SettingsTitle text=\"Preview\"/>\n {/** preview */}\n <RpcPreview settings={this}/>\n </div>,\n <div className={marginModule.marginBottom20}></div>,\n <button style={{opacity: 0.01}} onClick={window.ohgodohfuck}>\n Oh god Oh fuck\n </button>,\n <button style={{opacity: 0.01}} onClick={() => {\n remote.shell.openExternal(\"https://www.youtube.com/watch?v=LkYa7rps_g4\")\n }}>\n See ? I pulled a litle sneaky on ya\n </button>\n ]\n }\n\n get optionsComponents(){\n return this._optionsComponents || (this._optionsComponents = RPCProps.map(e => {\n if(e.type === \"text\"){\n return <InputText setting={e} manager={this} id={e.id}/>\n }else if(e.type === \"number\"){\n let array = [<InputNumber setting={e} manager={this} id={e.id}/>]/*\n if(e.id === \"timestamps.start\"){\n array.unshift(<DiscordButton title=\"Copy Current Timestamp\" onClick={() => {\n DiscordNative.clipboard.copy(Date.now()+\"\")\n }} />)\n }*/\n return array\n }else if(e.type === \"choice\"){\n if([\"assets.small\", \"assets.large\"].includes(e.id)){\n return <InputChoice setting={e} manager={this} id={e.id} choices={[{value: \"none\", label: \"No assets\"}].concat(this.state.assets.map(e => {\n return {\n value: \"asset-\"+e.id,\n label: e.name\n }\n }))}/>\n }else{\n return \"Unknown choice.\"\n }\n }\n }))\n }\n}\nconst RPCProps = [\n {\n title: \"Application ID\",\n id: \"application_id\",\n type: \"number\",\n placeholder: \"711416957718757418\"\n },\n {\n title: \"Name\",\n id: \"name\",\n type: \"text\",\n placeholder: \"Lightcord\"\n },\n {\n title: \"Details\",\n id: \"details\",\n type: \"text\",\n placeholder: \"Browsing Discord\"\n },\n {\n title: \"State\",\n id: \"state\",\n type: \"text\",\n placeholder: \"Lightcord Client\"\n },\n {\n title: \"Timestamp Start\",\n id: \"timestamps.start\",\n type: \"number\",\n get placeholder(){\n return Date.now()\n }\n },\n {\n title: \"LargeAsset\",\n id: \"assets.large\",\n type: \"choice\"\n },\n {\n title: \"SmallAsset\",\n id: \"assets.small\",\n type: \"choice\"\n },\n]\n\nlet inputTextModules\nclass InputText extends React.PureComponent {\n get modules(){\n if(inputTextModules && inputTextModules[0])return inputTextModules\n return inputTextModules = [\n BDModules.get(e => e.removeKeybind)[0],\n BDModules.get(e => e.marginBottom20)[0],\n BDModules.get(e => e.defaultMarginh5)[0],\n BDModules.get(e => e.colorStandard)[0],\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e._horizontal)[0],\n BDModules.get(e => e.inputMini)[0],\n BDModules.get(e => e.size16 && e.size20)[0],\n ]\n }\n\n constructor(props){\n super(props)\n let setting = this.props.setting\n this.state = {\n data: this.props.manager.state.data[setting.id]\n }\n\n this.input = <window.Lightcord.Api.Components.inputs.TextInput placeholder={setting.placeholder} name={setting.id} value={this.state.data} onChange={(value) => {\n this.setState({\n data: value\n })\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\n this.props.manager.onChange(this, value)\n this.lastEdited = Date.now()\n }else if(!this.isTiming){\n this.isTiming = setTimeout(() => {\n this.props.manager.onChange(this, this.state.data)\n this.isTiming = null\n this.lastEdited = Date.now()\n }, 500);\n }\n }} type=\"text\"/>\n }\n\n render(){\n let setting = this.props.setting\n\n let [\n rowModule,\n marginModule,\n marginModule2,\n colorModule,\n sizeModule,\n flexModule,\n inputModule,\n sizeModule2,\n ] = this.modules\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n {setting.title}\n </h5>\n {this.input}\n </div>\n <Divider/>\n </div>)\n }\n}\n\nlet InputNumberModules\nclass InputNumber extends React.PureComponent {\n get modules(){\n return InputNumberModules || (InputNumberModules = [\n BDModules.get(e => e.removeKeybind)[0],\n BDModules.get(e => e.marginBottom20)[0],\n BDModules.get(e => e.defaultMarginh5)[0],\n BDModules.get(e => e.colorStandard)[0],\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e._horizontal)[0],\n BDModules.get(e => e.inputMini)[0],\n BDModules.get(e => e.size16 && e.size20)[0],\n BDModules.get(e => e.colorTransparent)[0],\n ])\n }\n\n constructor(props){\n super(props)\n let setting = this.props.setting\n this.state = {\n data: this.props.manager.state.data[setting.id]\n }\n\n this.input = <window.Lightcord.Api.Components.inputs.TextInput placeholder={setting.placeholder} name={setting.id} value={this.state.data} type=\"number\" onChange={(value, name, input) => {\n value = value.replace(/[^\\d]+/g, \"\")\n if(value == this.state.data){\n input.setValue(value)\n return\n }\n\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\n this.props.manager.onChange(this, value)\n this.lastEdited = Date.now()\n }else if(!this.isTiming){\n this.isTiming = setTimeout(() => {\n this.props.manager.onChange(this, this.state.data)\n this.isTiming = null\n this.lastEdited = Date.now()\n }, 500);\n }\n this.setState({\n data: value\n })\n }} type=\"text\"/>\n }\n\n render(){\n let setting = this.props.setting\n\n let [\n rowModule,\n marginModule,\n marginModule2,\n colorModule,\n sizeModule,\n flexModule,\n ] = this.modules\n\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n {setting.title}\n </h5>\n {this.input}\n {setting.id === \"timestamps.start\" ? \n <Lightcord.Api.Components.inputs.Button onClick={() => {\n DiscordNative.clipboard.copy(Date.now()+\"\")\n }} color=\"brand\">Copy current timestamp</Lightcord.Api.Components.inputs.Button> : null}\n </div>\n <Divider/>\n </div>)\n }\n}\n\nlet InputChoiceModules\nclass InputChoice extends React.PureComponent {\n constructor(props){\n super(props)\n let setting = this.props.setting\n this.state = {\n data: this.props.manager.state.data[setting.id] ? \"asset-\"+this.props.manager.state.data[setting.id] : \"none\"\n }\n this.props.manager.updateWhenFetched(this)\n }\n\n onChange(value){\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\n this.props.manager.onChange(this, value === \"none\" ? null : value.replace(\"asset-\", \"\"))\n this.lastEdited = Date.now()\n }else if(!this.isTiming){\n this.isTiming = setTimeout(() => {\n this.props.manager.onChange(this, this.state.data === \"none\" ? null : this.state.data.replace(\"asset-\", \"\"))\n this.isTiming = null\n this.lastEdited = Date.now()\n }, 500);\n }\n this.setState({\n data: value\n })\n this.forceUpdate()\n }\n \n get modules(){\n return InputChoiceModules || (InputChoiceModules = [\n BDModules.get(e => e.removeKeybind)[0],\n BDModules.get(e => e.marginBottom20)[0],\n BDModules.get(e => e.defaultMarginh5)[0],\n BDModules.get(e => e.colorStandard)[0],\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e._horizontal)[0]\n ])\n }\n\n render(){\n let setting = this.props.setting\n\n let [\n rowModule,\n marginModule,\n marginModule2,\n colorModule,\n sizeModule,\n flexModule\n ] = this.modules\n \n let options = this.props.manager.state.assets.map(e => {\n return {\n value: \"asset-\"+e.id,\n label: e.name\n }\n })\n\n options.unshift({\n value: \"none\",\n label: \"No assets\"\n })\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n {setting.title}\n </h5>\n <window.Lightcord.Api.Components.inputs.Dropdown value={this.state.data} options={options} onChange={this.onChange.bind(this)} />\n {/*<Select value={this.state.data} onChange={this.onChange.bind(this)} options={options}/>*/}\n </div>\n <Divider/>\n </div>)\n }\n}\n\nlet DividerModules = []\nclass Divider extends React.PureComponent {\n get modules(){\n return DividerModules&&DividerModules[0] ? DividerModules : (DividerModules = [\n BDModules.get(e => e.divider && Object.keys(e).length === 1)[0],\n BDModules.get(e => e.dividerDefault)[0]\n ])\n }\n\n render(){\n let [\n divider,\n dividerDefault\n ] = this.modules\n\n return <div class={`${divider.divider} ${dividerDefault.dividerDefault}`}></div>\n }\n}\n\nclass DiscordButton extends React.Component {\n render(){\n let rowModule = BDModules.get(e => e.removeKeybind)[0]\n let marginModule = BDModules.get(e => e.marginBottom20)[0]\n let flexModule = BDModules.get(e => e._horizontal)[0]\n\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\n <Lightcord.Api.Components.inputs.Button onClick={this.props.onClick} color=\"brand\">\n {this.props.title}\n </Lightcord.Api.Components.inputs.Button>\n </div>\n </div>)\n }\n}\n\nclass RpcPreview extends React.Component {\n constructor(props = {}){\n super(props)\n this.state = {\n active: \"profile\"\n }\n this.tabs = []\n\n this.props.settings.preview = this\n }\n\n changeTab(tab){\n let ancientTab = this.state.active\n if(ancientTab === tab.props.id)return\n\n this.tabs.forEach(e => {\n e.setActive(false)\n })\n tab.setActive(true)\n this.setState({\n active: tab.props.id\n })\n }\n\n render(){\n return (<div className=\"lc-tabWrapper\">\n <div className=\"lc-tabnav\" style={{flex: \"0 1 auto\"}}>\n <Tab preview={this} title=\"Full Profile\" id=\"profile\"/>\n <Tab preview={this} title=\"User Popout\" id=\"popout\"/>\n </div>\n <PresenceErrorCatcher preview={this.preview} state={this.state.rpc} props={{preview: this}} key={this.state.active} />\n </div>)\n } \n\n isActive(tab){\n return this.state.active === tab\n }\n\n get preview(){\n if(this.state.active === \"profile\")return Profile\n return Popout\n }\n}\n\nclass Tab extends React.Component {\n constructor(props){\n super(props)\n\n this.state = {\n active: props.preview.isActive(props.id)\n }\n props.preview.tabs.push(this)\n }\n\n setActive(isActive){\n this.setState({\n active: !!isActive\n })\n }\n\n render(){\n let className = `lc-navItem`\n if(this.state.active){\n className += ` lc-navItemActive`\n }else{\n className += ` lc-navItemInactive`\n }\n return (<div className={className} onClick={()=>{\n this.props.preview.changeTab(this)\n }}>\n {this.props.title}\n </div>)\n }\n}\n\nlet emptyClasses\nclass PresenceErrorCatcher extends React.Component {\n componentDidCatch(err, errInfo){\n console.error(err, errInfo)\n this.setState({\n error: true\n })\n }\n render(){\n if(!this.state){\n this.state = {\n error: false\n }\n }\n if(!this.state.error){\n try{\n const preview = new this.props.preview(this.props.props)\n preview.setState(this.props.state)\n return preview.render()\n }catch(err){\n console.error(err)\n this.state.error = true\n return this.render()\n }\n }else{\n emptyClasses = emptyClasses || BDV2.WebpackModules.find(e => e.emptyStateImage && e.emptyState)\n if(!emptyClasses){\n Utils.showToast(\"An error occured. Please check the console for more informations.\")\n return null\n }\n return <div style={{\n margin: \"20px\"\n }}>\n <div style={{\n backgroundColor: \"var(--background-primary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n }} className={`lc-tab-box-shadow ${emptyClasses.emptyState}`}>\n <div className={emptyClasses.emptyStateImage} style={{\n marginTop: \"20px\"\n }}>\n\n </div>\n <div className={emptyClasses.emptyStateHeader}>An error occured</div>\n <p className={emptyClasses.emptyStateSubtext}>\n Please check the console for more informations. Join our ­\n <a className={`${BDV2.anchorClasses.anchor} ${BDV2.anchorClasses.anchorUnderlineOnHover}`} role=\"button\" tabindex={0} onClick={() => {\n BDV2.joinLC()\n }}>\n support server\n </a>\n ­ for help.\n </p>\n </div>\n </div>\n }\n }\n}\n\nlet popoutModules\nlet UserPopoutComponent\nlet PopoutProps\nclass Popout extends React.Component {\n get modules(){\n return popoutModules || (popoutModules = [\n BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"UserPopout\"),\n BDV2.WebpackModules.find(e => e.default && e.default.getCurrentUser)\n ])\n }\n\n getComponent(){\n let [\n UserPopout,\n userModule\n ] = this.modules\n\n const user = userModule.default.getCurrentUser()\n return React.createElement(() => {\n let render1 = UserPopout.default({\n userId: user.id, \n guildId: null, \n channelId: null, \n disableUserProfileLink: true\n })\n UserPopoutComponent = render1.type\n PopoutProps = render1.props\n return this.render()\n }, null)\n }\n\n render(){\n if(!UserPopoutComponent)return this.getComponent()\n let [\n _UserPopout,\n userModule\n ] = this.modules\n\n const user = userModule.default.getCurrentUser()\n\n let data = Object.assign({}, defaultRPC, this.props.preview.props.settings.state.data)\n const activity = (function(){\n if(!this.game)return null\n let game = {\n name: this.game.name || defaultRPC.name,\n application_id: this.game.application_id || defaultRPC.application_id,\n details: this.game.details || undefined,\n state: this.game.state || undefined,\n timestamps: this.game[\"timestamps.start\"] ? {\n start: this.game[\"timestamps.start\"]\n } : undefined,\n assets: this.game[\"assets.large\"] ? {\n large_image: this.game[\"assets.large\"],\n small_image: this.game[\"assets.small\"] || undefined\n } : undefined,\n type: 0\n }\n return game\n }).call({\n game: data\n })\n\n const popout = new UserPopoutComponent(Object.assign({}, PopoutProps, {\n activity: activity,\n userId: user.id\n })).render().props.children // bypass tracking\n\n // remove the stop propagation shit.\n const container = <div {...window.Lightcord.Api._.excludeProperties(popout.props, [\"onClick\", \"onContextMenu\"])} />\n\n return <div className=\"lc-userPopout lc-tab-box-shadow\">\n {container}\n </div>\n }\n}\n\nlet profileModules\nlet UserProfileComponent\nlet ProfileProps\nlet connectedProfileStore\nclass Profile extends React.Component {\n get modules(){\n return profileModules || (profileModules = [\n BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"UserProfile\"),\n BDV2.WebpackModules.find(e => e.default && e.default.getCurrentUser)\n ])\n }\n\n render(){\n let [\n UserProfile,\n userModule\n ] = this.modules\n\n const user = userModule.default.getCurrentUser()\n if(!UserProfileComponent){\n const render1 = new UserProfile.default({\n user: user\n }).render()\n connectedProfileStore = render1.type\n const render2 = new render1.type(render1.props).render()\n const render3 = render2.type.render(render2.props, null)\n const render4 = new render3.type(render3.props).render()\n UserProfileComponent = render4.type\n }\n if(!UserProfileComponent)throw new Error(`Couldn't find the UserProfileComponent component.`)\n\n let data = Object.assign({}, defaultRPC, this.props.preview.props.settings.state.data)\n const activity = (function(){\n if(!this.game)return null\n let game = {\n name: this.game.name || defaultRPC.name,\n application_id: this.game.application_id || defaultRPC.application_id,\n details: this.game.details || undefined,\n state: this.game.state || undefined,\n timestamps: this.game[\"timestamps.start\"] ? {\n start: this.game[\"timestamps.start\"]\n } : undefined,\n assets: this.game[\"assets.large\"] ? {\n large_image: this.game[\"assets.large\"],\n small_image: this.game[\"assets.small\"] || undefined\n } : undefined,\n type: 0\n }\n return game\n }).call({\n game: data\n })\n\n ProfileProps = new connectedProfileStore({\n user: user,\n close: () => {}\n }).render().props\n const profile = new UserProfileComponent(Object.assign({}, ProfileProps, {\n activity: activity\n })).render().props.children // bypass tracking\n\n profile.props.style = {\n width: \"auto\"\n }\n\n return <div className=\"lc-tab lc-tab-box-shadow\">\n {profile}\n </div>\n }\n}","import BDV2 from \"../modules/v2\";\nimport V2C_SettingsTitle from \"./settingsTitle\";\n\n/**\n * @type {typeof import(\"react\")}\n */\nconst React = BDV2.React;\n\nlet marginModule2 = BDModules.get(e => e.defaultMarginh5)[0]\nlet colorModule = BDModules.get(e => e.colorStandard)[0]\nlet sizeModule = BDModules.get(e => e.size32)[0]\nlet scrollbarModule1 = BDModules.get(e => e.scrollbarGhostHairline)[0]\nconst GuildModule = BDModules.get(e => e.default && e.default.getGuilds)[0].default\nconst relationShipModule = BDModules.get(e => e.default && e.default.getRelationships)[0].default\nconst sessionModule = BDModules.get(e => e.default && e.default.getSessions)[0].default\nconst userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0].default\n\nexport default class V2C_AccountInfos extends React.Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n if(!marginModule2)marginModule2 = BDModules.get(e => e.defaultMarginh5)[0]\n if(!colorModule)colorModule = BDModules.get(e => e.colorStandard)[0]\n if(!sizeModule)sizeModule = BDModules.get(e => e.size32)[0]\n return [\n <V2C_SettingsTitle text=\"Account Infos\"/>,\n <div>\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n Profile\n </h5>\n <CodeContent content={this.getProfileValue()} language=\"diff\" />\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n Statistics\n </h5>\n <CodeContent content={this.getStatistics()} language=\"diff\" />\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\n Connected Sessions\n </h5>\n <CodeContent content={this.getSessionValue()} language=\"diff\" />\n </div>,\n <div className={BDModules.get(e => e.marginBottom20)[0].marginBottom20}></div>\n ]\n }\n\n getSessionValue(){\n const sessionsRaw = sessionModule.getSessions()\n const sessions = Object.keys(sessionsRaw).filter(e => e !== \"all\").map(e => sessionsRaw[e])\n\n if(sessions.length === 0)return \"- No session detected. Please try in a few seconds\"\n \n return sessions.map(e => {\n return `+ id: ${e.sessionId}\n+ os: ${e.clientInfo.os[0].toUpperCase()+e.clientInfo.os.slice(1)}\n+ client: ${e.clientInfo.client}\n+ status: ${e.status}\n+ Activities: ${e.activities.length}`\n }).join(\"\\n\"+\"-\".repeat(38)+\"\\n\")\n }\n\n getProfileValue(){\n const user = userModule.getCurrentUser()\n /**\n * @type {Date}\n */\n const createdAt = user.createdAt\n\n let avatarURL = user.avatarURL\n if(user.avatar && user.avatar.startsWith(\"a_\")){\n avatarURL = user.getAvatarURL(\"gif\")\n }\n\n if(avatarURL.startsWith(\"/\")){\n avatarURL = \"https://discord.com\"+avatarURL\n }\n if(avatarURL.endsWith(\"?size=128\")){\n avatarURL = avatarURL.replace(\"?size=128\", \"?size=4096\")\n }\n\n return `+ Username: ${user.username}\n+ Discriminator: ${user.discriminator}\n+ Tag: ${user.tag}\n+ ID: ${user.id}\n+ Avatar: ${user.avatar}\n+ Avatar URL: ${avatarURL}\n+ Creation Date: ${(createdAt.getDate()).toString().padStart(2, \"0\")}/${(createdAt.getMonth()+1).toString().padStart(2, \"0\")}/${(createdAt.getFullYear()).toString().padStart(2, \"0\")} ${createdAt.getHours().toString().padStart(2, \"0\")}h ${createdAt.getMinutes().toString().padStart(2, \"0\")}min ${createdAt.getSeconds()}s\n+ Flags: ${user.flags}\n+ Has Nitro: ${user.hasPremiumSubscription ? \"Yes\" : \"No\"}\n- Email: ${user.email}\n- 2FA: ${user.mfaEnabled ? \"Yes\" : \"No\"}\n- Has Been On Mobile: ${user.mobile ? \"Yes\" : \"No\"}\n- Phone: ${user.phone || \"None\"}\n- Verified: ${user.verified}\n- Can See NSFW Channels: ${user.nsfwAllowed}`;\n }\n\n getStatistics(){\n\n const guilds = Object.values(GuildModule.getGuilds())\n const relations = Object.keys(relationShipModule.getRelationships())\n const friends = relations.filter(e => relationShipModule.isFriend(e))\n const blocked = relations.filter(e => relationShipModule.isBlocked(e))\n\n return `+ Server Count: ${guilds.length} servers\n+ Relations: ${relations.length} relations\n+ Friends Count: ${friends.length} friends\n- Blocked Users Count: ${blocked.length} blocked users`\n }\n}\n\n\nlet hightlightJS = BDModules.get(e => e.highlight)[0]\nlet messageModule1 = BDModules.get(e => e.markup)[0]\nlet messageModule2 = BDModules.get(e => e.messageContent)[0]\n\nclass CodeContent extends React.Component {\n render(){\n if(!messageModule1)messageModule1 = BDModules.get(e => e.markup)[0]\n if(!messageModule2)messageModule2 = BDModules.get(e => e.messageContent)[0]\n if(!scrollbarModule1)scrollbarModule1 = BDModules.get(e => e.scrollbarGhostHairline)[0]\n if(!hightlightJS)hightlightJS = BDModules.get(e => e.listLanguages)[0]\n return (<div class={`${messageModule1.markup} ${messageModule2.messageContent}`}>\n <pre>\n <code class={`${scrollbarModule1.scrollbarGhostHairline} hljs`} dangerouslySetInnerHTML={{__html: hightlightJS.highlight(this.props.language, this.props.content).value}}>\n\n </code>\n </pre>\n <div className={BDModules.get(e => e.marginBottom8)[0].marginBottom8}></div>\n </div>)\n }\n}","import Utils from \"./utils\"\n\nconst dispatcher = window.Lightcord.DiscordModules.dispatcher\nconst ChannelModule = BDModules.get(e => e.default && e.default.getChannel && e.default.hasChannel)[0].default\nlet relationShipModule = BDModules.get(e => e.default && e.default.addRelationship)[0]\nlet DMModule = BDModules.get(e => e.default && e.default.closePrivateChannel)[0]\n\nconst blocked = {}\n\nlet userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0]\nfunction getCurrentUser(){\n if(userModule)return userModule.default.getCurrentUser()\n return null\n}\n\nexport default new class AntiBotDM {\n constructor(){\n this.antiDM = this.antiDM.bind(this)\n this.enabled = false\n }\n\n enable(){\n if(this.enabled)return\n this.enabled = true\n\n dispatcher.subscribe(\"MESSAGE_CREATE\", this.antiDM)\n }\n\n disable(){\n if(!this.enabled)return\n this.enabled = false\n\n dispatcher.unsubscribe(\"MESSAGE_CREATE\", this.antiDM)\n }\n\n antiDM(ev){\n if(!ev.message.author.bot)return\n if(ev.message.author.id === getCurrentUser().id)\n if(ev.message.guild_id)return\n\n const channel = ChannelModule.getChannel(ev.message.channel_id)\n if(!channel)return // might be broken\n\n if(channel.type !== 1)return\n\n if(blocked[ev.message.author.id])return // If the user unblock the bot, Don't block it again.\n\n if(scanMessage(ev.message)){\n blocked[ev.message.author.id] = true\n Utils.showToast(`[AdBlock]: Blocked ${ev.message.author.username}#${ev.message.author.discriminator}`, {\n \"type\": \"warning\"\n })\n if(!relationShipModule)relationShipModule = BDModules.get(e => e.default && e.default.addRelationship)[0]\n relationShipModule.default.addRelationship(ev.message.author.id, {\n location: \"ContextMenu\"\n }, 2)\n if(!DMModule)DMModule = BDModules.get(e => e.default && e.default.closePrivateChannel)[0]\n DMModule.default.closePrivateChannel(channel.id, false)\n }\n }\n}\n\nfunction scanMessage(message){\n if(/(discord\\.gg|discord\\.com\\/invite\\/|discordapp\\.com\\/invite\\/)/g.test(message.content))return true\n if(EmbedsContains(message, \"discord.gg/\") || EmbedsContains(message, \"discord.com/invite/\") || EmbedsContains(message, \"discordapp.com/invite/\"))return true\n\n return false\n}\nfunction EmbedsContains(message, search){\n let embeds = message.embeds || []\n if(embeds.length === 0)return false\n return embeds.map(embed => {\n if(embed.type !== \"rich\")return false\n if((embed.title || \"\").includes(search))return true\n if((embed.description || \"\").includes(search))return true\n if(((embed.footer || \"\") && embed.footer.text || \"\").includes(search))return true\n if((embed.fields || []).map(e => {\n return e.value.includes(search) || e.name.includes(search)\n }).includes(true))return true\n return false\n\n }).includes(true)\n}","/**\n * Credits to @hellbound1337 on github for the css\n */\n\nimport DOMTools from \"./domtools\"\nimport Utils from \"./utils\"\n\nlet selectors\nconst removeDa = Utils.removeDa\nfunction getSelectors(){\n let standardSidebarView = BDModules.get(e => e.standardSidebarView)[0]\n if(!standardSidebarView)return null\n let defaultClassName = removeDa(standardSidebarView.standardSidebarView)\n let selects = []\n let userSettingsAccount = BDModules.get(e => e.userSettingsAccount)[0]\n const children = BDModules.get(e => typeof e.children === \"string\")[0]\n selects.push(`#app-mount .${defaultClassName} .payment-info .${removeDa(BDModules.get(e => e.description && typeof e.description === \"string\" && e.description.includes(\"formText\"))[0].description)}`)\n selects.push(`#app-mount .${defaultClassName} .${removeDa(BDModules.get(e => e.paymentSourceRow)[0].paymentSourceRow)} .${removeDa(BDModules.get(e => e.subText && e.descriptionWrapper)[0].subText)}`)\n if(userSettingsAccount){\n selects.push(`#app-mount .${defaultClassName} .${removeDa(userSettingsAccount.userSettingsAccount)} div:nth-child(2)>div:nth-child(2)>.${removeDa(BDModules.get(e => e.viewBody)[0].viewBody)}`)\n selects.push(`.${removeDa(userSettingsAccount.userSettingsSecurity)} .${removeDa(children.children)} > div:nth-child(2)`)\n }\n return selects\n}\n\nexport default new class BlurPrivate {\n constructor(){\n this.enabled = false\n }\n\n enable(){\n if(this.enabled)return\n this.enabled = true\n selectors = selectors || getSelectors()\n\n if(!selectors)console.error(new Error(\"Couldn't find selectors to blur personnal informations.\"))\n DOMTools.addStyle(\"blurPrivate\", `\n${selectors.join(\", \")} {\n transition: all 150ms cubic-bezier(.55,.085,.68,.53);\n filter: blur(4px);\n opacity: .8;\n}\n\n${selectors.map(e => e+\":hover\").join(\", \")} {\n transition: all 150ms cubic-bezier(.55,.09,.68,.53);\n filter: none;\n opacity: 1;\n}`)\n }\n\n disable(){\n if(!this.enabled)return\n this.enabled = false\n DOMTools.removeStyle(\"blurPrivate\")\n }\n}","export default new class DisableTyping {\r\n constructor(){\r\n window.Lightcord.Api.ensureExported(e => e.default && e.default.startTyping)\r\n .then(typingModule => {\r\n let self = this\r\n const startTyping = typingModule.default.startTyping\r\n typingModule.default.startTyping = function(){\r\n if(self.disabled)return startTyping.call(this, ...arguments)\r\n }\r\n const stopTyping = typingModule.default.stopTyping\r\n typingModule.default.stopTyping = function(){\r\n if(self.disabled)return stopTyping.call(this, ...arguments)\r\n }\r\n this.disabled = true\r\n })\r\n window.Lightcord.BetterDiscord.DisableTyping = this\r\n }\r\n\r\n disable(){\r\n this.disabled = true\r\n }\r\n\r\n enable(){\r\n this.disabled = false\r\n }\r\n}","// Good luck to read my code, Even me can't read it properly.\n\nimport { stat } from \"fs\"\nimport { uuidv4 } from \"../modules/distant\"\nimport webpackModules from \"../modules/webpackModules\"\nimport { remote } from \"electron\"\nimport MarginTop from \"./margintop\"\n\nlet formModule\nexport default class ApiPreview extends React.PureComponent {\n constructor(){\n super(...arguments)\n this.state = {\n states: []\n }\n }\n\n render(){\n if(!formModule)formModule = webpackModules.find(e => e.FormSection)\n /** \n * @type {Function[]}\n */\n const allComponents = [...new Set(Object.keys(window.Lightcord.Api.Components).map(e => {\n return Object.keys(window.Lightcord.Api.Components[e]).map(k => window.Lightcord.Api.Components[e][k])\n }).flat())]\n return [\n <formModule.FormSection tag=\"h2\" title=\"Lightcord's Api Availlable components\">\n <formModule.FormText type=\"description\" className=\"\" selectable={false}>\n These components are here for the plugin devs. They can quickly embed any component below with this panel.\n <div style={{marginTop: \"20px\"}}></div>\n <Lightcord.Api.Components.general.AlertBox type=\"info\">All these components have error handling. If you want none, add `.original` after the component path.</Lightcord.Api.Components.general.AlertBox>\n <Lightcord.Api.Components.general.AlertBox type=\"warn\">We do not recommend modifying these component with plugins. Only do this if you know what you are doing.</Lightcord.Api.Components.general.AlertBox>\n </formModule.FormText>\n <MarginTop></MarginTop>\n <Lightcord.Api.Components.inputs.Button color=\"brand\" look=\"outlined\" size=\"medium\" hoverColor=\"green\" onClick={() => {\n remote.shell.openExternal(\"https://lightcord.org/LightcordApi/\")\n }} wrapper={false}>\n Documentation\n </Lightcord.Api.Components.inputs.Button>\n </formModule.FormSection>,\n allComponents.map(comp => {\n const compName = comp.displayName || comp.name\n const compPath = `Lightcord.Api.Components.${Object.keys(window.Lightcord.Api.Components).find(e => window.Lightcord.Api.Components[e][compName])}.${compName}`\n return <ComponentPreview key={compPath} comp={comp} />\n })\n ]\n }\n\n get renders(){\n\n }\n}\n\nclass ComponentPreview extends React.Component {\n constructor(props){\n super(props)\n this.state = {\n tab: \"preview\",\n elem: props.comp,\n options: {}\n }\n }\n\n render(){\n const comp = this.props.comp\n let AllPreviews = []\n if(comp.AllPreviews)AllPreviews = comp.AllPreviews\n let state = this.state\n let getProps = () => {\n let final = {}\n AllPreviews.forEach(category => {\n final[Object.keys(category[0])[0]] = category[0][Object.keys(category[0])[0]]\n })\n Object.keys(state.options).forEach(key => {\n final[key] = AllPreviews.find(e => e.find(e => e[key]))[state.options[key]][key]\n })\n return final\n }\n let renderPreview = () => {\n return <div style={{margin: \"20px\"}}>\n <div style={{\n backgroundColor: \"var(--background-secondary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n }} className=\"lc-tab-box-shadow\">\n {React.createElement(comp, getProps())}\n </div>\n </div>\n }\n let renderCode = () => {\n return <div style={{margin: \"20px\"}}>\n <div style={{\n backgroundColor: \"var(--background-secondary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n }} className=\"lc-tab-box-shadow\">\n <window.Lightcord.Api.Components.general.SettingSubTitle>\n JSX\n </window.Lightcord.Api.Components.general.SettingSubTitle>\n <window.Lightcord.Api.Components.general.ErrorCatcher>\n {React.createElement(() => {\n return <window.Lightcord.Api.Components.general.CodeBlock language=\"jsx\" content={generateCode(\"jsx\")}/>\n })}\n </window.Lightcord.Api.Components.general.ErrorCatcher>\n <window.Lightcord.Api.Components.general.SettingSubTitle> \n React\n </window.Lightcord.Api.Components.general.SettingSubTitle>\n <window.Lightcord.Api.Components.general.ErrorCatcher>\n {React.createElement(() => {\n return <window.Lightcord.Api.Components.general.CodeBlock language=\"js\" content={generateCode(\"react\")}/>\n })}\n </window.Lightcord.Api.Components.general.ErrorCatcher>\n </div>\n </div>\n }\n let getStrForProp = (value, compPath, lang) => {\n if(typeof value === \"string\"){\n return value\n }else if(typeof value === \"boolean\"){\n return String(value)\n }else if(typeof value === \"function\"){\n return value.toString()\n }else if(typeof value === \"object\"){\n if(value && value.$$typeof && (value.$$typeof === Symbol.for(\"react.element\") || value.$$typeof === 0xeac7)){\n if(compPath === \"Lightcord.Api.Components.general.Tabs\"){\n if(lang === \"react\"){\n return `React.createElement(\"div\", {style: {\nmarginTop: \"20px\", marginBottom: \"20px\"\n}},\nReact.createElement(\"div\", {style: {\nbackgroundColor: \"var(--background-secondary)\",\npadding: \"30px 30px\",\nborderRadius: \"8px\"\n}, className: \"lc-tab-box-shadow\" },\nReact.createElement(Lightcord.Api.Components.general.Title, null, \"Preview tabs\")\n)\n)`\n }else if(lang === \"jsx\"){\n return `<div style={{\nmarginTop: \"20px\", marginBottom: \"20px\"\n}}>\n<div style={{\n backgroundColor: \"var(--background-secondary)\", \n padding: \"30px 30px\", \n borderRadius: \"8px\"\n}} className=\"lc-tab-box-shadow\">\n <Lightcord.Api.Components.general.Title>Preview tabs</Lightcord.Api.Components.general.Title>\n</div>\n</div>`\n }\n }\n return \"Your components here.\"\n }\n return JSON.stringify(value, null, \" \")\n }else if(typeof value === \"number\"){\n return String(value)\n }\n return String(value)\n }\n let generateCode = function(lang){ // code formatting is hard\n const compName = comp.displayName || comp.name\n let categories = Object.keys(window.Lightcord.Api.Components)\n const compCategory = categories.find(e => window.Lightcord.Api.Components[e][compName])\n const compPath = `Lightcord.Api.Components.${compCategory}.${compName}`\n const props = getProps()\n\n if(lang === \"jsx\"){\n let propStrings = []\n let childrenProp = null\n Object.keys(props).forEach(key => {\n if(key == \"children\"){\n childrenProp = getStrForProp(props[key], compPath, lang)\n }else{\n let str = key+\"=\"\n if(typeof props[key] === \"string\"){\n str += JSON.stringify(props[key])\n }else{\n str += `{${getStrForProp(props[key], compPath, lang)}}`\n }\n propStrings.push(str)\n }\n })\n let openTag\n if(childrenProp){\n openTag = `<${compPath} ${propStrings.join(\" \")}>`\n let closeTag = `</${compPath}>`\n return `${openTag}\\n ${childrenProp}\\n${closeTag}`\n }else{\n openTag = `<${compPath} ${propStrings.join(\" \")}/>`\n return openTag\n }\n }else if(lang === \"react\"){\n let children = props.children || null\n delete props.children\n if(children && children.$$typeof && (children.$$typeof === Symbol.for(\"react.element\") || children.$$typeof === 0xeac7)){\n children = getStrForProp(children, compPath, lang)\n }\n let propStrings = []\n Object.keys(props).forEach(key => {\n let visibleKey = /[^\\w\\d_]/g.test(key) ? JSON.stringify(key) : key\n let str = visibleKey+\": \"\n if(typeof props[key] === \"string\"){\n str += JSON.stringify(props[key])\n }else{\n str += getStrForProp(props[key], compPath, lang).split(\"\\n\").map((str, i) => {\n if(i === 0)return str\n return \" \" + str\n }).join(\"\\n\")\n }\n propStrings.push(str)\n })\n let propObject = \"{\"\n if(propStrings.length){\n propStrings.forEach((str, i) => {\n let isLast = i === propStrings.length - 1\n let isFirst = i === 0\n if(!isFirst){\n propObject += \",\"\n }\n propObject += \"\\n \"\n propObject += str\n if(isLast){\n propObject +=\"\\n}\"\n }\n })\n }else{\n propObject += \"}\"\n }\n let childrenData = typeof children === \"string\" && children.startsWith(\"React.createElement\") ? children : JSON.stringify(children)\n return `React.createElement(${compPath}, ${propObject}, ${childrenData})`\n }\n }\n let help = comp.help || {}\n let info = help.info ? <window.Lightcord.Api.Components.general.AlertBox type=\"info\">\n {help.info}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let warn = help.warn ? <window.Lightcord.Api.Components.general.AlertBox type=\"warn\">\n {help.warn}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let danger = help.danger ? <window.Lightcord.Api.Components.general.AlertBox type=\"danger\">\n {help.danger}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let error = help.error ? <window.Lightcord.Api.Components.general.AlertBox type=\"error\">\n {help.error}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n let success = help.success ? <window.Lightcord.Api.Components.general.AlertBox type=\"success\">\n {help.success}\n </window.Lightcord.Api.Components.general.AlertBox> : null\n return (<div>\n <window.Lightcord.Api.Components.general.SettingsTitle>\n {comp.displayName || comp.name}\n </window.Lightcord.Api.Components.general.SettingsTitle>\n {info}\n {success}\n {warn}\n {error}\n {danger}\n {AllPreviews.map(category => {\n if(category[0].onClick)return null\n if(category[0].text)return null\n if(category[0].children)return null\n if(category.length === 1)return null\n \n let key = Object.keys(category[0])[0]\n return [\n <window.Lightcord.Api.Components.general.SettingSubTitle>\n {key}\n </window.Lightcord.Api.Components.general.SettingSubTitle>,\n <window.Lightcord.Api.Components.inputs.Dropdown options={category.map((e, index) => {\n return {\n value: \"opt-\"+index,\n label: JSON.stringify(e[Object.keys(e)[0]])\n }\n })} value={\"opt-\"+(state.options[key] || \"0\")} onChange={(value) => {\n this.setState({\n options: Object.assign({}, state.options, {\n [key]: (value.value || \"0\").replace(\"opt-\", \"\")\n })\n })\n }} searchable={true}/>,\n <div style={{marginBottom: \"8px\"}}></div>\n ]\n })}\n <window.Lightcord.Api.Components.general.Tabs tabs={[{label: \"Preview\", id: \"preview\"}, {label: \"Code\", id: \"code\"}]} \n active={state.tab} children={state.tab === \"preview\" ? renderPreview() : renderCode()} onChange={(tab) => {\n this.setState({\n tab\n })\n }}/>\n </div>)\n }\n}","{/* <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"white\" width=\"18px\" height=\"18px\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <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\"/>\n</svg> */}\n\nimport BDV2 from \"../../modules/v2\";\n\nconst React = BDV2.React;\n\nexport default class History extends React.Component {\n render() {\n const size = this.props.size || \"18px\";\n return <svg viewBox=\"0 0 24 24\" fill=\"var(--text-normal)\" className={this.props.className || \"\"} style={{width: size, height: size}} onClick={this.props.onClick}>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <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\"/>\n </svg>;\n }\n}","import { themeCookie } from \"../0globals\"\nimport bdEvents from \"./bdEvents\"\nimport DOM from \"./domtools\"\n\nexport default new class popoutWindow {\n constructor(){\n /**\n * @type {Map<string, Window>}\n */\n this.windows = new Map()\n this.enabled = false\n this.init()\n }\n\n async init(){\n let popoutModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getWindow)\n window.Lightcord.DiscordModules.dispatcher.subscribe(\"POPOUT_WINDOW_OPEN\", (ev) => {\n setImmediate(() => {\n /**\n * @type {Window}\n */\n const window = popoutModule.default.getWindow(ev.key)\n this.windows.set(ev.key, window)\n\n let classList = window.document.body.classList\n classList.add(\"window-popout\")\n classList.add(\"lightcord\")\n classList.add(\"lightcord\")\n\n this.update(ev.key)\n })\n })\n window.Lightcord.DiscordModules.dispatcher.subscribe(\"POPOUT_WINDOW_CLOSE\", (ev) => {\n setImmediate(() => {\n this.windows.delete(ev.key)\n })\n })\n bdEvents.on(\"theme-enabled\", () => {\n this.update()\n })\n bdEvents.on(\"theme-disabled\", () => {\n this.update()\n })\n bdEvents.on(\"theme-reloaded\", () => {\n this.update()\n })\n bdEvents.on(\"theme-unloaded\", () => {\n this.update()\n })\n bdEvents.on(\"theme-loaded\", () => {\n this.update()\n })\n }\n\n enable(){\n this.enabled = true\n this.update()\n }\n\n disable(){\n this.enabled = false\n this.update()\n }\n\n update(key){\n if(!this.windows.size)return\n if(!this.enabled){\n return this.removeThemes(key)\n }else{\n return this.applyThemes(key)\n }\n }\n\n removeThemes(key){\n if(this.enabled)return\n if(key){\n let window = this.windows.get(key)\n if(!window)return\n let document = window.document\n\n for(let style of document.querySelectorAll(\"style[data-lightcord-theme=true]\")){\n style.remove()\n }\n }else{\n for(let key of this.windows.keys()){\n this.removeThemes(key)\n }\n }\n }\n\n applyThemes(key){\n if(!this.enabled)return\n if(key){\n let window = this.windows.get(key)\n if(!window)return\n let document = window.document\n\n for(let style of document.querySelectorAll(\"style[data-lightcord-theme=true]\")){\n style.setAttribute(\"will-remove\", \"true\")\n }\n\n Object.keys(bdthemes)\n .forEach(themeName => {\n if(!themeCookie[themeName])return // theme disabled\n const theme = bdthemes[themeName]\n if(!theme)return //:shrug:\n\n let existing = document.querySelector(\"style[data-lightcord-theme=true]#\"+DOM.escapeID(theme.id))\n if(existing){\n existing.innerHTML = unescape(theme.css)\n existing.removeAttribute(\"will-remove\")\n }else{\n const style = document.createElement(\"style\")\n style.id = DOM.escapeID(theme.id)\n style.innerHTML = unescape(theme.css)\n style.setAttribute(\"data-lightcord-theme\", \"true\")\n document.head.append(style)\n }\n })\n\n for(let style of document.querySelectorAll(\"style[will-remove=true]\")){\n style.remove()\n }\n }else{\n for(let key of this.windows.keys()){\n this.applyThemes(key)\n }\n }\n }\n}","import BDV2 from \"../../modules/v2\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class TextInput extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {value: this.props.value};\r\n this.onChange = this.onChange.bind(this);\r\n this.emitChange = this.emitChange.bind(this);\r\n this.input = <Lightcord.Api.Components.inputs.TextInput.original ref={console.log} onChange={this.onChange} value={this.state.value} placeholder={this.props.placeholder} onBlur={this.emitChange}/>\r\n }\r\n\r\n onChange(value) {\r\n console.log(value, this.props)\r\n if (this.props.disabled) return;\r\n this.props.onChange(value);\r\n this.setState({value: value});\r\n }\r\n\r\n emitChange(){\r\n console.log(`Should emit changes.`)\r\n }\r\n\r\n render() {\r\n return this.input\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\nimport TextInput from \"./components/textinput\";\r\n\r\nlet classnames = []\r\nfunction getClassName(name){\r\n let className = classnames.find(e => e.startsWith(name+\"-\"))\r\n if(className)return className\r\n className = BDModules.get(e => e[name])[0][name]\r\n classnames.push(className)\r\n return className\r\n}\r\n\r\nexport default class TextInputSetting extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n onChange(value) {\r\n this.props.onChange(this.props.id, value);\r\n }\r\n\r\n render() {\r\n let {text, info} = this.props.data;\r\n if(this.props.data.experimental){\r\n if(!classnames.find(e => e.startsWith(\"beta-\"))){\r\n classnames.push(BDModules.get(e => e.beta && (!e.container && !e.userSettingsVoice))[0].beta)\r\n }\r\n info = [\r\n info,\r\n <sup className={getClassName(\"beta\")}>(EXPERIMENTAL)</sup>\r\n ]\r\n }\r\n return <div className={\"ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item\"}>\r\n <div className={\"ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap\"}>\r\n <h3 key=\"title\" className=\"ui-form-title h3 margin-reset margin-reset ui-flex-child\">\r\n {text}\r\n </h3>\r\n <TextInput key=\"input\" onChange={this.onChange} value={this.props.value} placeholder={this.props.placeholder||null} />\r\n </div>\r\n <div className=\"ui-form-text style-description margin-top-4\" style={{\r\n flex: \"1 1 auto\"\r\n }}>\r\n {info}\r\n </div>\r\n </div>\r\n }\r\n}","import {settings, settingsCookie, settingsRPC, lightcordSettings} from \"../0globals\";\nimport DataStore from \"./dataStore\";\nimport V2_SettingsPanel_Sidebar from \"./settingsPanelSidebar\";\nimport Utils from \"./utils\";\nimport BDV2 from \"./v2\";\nimport ContentManager from \"./contentManager\";\nimport coloredText from \"./coloredText\";\nimport tfHour from \"./24hour\";\nimport DOM from \"./domtools\";\n\nimport publicServersModule from \"./publicServers\";\nimport voiceMode from \"./voiceMode\";\nimport ClassNormalizer from \"./classNormalizer\";\nimport dMode from \"./devMode\";\n\nimport SectionedSettingsPanel from \"../ui/sectionedSettingsPanel\";\nimport CssEditor from \"../ui/cssEditor\";\nimport CardList from \"../ui/addonlist\";\nimport V2C_PresenceSettings from \"../ui/presenceSettings\";\nimport CustomRichPresence from \"./CustomRichPresence\";\nimport V2C_AccountInfos from \"../ui/AccountInfos\";\nimport { remote, ipcRenderer } from \"electron\";\nimport AntiAdDM from \"./AntiAdDM\";\nimport blurPrivate from \"./blurPrivate\";\nimport disableTyping from \"./disableTyping\";\nimport ApiPreview from \"../ui/ApiPreview\";\nimport Switch from \"../ui/switch\";\nimport MarginTop from \"../ui/margintop\";\nimport webpackModules from \"./webpackModules\";\nimport tooltipWrap from \"../ui/tooltipWrap\";\nimport History from \"../ui/icons/history\";\nimport core from \"./core\";\nimport popoutWindow from \"./popoutWindow\";\nimport TextInputSetting from \"../ui/TextInputSetting\";\n\nclass BDSidebarHeader extends React.PureComponent {\n render(){\n let sidebarComponents = webpackModules.find(e => e.Separator && e.Header && e.Item)\n\n const changelogButton = React.createElement(tooltipWrap, {color: \"black\", side: \"top\", text: \"Changelog\"}, \n React.createElement(\"span\", {style: {float: \"right\", cursor: \"pointer\"}, className: \"bd-changelog-button\", onClick: () => {Utils.showChangelogModal(bbdChangelog);}},\n React.createElement(History, {className: \"bd-icon\", size: \"16px\"})\n )\n );\n let rendered = new sidebarComponents.Header({\n children: React.createElement(\"span\", null, \"Bandaged BD\", changelogButton),\n className: \"ui-tab-bar-header\"\n })\n return rendered\n }\n}\n\nlet isClearingCache = false\n\nexport default new class V2_SettingsPanel {\n\n constructor() {\n this.onChange = this.onChange.bind(this);\n this.updateSettings = this.updateSettings.bind(this);\n this.sidebar = new V2_SettingsPanel_Sidebar();\n\n this.registerComponents()\n }\n\n registerComponents(){\n /** Lightcord */\n this.sidebar.register(\"lightcord\", makeComponent(this.lightcordComponent.bind(this)))\n this.sidebar.register(\"status\", makeComponent(this.PresenceComponent.bind(this)))\n this.sidebar.register(\"accountinfo\", makeComponent(this.AccountInfosComponent.bind(this)))\n this.sidebar.register(\"lcapipreview\", makeComponent(this.ApiPreviewComponent.bind(this)))\n\n /* Bandaged BD */\n this.sidebar.register(\"BDChangelogTitle\", makeComponent(() => {\n return new BDSidebarHeader().render()\n }))\n this.sidebar.register(\"core\", makeComponent(this.coreComponent.bind(this)))\n this.sidebar.register(\"customcss\", makeComponent(this.customCssComponent.bind(this)))\n this.sidebar.register(\"plugins\", makeComponent(this.renderAddonPane(\"plugins\")))\n this.sidebar.register(\"themes\", makeComponent(this.renderAddonPane(\"themes\")))\n }\n \n get coreSettings() {\n const settings = this.getSettings(\"core\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {return {title: c, settings: settings.filter(s => s.category == c)};});\n return sections;\n }\n\n get lightcordSettings() {\n const settings = this.getSettings(\"lightcord\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {return {title: c, settings: settings.filter(s => s.category == c)};});\n return sections;\n }\n\n get PresenceSettings() {\n return this.getSettings(\"status\")\n }\n\n getSettings(category) {\n return Object.keys(settings).reduce((arr, key) => {\n const setting = settings[key];\n if (setting.cat === category && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n }\n return arr;\n }, []);\n }\n\n\n onChange(id, checked, sidebar) {\n this.updateSettings(id, checked, sidebar);\n }\n\n updateSettings(id, enabled, sidebar) {\n if(![\"lightcord-8\", \"no_window_bound\", \"enable_glasstron\", \"lightcord-10\", \"lightcord-11\"].includes(id))settingsCookie[id] = enabled;\n\n if (id == \"bda-gs-2\") {\n if (enabled) DOM.addClass(document.body, \"bd-minimal\");\n else DOM.removeClass(document.body, \"bd-minimal\");\n }\n\n if (id == \"bda-gs-3\") {\n if (enabled) DOM.addClass(document.body, \"bd-minimal-chan\");\n else DOM.removeClass(document.body, \"bd-minimal-chan\");\n }\n\n if (id == \"bda-gs-1\") {\n if (enabled) publicServersModule.addButton();\n else publicServersModule.removeButton();\n }\n\n if (id == \"bda-gs-4\") {\n if (enabled) voiceMode.start();\n else voiceMode.stop();\n }\n\n if (id == \"bda-gs-5\") {\n if (enabled) DOM.addClass(DOM.query(\"#app-mount\"), \"bda-dark\");\n else DOM.removeClass(DOM.query(\"#app-mount\"), \"bda-dark\");\n }\n\n if (enabled && id == \"bda-gs-6\") tfHour.inject24Hour();\n\n if (id == \"bda-gs-7\") {\n if (enabled) coloredText.injectColoredText();\n else coloredText.removeColoredText();\n }\n\n if (id == \"fork-ps-4\") {\n if (enabled) ClassNormalizer.start();\n else ClassNormalizer.stop();\n }\n\n if (id == \"fork-ps-5\") {\n if (enabled) {\n ContentManager.watchContent(\"plugin\");\n ContentManager.watchContent(\"theme\");\n }\n else {\n ContentManager.unwatchContent(\"plugin\");\n ContentManager.unwatchContent(\"theme\");\n }\n }\n\n if (id == \"fork-wp-1\") {\n Utils.setWindowPreference(\"transparent\", enabled);\n if (enabled) Utils.setWindowPreference(\"backgroundColor\", null);\n else Utils.setWindowPreference(\"backgroundColor\", \"#2f3136\");\n }\n\n\n if (id == \"bda-gs-8\") {\n if (enabled) dMode.startDebugListener();\n else dMode.stopDebugListener();\n }\n\n if (id == \"fork-dm-1\") {\n if (enabled) dMode.startCopySelector();\n else dMode.stopCopySelector();\n }\n\n if (id === \"lightcord-1\") {\n if (enabled) window.Lightcord.Settings.devMode = true\n else window.Lightcord.Settings.devMode = false\n sidebar.forceUpdate()\n }\n if (id === \"lightcord-2\") {\n if (enabled) window.Lightcord.Settings.callRingingBeat = true\n else window.Lightcord.Settings.callRingingBeat = false\n }\n if (id === \"lightcord-presence-1\") {\n if (enabled) {\n CustomRichPresence.enable()\n const settingsStore = BDModules.get(e => e.default && typeof e.default === \"object\" && \"showCurrentGame\" in e.default)[0]\n if(settingsStore && !settingsStore.default.showCurrentGame){\n BDModules.get(e => e.default && e.default.updateRemoteSettings)[0].default.updateRemoteSettings({\n showCurrentGame: true\n })\n }\n }\n else CustomRichPresence.disable()\n }\n if (id === \"lightcord-3\") {\n ipcRenderer.sendSync(\"LIGHTCORD_SET_ALWAYS_ON_TOP\", enabled)\n }\n if (id === \"lightcord-4\") {\n if(enabled){\n AntiAdDM.enable()\n }else{\n AntiAdDM.disable()\n }\n }\n if (id === \"lightcord-6\") {\n if(enabled){\n blurPrivate.enable()\n }else{\n blurPrivate.disable()\n }\n }\n if (id === \"lightcord-7\") {\n if(enabled){\n disableTyping.enable()\n }else{\n disableTyping.disable()\n }\n }\n if (id === \"lightcord-8\"){\n let appSettings = window.Lightcord.Api.settings\n appSettings.set(\"isTabs\", enabled)\n appSettings.save()\n DiscordNative.app.relaunch()\n }\n if (id === \"lightcord-9\") {\n popoutWindow[enabled ? \"enable\" : \"disable\"]()\n }\n if (id === \"lightcord-10\"){\n core.methods.NotificationsUseShim(enabled)\n return\n }\n if (id === \"no_window_bound\"){\n let appSettings = window.Lightcord.Api.settings\n appSettings.set(\"NO_WINDOWS_BOUND\", enabled)\n\n appSettings.delete(\"IS_MAXIMIZED\")\n appSettings.delete(\"IS_MINIMIZED\") \n appSettings.delete(\"WINDOW_BOUNDS\")\n \n appSettings.save()\n DiscordNative.app.relaunch()\n }\n if (id === \"enable_glasstron\"){\n let appSettings = window.Lightcord.Api.settings\n appSettings.set(\"GLASSTRON\", enabled)\n appSettings.save()\n DiscordNative.app.relaunch()\n }\n \n if(id === \"lightcord-11\"){\n let appSettings = window.Lightcord.Api.settings\n if(!enabled){\n appSettings.delete(\"BD_\"+id)\n appSettings.save()\n return\n }\n appSettings.set(\"BD_\"+id, enabled)\n appSettings.save()\n return\n }\n\n this.saveSettings();\n }\n\n async initializeSettings() {\n if (settingsCookie[\"bda-gs-2\"]) DOM.addClass(document.body, \"bd-minimal\");\n if (settingsCookie[\"bda-gs-3\"]) DOM.addClass(document.body, \"bd-minimal-chan\");\n if (settingsCookie[\"bda-gs-1\"]) publicServersModule.addButton();\n if (settingsCookie[\"bda-gs-4\"]) voiceMode.start();\n if (settingsCookie[\"bda-gs-5\"]) DOM.addClass(DOM.query(\"#app-mount\"), \"bda-dark\");\n if (settingsCookie[\"bda-gs-6\"]) tfHour.inject24Hour();\n if (settingsCookie[\"bda-gs-7\"]) coloredText.injectColoredText();\n if (settingsCookie[\"fork-ps-4\"]) ClassNormalizer.start();\n if (settingsCookie[\"lightcord-1\"]) window.Lightcord.Settings.devMode = true\n if (settingsCookie[\"lightcord-2\"]) window.Lightcord.Settings.callRingingBeat = true\n if (settingsCookie[\"lightcord-presence-1\"]) CustomRichPresence.enable()\n if (settingsCookie[\"lightcord-3\"]) ipcRenderer.sendSync(\"LIGHTCORD_SET_ALWAYS_ON_TOP\", true)\n if (settingsCookie[\"lightcord-4\"]) AntiAdDM.enable()\n if (settingsCookie[\"lightcord-6\"]) blurPrivate.enable()\n if (settingsCookie[\"lightcord-7\"]) disableTyping.enable()\n if (settingsCookie[\"lightcord-9\"]) popoutWindow.enable()\n\n if (settingsCookie[\"fork-ps-5\"]) {\n ContentManager.watchContent(\"plugin\");\n ContentManager.watchContent(\"theme\");\n }\n\n if (settingsCookie[\"bda-gs-8\"]) dMode.startDebugListener();\n if (settingsCookie[\"fork-dm-1\"]) dMode.startCopySelector();\n\n this.saveSettings();\n }\n\n saveSettings() {\n DataStore.setSettingGroup(\"settings\", settingsCookie);\n DataStore.setSettingGroup(\"rpc\", settingsRPC);\n }\n\n loadSettings() {\n Object.assign(settingsCookie, DataStore.getSettingGroup(\"settings\"));\n Object.assign(settingsRPC, DataStore.getSettingGroup(\"rpc\"));\n }\n\n renderSidebar(sidebar) {\n return this.sidebar.render(sidebar);\n }\n\n coreComponent() {\n return BDV2.react.createElement(SectionedSettingsPanel, {key: \"cspanel\", onChange: this.onChange, sections: this.coreSettings})\n }\n\n lightcordComponent(sidebar, forceUpdate) {\n let appSettings = window.Lightcord.Api.settings\n return [\n this.lightcordSettings.map((section, i) => {\n return [\n (i === 0 ? null : BDV2.react.createElement(MarginTop)),\n BDV2.react.createElement(\"h2\", {className: \"ui-form-title h2 margin-reset margin-bottom-20\"}, section.title),\n section.settings.map(setting => {\n let isChecked = settingsCookie[setting.id]\n let value = appSettings.get(\"BD_\"+setting.id, setting.default || \"\")\n if(setting.id === \"lightcord-8\")isChecked = appSettings.get(\"isTabs\", false);\n if(setting.id === \"no_window_bound\")isChecked = appSettings.get(\"NO_WINDOWS_BOUND\", false)\n if(setting.id === \"enable_glasstron\")isChecked = appSettings.get(\"GLASSTRON\", true)\n if(setting.id === \"lightcord-10\")isChecked = !appSettings.get(\"DEFAULT_NOTIFICATIONS\", true)\n let returnValue\n if([\"lightcord-11\"].includes(setting.id)){\n returnValue = BDV2.react.createElement(TextInputSetting, {id: setting.id, key: setting.id, data: setting, value, placeholder: setting.default || null, onChange: (id, value) => {\n this.onChange(id, value, sidebar);\n }})\n }else{\n returnValue = BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: isChecked, onChange: (id, checked) => {\n this.onChange(id, checked, sidebar);\n }})\n }\n if(setting.id == \"lightcord-8\" && isChecked){\n return [\n returnValue,\n React.createElement(Lightcord.Api.Components.inputs.Button, {\n color: \"green\",\n look: \"outlined\",\n size: \"small\",\n hoverColor: \"brand\",\n onClick: () => {\n DiscordNative.ipc.send(\"NEW_TAB\")\n },\n wrapper: false,\n disabled: false\n }, \"Open a new Tab\")\n ]\n }\n if(setting.id === \"enable_glasstron\" && isChecked){\n if(process.platform !== \"linux\"){\n let choices = []\n let actual = null\n if(process.platform === \"win32\"){\n choices.push(\"blurbehind\", \"acrylic\", \"transparent\")\n actual = appSettings.get(\"GLASSTRON_BLUR\", \"blurbehind\")\n }else if(process.platform === \"darwin\"){\n choices.push(\"titlebar\", \n \"selection\", \n \"menu\", \n \"popover\", \n \"sidebar\", \n \"header\", \n \"sheet\", \n \"window\", \n \"hud\", \n \"fullscreen-ui\", \n \"tooltip\", \n \"content\", \n \"under-window\", \n \"under-page\", \n \"none\"\n )\n actual = appSettings.get(\"GLASSTRON_VIBRANCY\", \"fullscreen-ui\")\n }\n return [\n returnValue,\n React.createElement(Lightcord.Api.Components.general.SettingSubTitle, {}, \"Glasstron Blur\"),\n React.createElement(Lightcord.Api.Components.inputs.Dropdown, {\n options: choices.map(e => {\n return {\n value: e,\n label: e\n }\n }),\n value: actual,\n disabled: false,\n searchable: true,\n clearable: false,\n onChange: (value) => {\n if(process.platform === \"win32\"){\n ipcRenderer.invoke(\"LIGHTCORD_SET_BLUR_TYPE\", value)\n }else{\n ipcRenderer.invoke(\"LIGHTCORD_SET_VIBRANCY\", value)\n }\n }\n }, null)\n ]\n }\n }\n return returnValue\n })\n ]\n }), \n BDV2.react.createElement(window.Lightcord.Api.Components.inputs.Button, {\n color: \"yellow\",\n look: \"ghost\",\n size: \"medium\",\n hoverColor: \"red\",\n onClick(){\n ipcRenderer.sendSync(\"LIGHTCORD_RELAUNCH_APP\", {\n args: remote.process.argv.slice(1).concat([\"--disable-betterdiscord\"])\n })\n },\n wrapper: true\n }, \"Relaunch without BetterDiscord\"),\n React.createElement(Lightcord.Api.Components.inputs.Button, {\n color: \"yellow\",\n look: \"ghost\",\n size: \"medium\",\n hoverColor: \"red\",\n onClick: () => {\n if(isClearingCache)return\n isClearingCache = true\n Utils.showToast(\"Clearing cache...\", {\n type: \"info\"\n })\n forceUpdate()\n remote.getCurrentWebContents().session.clearCache()\n .then(() => {\n Utils.showToast(\"Cache is cleared !\", {\n type: \"success\"\n })\n isClearingCache = false\n forceUpdate()\n }).catch(err => {\n console.error(err)\n Utils.showToast(\"An error occured. Check console for more informations.\", {\n type: \"error\"\n })\n isClearingCache = false\n forceUpdate()\n })\n },\n wrapper: true,\n disabled: isClearingCache\n }, \"Clear cache\")\n ]\n }\n\n PresenceComponent() {\n return BDV2.react.createElement(V2C_PresenceSettings, {\n key: \"lppannel\",\n onChange: this.onChange, \n settings: this.PresenceSettings\n })\n }\n\n AccountInfosComponent() {\n return BDV2.react.createElement(V2C_AccountInfos, {\n key: \"lapannel\"\n })\n }\n\n ApiPreviewComponent() {\n return BDV2.react.createElement(ApiPreview, {\n key: \"lapipannel\"\n })\n }\n\n customCssComponent() {\n return BDV2.react.createElement(CssEditor, {key: \"csseditor\"})\n }\n\n renderAddonPane(type) {\n // I know this shouldn't be here, but when it isn't,\n // React refuses to change the button when going\n // between plugins and themes page... something\n // to debug later.\n class ContentList extends BDV2.react.Component {\n constructor(props) {\n super(props);\n this.prefix = this.props.type.replace(\"s\", \"\");\n }\n \n onChange() {\n this.props.onChange(this.props.type);\n }\n \n render() {return this.props.children;}\n }\n const originalRender = ContentList.prototype.render;\n Object.defineProperty(ContentList.prototype, \"render\", {\n enumerable: false,\n configurable: false,\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\n get: () => originalRender\n });\n return function(){\n return BDV2.react.createElement(ContentList, {type}, BDV2.react.createElement(CardList, {type}))\n }\n }\n};\n\n/**\n * No need to export settingsPanel on window\n */\n\nfunction makeComponent(children){\n class SettingComponent extends React.Component {\n render(){\n return children(sidebar, () => this.forceUpdate())\n }\n }\n let sidebar\n return (s) => {\n sidebar = s\n return SettingComponent\n }\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class BDLogo extends BDV2.reactComponent {\r\n render() {\r\n return BDV2.react.createElement(\r\n \"svg\",\r\n {height: \"100%\", width: this.props.size || \"16px\", className: \"bd-logo \" + this.props.className, style: {fillRule: \"evenodd\", clipRule: \"evenodd\", strokeLinecap: \"round\", strokeLinejoin: \"round\"}, viewBox: \"0 0 2000 2000\"},\r\n BDV2.react.createElement(\"metadata\", null),\r\n BDV2.react.createElement(\"defs\", null,\r\n BDV2.react.createElement(\"filter\", {id: \"shadow1\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"20\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(0,0,0,0.35)\"})),\r\n BDV2.react.createElement(\"filter\", {id: \"shadow2\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"15\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(255,255,255,0.15)\"})),\r\n BDV2.react.createElement(\"filter\", {id: \"shadow3\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"10\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(0,0,0,0.35)\"}))\r\n ),\r\n BDV2.react.createElement(\"g\", null,\r\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow3)\"}, 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\", fill: \"#171717\", opacity: \"1\"}),\r\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow2)\"}, 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\", fill: \"#3E82E5\", opacity: \"1\"}),\r\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow1)\"}, 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\", fill: \"#FFFFFF\", opacity: \"1\"})\r\n )\r\n );\r\n }\r\n}","export default class LightcordLogo extends React.Component {\r\n render(){\r\n const props = this.props\r\n return (\r\n <svg viewBox=\"0 0 168 168.69\" {...props} height=\"100%\" width={props.size}>\r\n <defs>\r\n <linearGradient id=\"prefix__a\" x1={66.7} y1={-487.7} x2={66.7} y2={-508.73} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\r\n <stop offset={0} stopColor=\"#e30613\" />\r\n <stop offset={1} stopColor=\"#731a14\" />\r\n </linearGradient>\r\n <linearGradient id=\"prefix__b\" x1={101.7} y1={-487.7} x2={101.7} y2={-508.73} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\r\n <stop offset={0} stopColor=\"#e20613\" />\r\n <stop offset={1} stopColor=\"#731a13\" />\r\n </linearGradient>\r\n <linearGradient id=\"prefix__c\" x1={84} y1={-408} x2={84} y2={-576.69} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\r\n <stop offset={0} stopColor=\"#e30613\" />\r\n <stop offset={1} stopColor=\"#731a13\" />\r\n </linearGradient>\r\n </defs>\r\n <path fill=\"#fff\" d=\"M14.9 35.3h139.2V133H14.9z\" />\r\n <path d=\"M66.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\" fill=\"url(#prefix__a)\" />\r\n <path d=\"M101.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\" fill=\"url(#prefix__b)\" />\r\n <path d=\"M0 0v168l168 .69V0zm111.3 124.1s-3.4-4.1-6.3-7.7c12.6-3.5 17.4-11.3 17.4-11.3a52.52 52.52 0 01-11.1 5.6 68.63 68.63 0 01-38.9 4 70.12 70.12 0 01-14.1-4.1 48.88 48.88 0 01-7.1-3.3c-.3-.2-.6-.3-.9-.5a.76.76 0 00-.4-.2c-1.7-1-2.6-1.6-2.6-1.6s4.6 7.6 16.8 11.2c-2.9 3.6-6.4 7.9-6.4 7.9-21.2-.6-29.3-14.5-29.3-14.5 0-30.6 13.8-55.4 13.8-55.4 13.8-10.3 26.9-10 26.9-10l1 1.1C52.8 50.3 45 57.9 45 57.9a56.2 56.2 0 015.7-2.7 72.19 72.19 0 0121.8-6 8.75 8.75 0 011.6-.2 89.1 89.1 0 0119.4-.2 78.45 78.45 0 0128.9 9.1s-7.5-7.2-23.9-12.1l1.3-1.5s13.1-.3 26.9 10c0 0 13.8 24.8 13.8 55.4.1-.1-8 13.8-29.2 14.4z\" fill=\"url(#prefix__c)\" />\r\n </svg>\r\n )\r\n }\r\n}","import BDV2 from \"./v2\";\r\nimport Utils from \"./utils\";\r\nimport { settings } from \"../0globals\";\r\n\r\nconst Constants = {\r\n EmojiRegex: /<a?\\.(\\w+)\\.(\\d+)>/g\r\n}\r\n\r\nlet CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\r\nlet EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\r\nlet AutocompleteModule = BDModules.get(e => e.default && e.default.displayName === \"Autocomplete\")[0]\r\nlet AutoCompletionTemplates = BDModules.get(e => e.getAutocompleteOptions)[0]\r\nlet EmojiModuleQuery = BDModules.get(e => e.default && e.default.queryEmojiResults)[0]\r\nlet Messages = BDModules.get(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)[0]\r\nlet guildModule = BDModules.get(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)[0]\r\nlet emojiSearch = BDModules.get(e => e.default && e.default.getDisambiguatedEmojiContext)\r\nconst appSettings = Lightcord.Api.settings\r\n\r\nexport default new class EmojiModule {\r\n constructor(){\r\n this.init().catch(err => Utils.err(\"EmojiModule\", \"An error occured\", err)) // better logging\r\n }\r\n\r\n async init(){\r\n /** Emoji AutoComplete */\r\n if(!AutocompleteModule)AutocompleteModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"Autocomplete\")\r\n if(!AutoCompletionTemplates)AutoCompletionTemplates = await window.Lightcord.Api.ensureExported(e => e.getAutocompleteOptions)\r\n if(!EmojiModuleQuery)EmojiModuleQuery = await window.Lightcord.Api.ensureExported(e => e.default && e.default.queryEmojiResults)\r\n if(!Messages)Messages = await window.Lightcord.Api.ensureExported(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)\r\n if(!guildModule)guildModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)\r\n if(!emojiSearch)emojiSearch = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getDisambiguatedEmojiContext)\r\n\r\n const setting = settings[\"Emoji Prefix\"]\r\n const getValue = () => {\r\n const value = appSettings.get(\"BD_\"+setting.id, setting.default)\r\n if(typeof value !== \"string\")return setting.default\r\n return value\r\n }\r\n\r\n if(AutocompleteModule && AutoCompletionTemplates && EmojiModuleQuery && Messages && guildModule && emojiSearch){\r\n console.log(`Patching getAutocompleteOptions of AutoCompletionTemplates`, AutoCompletionTemplates)\r\n const getAutocompleteOptions = AutoCompletionTemplates.getAutocompleteOptions\r\n AutoCompletionTemplates.getAutocompleteOptions = function(e, t, n, r, a){\r\n const value = getAutocompleteOptions.call(this, ...arguments)\r\n value.LIGHTCORD_EMOJIS = {\r\n matches(arg1, arg2){\r\n let condition = arg2.length > 1 && getValue() === arg1\r\n setEmojiUsable(condition)\r\n return condition\r\n },\r\n queryResults(t){\r\n let results = EmojiModuleQuery.default.queryEmojiResults(t, e)\r\n return results\r\n },\r\n renderResults(e, t, n, r, a){\r\n return D(e, t, a.emojis, n, r, Messages.default.Messages.EMOJI_MATCHING, Messages.default.Messages.EMOJI, AutocompleteModule.default.Emoji, (function(e) {\r\n return {\r\n emoji: e,\r\n key: e.id || e.uniqueName || e.name,\r\n sentinel: getValue(),\r\n guild: null != e.guildId ? guildModule.default.getGuild(e.guildId) : null\r\n }\r\n }), (function(e) {\r\n return getValue() + e + getValue()\r\n }))\r\n },\r\n getPlainText(id, guild){\r\n var emojis = guild.emojis;\r\n if (null == emojis || null == emojis[id]) return \"\";\r\n var emoji = emojis[id],\r\n isAnimated = emoji.animated ? \"a\" : \"\";\r\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\r\n },\r\n getRawText(id, guild){\r\n var emojis = guild.emojis;\r\n if (null == emojis || null == emojis[id]) return \"\";\r\n var emoji = emojis[id],\r\n isAnimated = emoji.animated ? \"a\" : \"\";\r\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\r\n }\r\n }\r\n return value\r\n }\r\n }else{\r\n console.error(new Error(\"Couldn't start autocompletion of Lightcord's emojis.\"))\r\n }\r\n\r\n /** Emoji display */\r\n while (!BDV2.MessageComponent) await new Promise(resolve => setTimeout(resolve, 100));\r\n\r\n if (!this.cancelEmojiRender){ // TODO: Proper emoji formatting / rendering\r\n this.cancelEmoteRender = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\r\n const message = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.message\")\r\n if(!message)return\r\n const content = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.content\")\r\n if(!content || !content.length)return\r\n \r\n /**\r\n * @type {{\r\n * raw: string,\r\n * name: string,\r\n * id: string,\r\n * animated: boolean\r\n * }[]}\r\n */\r\n let emojis = []\r\n \r\n const newContent = []\r\n for(let node of content){\r\n if (typeof(node) !== \"string\") {\r\n newContent.push(node)\r\n continue\r\n };\r\n let parsed;\r\n let hasParsed = false\r\n \r\n do {\r\n parsed = Constants.EmojiRegex.exec(node);\r\n if (parsed) {\r\n hasParsed = true\r\n if(!EmojiModuleApi)EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\r\n const emoji = EmojiModuleApi.default.getCustomEmojiById(parsed[2])\r\n if(emoji){\r\n emojis.push({\r\n animated: emoji.animated,\r\n name: emoji.name,\r\n id: emoji.id,\r\n raw: parsed[0]\r\n })\r\n }else{\r\n emojis.push({\r\n animated: parsed[0].startsWith(\"<a\"),\r\n name: parsed[1],\r\n id: parsed[2],\r\n raw: parsed[0]\r\n })\r\n }\r\n }\r\n } while (parsed);\r\n \r\n if(hasParsed){\r\n const words = node.split(\" \").map((word, index, arr) => {\r\n if(!word)return \"\"\r\n const emoji = emojis.find(e => e.raw == word)\r\n if(!emoji)return word\r\n if(!CustomEmojiModule)CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\r\n return React.createElement(CustomEmojiModule.CustomEmoji, {\r\n emoji: {\r\n name: `${getValue()}${emoji.name}${getValue()}`,\r\n emojiId: emoji.id,\r\n animated: emoji.animated,\r\n jumboable: arr.length === 1 && content.length === 1\r\n }\r\n })\r\n }).reduce((previous, current) => {\r\n if(previous.length === 0)return [current]\r\n if(typeof current === \"string\"){\r\n if(typeof previous[previous.length - 1] === \"string\"){\r\n previous[previous.length - 1] += ` ${current}`\r\n return previous\r\n }\r\n previous.push(\" \"+current)\r\n return previous\r\n }\r\n previous.push(\" \", current)\r\n return previous\r\n }, [])\r\n newContent.push(...words)\r\n }else{\r\n newContent.push(node)\r\n }\r\n }\r\n while(data.methodArguments[0].childrenMessageContent.props.content[0]){\r\n data.methodArguments[0].childrenMessageContent.props.content.shift()\r\n }\r\n while(newContent[0]){\r\n data.methodArguments[0].childrenMessageContent.props.content.push(newContent.shift())\r\n }\r\n }});\r\n }/*\r\n let userModule\r\n window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"EmojiPickerListRow\")\r\n .then(EmojiPickerListRow => {\r\n let classs = EmojiPickerListRow.default\r\n EmojiPickerListRow.default = class EmojiPickerListRow extends React.Component {\r\n constructor(props){\r\n super(props)\r\n }\r\n\r\n render(){\r\n if(!userModule)userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0]\r\n if(!userModule)return React.createElement(classs, this.props)\r\n let user = userModule.default.getCurrentUser()\r\n if(!user.hasPremiumSubscription)return React.createElement(classs, this.props)\r\n\r\n return React.createElement(classs, Object.assign({}, this.props, {\r\n emojiDescriptors: this.props.emojiDescriptors.map(e => {\r\n e.isDisabled = false\r\n })\r\n })) \r\n }\r\n }\r\n EmojiPickerListRow.default.displayName = \"EmojiPickerListRow\"\r\n })*/\r\n }\r\n\r\n disable(){\r\n if (!this.cancelEmoteRender) return;\r\n this.cancelEmoteRender();\r\n this.cancelEmoteRender = null;\r\n }\r\n\r\n start(){\r\n \r\n }\r\n}\r\n\r\nfunction D(e, t, n, r, o, i, s, u, l, c) {\r\n if (null == n || 0 === n.length) return null;\r\n var d = n.map((function(e, n) {\r\n return React.createElement(u, Object.assign({\r\n onClick: o,\r\n onHover: r,\r\n selected: t === n,\r\n index: n\r\n }, l(e, n)))\r\n }));\r\n return [R(i, s, e, c), d]\r\n}\r\n\r\nfunction R(e, t, n, r) {\r\n var a = (n.length > 0 ? e.format({\r\n prefix: r(n)\r\n }) : t)\r\n if(Array.isArray(a)){\r\n a.unshift(React.createElement(\"strong\", {}, \"[Lightcord] \"))\r\n }else{\r\n a = \"[LIGHTCORD] \"+a\r\n }\r\n return React.createElement(AutocompleteModule.default.Title, {\r\n title: a\r\n }, a)\r\n}\r\nR.displayName = \"renderHeader\";\r\n\r\nlet EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\r\nlet isEmojiDisabled = EmojiFilterModule && EmojiFilterModule.default.isEmojiDisabled\r\nlet isUsable = false\r\nlet hasPatched = false\r\n\r\nfunction setEmojiUsable(usable){\r\n isUsable = usable\r\n if(hasPatched)return\r\n if(!EmojiFilterModule)EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\r\n if(!EmojiFilterModule)return\r\n if(!isEmojiDisabled)isEmojiDisabled = EmojiFilterModule.default.isEmojiDisabled\r\n\r\n hasPatched = true\r\n EmojiFilterModule.default.isEmojiDisabled = function(emoji){\r\n if(isUsable){\r\n if(emoji.surrogates || emoji.diversity)return true\r\n return false\r\n }\r\n return isEmojiDisabled.call(this, ...arguments)\r\n }\r\n}","import {bdConfig, minSupportedVersion, bbdVersion, settingsCookie, bdpluginErrors, bdthemeErrors, bbdChangelog, defaultCookie, currentDiscordVersion, defaultRPC, settingsRPC, lightcordSettings} from \"../0globals\";\nimport Utils from \"./utils\";\n\nimport BDV2 from \"./v2\";\nimport settingsPanel from \"./settingsPanel\";\nimport pluginModule from \"./pluginModule\";\nimport themeModule from \"./themeModule\";\nimport DataStore from \"./dataStore\";\nimport WebpackModules from \"./webpackModules\";\nimport DOM from \"./domtools\";\n\nimport BDLogo from \"../ui/bdLogo\";\nimport TooltipWrap from \"../ui/tooltipWrap\";\nimport LightcordLogo from \"../svg/Lightcord\";\nimport PluginCertifier from \"./pluginCertifier\";\nimport distant, { uuidv4 } from \"./distant\";\nimport EmojiModule from \"./emojiModule\"\nimport * as electron from \"electron\"\nimport v2 from \"./v2\";\nimport contentManager from \"./contentManager\";\n\nlet methods\nfunction Core() {}\n\n\nCore.prototype.setConfig = function(config) {\n if (this.hasStarted) return;\n Object.assign(bdConfig, config);\n};\n\nObject.defineProperty(Core.prototype, \"methods\", {\n get(){\n return methods\n }\n})\n\nCore.prototype.setMethods = function(m) {\n if (this.hasStarted) return;\n methods = m\n};\n\nCore.prototype.init = async function() {\n if (this.hasStarted) return;\n this.hasStarted = true;\n\n if (!Array.prototype.flat) {\n Utils.alert(\"Not Supported\", \"BetterDiscord v\" + bbdVersion + \" does not support this old version (\" + currentDiscordVersion + \") of Discord. Please update your Discord installation before proceeding.\");\n return;\n }\n\n if (bdConfig.version < minSupportedVersion) {\n Utils.alert(\"Not Supported\", \"BetterDiscord v\" + bdConfig.version + \" (your version)\" + \" is not supported by the latest js (\" + bbdVersion + \").<br><br> Please download the latest version from <a href='https://github.com/rauenzi/BetterDiscordApp/releases/latest' target='_blank'>GitHub</a>\");\n return;\n }\n\n if (window.ED) {\n Utils.alert(\"Not Supported\", \"BandagedBD does not work with EnhancedDiscord. Please uninstall one of them.\");\n return;\n }\n\n if (window.WebSocket && window.WebSocket.name && window.WebSocket.name.includes(\"Patched\")) {\n Utils.alert(\"Not Supported\", \"BandagedBD does not work with Powercord. Please uninstall one of them.\");\n return;\n }\n\n Utils.suppressErrors(this.patchAttributes.bind(this), \"LC Plugin Certifier Patch\")();\n\n Utils.log(\"Startup\", \"Initializing Settings\");\n this.initSettings();\n\n await this.checkForGuilds();\n BDV2.initialize();\n Utils.log(\"Startup\", \"Updating Settings\");\n settingsPanel.initializeSettings();\n\n Utils.log(\"Startup\", \"Loading Addons Cache\")\n await contentManager.loadAddonCertifierCache()\n\n Utils.log(\"Startup\", \"Loading Plugins\");\n await pluginModule.loadPlugins();\n\n Utils.log(\"Startup\", \"Loading Themes\");\n await themeModule.loadThemes();\n\n DOM.addStyle(\"customcss\", Buffer.from(DataStore.getBDData(\"bdcustomcss\"), \"base64\").toString(\"utf8\"));\n\n window.addEventListener(\"beforeunload\", function() {\n if (settingsCookie[\"bda-dc-0\"]) document.querySelector(\".btn.btn-disconnect\").click();\n });\n\n PluginCertifier.start()\n\n Utils.log(\"Startup\", \"Removing Loading Icon\");\n if (document.getElementsByClassName(\"bd-loaderv2\").length) document.getElementsByClassName(\"bd-loaderv2\")[0].remove();\n Utils.log(\"Startup\", \"Initializing Main Observer\");\n this.initObserver();\n\n // Show loading errors\n if (settingsCookie[\"fork-ps-1\"]) {\n Utils.log(\"Startup\", \"Collecting Startup Errors\");\n Utils.showContentErrors({plugins: bdpluginErrors, themes: bdthemeErrors});\n }\n\n const previousVersion = DataStore.getBDData(\"version\");\n if (bbdVersion > previousVersion) {\n if (bbdChangelog) this.showChangelogModal(bbdChangelog);\n DataStore.setBDData(\"version\", bbdVersion);\n }\n\n EmojiModule.start()\n\n Utils.suppressErrors(this.patchSocial.bind(this), \"BD Social Patch\")();\n Utils.suppressErrors(this.patchGuildPills.bind(this), \"BD Guild Pills Patch\")();\n Utils.suppressErrors(this.patchGuildListItems.bind(this), \"BD Guild List Items Patch\")();\n Utils.suppressErrors(this.patchGuildSeparator.bind(this), \"BD Guild Separator Patch\")();\n Utils.suppressErrors(this.patchMessageHeader.bind(this), \"BD Badge Chat Patch\")();\n Utils.suppressErrors(this.patchMemberList.bind(this), \"BD Badge Member List Patch\")();\n Utils.suppressErrors(this.patchAttachment.bind(this), \"LC Plugin Certifier Patch\")();\n\n if(bdConfig.haveInstalledDefault){\n let alert = Utils.alert(\"First Installation\", \"As it is the first time you install Lightcord, We added two default themes and one default plugin in your plugin/theme folder. Check it in the Plugin/Theme settings.\")\n await new Promise((resolve) => {\n alert.onClose(resolve)\n })\n }\n const logo = document.querySelector(\"#app-mount > div.typeWindows-1za-n7.withFrame-haYltI.titleBar-AC4pGV.horizontalReverse-3tRjY7.flex-1O1GKY.directionRowReverse-m8IjIq.justifyStart-2NDFzi.alignStretch-DpGPf3.da-typeWindows.da-withFrame.da-titleBar.da-horizontalReverse.da-flex.da-directionRowReverse.da-justifyStart.da-alignStretch > div.wordmarkWindows-1v0lYD.wordmark-2iDDfm.da-wordmarkWindows.da-wordmark\")\n if(logo){\n logo.style.top = \"3px\"\n logo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"10\" width=\"70\" viewBox=\"0 0 72.54 10\" style=\"margin-left: -5px, margin-top: 10px\">\n <path fill=\"currentColor\" d=\"M44.81,9.67V6.33c0-1.21,2.13-1.49,2.78-.28l2-.81A3.53,3.53,0,0,0,46.2,3c-1.92,0-3.81,1.13-3.81,3.33V9.67c0,2.21,1.89,3.33,3.77,3.33a3.87,3.87,0,0,0,3.45-2.18l-2.12-1C47,11.17,44.81,10.85,44.81,9.67ZM10.68,12.89h2.41V3.17H10.68ZM71.76,3.14H68.19V7.23L70.57,9.4v-4h1.27c.81,0,1.21.41,1.21,1v3c0,.63-.38,1.05-1.21,1.05H68.18v2.31h3.57c1.92,0,3.72-1,3.72-3.2V6.39C75.48,4.13,73.68,3.14,71.76,3.14ZM54.22,3c-2,0-4,1.1-4,3.34V9.66c0,2.23,2,3.34,4,3.34s3.95-1.11,3.95-3.34V6.34C58.19,4.11,56.2,3,54.22,3Zm1.55,6.66c0,.7-.78,1.06-1.54,1.06s-1.55-.35-1.55-1.06V6.34c0-.72.75-1.1,1.5-1.1s1.59.35,1.59,1.1ZM66.84,6.34c0-2.29-1.58-3.2-3.55-3.2H59.46v9.73h2.45V9.77h.43l2.22,3.09h3L65,9.52C66.13,9.15,66.84,8.14,66.84,6.34ZM63.33,7.65H61.91V5.43h1.42A1.11,1.11,0,1,1,63.33,7.65ZM29.83,13h2.42V3.06H29.83V6.73l-3,0V3.09H24.7v9.78h2.14V8.68l3,0ZM17.16,9.76V6.42c0-1.21,2.13-1.49,2.78-.28l2-.81a3.55,3.55,0,0,0-3.36-2.24c-1.92,0-3.81,1.13-3.81,3.33V9.76c0,2.21,2,3.15,3.9,3.15s3.58-1,3.58-3V7.58H18.79l0,1.36H20.3v.77C20.3,10.92,17.16,10.94,17.16,9.76Z\" transform=\"translate(-2.93 -3)\"/>\n <polygon fill=\"currentColor\" points=\"35.91 0.06 38.43 0.06 38.43 1.84 35.92 1.81 35.97 10 33.55 10 33.49 1.75 30.98 1.74 30.98 0.06 33.49 0.06 35.91 0.06\"/>\n <polygon fill=\"currentColor\" points=\"0 9.97 6.5 10 6.5 7.63 2.41 7.63 2.41 0.26 0 2.26 0 9.97\"/>\n</svg>`\n }\n};\n\nCore.prototype.patchAttributes = async function() {\n let attribsPatchs = []\n this.cancelPatchAttributes = function() {\n attribsPatchs.forEach(e => e())\n }\n\n while(!v2.MessageComponent)await new Promise(resolve => setTimeout(resolve, 100))\n \n // TODO: try to patch correctly the user popout on a next update\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"DiscordTag\")\n .then(DiscordTag => {\n let DiscordTagComp = DiscordTag.default\n DiscordTag.default = function(props){\n let returnValue = DiscordTagComp(props)\n\n let id = uuidv4()\n\n let badgeDiv = BDV2.React.createElement(\"div\", {\n style: {\n display: \"inline\",\n marginTop: \"5px\"\n }\n }, BDV2.React.createElement(\"span\", {\n id: \"badges-\"+id,\n key: \"badges-\"+id,\n style: {\n display: \"inherit\"\n }\n }))\n\n let children = [returnValue]\n\n if (props.user.id === \"249746236008169473\") { // Rauenzi: BandagedBD Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n } else if (props.user.id === \"696481194443014174\" || props.user.id === \"696003456611385396\"){ // Not Thomiz: Lightcord Developer, Phorcys: Lightcord Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n }\n\n children.push(badgeDiv)\n let div = BDV2.React.createElement(\"div\", {\n style: {\n display: \"block\"\n }\n }, children)\n applyBadges(id, props.user, false)\n\n return div\n }\n DiscordTag.default.displayName = DiscordTagComp.displayName\n })\n\n attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, \"default\", {after: (data) => {\n if(data.methodArguments[0].childrenMessageContent.props.message){ // this can be a blocked message (not opened)\n data.returnValue.props[\"data-message-id\"] = data.methodArguments[0].childrenMessageContent.props.message.id\n }\n }}))\n /*\n attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, \"default\", {after: (data) => {\n data.returnValue.props[\"message-id\"] = data.methodArguments[0].childrenMessageContent.props.message.id\n }}))*/\n}\n\nCore.prototype.checkForGuilds = function() {\n let timesChecked = 0;\n return new Promise(resolve => {\n const checkForGuilds = function() {\n const wrapper = BDV2.guildClasses.wrapper.split(\" \")[0];\n if (document.querySelectorAll(`.${wrapper}`).length > 0) timesChecked++;\n const guild = BDV2.guildClasses.listItem.split(\" \")[0];\n const blob = BDV2.guildClasses.blobContainer.split(\" \")[0];\n if (document.querySelectorAll(`.${wrapper} .${guild} .${blob}`).length > 0) return resolve(bdConfig.deferLoaded = true);\n else if (timesChecked >= 50) return resolve(bdConfig.deferLoaded = true);\n setTimeout(checkForGuilds, 100);\n };\n if (document.readyState != \"loading\") setTimeout(checkForGuilds, 100);\n document.addEventListener(\"DOMContentLoaded\", () => {setTimeout(checkForGuilds, 100);});\n });\n};\n\nCore.prototype.injectExternals = async function() {\n // No externals\n};\n\nCore.prototype.initSettings = function () {\n DataStore.initialize();\n if(!DataStore.getSettingGroup(\"rpc\")){\n Object.assign(settingsRPC, defaultRPC);\n }\n if(!DataStore.getSettingGroup(\"settings\")){\n Object.assign(settingsCookie, defaultCookie);\n settingsPanel.saveSettings();\n } else {\n settingsPanel.loadSettings();\n for (const setting in defaultCookie) {\n if (settingsCookie[setting] == undefined) {\n settingsCookie[setting] = defaultCookie[setting];\n settingsPanel.saveSettings();\n }\n }\n }\n window.Lightcord.Api.ensureExported(e => e.default && e.default.prototype && e.default.prototype.getPredicateSections)\n .then(settingModule => {\n\n let getPredicateSections = settingModule.default.prototype.getPredicateSections\n settingModule.default.prototype.getPredicateSections = function(){\n let result = getPredicateSections.call(this, ...arguments)\n\n if(!result[1])return result\n if(result[1].section === \"My Account\"){ // user settings, not guild settings\n let poped = []\n \n poped.push(result.pop())\n poped.push(result.pop())\n poped.push(result.pop())\n poped.push(result.pop())\n\n result.push(...settingsPanel.renderSidebar(this))\n\n while(poped[0]){\n result.push(poped.pop())\n }\n }\n console.log(result)\n return result\n }\n })\n};\n\n\nlet classNameLayer\nlet classNameSocialLinks\nlet classNameModal\n\nCore.prototype.initObserver = function () {\n const mainObserver = new MutationObserver((mutations) => {\n for (let i = 0, mlen = mutations.length; i < mlen; i++) {\n const mutation = mutations[i];\n if (typeof pluginModule !== \"undefined\") pluginModule.rawObserver(mutation);\n\n // if there was nothing added, skip\n if (!mutation.addedNodes.length || !(mutation.addedNodes[0] instanceof Element)) continue;\n\n const node = mutation.addedNodes[0];\n\n if(!classNameLayer)classNameLayer = BDModules.get((e) => e.layer && typeof e.layer === \"string\" && e.animating)[0].layer\n if(!classNameSocialLinks)classNameSocialLinks = BDModules.get((e) => e.socialLinks && typeof e.socialLinks === \"string\")[0].socialLinks\n if(!classNameModal)classNameModal = BDModules.get((e) => e.modal && typeof e.modal === \"string\" && e.inner && typeof e.inner === \"string\" && !e.responsiveWidthMobile)[0].modal\n\n if (node.classList.contains(classNameLayer)) {\n if (node.getAttribute(\"aria-label\") === \"GUILD_SETTINGS\"){\n node.setAttribute(\"layer-id\", \"server-settings\");\n node.setAttribute(\"id\", \"server-settings\");\n }\n\n if (node.getElementsByClassName(classNameSocialLinks).length) {\n node.setAttribute(\"layer-id\", \"user-settings\");\n node.setAttribute(\"id\", \"user-settings\");\n }\n }\n\n if (node.parentElement == document.body && node.querySelector(\"#ace_settingsmenu\")) node.id = \"ace_settingsmenu_container\";\n\n // Emoji Picker\n //node.getElementsByClassName(\"emojiPicker-3m1S-j\").length && !node.querySelector(\".emojiPicker-3m1S-j\").parentElement.classList.contains(\"animatorLeft-1EQxU0\")\n //if (node.classList.contains(classNameLayer2) && node.getElementsByClassName(classNameEmojiPicker).length && !node.querySelector(\".\"+classNameEmojiPicker).parentElement.classList.contains(classNameAnimatorLeft)) quickEmoteMenu.obsCallback(node);\n\n }\n });\n\n mainObserver.observe(document, {\n childList: true,\n subtree: true\n });\n};\n\nCore.prototype.showChangelogModal = function(options = {}) {\n return Utils.showChangelogModal(options);\n};\n\nCore.prototype.alert = function(title, content) {\n return Utils.alert(title, content);\n};\n\nCore.prototype.patchSocial = function() {\n if (this.socialPatch) return;\n const TabBar = WebpackModules.find(m => m.displayName == \"TabBar\");\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!TabBar) return;\n this.socialPatch = Utils.monkeyPatch(TabBar.prototype, \"render\", {after: (data) => {\n const children = data.returnValue.props.children;\n if (!children || !children.length || children.length < 3) return;\n if (children[children.length - 3].type.displayName !== \"Separator\") return;\n if (!children[children.length - 2].type.toString().includes(\"socialLinks\")) return;\n if (Anchor) {\n let socialModule1 = BDModules.get(e => e.socialLinks)[0]\n const original = children[children.length - 2].type;\n const newOne = function() {\n const returnVal = original(...arguments);\n returnVal.props.children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord\"},\n BDV2.React.createElement(Anchor, {className: \"bd-social-link \"+socialModule1.link, href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-social-logo\"})\n )\n )\n );\n returnVal.props.children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD\"},\n BDV2.React.createElement(Anchor, {className: \"bd-social-link \"+socialModule1.link, href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-social-logo\"})\n )\n )\n );\n return returnVal;\n };\n children[children.length - 2].type = newOne;\n }\n\n let [\n classNameColorMuted,\n sizes,\n classNameVersionHash\n ] = [\n BDModules.get(e => e.colorMuted)[0].colorMuted,\n BDModules.get(e => e.size32)[0],\n BDModules.get(e => e.versionHash)[0].versionHash\n ]\n\n const versionHash = `(${bdConfig.hash ? bdConfig.hash.substring(0, 7) : bdConfig.branch})`;\n const buildInfo = electron.ipcRenderer.sendSync(\"LIGHTCORD_GET_BUILD_INFOS\")\n const additional = [\n BDV2.react.createElement(\"div\", {className: `${classNameColorMuted} ${sizes.size12}`}, `Lightcord ${buildInfo.version} `, BDV2.react.createElement(\"span\", {className: classNameVersionHash+\" da-versionHash\"}, `(${(buildInfo.commit || \"Unknown\").slice(0, 7)})`)),\n BDV2.react.createElement(\"div\", {className: `${classNameColorMuted} ${sizes.size12}`}, `BBD ${bbdVersion} `, BDV2.react.createElement(\"span\", {className: classNameVersionHash+\" da-versionHash\"}, versionHash))\n ]\n \n\n const originalVersions = children[children.length - 1].type;\n children[children.length - 1].type = function() {\n const returnVal = originalVersions(...arguments);\n returnVal.props.children.splice(1, 0, additional);\n return returnVal;\n };\n }});\n};\n\nconst getGuildClasses = function() {\n const guildsWrapper = WebpackModules.findByProps(\"wrapper\", \"unreadMentionsBar\");\n const guilds = WebpackModules.findByProps(\"guildsError\", \"selected\");\n const pill = WebpackModules.findByProps(\"blobContainer\");\n return Object.assign({}, guildsWrapper, guilds, pill);\n};\n\nCore.prototype.patchGuildListItems = function() {\n if (this.guildListItemsPatch) return;\n const GuildClasses = getGuildClasses();\n const listItemClass = GuildClasses.listItem.split(\" \")[0];\n const blobClass = GuildClasses.blobContainer.split(\" \")[0];\n const reactInstance = BDV2.getInternalInstance(document.querySelector(`.${listItemClass} .${blobClass}`).parentElement);\n const GuildComponent = reactInstance.return.type;\n if (!GuildComponent) return;\n this.guildListItemsPatch = Utils.monkeyPatch(GuildComponent.prototype, \"render\", {after: (data) => {\n if (data.returnValue && data.thisObject) {\n const returnValue = data.returnValue;\n const guildData = data.thisObject.props;\n let className = returnValue.props.className\n className += \" bd-guild\";\n if (guildData.unread) className += \" bd-unread\";\n if (guildData.selected) className += \" bd-selected\";\n if (guildData.audio) className += \" bd-audio\";\n if (guildData.video) className += \" bd-video\";\n if (guildData.badge) className += \" bd-badge\";\n if (guildData.animatable) className += \" bd-animatable\";\n returnValue.props.className = className\n return returnValue;\n }\n }});\n};\n\nCore.prototype.patchGuildPills = function() {\n if (this.guildPillPatch) return;\n const guildPill = WebpackModules.find(m => m.default && !m.default.displayName && m.default.toString && m.default.toString().includes(\"translate3d\"));\n if (!guildPill) return;\n this.guildPillPatch = Utils.monkeyPatch(guildPill, \"default\", {after: (data) => {\n const props = data.methodArguments[0];\n if (props.unread) data.returnValue.props.className += \" bd-unread\";\n if (props.selected) data.returnValue.props.className += \" bd-selected\";\n if (props.hovered) data.returnValue.props.className += \" bd-hovered\";\n return data.returnValue;\n }});\n};\n\nCore.prototype.patchGuildSeparator = function() {\n if (this.guildSeparatorPatch) return;\n const Guilds = WebpackModules.findByDisplayName(\"Guilds\");\n const guildComponents = WebpackModules.findByProps(\"renderListItem\");\n if (!guildComponents || !Guilds) return;\n const GuildSeparator = function() {\n const returnValue = guildComponents.Separator(...arguments);\n returnValue.props.className += \" bd-guild-separator\";\n return returnValue;\n };\n this.guildSeparatorPatch = Utils.monkeyPatch(Guilds.prototype, \"render\", {after: (data) => {\n data.returnValue.props.children[1].props.children[3].type = GuildSeparator;\n }});\n};\n\nCore.prototype.patchAttachment = function() {\n if (this.AttachmentPatch) return;\n const Attachment = BDModules.get(e => e.default && e.default.displayName === \"Attachment\")[0] // temporary\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!Anchor || !Attachment || !Attachment.default) return;\n this.AttachmentPatch = Utils.monkeyPatch(Attachment, \"default\", {after: (data) => {\n if(!settingsCookie[\"fork-ps-6\"])return\n const attachment = data.methodArguments[0] || null\n const children = Utils.getNestedProp(data.returnValue, \"props.children\");\n\n if (!children || !attachment || !attachment.url)return\n if (!Array.isArray(children)) return;\n\n const id = uuidv4()\n children.push(BDV2.react.createElement(\"span\", {\n id: \"certified-\"+id\n }))\n PluginCertifier.patch(attachment, \"certified-\"+id)\n }})\n}\n\nCore.prototype.patchMessageHeader = function() {\n if (this.messageHeaderPatch) return;\n const MessageHeader = WebpackModules.findByProps(\"MessageTimestamp\");\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!Anchor || !MessageHeader || !MessageHeader.default) return;\n this.messageHeaderPatch = Utils.monkeyPatch(MessageHeader, \"default\", {after: (data) => {\n const author = Utils.getNestedProp(data.methodArguments[0], \"message.author\");\n // const header = Utils.getNestedProp(data.returnValue, \"props.children.1.props\");\n const children = Utils.getNestedProp(data.returnValue, \"props.children.1.props.children.1.props.children\");\n if (!children || !author || !author.id)return\n // if (header && header.className) header.className += \" \"\n if (!Array.isArray(children)) return;\n if (author.id === \"249746236008169473\") { // Rauenzi: BandagedBD Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n } else if (author.id === \"696481194443014174\" || author.id === \"696003456611385396\"){ // Not Thomiz: Lightcord Developer, Phorcys: Lightcord Developer\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n }\n const id = uuidv4()\n children.push(\n BDV2.React.createElement(\"div\", {\n id: \"badges-\"+id,\n style: {\n display: \"inline\"\n }\n })\n )\n applyBadges(id, author, true)\n }});\n};\n\nfunction applyBadges(id, user, chat){\n process.nextTick(() => {\n const div = document.getElementById(\"badges-\"+id)\n if(!div || div.childNodes.length > 0)return\n if(div.childNodes.length)return\n let blockDiv = document.createElement(\"div\")\n blockDiv.style.display = \"none\"\n div.appendChild(blockDiv)\n\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n\n distant.getBadges(user.id)\n .then(badges => {\n badges.forEach(badge => {\n const props = {\n svg: {\n size: \"16px\", \n className: \"bd-logo\",\n width: \"16px\", \n }\n }\n badge.scopes.forEach(scope => {\n if(scope === \"user\"){// require user\n props.user = user\n }\n }) \n if(!badge.href){\n props.Anchor = Anchor\n props.href = {\n className: chat ? \"bd-chat-badge\" : \"bd-member-badge\", \n title: badge.name, \n target: \"_blank\"\n }\n }\n const element = BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: badge.name},\n badge.href ? BDV2.react.createElement(Anchor, {\n href: badge.href,\n className: chat ? \"bd-chat-badge\" : \"bd-member-badge\", \n title: badge.name, \n target: \"_blank\"\n }, BDV2.React.createElement(badge.component, props)) : BDV2.React.createElement(badge.component, props)\n )\n const div2 = document.createElement(\"div\")\n BDV2.reactDom.render(element, div2)\n div2.childNodes.forEach(node => {\n div.appendChild(node)\n })\n })\n })\n })\n}\n\nCore.prototype.patchMemberList = function() {\n if (this.memberListPatch) return;\n const MemberListItem = WebpackModules.findByDisplayName(\"MemberListItem\");\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\n if (!Anchor || !MemberListItem || !MemberListItem.prototype || !MemberListItem.prototype.renderDecorators) return;\n this.memberListPatch = Utils.monkeyPatch(MemberListItem.prototype, \"renderDecorators\", {after: (data) => {\n const user = Utils.getNestedProp(data.thisObject, \"props.user\");\n const children = Utils.getNestedProp(data.returnValue, \"props.children\");\n if (!children || !user || !user.id)return\n // if (header && header.className) header.className += \" \"\n if (!Array.isArray(children)) return;\n if (user.id === \"249746236008169473\") {\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-member-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n } else if (user.id === \"696481194443014174\" || user.id === \"696003456611385396\"){\n children.push(\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\n BDV2.React.createElement(Anchor, {className: \"bd-member-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\n )\n )\n );\n }\n const id = uuidv4()\n children.push(\n BDV2.React.createElement(\"div\", {id: \"badges-\"+id})\n )\n applyBadges(id, user, false)\n }});\n};\n\nCore.prototype.updateInjector = async function() {\n // There will never be an injection path, so we do not need the code below. \n // Insert comments so it will be erased when production.\n \n const injectionPath = DataStore.injectionPath;\n if (!injectionPath) return false;\n\n /*\n\n const fs = require(\"fs\");\n const path = require(\"path\");\n const rmrf = require(\"rimraf\");\n const yauzl = require(\"yauzl\");\n const mkdirp = require(\"mkdirp\");\n const request = require(\"request\");\n\n const parentPath = path.resolve(injectionPath, \"..\");\n const folderName = path.basename(injectionPath);\n const zipLink = \"https://github.com/rauenzi/BetterDiscordApp/archive/injector.zip\";\n const savedZip = path.resolve(parentPath, \"injector.zip\");\n const extractedFolder = path.resolve(parentPath, \"BetterDiscordApp-injector\");\n\n // Download the injector zip file\n Utils.log(\"InjectorUpdate\", \"Downloading \" + zipLink);\n let success = await new Promise(resolve => {\n request.get({url: zipLink, encoding: null}, async (error, response, body) => {\n if (error || response.statusCode !== 200) return resolve(false);\n // Save a backup in case someone has their own copy\n const alreadyExists = await new Promise(res => fs.exists(savedZip, res));\n if (alreadyExists) await new Promise(res => fs.rename(savedZip, `${savedZip}.bak${Math.round(performance.now())}`, res));\n\n Utils.log(\"InjectorUpdate\", \"Writing \" + savedZip);\n fs.writeFile(savedZip, body, err => resolve(!err));\n });\n });\n if (!success) return success;\n\n // Check and delete rename extraction\n const alreadyExists = await new Promise(res => fs.exists(extractedFolder, res));\n if (alreadyExists) await new Promise(res => fs.rename(extractedFolder, `${extractedFolder}.bak${Math.round(performance.now())}`, res));\n \n // Unzip the downloaded zip file\n const zipfile = await new Promise(r => yauzl.open(savedZip, {lazyEntries: true}, (err, zip) => r(zip)));\n zipfile.on(\"entry\", function(entry) {\n // Skip directories, they are handled with mkdirp\n if (entry.fileName.endsWith(\"/\")) return zipfile.readEntry();\n\n Utils.log(\"InjectorUpdate\", \"Extracting \" + entry.fileName);\n // Make any needed parent directories\n const fullPath = path.resolve(parentPath, entry.fileName);\n mkdirp.sync(path.dirname(fullPath));\n zipfile.openReadStream(entry, function(err, readStream) {\n if (err) return success = false;\n readStream.on(\"end\", function() {zipfile.readEntry();}); // Go to next file after this\n readStream.pipe(fs.createWriteStream(fullPath));\n });\n });\n zipfile.readEntry(); // Start reading\n\n // Wait for the final file to finish\n await new Promise(resolve => zipfile.once(\"end\", resolve));\n\n // Save a backup in case something goes wrong during final step\n const backupFolder = path.resolve(parentPath, `${folderName}.bak${Math.round(performance.now())}`);\n await new Promise(resolve => fs.rename(injectionPath, backupFolder, resolve));\n\n // Rename the extracted folder to what it should be\n Utils.log(\"InjectorUpdate\", `Renaming ${path.basename(extractedFolder)} to ${folderName}`);\n success = await new Promise(resolve => fs.rename(extractedFolder, injectionPath, err => resolve(!err)));\n if (!success) {\n Utils.err(\"InjectorUpdate\", \"Failed to rename the final directory\");\n return success;\n }\n\n // If rename had issues, delete what we tried to rename and restore backup\n if (!success) {\n Utils.err(\"InjectorUpdate\", \"Something went wrong... restoring backups.\");\n await new Promise(resolve => rmrf(extractedFolder, resolve));\n await new Promise(resolve => fs.rename(backupFolder, injectionPath, resolve));\n return success;\n }\n\n // If we've gotten to this point, everything should have gone smoothly.\n // Cleanup the backup folder then remove the zip\n await new Promise(resolve => rmrf(backupFolder, resolve));\n await new Promise(resolve => fs.unlink(savedZip, resolve));\n\n Utils.log(\"InjectorUpdate\", \"Injector Updated!\");\n return success;*/\n};\n\nexport default new Core();\n\n/**\n * Don't expose core - could be dangerous for now\n */","import {pluginCookie, themeCookie, bdplugins, bdthemes, settingsCookie, settings} from \"../0globals\";\nimport mainCore from \"./core\";\nimport Utils from \"./utils\";\nimport BDV2 from \"./v2\";\nimport DataStore from \"./dataStore\";\nimport pluginModule from \"./pluginModule\";\nimport themeModule from \"./themeModule\";\nimport settingsPanel from \"./settingsPanel\";\nimport DOM from \"./domtools\";\n\nconst BdApi = {\n get React() { return BDV2.React; },\n get ReactDOM() { return BDV2.ReactDom; },\n get ReactComponent() {return BDV2.ReactComponent;},\n get WindowConfigFile() {return Utils.WindowConfigFile;},\n get settings() {return settings;},\n get emotes() {return null}, // deprecated, deleted all emotes from betterdiscord.\n get screenWidth() { return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); },\n get screenHeight() { return Math.max(document.documentElement.clientHeight, window.innerHeight || 0); }\n};\n\nBdApi.getAllWindowPreferences = function() {\n return Utils.getAllWindowPreferences();\n};\n\nBdApi.getWindowPreference = function(key) {\n return Utils.getWindowPreference(key);\n};\n\nBdApi.setWindowPreference = function(key, value) {\n return Utils.setWindowPreference(key, value);\n};\n\n//Inject CSS to document head\n//id = id of element\n//css = custom css\nBdApi.injectCSS = function (id, css) {\n DOM.addStyle(DOM.escapeID(id), css);\n};\n\n//Clear css/remove any element\n//id = id of element\nBdApi.clearCSS = function (id) {\n DOM.removeStyle(DOM.escapeID(id));\n};\n\n//Inject CSS to document head\n//id = id of element\n//css = custom css\nBdApi.linkJS = function (id, url) {\n DOM.addScript(DOM.escapeID(id), url);\n};\n\n//Clear css/remove any element\n//id = id of element\nBdApi.unlinkJS = function (id) {\n DOM.removeScript(DOM.escapeID(id));\n};\n\n//Get another plugin\n//name = name of plugin\nBdApi.getPlugin = function (name) {\n if (bdplugins.hasOwnProperty(name)) {\n return bdplugins[name].plugin;\n }\n return null;\n};\n\n//Get BetterDiscord Core\nBdApi.getCore = function () {\n Utils.warn(\"Deprecation Notice\", `BdApi.getCore() will be removed in future versions.`);\n return mainCore;\n};\n\n/**\n * Shows a generic but very customizable modal.\n * @param {string} title - title of the modal\n * @param {string} content - a string of text to display in the modal\n */\nBdApi.alert = function (title, content) {\n return Utils.showConfirmationModal(title, content, {cancelText: null});\n};\n\n/**\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\n * @param {string} title - title of the modal\n * @param {(string|ReactElement|Array<string|ReactElement>)} children - a single or mixed array of react elements and strings. Every string is wrapped in Discord's `Markdown` component so strings will show and render properly.\n * @param {object} [options] - options to modify the modal\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\n * @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned\n * @returns {string} - the key used for this modal\n */\nBdApi.showConfirmationModal = function (title, content, options = {}) {\n return Utils.showConfirmationModal(title, content, options);\n};\n\n//Show toast alert\nBdApi.showToast = function(content, options = {}) {\n Utils.showToast(content, options);\n};\n\n// Finds module\nBdApi.findModule = function(filter) {\n return BDV2.WebpackModules.find(filter);\n};\n\n// Finds module\nBdApi.findAllModules = function(filter) {\n return BDV2.WebpackModules.findAll(filter);\n};\n\n// Finds module\nBdApi.findModuleByProps = function(...props) {\n return BDV2.WebpackModules.findByUniqueProperties(props);\n};\n\nBdApi.findModuleByPrototypes = function(...protos) {\n return BDV2.WebpackModules.findByPrototypes(protos);\n};\n\nBdApi.findModuleByDisplayName = function(name) {\n return BDV2.WebpackModules.findByDisplayName(name);\n};\n\n// Gets react instance\nBdApi.getInternalInstance = function(node) {\n if (!(node instanceof window.jQuery) && !(node instanceof Element)) return undefined;\n if (node instanceof jQuery) node = node[0];\n return BDV2.getInternalInstance(node);\n};\n\n// Gets data\nBdApi.loadData = function(pluginName, key) {\n return DataStore.getPluginData(pluginName, key);\n};\n\nBdApi.getData = BdApi.loadData;\n\n// Sets data\nBdApi.saveData = function(pluginName, key, data) {\n return DataStore.setPluginData(pluginName, key, data);\n};\n\nBdApi.setData = BdApi.saveData;\n\n// Deletes data\nBdApi.deleteData = function(pluginName, key) {\n return DataStore.deletePluginData(pluginName, key);\n};\n\n// Patches other functions\nBdApi.monkeyPatch = function(what, methodName, options) {\n return Utils.monkeyPatch(what, methodName, options);\n};\n\n// Event when element is removed\nBdApi.onRemoved = function(node, callback) {\n return Utils.onRemoved(node, callback);\n};\n\n// Wraps function in try..catch\nBdApi.suppressErrors = function(method, message) {\n return Utils.suppressErrors(method, message);\n};\n\n// Tests for valid JSON\nBdApi.testJSON = function(data) {\n return Utils.testJSON(data);\n};\n\nBdApi.isPluginEnabled = function(name) {\n return !!pluginCookie[name];\n};\n\nBdApi.isThemeEnabled = function(name) {\n return !!themeCookie[name];\n};\n\nBdApi.isSettingEnabled = function(id) {\n return !!settingsCookie[id];\n};\n\nBdApi.enableSetting = function(id) {\n return settingsPanel.onChange(id, true);\n};\n\nBdApi.disableSetting = function(id) {\n return settingsPanel.onChange(id, false);\n};\n\nBdApi.toggleSetting = function(id) {\n return settingsPanel.onChange(id, !settingsCookie[id]);\n};\n\n// Gets data\nBdApi.getBDData = function(key) {\n return DataStore.getBDData(key);\n};\n\n// Sets data\nBdApi.setBDData = function(key, data) {\n return DataStore.setBDData(key, data);\n};\n\n\n\nconst makeAddonAPI = (cookie, list, manager) => new class AddonAPI {\n\n get folder() {return manager.folder;}\n\n isEnabled(name) {\n return !!cookie[name];\n }\n\n enable(name) {\n return manager.enable(name);\n }\n\n disable(name) {\n return manager.disable(name);\n }\n\n toggle(name) {\n if (cookie[name]) this.disable(name);\n else this.enable(name);\n }\n\n reload(name) {\n return manager.reload(name);\n }\n\n get(name) {\n if (list.hasOwnProperty(name)) {\n if (list[name].plugin) return list[name].plugin;\n return list[name];\n }\n return null;\n }\n\n getAll() {\n return Object.keys(list).map(k => this.get(k)).filter(a => a);\n }\n};\n\nBdApi.Plugins = makeAddonAPI(pluginCookie, bdplugins, pluginModule);\nBdApi.Themes = makeAddonAPI(themeCookie, bdthemes, themeModule);\n\nexport default BdApi;\n\nwindow.Lightcord.BetterDiscord.BdApi = BdApi","export default function() {\r\n const contentWindowGetter = Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype, \"contentWindow\").get;\r\n Object.defineProperty(HTMLIFrameElement.prototype, \"contentWindow\", {\r\n get: function () {\r\n const contentWindow = Reflect.apply(contentWindowGetter, this, arguments);\r\n return new Proxy(contentWindow, {\r\n getOwnPropertyDescriptor: function(obj, prop) {\r\n if (prop === \"localStorage\") return undefined;\r\n return Object.getOwnPropertyDescriptor(obj, prop);\r\n },\r\n get: function(obj, prop) {\r\n if (prop === \"localStorage\") return null;\r\n const val = obj[prop];\r\n if (typeof val === \"function\") return val.bind(obj);\r\n return val;\r\n }\r\n });\r\n }\r\n });\r\n\r\n // Prevent interception by patching Reflect.apply and Function.prototype.bind\r\n Object.defineProperty(Reflect, \"apply\", {value: Reflect.apply, writable: false, configurable: false});\r\n Object.defineProperty(Function.prototype, \"bind\", {value: Function.prototype.bind, writable: false, configurable: false});\r\n\r\n const oOpen = XMLHttpRequest.prototype.open;\r\n XMLHttpRequest.prototype.open = function() {\r\n const url = arguments[1];\r\n if (url.toLowerCase().includes(\"api/webhooks\")) return null;\r\n return Reflect.apply(oOpen, this, arguments);\r\n };\r\n}","import localStorageFix from \"./localStorageFix\";\nimport loadingIcon from \"./loadingIcon\";\nlocalStorageFix();\nloadingIcon();\n\nconst deprecateGlobal = (key, value) => {\n Object.defineProperty(window, key, {\n get() {\n Utils.warn(\"Deprecated Global\", `\"${key}\" will be removed in future versions. Please only use BdApi.`);\n return value;\n }\n }); \n};\n\n\nimport * as Globals from \"./0globals\";\n\nconst globalKeys = Object.keys(Globals);\nfor (const key of globalKeys) deprecateGlobal(key, Globals[key]);\n\n\nimport BdApi from \"./modules/bdApi\";\nimport BDV2 from \"./modules/v2\";\nimport pluginModule from \"./modules/pluginModule\";\nimport themeModule from \"./modules/themeModule\";\nimport Utils from \"./modules/utils\";\nimport BDEvents from \"./modules/bdEvents\";\nimport settingsPanel from \"./modules/settingsPanel\";\nimport DataStore from \"./modules/dataStore\";\nimport ContentManager from \"./modules/contentManager\";\nimport ClassNormalizer from \"./modules/classNormalizer\";\n\ndeprecateGlobal(\"BDV2\", BDV2);\ndeprecateGlobal(\"pluginModule\", pluginModule);\ndeprecateGlobal(\"themeModule\", themeModule);\ndeprecateGlobal(\"Utils\", Utils);\ndeprecateGlobal(\"BDEvents\", BDEvents);\ndeprecateGlobal(\"settingsPanel\", settingsPanel);\ndeprecateGlobal(\"DataStore\", DataStore);\ndeprecateGlobal(\"ContentManager\", ContentManager);\ndeprecateGlobal(\"ClassNormalizer\", ClassNormalizer);\n\nwindow.BdApi = BdApi;\n\nimport Core from \"./modules/core\";\ndeprecateGlobal(\"mainCore\", Core);\n\n// TODO: Change Init mode and stop using CoreWrapper.\nexport default class CoreWrapper {\n constructor(bdConfig, methods) {\n Core.setConfig(bdConfig);\n Core.setMethods(methods);\n }\n\n init() {\n // deprecateGlobal(\"mainCore\", this.mainCore);\n Core.init();\n }\n}","export default () => {\r\n const v2Loader = document.createElement(\"div\");\r\n v2Loader.className = \"bd-loaderv2\";\r\n v2Loader.title = \"BandagedBD is loading...\";\r\n document.body.appendChild(v2Loader);\r\n};"],"sourceRoot":""}