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

1 line
597 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/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","defaultCookie","settingsCookie","settingsRPC","defaultRPC","Date","now","lightcordSettings","defaultLightcordSettings","bdpluginErrors","bdthemeErrors","bdConfig","BetterDiscordConfig","bdthemes","bdplugins","pluginCookie","themeCookie","req","webpackJsonp","push","__extra_id__","find","filter","default","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","openItem","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","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","DEFAULT","Themes","note","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","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","openExternal","_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","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","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,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EA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,KAAK,oBAAsB,IAAGzf,iEAC7BN,MAQb2vD,GAAalwD,OAAO2J,KAAKwmD,GAC/B,IAAK,MAAMtvD,KAAOqvD,GAAYD,GAAgBpvD,EAAKsvD,EAAQtvD,IAc3DovD,GAAgB,OAAQj9C,IACxBi9C,GAAgB,eAAgBtyC,GAChCsyC,GAAgB,cAAeryC,IAC/BqyC,GAAgB,QAASxoD,IACzBwoD,GAAgB,WAAYpnD,GAC5BonD,GAAgB,gBAAiB1kB,IACjC0kB,GAAgB,YAAazpD,GAC7BypD,GAAgB,iBAAkB9nD,IAClC8nD,GAAgB,kBAAmBpuB,IAEnCpgC,OAAOiuC,MAAQA,GAGfugB,GAAgB,WAAYhI,IAGb,MAAMmI,GACjBnqD,YAAYxC,EAAU2+C,GAClB6F,GAAKC,UAAUzkD,GACfwkD,GAAKI,WAAWjG,GAGpB7C,OAEI0I,GAAK1I","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\", experimental: false},\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__\"]]]);\ndelete req.m.__extra_id__;\ndelete req.c.__extra_id__;\nconst 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 m.default;\n if (m && filter(m))\treturn m;\n }\n }\n // console.warn(\"Cannot find loaded module in cache\");\n return null;\n};\n\nconst 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(m.default);\n else if (m && filter(m)) modules.push(m);\n }\n }\n return modules;\n};\n\nconst findByProps = (...propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\nconst findByPrototypes = (...protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\nconst findByDisplayName = (displayName) => find(module => module.displayName === displayName);\n\nlet mod = {find, findAll, findByProps, findByPrototypes, findByDisplayName};\nexport default mod\n\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 console.log(\"Edit \" + 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 console.log(\"Edit \" + fullPath);\n require(\"electron\").shell.openItem(`${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],\n [/email/gi, 0],\n [/mfa/gi, 0],\n [/2fa/gi, 0],\n [/phone/gi, 0],\n [/child_process/gi, 0],\n [/localStorage/gi, 0],\n [/getGlobal/gi, 0],\n [/BrowserWindow/gi, 0],\n [/\\.exe/gi, 0],\n [/eval/gi, 0],\n [/WebAssembly/gi, 0],\n [/XMLHttpRequest(\\.|\\[[\"'`])prototype/gi, 0],\n [/window\\.fetch( +)?=/gi, 0],\n /** Obfuscation / hidden / workarounds */\n [/([\"'`]\\+)[\"'`]\\w[\"'`]/gi, 1],\n [/[\"'`]\\w[\"'`](\\+[\"'`])/gi, 1],\n [/\\${[\"'`]\\w+[\"'`]}/gi, 1],\n /** hexadecimal */\n [/_0x\\w{4}\\('0x[\\dabcdef]+'\\)/g, 1],\n [/_0x\\w{4}\\('0x[\\dabcdef]+'( +)?,( +)?'[^']{4}'\\)/g, 1], // _0x8db7('0x0', 'x1]f')\n /** mangled */\n [/\\w+\\('0x[\\dabcdef]+'\\)/g, 1], // b('0x0')\n [/\\w+\\('0x[\\dabcdef]+'( +)?,( +)?'[^']{4}'\\)/g, 1], // b('0x0', 'x1]f')\n /** string array at start */\n [/^var [\\w\\d_$]+=\\[\"/gi, 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] of tests){\n const scrpt = type === 1 ? no_comments : data\n if(test.exec(scrpt)){\n isHarmful = 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.openItem(`${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\";\nimport BDV2 from \"./v2\";\nimport Utils from \"./utils\";\n\nexport default new class ColoredText {\n injectColoredText() {\n if (this.cancelColoredText) return;\n if (!BDV2.MessageComponent) return;\n\n this.cancelColoredText = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\n const props = data.methodArguments[0];\n if (!props || !props.childrenMessageContent) return;\n const messageContent = props.childrenMessageContent;\n\n if (!messageContent.type || !messageContent.type.type || messageContent.type.type.displayName != \"MessageContent\") return;\n const originalType = messageContent.type.type;\n if (originalType.__originalMethod) return; // Don't patch again\n messageContent.type.type = function(props) {\n const returnValue = originalType(props);\n const roleColor = settingsCookie[\"bda-gs-7\"] ? props.message.colorString || \"\" : \"\";\n returnValue.props.style = {color: roleColor};\n return returnValue;\n };\n\n messageContent.type.type.__originalMethod = originalType;\n Object.assign(messageContent.type.type, originalType);\n }});\n }\n\n removeColoredText() {\n let classNameMarkup = BDModules.get(e => e.markup)[0].markup\n document.querySelectorAll(\".\"+classNameMarkup.split(\" \")[0]).forEach(elem => {\n elem.style.setProperty(\"color\", \"\");\n });\n }\n};","import {settingsCookie} from \"../0globals\";\nimport BDV2 from \"./v2\";\nimport Utils from \"./utils\";\n\nexport default new class TFHour {\n inject24Hour() {\n if (this.cancel24Hour) return;\n\n const twelveHour = new RegExp(`([0-9]{1,2}):([0-9]{1,2})\\\\s(AM|PM)`);\n const convert = (data) => {\n if (!settingsCookie[\"bda-gs-6\"]) return;\n const matched = data.returnValue.match(twelveHour);\n if (!matched || matched.length !== 4) return;\n if (matched[3] === \"AM\") return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"00\" : matched[1].padStart(2, \"0\")}:${matched[2]}`);\n return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"12\" : parseInt(matched[1]) + 12}:${matched[2]}`);\n };\n\n const cancelCozy = Utils.monkeyPatch(BDV2.TimeFormatter, \"calendarFormat\", {after: convert}); // Called in Cozy mode\n const cancelCompact = Utils.monkeyPatch(BDV2.TimeFormatter, \"dateFormat\", {after: convert}); // Called in Compact mode\n this.cancel24Hour = () => {cancelCozy(); cancelCompact();}; // Cancel both\n }\n\n remove24Hour() {\n if (this.cancel24Hour) this.cancel24Hour();\n }\n};","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_SettingsTitle extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\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\n render() {\n return BDV2.react.createElement(\n \"h2\",\n {className: \"ui-form-title h2 margin-reset margin-bottom-20\"},\n this.props.text\n );\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_TabBarSeparator extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return BDV2.react.createElement(\"div\", {className: \"ui-tab-bar-separator margin-top-8 margin-bottom-8\"});\n }\n}","import BDV2 from \"../../modules/v2\";\n\nexport default class V2C_ServerCard extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n if (!this.props.server.iconUrl) this.props.server.iconUrl = this.props.fallback;\n this.state = {\n imageError: false,\n joined: this.props.guildList.includes(this.props.server.identifier)\n };\n }\n\n render() {\n const {server} = this.props;\n let cardModule = BDModules.get(e => e.card && e.cardPrimary)[0]\n let flexModule = BDModules.get(e => e.flexChild && e._horizontalReverse)[0]\n let wrapModule = BDModules.get(e => e.noWrap && !e.streamerModeEnabled)[0]\n return BDV2.react.createElement(\n \"div\", // cardPrimary-1Hv-to\n {className: `${cardModule.card} ${cardModule.cardPrimary} ${BDModules.get(e => e.marginBottom8)[0].marginBottom8} bd-server-card${server.pinned ? \" bd-server-card-pinned\" : \"\"}`},\n // BDV2.react.createElement(\n // \"div\",\n // { className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2yIZo0 alignStretch-1hwxMa noWrap-3jynv6\" },\n BDV2.react.createElement(\"img\", {ref: \"img\", className: \"bd-server-image\", src: server.iconUrl, onError: this.handleError.bind(this), draggable: false}),\n BDV2.react.createElement(\n \"div\",\n {className: flexModule.flexChild+\" bd-server-content\"},\n BDV2.react.createElement(\n \"div\",\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap+\" bd-server-header\"},\n BDV2.react.createElement(\n \"h5\",\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-name\"},\n server.name\n ),\n BDV2.react.createElement(\n \"h5\",\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-member-count\"},\n server.members,\n \" Members\"\n )\n ),\n BDV2.react.createElement(\n \"div\",\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap},\n BDV2.react.createElement(\n \"div\",\n {className: \"scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y bd-server-description-container\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"scroller-2FKFPG scroller bd-server-description\"},\n server.description\n )\n )\n ),\n BDV2.react.createElement(\n \"div\",\n {className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-footer\"},\n BDV2.react.createElement(\n \"div\",\n {className: \"flexChild-faoVW3 bd-server-tags\", style: {flex: \"1 1 auto\"}},\n server.categories.join(\", \")\n ),\n this.state.joined && BDV2.react.createElement(\n \"button\",\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN colorGreen-29iAKY\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#3ac15c\"}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Joined\"\n )\n ),\n server.error && BDV2.react.createElement(\n \"button\",\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN disabled-9aF2ug\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#c13a3a\"}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Error\"\n )\n ),\n !server.error && !this.state.joined && BDV2.react.createElement(\n \"button\",\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN\", style: {minHeight: \"12px\", marginTop: \"4px\"}, onClick: () => {this.join();}},\n BDV2.react.createElement(\n \"div\",\n {className: \"ui-button-contents\"},\n \"Join\"\n )\n )\n )\n )\n // )\n );\n }\n\n handleError() {\n this.props.server.iconUrl = this.props.fallback;\n this.setState({imageError: true});\n }\n\n join() {\n this.props.join(this);\n //this.setState({joined: true});\n }\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 {\n render(){\n const props = this.props\n\n return (\n <svg viewBox=\"0 0 31.3 29.5\" {...props.svg} height=\"100%\">\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)\" />\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\" />\n </svg>\n )\n } \n}","export default class Circus extends React.Component {\n render(){\n return (<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\" {...this.props.svg} height=\"100%\">\n <path\n fill=\"#DD2E44\"\n d=\"M33 33a2 2 0 01-2 2H5a2 2 0 01-2-2l1-12h28l1 12z\"\n ></path>\n <path\n fill=\"#EA596E\"\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\"\n ></path>\n <path\n fill=\"#BE1931\"\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\"\n ></path>\n <circle cx=\"14\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <circle cx=\"22\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <circle cx=\"10\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <circle cx=\"26\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\n <path d=\"M23 35H13s2-6 2-13h6c0 7 2 13 2 13zM17 2h2v7h-2z\"></path>\n <path\n fill=\"#55ACEE\"\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\"\n ></path>\n <path\n fill=\"#CCD6DD\"\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\"\n ></path>\n <g fill=\"#F5F8FA\">\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>\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>\n </g>\n </svg>\n )\n } \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.deroku.xyz\",\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\";\n\nconst style = `\n .container-2Rl01u {\n display: none!important;\n }\n\n .chat-3bRxxu {\n display: none!important;\n }\n\n .sidebar-2K8pFh {\n flex-grow: 1!important;\n }\n`;\n\nexport default new class VoiceMode {\n start() {\n DOM.addStyle(\"VoiceMode\", style);\n }\n\n stop() {\n DOM.removeStyle(\"VoiceMode\");\n }\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(!classnames.find(e => e.startsWith(\"beta-\"))){\n classnames.push(BDModules.get(e => e.beta && (!e.container && !e.userSettingsVoice))[0].beta)\n }\n if(this.props.data.experimental){\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]\n\nexport default class MarginTop extends React.Component {\n render(){\n if(!marginModule)marginModule = BDModules.get(e => e.marginTop60)[0]\n return <div className={marginModule.marginTop60}></div>\n }\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 }});\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 size={switchItem.default.Sizes.DEFAULT} theme={switchItem.default.Themes.DEFAULT} note={setting.info}>\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\";\n\nimport SettingsGroup from \"./settingsGroup\";\nimport MarginTop from \"./margintop\";\n\nexport default class V2C_SectionedSettingsPanel extends BDV2.reactComponent {\n\n constructor(props) {\n super(props);\n }\n\n render() {\n return this.props.sections.map((section, i) => {\n return [\n i !== 0 ? BDV2.react.createElement(MarginTop, {}) : null,\n BDV2.react.createElement(SettingsGroup, Object.assign({}, section, {onChange: this.props.onChange}))\n ]\n })\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_Checkbox extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n this.onClick = this.onClick.bind(this);\n this.setInitialState();\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.checked || false\n };\n }\n\n render() {\n return BDV2.react.createElement(\n \"li\",\n null,\n BDV2.react.createElement(\n \"div\",\n {className: \"checkbox \"+BDModules.get(e => e.checkboxElement)[0].checkbox, onClick: this.onClick},\n BDV2.react.createElement(\n \"div\",\n {className: \"checkbox-inner \"+BDModules.get(e => e.checkboxInner)[0].checkboxInner},\n BDV2.react.createElement(\"input\", {className: BDModules.get(e => e.checkboxElement)[0].checkboxElement, checked: this.state.checked, onChange: () => {}, type: \"checkbox\"}),\n BDV2.react.createElement(\"span\", null)\n ),\n BDV2.react.createElement(\n \"span\",\n null,\n this.props.text\n )\n )\n );\n }\n\n onClick() {\n this.props.onChange(this.props.id, !this.state.checked);\n this.setState({\n checked: !this.state.checked\n });\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 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\";\n\nexport default class BDErrorBoundary extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n this.state = {hasError: false};\n }\n\n componentDidCatch() {\n this.setState({hasError: true});\n }\n\n render() {\n if (this.state.hasError) return BDV2.react.createElement(\"div\", {className: \"react-error\"}, \"Component Error\"); \n return this.props.children; \n }\n}\n\nconst originalRender = BDErrorBoundary.prototype.render;\nObject.defineProperty(BDErrorBoundary.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\nexport default class V2C_ContentColumn extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n static get displayName() {return \"ContentColumn\";}\n\n render() {\n //let contentModule = BDModules.get(e => e.contentColumn)[0]\n let title = this.props.title ? BDV2.react.createElement(\"h2\", {className: \"ui-form-title h2 margin-reset margin-bottom-20\"}, this.props.title) : null\n return [\n title,\n this.props.children\n ]\n return BDV2.react.createElement(\n \"div\",\n {className: contentModule.contentColumn + \" \"+contentModule.contentColumnDefault+\" content-column default\", style: {padding: \"60px 40px 0px\"}},\n title,\n this.props.children\n );\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_ReloadIcon extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return BDV2.react.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"#dcddde\",\n className: \"bd-reload \" + this.props.className,\n onClick: this.props.onClick,\n style: {width: this.props.size || \"24px\", height: this.props.size || \"24px\"}\n },\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\"}),\n BDV2.react.createElement(\"path\", {fill: \"none\", d: \"M0 0h24v24H0z\"})\n );\n }\n}","import BDV2 from \"../modules/v2\";\n\nexport default class V2C_XSvg extends BDV2.reactComponent {\n constructor(props) {\n super(props);\n }\n\n render() {\n return BDV2.react.createElement(\n \"svg\",\n {xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 12 12\", style: {width: \"18px\", height: \"18px\"}},\n BDV2.react.createElement(\n \"g\",\n {className: \"background\", fill: \"none\", fillRule: \"evenodd\"},\n BDV2.react.createElement(\"path\", {d: \"M0 0h12v12H0\"}),\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\"})\n )\n );\n }\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\";\nimport Arrow from \"../icons/downarrow\";\n\nconst React = BDV2.React;\n\n\nexport default class Select extends React.Component {\n constructor(props) {\n super(props);\n this.state = {open: false, value: this.props.value || this.props.options[0].value};\n this.dropdown = React.createRef();\n this.onChange = this.onChange.bind(this);\n this.showMenu = this.showMenu.bind(this);\n this.hideMenu = this.hideMenu.bind(this);\n }\n\n showMenu(event) {\n event.preventDefault();\n this.setState({open: true}, () => {\n document.addEventListener(\"click\", this.hideMenu);\n });\n }\n\n hideMenu() {\n this.setState({open: false}, () => {\n document.removeEventListener(\"click\", this.hideMenu);\n });\n }\n\n onChange(value) {\n this.setState({value});\n if (this.props.onChange) this.props.onChange(value);\n }\n\n get selected() {return this.props.options.find(o => o.value == this.state.value);}\n\n get options() {\n const selected = this.selected;\n return <div className=\"bd-select-options\">\n {this.props.options.map(opt => \n <div className={`bd-select-option${selected.value == opt.value ? \" selected\" : \"\"}`} onClick={this.onChange.bind(this, opt.value)}>{opt.label}</div>\n )}\n </div>;\n }\n\n render() {\n const style = this.props.style == \"transparent\" ? \" bd-select-transparent\" : \"\";\n const isOpen = this.state.open ? \" menu-open\" : \"\";\n return <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\n <div className=\"bd-select-value\">{this.selected.label}</div>\n <Arrow className=\"bd-select-arrow\" />\n {this.state.open && this.options}\n </div>;\n }\n}\n\n// return <div className=\"bd-select-wrap\">\n// <label className=\"bd-label\">{this.props.label}</label>\n// <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\n// <div className=\"bd-select-controls\">\n// <div className=\"bd-select-value\">{this.selected.label}</div>\n// <Arrow className=\"bd-select-arrow\" />\n// </div>\n// </div>\n// {this.state.open && this.options}\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\";\n\nconst dispatcher = BDModules.get(m=>m.Dispatcher&&m.default&&m.default.dispatch)[0].default\nconst ActionTypes = BDModules.get(m=>m.ActionTypes)[0].ActionTypes\n\nconst socketId = \"lightcord-spoof-socket\"\nconst pid = process.pid\n\nexport default new class CustomRichPresence {\n constructor(){\n this.enabled = false\n\n this.game = settingsRPC\n }\n \n get formatedGame(){\n if(!this.game)return null\n if(this.enabled === false)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 }\n return game\n }\n\n sendGame(){\n dispatcher.dispatch({\n type: ActionTypes.LOCAL_ACTIVITY_UPDATE,\n socketId,\n pid,\n activity: this.formatedGame\n }) \n }\n\n enable() {\n if(this.enabled)return\n this.enabled = true\n console.log(\"Enabling custom RichPresence\")\n\n this.set(settingsRPC || Object.create(defaultRPC))\n\n this.sendGame()\n }\n\n disable() {\n if(!this.enabled)return\n this.enabled = false\n console.log(\"Disabling custom RichPresence\")\n\n this.sendGame()\n }\n\n async fetchAssets(applicationId){\n let assets = await BDModules.get(e => e.getAssets)[0].getAssets(applicationId)\n if(assets.undefined && typeof assets.undefined === \"number\"){\n throw new Error(\"Unknown Application\")\n }\n return assets\n }\n\n set(activity){\n this.game = activity\n\n this.sendGame()\n }\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 console.log(selects)\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 {\n constructor(){\n window.Lightcord.Api.ensureExported(e => e.default && e.default.startTyping)\n .then(typingModule => {\n let self = this\n const startTyping = typingModule.default.startTyping\n typingModule.default.startTyping = function(){\n if(self.disabled)return startTyping.call(this, ...arguments)\n }\n const stopTyping = typingModule.default.stopTyping\n typingModule.default.stopTyping = function(){\n if(self.disabled)return stopTyping.call(this, ...arguments)\n }\n this.disabled = true\n })\n window.Lightcord.BetterDiscord.DisableTyping = this\n }\n\n disable(){\n this.disabled = true\n }\n\n enable(){\n this.disabled = false\n }\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.deroku.xyz/LightcordApi/docs\")\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 {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\";\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\"].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 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 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 = 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 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\";\n\nexport default class BDLogo extends BDV2.reactComponent {\n render() {\n return BDV2.react.createElement(\n \"svg\",\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\"},\n BDV2.react.createElement(\"metadata\", null),\n BDV2.react.createElement(\"defs\", null,\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)\"})),\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)\"})),\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)\"}))\n ),\n BDV2.react.createElement(\"g\", null,\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\"}),\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\"}),\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\"})\n )\n );\n }\n}","export default class LightcordLogo extends React.Component {\n render(){\n const props = this.props\n return (\n <svg viewBox=\"0 0 168 168.69\" {...props} height=\"100%\" width={props.size}>\n <defs>\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\">\n <stop offset={0} stopColor=\"#e30613\" />\n <stop offset={1} stopColor=\"#731a14\" />\n </linearGradient>\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\">\n <stop offset={0} stopColor=\"#e20613\" />\n <stop offset={1} stopColor=\"#731a13\" />\n </linearGradient>\n <linearGradient id=\"prefix__c\" x1={84} y1={-408} x2={84} y2={-576.69} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\n <stop offset={0} stopColor=\"#e30613\" />\n <stop offset={1} stopColor=\"#731a13\" />\n </linearGradient>\n </defs>\n <path fill=\"#fff\" d=\"M14.9 35.3h139.2V133H14.9z\" />\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)\" />\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)\" />\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)\" />\n </svg>\n )\n }\n}","import BDV2 from \"./v2\";\nimport Utils from \"./utils\";\n\nconst Constants = {\n EmojiRegex: /<a?\\.(\\w+)\\.(\\d+)>/g\n}\n\nlet CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\nlet EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\nlet AutocompleteModule = BDModules.get(e => e.default && e.default.displayName === \"Autocomplete\")[0]\nlet AutoCompletionTemplates = BDModules.get(e => e.getAutocompleteOptions)[0]\nlet EmojiModuleQuery = BDModules.get(e => e.default && e.default.queryEmojiResults)[0]\nlet Messages = BDModules.get(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)[0]\nlet guildModule = BDModules.get(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)[0]\nlet emojiSearch = BDModules.get(e => e.default && e.default.getDisambiguatedEmojiContext)\n\nexport default new class EmojiModule {\n constructor(){\n this.init().catch(err => Utils.err(\"EmojiModule\", \"An error occured\", err)) // better logging\n }\n\n async init(){\n /** Emoji AutoComplete */\n if(!AutocompleteModule)AutocompleteModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"Autocomplete\")\n if(!AutoCompletionTemplates)AutoCompletionTemplates = await window.Lightcord.Api.ensureExported(e => e.getAutocompleteOptions)\n if(!EmojiModuleQuery)EmojiModuleQuery = await window.Lightcord.Api.ensureExported(e => e.default && e.default.queryEmojiResults)\n if(!Messages)Messages = await window.Lightcord.Api.ensureExported(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)\n if(!guildModule)guildModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)\n if(!emojiSearch)emojiSearch = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getDisambiguatedEmojiContext)\n\n if(AutocompleteModule && AutoCompletionTemplates && EmojiModuleQuery && Messages && guildModule && emojiSearch){\n console.log(`Patching getAutocompleteOptions of AutoCompletionTemplates`, AutoCompletionTemplates)\n const getAutocompleteOptions = AutoCompletionTemplates.getAutocompleteOptions\n AutoCompletionTemplates.getAutocompleteOptions = function(e, t, n, r, a){\n const value = getAutocompleteOptions.call(this, ...arguments)\n value.LIGHTCORD_EMOJIS = {\n matches(arg1, arg2){\n let condition = arg2.length > 1 && \".\" === arg1\n setEmojiUsable(condition)\n return condition\n },\n queryResults(t){\n let results = EmojiModuleQuery.default.queryEmojiResults(t, e)\n return results\n },\n renderResults(e, t, n, r, a){\n return D(e, t, a.emojis, n, r, Messages.default.Messages.EMOJI_MATCHING, Messages.default.Messages.EMOJI, AutocompleteModule.default.Emoji, (function(e) {\n return {\n emoji: e,\n key: e.id || e.uniqueName || e.name,\n sentinel: \".\",\n guild: null != e.guildId ? guildModule.default.getGuild(e.guildId) : null\n }\n }), (function(e) {\n return \".\" + e + \".\"\n }))\n },\n getPlainText(id, guild){\n var emojis = guild.emojis;\n if (null == emojis || null == emojis[id]) return \"\";\n var emoji = emojis[id],\n isAnimated = emoji.animated ? \"a\" : \"\";\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\n },\n getRawText(id, guild){\n var emojis = guild.emojis;\n if (null == emojis || null == emojis[id]) return \"\";\n var emoji = emojis[id],\n isAnimated = emoji.animated ? \"a\" : \"\";\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\n }\n }\n return value\n }\n }else{\n console.error(new Error(\"Couldn't start autocompletion of Lightcord's emojis.\"))\n }\n\n /** Emoji display */\n while (!BDV2.MessageComponent) await new Promise(resolve => setTimeout(resolve, 100));\n\n if (!this.cancelEmojiRender){ // TODO: Proper emoji formatting / rendering\n this.cancelEmoteRender = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\n const message = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.message\")\n if(!message)return\n const content = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.content\")\n if(!content || !content.length)return\n \n /**\n * @type {{\n * raw: string,\n * name: string,\n * id: string,\n * animated: boolean\n * }[]}\n */\n let emojis = []\n \n const newContent = []\n for(let node of content){\n if (typeof(node) !== \"string\") {\n newContent.push(node)\n continue\n };\n let parsed;\n let hasParsed = false\n \n do {\n parsed = Constants.EmojiRegex.exec(node);\n if (parsed) {\n hasParsed = true\n if(!EmojiModuleApi)EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\n const emoji = EmojiModuleApi.default.getCustomEmojiById(parsed[2])\n if(emoji){\n emojis.push({\n animated: emoji.animated,\n name: emoji.name,\n id: emoji.id,\n raw: parsed[0]\n })\n }else{\n emojis.push({\n animated: parsed[0].startsWith(\"<a\"),\n name: parsed[1],\n id: parsed[2],\n raw: parsed[0]\n })\n }\n }\n } while (parsed);\n \n if(hasParsed){\n const words = node.split(\" \").map((word, index, arr) => {\n if(!word)return \"\"\n const emoji = emojis.find(e => e.raw == word)\n if(!emoji)return word\n if(!CustomEmojiModule)CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\n return React.createElement(CustomEmojiModule.CustomEmoji, {\n emoji: {\n name: `.${emoji.name}.`,\n emojiId: emoji.id,\n animated: emoji.animated,\n jumboable: arr.length === 1 && content.length === 1\n }\n })\n }).reduce((previous, current) => {\n if(previous.length === 0)return [current]\n if(typeof current === \"string\"){\n if(typeof previous[previous.length - 1] === \"string\"){\n previous[previous.length - 1] += ` ${current}`\n return previous\n }\n previous.push(\" \"+current)\n return previous\n }\n previous.push(\" \", current)\n return previous\n }, [])\n newContent.push(...words)\n }else{\n newContent.push(node)\n }\n }\n while(data.methodArguments[0].childrenMessageContent.props.content[0]){\n data.methodArguments[0].childrenMessageContent.props.content.shift()\n }\n while(newContent[0]){\n data.methodArguments[0].childrenMessageContent.props.content.push(newContent.shift())\n }\n }});\n }/*\n let userModule\n window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"EmojiPickerListRow\")\n .then(EmojiPickerListRow => {\n let classs = EmojiPickerListRow.default\n EmojiPickerListRow.default = class EmojiPickerListRow extends React.Component {\n constructor(props){\n super(props)\n }\n\n render(){\n if(!userModule)userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0]\n if(!userModule)return React.createElement(classs, this.props)\n let user = userModule.default.getCurrentUser()\n if(!user.hasPremiumSubscription)return React.createElement(classs, this.props)\n\n return React.createElement(classs, Object.assign({}, this.props, {\n emojiDescriptors: this.props.emojiDescriptors.map(e => {\n e.isDisabled = false\n })\n })) \n }\n }\n EmojiPickerListRow.default.displayName = \"EmojiPickerListRow\"\n })*/\n }\n\n disable(){\n if (!this.cancelEmoteRender) return;\n this.cancelEmoteRender();\n this.cancelEmoteRender = null;\n }\n\n start(){\n \n }\n}\n\nfunction D(e, t, n, r, o, i, s, u, l, c) {\n if (null == n || 0 === n.length) return null;\n var d = n.map((function(e, n) {\n return React.createElement(u, Object.assign({\n onClick: o,\n onHover: r,\n selected: t === n,\n index: n\n }, l(e, n)))\n }));\n return [R(i, s, e, c), d]\n}\n\nfunction R(e, t, n, r) {\n var a = (n.length > 0 ? e.format({\n prefix: r(n)\n }) : t)\n if(Array.isArray(a)){\n a.unshift(React.createElement(\"strong\", {}, \"[Lightcord] \"))\n }else{\n a = \"[LIGHTCORD] \"+a\n }\n return React.createElement(AutocompleteModule.default.Title, {\n title: a\n }, a)\n}\nR.displayName = \"renderHeader\";\n\nlet EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\nlet isEmojiDisabled = EmojiFilterModule && EmojiFilterModule.default.isEmojiDisabled\nlet isUsable = false\nlet hasPatched = false\n\nfunction setEmojiUsable(usable){\n isUsable = usable\n if(hasPatched)return\n if(!EmojiFilterModule)EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\n if(!EmojiFilterModule)return\n if(!isEmojiDisabled)isEmojiDisabled = EmojiFilterModule.default.isEmojiDisabled\n\n hasPatched = true\n EmojiFilterModule.default.isEmojiDisabled = function(emoji){\n if(isUsable){\n if(emoji.surrogates || emoji.diversity)return true\n return false\n }\n return isEmojiDisabled.call(this, ...arguments)\n }\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() {\n const contentWindowGetter = Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype, \"contentWindow\").get;\n Object.defineProperty(HTMLIFrameElement.prototype, \"contentWindow\", {\n get: function () {\n const contentWindow = Reflect.apply(contentWindowGetter, this, arguments);\n return new Proxy(contentWindow, {\n getOwnPropertyDescriptor: function(obj, prop) {\n if (prop === \"localStorage\") return undefined;\n return Object.getOwnPropertyDescriptor(obj, prop);\n },\n get: function(obj, prop) {\n if (prop === \"localStorage\") return null;\n const val = obj[prop];\n if (typeof val === \"function\") return val.bind(obj);\n return val;\n }\n });\n }\n });\n\n // Prevent interception by patching Reflect.apply and Function.prototype.bind\n Object.defineProperty(Reflect, \"apply\", {value: Reflect.apply, writable: false, configurable: false});\n Object.defineProperty(Function.prototype, \"bind\", {value: Function.prototype.bind, writable: false, configurable: false});\n\n const oOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function() {\n const url = arguments[1];\n if (url.toLowerCase().includes(\"api/webhooks\")) return null;\n return Reflect.apply(oOpen, this, arguments);\n };\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 () => {\n const v2Loader = document.createElement(\"div\");\n v2Loader.className = \"bd-loaderv2\";\n v2Loader.title = \"BandagedBD is loading...\";\n document.body.appendChild(v2Loader);\n};"],"sourceRoot":""}