1 line
619 KiB
Plaintext
1 line
619 KiB
Plaintext
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"electron\"","webpack:///external \"path\"","webpack:///external \"fs\"","webpack:///external \"crypto\"","webpack:///external \"node-fetch\"","webpack:///external \"events\"","webpack:///external \"module\"","webpack:///./src/0globals.js","webpack:///./src/modules/webpackModules.js","webpack:///./src/modules/dataStore.js","webpack:///./src/modules/bdEvents.js","webpack:///./src/modules/pluginModule.js","webpack:///./src/ui/tooltip.js","webpack:///./src/ui/tooltipWrap.js","webpack:///./src/modules/pluginCertifier.js","webpack:///./src/modules/contentManager.js","webpack:///./src/modules/domtools.js","webpack:///./src/modules/themeModule.js","webpack:///./src/modules/v2.js","webpack:///./src/modules/utils.js","webpack:///./src/modules/settingsPanelSidebar.js","webpack:///./src/modules/coloredText.js","webpack:///./src/modules/24hour.js","webpack:///./src/ui/xSvg.js","webpack:///./src/ui/tools.js","webpack:///./src/ui/settingsTitle.js","webpack:///./src/ui/tabBarSeparator.js","webpack:///./src/ui/tabBarHeader.js","webpack:///./src/ui/tabBarItem.js","webpack:///./src/ui/publicservers/serverCard.js","webpack:///./src/ui/scroller.js","webpack:///./src/ui/publicservers/sidebarView.js","webpack:///./src/ui/publicservers/publicServers.js","webpack:///./src/svg/bug_hunter.jsx","webpack:///./src/svg/circus.jsx","webpack:///./src/modules/distant.js","webpack:///./src/modules/Layers.jsx","webpack:///./src/modules/publicServers.js","webpack:///./src/modules/voiceMode.js","webpack:///./src/modules/classNormalizer.js","webpack:///./src/modules/devMode.js","webpack:///./src/ui/components/switch.jsx","webpack:///./src/ui/switch.js","webpack:///./src/ui/margintop.jsx","webpack:///./src/ui/settingsGroup.jsx","webpack:///./src/ui/sectionedSettingsPanel.js","webpack:///./src/ui/checkbox.js","webpack:///./src/ui/cssEditorDetached.js","webpack:///./src/ui/cssEditor.js","webpack:///./src/ui/errorBoundary.js","webpack:///./src/ui/contentColumn.js","webpack:///./src/ui/reloadIcon.js","webpack:///./src/ui/icons/edit.jsx","webpack:///./src/ui/icons/delete.jsx","webpack:///./src/ui/addoncard.jsx","webpack:///./src/ui/icons/downarrow.jsx","webpack:///./src/ui/components/dropdown.jsx","webpack:///./src/ui/icons/search.jsx","webpack:///./src/ui/components/search.jsx","webpack:///./src/ui/addonlist.jsx","webpack:///./src/modules/CustomRichPresence.js","webpack:///./src/ui/presenceSettings.jsx","webpack:///./src/ui/AccountInfos.jsx","webpack:///./src/modules/AntiAdDM.js","webpack:///./src/modules/blurPrivate.js","webpack:///./src/modules/disableTyping.js","webpack:///./src/ui/ApiPreview.jsx","webpack:///./src/ui/icons/history.jsx","webpack:///./src/modules/popoutWindow.js","webpack:///./src/modules/settingsPanel.js","webpack:///./src/ui/bdLogo.js","webpack:///./src/svg/lightcord.jsx","webpack:///./src/modules/emojiModule.js","webpack:///./src/modules/core.js","webpack:///./src/modules/bdApi.js","webpack:///./src/localStorageFix.js","webpack:///./src/index.js","webpack:///./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","__non_webpack_require__","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","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","userAgent","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","openExternal","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","checkViruses","resultCallback","removeCallback","toString","isHarmful","keyword","split","oof","no_comments","replace","trim","test","regexps","regex","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","getAppPath","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_XSvg","reactComponent","xmlns","fillRule","V2C_Tools","toolsModule","toolsContainer","containerModule","closeButton","closeButtonBold","tools","XSvg","keybind","keybindBold","V2C_SettingsTitle","V2C_TabBarSeparator","V2C_TabBarHeader","button","V2C_TabBarItem","setInitialState","state","V2C_ServerCard","server","iconUrl","fallback","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","V2C_Scroller","scrollerModule1","scrollerHorizontal","scrollerModule2","sidebarRegionScroller","wrapperClass","scrollerWrap","scrollerThemed","themeGhostHairline","fade","scrollerFade","scrollerClass","contentColumn","contentRegionScroller","contentRegionScrollerWrap","themeGhost","scrollerTrack","originalRender","configurable","V2C_SidebarView","Scroller","dark","V2C_PublicServers","changeCategory","searchKeyDown","checkConnection","connect","GuildStore","AvatarDefaults","SortedGuildStore","componentDidMount","selectedCategory","loading","servers","connection","user","fetch","endPoint","end","term","categoryButtons","total","refs","sbv","contentScroller","scrollTop","serverCard","acceptInvite","invite_code","joinEndPoint","credentials","windowOptions","round","screenX","screenY","joinWindow","webContents","loadURL","resizable","maximizable","minimizable","alwaysOnTop","center","webPreferences","nodeIntegration","getFlattenedGuildIds","defaultList","DEFAULT_AVATARS","ServerCard","online","nativejoin","floor","random","response","SidebarView","Tools","fontSize","TabBarSeparator","searchInput","TabBarHeader","TabBarItem","marginLeft","onKeyDown","onChange","placeholder","maxLength","which","searchinput","notConnected","columnModule","contentColumnDefault","SettingsTitle","bdServer","marginBottom","lineHeight","username","discriminator","padding","BugHunterBadge","Circus","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","forceUpdate","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","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","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","sections","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","V2C_ContentColumn","V2C_ReloadIcon","Edit","Delete","anchorClasses","V2C_PluginCard","showSettings","hasSettings","addon","getSettingsPanel","settingsPanel","reloads","trusted","closeSettings","panelRef","current","settingsOpen","settingspanel","cardNode","cTop","cBottom","eTop","offsetTop","eBottom","isHidden","thisNodeOffset","offset","containerOffset","original","getString","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","_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","setValue","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","getCurrentWindow","setAlwaysOnTop","AntiAdDM","blurPrivate","disableTyping","appSettings","getGlobal","relaunch","exit","popoutWindow","core","methods","NotificationsUseShim","loadSettings","renderSidebar","SectionedSettingsPanel","coreSettings","isChecked","ipc","send","argv","quit","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","exec","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","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,GA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V,IAAG,KACCsH,GAAM+Y,KAAK,oBAAsB,IAAG3f,iEAC7BN,MAQbmxD,GAAa1xD,OAAO2J,KAAKgoD,GAC/B,IAAK,MAAM9wD,KAAO6wD,GAAYD,GAAgB5wD,EAAK8wD,EAAQ9wD,IAc3D4wD,GAAgB,OAAQz+C,IACxBy+C,GAAgB,eAAgB5zC,GAChC4zC,GAAgB,cAAe3zC,IAC/B2zC,GAAgB,QAAShqD,IACzBgqD,GAAgB,WAAY5oD,GAC5B4oD,GAAgB,gBAAiBxkB,IACjCwkB,GAAgB,YAAahrD,GAC7BgrD,GAAgB,iBAAkBtpD,IAClCspD,GAAgB,kBAAmB5tB,IAEnCpiC,OAAOwvC,MAAQA,GAGfwgB,GAAgB,WAAY/H,IAGb,MAAMkI,GACjB1rD,YAAYzC,EAAUqgD,GAClB4F,GAAKC,UAAUlmD,GACfimD,GAAKI,WAAWhG,GAGpBhD,OAEI4I,GAAK5I","file":"index.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"https://rawcdn.githack.com/Lightcord/Lightcord/68cee85508c6296826f3907cc9e9888d63e80d2b/LightcordApi/dist/\";\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.307\";\r\nexport const currentDiscordVersion = (window.DiscordNative && window.DiscordNative.remoteApp && window.DiscordNative.remoteApp.getVersion && window.DiscordNative.remoteApp.getVersion()) || \"0.0.307\";\r\nexport const minSupportedVersion = \"0.3.0\";\r\nexport const bbdVersion = \"0.3.5\";\r\nexport const bbdChangelog = {\r\n description: \"Big things are coming.\",\r\n changes: [\r\n {\r\n title: \"Bug Fixes\",\r\n type: \"fixed\",\r\n items: [\r\n \"Some fixes related to showing modals in the `BdApi`.\",\r\n \"Fixed the open folder buttons for plugins and themes\"\r\n ]\r\n }\r\n ]\r\n};\r\n\r\nexport const settings = {\r\n \"Custom css live update\": {id: \"bda-css-0\", info: \"\", implemented: true, hidden: true, cat: \"core\"},\r\n \"Custom css auto udpate\": {id: \"bda-css-1\", info: \"\", implemented: true, hidden: true, cat: \"core\"},\r\n \"BetterDiscord Blue\": {id: \"bda-gs-b\", info: \"Replace Discord blue with BD Blue\", implemented: false, hidden: false, cat: \"core\"},\r\n\r\n /* Core */\r\n /* ====== */\r\n \"Public Servers\": {id: \"bda-gs-1\", info: \"Display public servers button\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\n \"Minimal Mode\": {id: \"bda-gs-2\", info: \"Hide elements and reduce the size of elements.\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\n \"Voice Mode\": {id: \"bda-gs-4\", info: \"Only show voice chat\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\n \"Hide Channels\": {id: \"bda-gs-3\", info: \"Hide channels in minimal mode\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\n \"Dark Mode\": {id: \"bda-gs-5\", info: \"Make certain elements dark by default(wip)\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\n \"Voice Disconnect\": {id: \"bda-dc-0\", info: \"Disconnect from voice server when closing Discord\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\n \"24 Hour Timestamps\": {id: \"bda-gs-6\", info: \"Replace 12hr timestamps with proper ones\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\n \"Colored Text\": {id: \"bda-gs-7\", info: \"Make text color the same as role color\", implemented: true, hidden: false, cat: \"core\", category: \"modules\"},\r\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\"},\r\n\r\n /* Content */\r\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\"},\r\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\"},\r\n \"Show Toasts\": {id: \"fork-ps-2\", info: \"Shows a small notification for important information\", implemented: true, hidden: false, cat: \"core\", category: \"content manager\"},\r\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\"},\r\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\"},\r\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\"},\r\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},\r\n\r\n /* Developer */\r\n \"Developer Mode\": \t {id: \"bda-gs-8\", info: \"Developer Mode Toggle\", implemented: true, hidden: false, cat: \"core\", category: \"developer settings\"},\r\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\"},\r\n\r\n /** Lightcord */\r\n \"Disable BetterDiscord\": {id: \"bd-disable\", info: \"Disable Betterdiscord (plugins, themes, etc) (Not implemented).\", implemented: false, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\r\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\"},\r\n \"Calling Ring Beat\": {id: \"lightcord-2\", info: \"Enable Discord's special calling beat.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\r\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\"},\r\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\"},\r\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\"},\r\n \"Disable typing\": {id: \"lightcord-7\", info: \"Don't let other see you're typing.\", implemented: true, hidden: false, cat: \"lightcord\", category: \"Lightcord\"},\r\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},\r\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},\r\n\r\n /** Lightcord Window */\r\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\"},\r\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\"},\r\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\"},\r\n \r\n /** RichPresence */\r\n \"Enable\": {id: \"lightcord-presence-1\", info: \"Enable RichPresence below.\", implemented: true, hidden: false, cat: \"status\"}\r\n};\r\n\r\nexport const defaultCookie = {\r\n \"bda-gs-1\": true,\r\n \"bda-gs-2\": false,\r\n \"bda-gs-3\": false,\r\n \"bda-gs-4\": false,\r\n \"bda-gs-5\": true,\r\n \"bda-gs-6\": false,\r\n \"bda-gs-7\": false,\r\n \"bda-gs-8\": false,\r\n \"bda-es-0\": true,\r\n \"bda-es-1\": true,\r\n \"bda-es-2\": true,\r\n \"bda-es-4\": false,\r\n \"bda-es-6\": true,\r\n \"bda-es-7\": true,\r\n \"bda-gs-b\": false,\r\n \"bda-es-8\": true,\r\n \"bda-dc-0\": false,\r\n \"bda-css-0\": false,\r\n \"bda-css-1\": false,\r\n \"bda-es-9\": true,\r\n \"fork-dm-1\": false,\r\n \"fork-ps-1\": true,\r\n \"fork-ps-2\": true,\r\n \"fork-ps-3\": true,\r\n \"fork-ps-4\": true,\r\n \"fork-ps-5\": true,\r\n \"fork-ps-6\": true,\r\n \"fork-ps-7\": false,\r\n \"fork-es-2\": false,\r\n \"fork-es-3\": true,\r\n \"fork-wp-1\": false,\r\n \"fork-wp-2\": false,\r\n \"fork-beta\": true,\r\n \"lightcord-1\": false,\r\n \"lightcord-2\": true,\r\n \"lightcord-presence-1\": false,\r\n \"lightcord-3\": false,\r\n \"lightcord-4\": false,\r\n \"lightcord-5\": true,\r\n \"lightcord-6\": true,\r\n \"lightcord-7\": false,\r\n \"lightcord-8\": false,\r\n \"lightcord-9\": false,\r\n \"lightcord-10\": false,\r\n \"no_window_bound\": false,\r\n};\r\n\r\n\r\nexport const settingsCookie = {};\r\n\r\nexport const settingsRPC = {};\r\nexport const defaultRPC = {\r\n \"name\": \"Lightcord\",\r\n \"application_id\": \"711416957718757418\",\r\n \"state\": \"Lightcord Client\",\r\n \"details\": \"Browsing Discord\",\r\n \"timestamps.start\": Date.now(),\r\n \"assets.small\": null,\r\n \"assets.large\": \"712323821037682791\"\r\n}\r\n\r\nexport const lightcordSettings = {};\r\nexport const defaultLightcordSettings = {};\r\n\r\nexport const bdpluginErrors = [];\r\nexport const bdthemeErrors = []; // define for backwards compatibility\r\n\r\nexport const bdConfig = Object.create(BetterDiscordConfig);\r\n\r\nexport const bdthemes = {};\r\nexport const bdplugins = {};\r\n\r\nexport const pluginCookie = {};\r\nexport const themeCookie = {};","const req = webpackJsonp.push([[], {__extra_id__: (module, exports, req) => module.exports = req}, [[\"__extra_id__\"]]]);\r\ndelete req.m.__extra_id__;\r\ndelete req.c.__extra_id__;\r\nconst find = (filter) => {\r\n for (const i in req.c) {\r\n if (req.c.hasOwnProperty(i)) {\r\n const m = req.c[i].exports;\r\n if (m && m.__esModule && m.default && filter(m.default)) return m.default;\r\n if (m && filter(m))\treturn m;\r\n }\r\n }\r\n // console.warn(\"Cannot find loaded module in cache\");\r\n return null;\r\n};\r\n\r\nconst findAll = (filter) => {\r\n const modules = [];\r\n for (const i in req.c) {\r\n if (req.c.hasOwnProperty(i)) {\r\n const m = req.c[i].exports;\r\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(m.default);\r\n else if (m && filter(m)) modules.push(m);\r\n }\r\n }\r\n return modules;\r\n};\r\n\r\nconst findByProps = (...propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\r\nconst findByPrototypes = (...protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\r\nconst findByDisplayName = (displayName) => find(module => module.displayName === displayName);\r\n\r\nlet mod = {find, findAll, findByProps, findByPrototypes, findByDisplayName};\r\nexport default mod\r\n\r\nwindow.Lightcord.BetterDiscord.WebpackModules = mod","const __non_webpack_require__ = window.require\r\n\r\nimport Utils from \"./utils\";\r\nimport ContentManager from \"./contentManager\";\r\n\r\nconst fs = require(\"fs\");\r\nconst path = require(\"path\");\r\nconst releaseChannel = DiscordNative.globals ? DiscordNative.globals.releaseChannel : DiscordNative.app ? DiscordNative.app.getReleaseChannel() : \"stable\";\r\n\r\nlet dataPath = \"\";\r\nif (process.platform === \"win32\") dataPath = process.env.APPDATA;\r\nelse if (process.platform === \"darwin\") dataPath = path.join(process.env.HOME, \"Library\", \"Preferences\");\r\nelse dataPath = process.env.XDG_CONFIG_HOME ? process.env.XDG_CONFIG_HOME : path.join(process.env.HOME, \".config\");\r\ndataPath = path.join(dataPath, \"BetterDiscord\");\r\n\r\nexport default new class DataStore {\r\n constructor() {\r\n this.data = {settings: {stable: {}, canary: {}, ptb: {}}};\r\n this.pluginData = {};\r\n window.Lightcord.BetterDiscord.DataStore = this\r\n }\r\n\r\n initialize() {\r\n try {\r\n if (!fs.existsSync(this.BDFile)) fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\r\n const data = JSON.parse(fs.readFileSync(this.BDFile, \"utf-8\"))\r\n if (data.hasOwnProperty(\"settings\")) this.data = data;\r\n if (!fs.existsSync(this.settingsFile)) return;\r\n let settings = __non_webpack_require__(this.settingsFile);\r\n fs.unlinkSync(this.settingsFile);\r\n if (settings.hasOwnProperty(\"settings\")) settings = Object.assign({stable: {}, canary: {}, ptb: {}}, {[releaseChannel]: settings});\r\n else settings = Object.assign({stable: {}, canary: {}, ptb: {}}, settings);\r\n this.setBDData(\"settings\", settings);\r\n }\r\n catch (err) {\r\n console.error(err);\r\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.\");\r\n }\r\n }\r\n\r\n get injectionPath() {\r\n return this._injectionPath = null;\r\n if (this._injectionPath) return this._injectionPath;\r\n const electron = require(\"electron\").remote.app;\r\n const base = electron.getAppPath();\r\n const roamingBase = electron.getPath(\"userData\");\r\n const roamingLocation = path.resolve(roamingBase, electron.getVersion(), \"modules\", \"discord_desktop_core\", \"injector\");\r\n const location = path.resolve(base, \"..\", \"app\");\r\n const realLocation = fs.existsSync(location) ? location : fs.existsSync(roamingLocation) ? roamingLocation : null;\r\n if (!realLocation) return this._injectionPath = null;\r\n return this._injectionPath = realLocation;\r\n }\r\n\r\n get configFile() {return this._configFile || (this._configFile = path.resolve(this.injectionPath, \"betterdiscord\", \"config.json\"));}\r\n get BDFile() {return this._BDFile || (this._BDFile = path.resolve(dataPath, \"bdstorage.json\"));}\r\n get settingsFile() {return this._settingsFile || (this._settingsFile = path.resolve(dataPath, \"bdsettings.json\"));}\r\n getPluginFile(pluginName) {return path.resolve(ContentManager.pluginsFolder, pluginName + \".config.json\");}\r\n\r\n getSettingGroup(key) {\r\n return this.data.settings[releaseChannel][key] || null;\r\n }\r\n\r\n setSettingGroup(key, data) {\r\n this.data.settings[releaseChannel][key] = data;\r\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\r\n }\r\n\r\n getBDData(key) {\r\n return this.data[key] || \"\";\r\n }\r\n\r\n setBDData(key, value) {\r\n this.data[key] = value;\r\n fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4), \"utf-8\");\r\n }\r\n\r\n getPluginData(pluginName, key) {\r\n if (this.pluginData[pluginName] !== undefined) return this.pluginData[pluginName][key];\r\n if (!fs.existsSync(this.getPluginFile(pluginName))) return undefined;\r\n this.pluginData[pluginName] = JSON.parse(fs.readFileSync(this.getPluginFile(pluginName)));\r\n return this.pluginData[pluginName][key];\r\n }\r\n\r\n setPluginData(pluginName, key, value) {\r\n if (value === undefined) return;\r\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\r\n this.pluginData[pluginName][key] = value;\r\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"utf-8\");\r\n }\r\n\r\n deletePluginData(pluginName, key) {\r\n if (this.pluginData[pluginName] === undefined) this.pluginData[pluginName] = {};\r\n delete this.pluginData[pluginName][key];\r\n fs.writeFileSync(this.getPluginFile(pluginName), JSON.stringify(this.pluginData[pluginName], null, 4), \"utf-8\");\r\n }\r\n};","/* BDEvents */\r\nconst EventEmitter = require(\"events\");\r\nexport default new class BDEvents extends EventEmitter {\r\n constructor(){\r\n super()\r\n window.Lightcord.BetterDiscord.BDEvents = this\r\n }\r\n dispatch(eventName, ...args) {this.emit(eventName, ...args);}\r\n off(eventName, eventAction) {this.removeListener(eventName, eventAction);}\r\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();","/**\r\n * Tooltip that automatically show and hide themselves on mouseenter and mouseleave events.\r\n * Will also remove themselves if the node to watch is removed from DOM through\r\n * a MutationObserver.\r\n *\r\n * Note this is not using Discord's internals but normal DOM manipulation and emulates\r\n * Discord's own tooltips as closely as possible.\r\n *\r\n * @module EmulatedTooltip\r\n * @version 0.0.1\r\n */\r\n\r\nimport Utils from \"../modules/utils\";\r\nimport WebpackModules from \"../modules/webpackModules\";\r\nlet TooltipClasses\r\nfunction getTooltipClasses(){\r\n\tif(TooltipClasses)return TooltipClasses\r\n\treturn TooltipClasses = WebpackModules.findByProps(\"tooltip\", \"tooltipBlack\");\r\n}\r\nlet TooltipLayers\r\nfunction getTooltipLayers(){\r\n\tif(TooltipLayers)return TooltipLayers\r\n\treturn TooltipLayers = WebpackModules.findByProps(\"layer\", \"layerContainer\");\r\n}\r\n\r\nconst getClass = function(sideOrColor) {\r\n const upperCase = sideOrColor[0].toUpperCase() + sideOrColor.slice(1);\r\n const tooltipClass = getTooltipClasses()[`tooltip${upperCase}`];\r\n if (tooltipClass) return tooltipClass;\r\n return null;\r\n};\r\n\r\nconst classExists = function(sideOrColor) {\r\n return getClass(sideOrColor) ? true : false;\r\n};\r\n\r\nconst toPx = function(value) {\r\n return `${value}px`;\r\n};\r\n\r\nexport default class EmulatedTooltip {\r\n\t/**\r\n\t *\r\n\t * @constructor\r\n\t * @param {(HTMLElement|jQuery)} node - DOM node to monitor and show the tooltip on\r\n\t * @param {string} tip - string to show in the tooltip\r\n\t * @param {object} options - additional options for the tooltip\r\n\t * @param {string} [options.style=black] - correlates to the discord styling/colors (black, brand, green, grey, red, yellow)\r\n\t * @param {string} [options.side=top] - can be any of top, right, bottom, left\r\n\t * @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen\r\n * @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover\r\n * @param {boolean} [options.attachEvents=true] - whether the tooltip should listen to mouseenter and mouseleave events.\r\n\t */\r\n\tconstructor(node, text, options = {}) {\r\n\t\tconst {style = \"black\", side = \"top\", preventFlip = false, disabled = false, attachEvents = true} = options;\r\n\t\tthis.node = node instanceof jQuery ? node[0] : node;\r\n this.label = text;\r\n this.style = style.toLowerCase();\r\n\t\tthis.side = side.toLowerCase();\r\n this.preventFlip = preventFlip;\r\n this.disabled = disabled;\r\n\r\n if (!classExists(this.side)) return Utils.err(\"EmulatedTooltip\", `Side ${this.side} does not exist.`);\r\n\t\tif (!classExists(this.style)) return Utils.err(\"EmulatedTooltip\", `Style ${this.style} does not exist.`);\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.className = getTooltipLayers().layer + \" \" + getTooltipLayers().disabledPointerEvents;\r\n\r\n\t\tthis.tooltipElement = document.createElement(\"div\");\r\n\t\tthis.tooltipElement.className = `${getTooltipClasses().tooltip} ${getClass(this.style)}`;\r\n\r\n\t\tthis.labelElement = document.createElement(\"div\");\r\n\t\tthis.labelElement.className = getTooltipClasses().tooltipContent\r\n\r\n\t\tconst pointerElement = document.createElement(\"div\");\r\n\t\tpointerElement.className = getTooltipClasses().tooltipPointer;\r\n\r\n\t\tthis.tooltipElement.append(pointerElement);\r\n\t\tthis.tooltipElement.append(this.labelElement);\r\n\t\tthis.element.append(this.tooltipElement);\r\n\r\n\t\tif(attachEvents){\r\n\t\t\tthis.node.addEventListener(\"mouseenter\", () => {\r\n\t\t\t\tif (this.disabled) return;\r\n\t\t\t\tthis.show();\r\n\t\r\n\t\t\t\tconst observer = new MutationObserver((mutations) => {\r\n\t\t\t\t\tmutations.forEach((mutation) => {\r\n\t\t\t\t\t\tconst nodes = Array.from(mutation.removedNodes);\r\n\t\t\t\t\t\tconst directMatch = nodes.indexOf(this.node) > -1;\r\n\t\t\t\t\t\tconst parentMatch = nodes.some(parent => parent.contains(this.node));\r\n\t\t\t\t\t\tif (directMatch || parentMatch) {\r\n\t\t\t\t\t\t\tthis.hide();\r\n\t\t\t\t\t\t\tobserver.disconnect();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\r\n\t\t\t\tobserver.observe(document.body, {subtree: true, childList: true});\r\n\t\t\t});\r\n\t\r\n\t\t\tthis.node.addEventListener(\"mouseleave\", () => {\r\n\t\t\t\tthis.hide();\r\n\t\t\t});\r\n\t\t}\r\n }\r\n\r\n /** Container where the tooltip will be appended. */\r\n get container() { \r\n\t\treturn document.querySelector(\".\"+Utils.removeDa(BDModules.get(e => e.popouts)[0].popouts)+\" ~ .\"+Utils.removeDa(BDModules.get(e => e.layerContainer)[0].layerContainer)); \r\n\t}\r\n /** Boolean representing if the tooltip will fit on screen above the element */\r\n get canShowAbove() { return this.node.getBoundingClientRect().top - this.element.offsetHeight >= 0; }\r\n /** Boolean representing if the tooltip will fit on screen below the element */\r\n get canShowBelow() { return this.node.getBoundingClientRect().top + this.node.offsetHeight + this.element.offsetHeight <= Utils.screenHeight; }\r\n /** Boolean representing if the tooltip will fit on screen to the left of the element */\r\n get canShowLeft() { return this.node.getBoundingClientRect().left - this.element.offsetWidth >= 0; }\r\n /** Boolean representing if the tooltip will fit on screen to the right of the element */\r\n\tget canShowRight() { return this.node.getBoundingClientRect().left + this.node.offsetWidth + this.element.offsetWidth <= Utils.screenWidth; }\r\n\r\n /** Hides the tooltip. Automatically called on mouseleave. */\r\n\thide() {\r\n this.element.remove();\r\n this.tooltipElement.className = this._className;\r\n\t}\r\n\r\n /** Shows the tooltip. Automatically called on mouseenter. Will attempt to flip if position was wrong. */\r\n\tshow() {\r\n this.tooltipElement.className = `${getTooltipClasses().tooltip} ${getClass(this.style)}`;\r\n\t\tthis.labelElement.textContent = this.label;\r\n\t\tthis.container.append(this.element);\r\n\r\n\t\tif (this.side == \"top\") {\r\n\t\t\tif (this.canShowAbove || (!this.canShowAbove && this.preventFlip)) this.showAbove();\r\n\t\t\telse this.showBelow();\r\n\t\t}\r\n\r\n\t\tif (this.side == \"bottom\") {\r\n\t\t\tif (this.canShowBelow || (!this.canShowBelow && this.preventFlip)) this.showBelow();\r\n\t\t\telse this.showAbove();\r\n\t\t}\r\n\r\n\t\tif (this.side == \"left\") {\r\n\t\t\tif (this.canShowLeft || (!this.canShowLeft && this.preventFlip)) this.showLeft();\r\n\t\t\telse this.showRight();\r\n\t\t}\r\n\r\n\t\tif (this.side == \"right\") {\r\n\t\t\tif (this.canShowRight || (!this.canShowRight && this.preventFlip)) this.showRight();\r\n\t\t\telse this.showLeft();\r\n\t\t}\r\n\t}\r\n\r\n /** Force showing the tooltip above the node. */\r\n\tshowAbove() {\r\n\t\tthis.tooltipElement.classList.add(getClass(\"top\"));\r\n\t\tthis.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top - this.element.offsetHeight - 10));\r\n\t\tthis.centerHorizontally();\r\n\t}\r\n\r\n /** Force showing the tooltip below the node. */\r\n\tshowBelow() {\r\n\t\tthis.tooltipElement.classList.add(getClass(\"bottom\"));\r\n\t\tthis.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top + this.node.offsetHeight + 10));\r\n\t\tthis.centerHorizontally();\r\n\t}\r\n\r\n /** Force showing the tooltip to the left of the node. */\r\n\tshowLeft() {\r\n\t\tthis.tooltipElement.classList.add(getClass(\"left\"));\r\n\t\tthis.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left - this.element.offsetWidth - 10));\r\n\t\tthis.centerVertically();\r\n\t}\r\n\r\n /** Force showing the tooltip to the right of the node. */\r\n\tshowRight() {\r\n\t\tthis.tooltipElement.classList.add(getClass(\"right\"));\r\n\t\tthis.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left + this.node.offsetWidth + 10));\r\n\t\tthis.centerVertically();\r\n\t}\r\n\r\n\tcenterHorizontally() {\r\n const nodecenter = this.node.getBoundingClientRect().left + (this.node.offsetWidth / 2);\r\n this.element.style.setProperty(\"left\", toPx(nodecenter - (this.element.offsetWidth / 2)));\r\n\t}\r\n\r\n\tcenterVertically() {\r\n\t\tconst nodecenter = this.node.getBoundingClientRect().top + (this.node.offsetHeight / 2);\r\n\t\tthis.element.style.setProperty(\"top\", toPx(nodecenter - (this.element.offsetHeight / 2)));\r\n\t}\r\n}","import BDV2 from \"../modules/v2\";\r\nimport Tooltip from \"./tooltip\";\r\n\r\nexport default class extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n async componentDidMount() {\r\n const {style = \"black\", side = \"top\", text = \"\"} = this.props;\r\n this.node = BDV2.reactDom.findDOMNode(this);\r\n this.tooltip = new Tooltip(this.node, text, {style, side});\r\n }\r\n\r\n componentWillUnmount() {\r\n this.tooltip.hide();\r\n delete this.tooltip;\r\n }\r\n\r\n render() {\r\n return this.props.children;\r\n }\r\n}","import nodeFetch from \"node-fetch\"\r\nimport * as electron from \"electron\"\r\nimport * as crypto from \"crypto\"\r\nimport BDV2 from \"./v2\"\r\nimport tooltipWrap from \"../ui/tooltipWrap\"\r\nimport Utils from \"./utils\"\r\nimport { createReadStream, writeFileSync } from \"fs\"\r\nimport { basename, join } from \"path\"\r\nimport contentManager from \"./contentManager\"\r\nimport { addonCache } from \"./contentManager\"\r\n\r\nconst cache = {}\r\nconst cache2 = {}\r\n\r\nexport default new class PluginCertifier {\r\n constructor(){\r\n window.Lightcord.BetterDiscord.PluginCertifier = this\r\n }\r\n\r\n patch(attachment, id){\r\n process.nextTick(() => {\r\n processAttachment(attachment, id)\r\n })\r\n }\r\n\r\n start(){\r\n\r\n }\r\n\r\n isTrusted(hash){\r\n return cache[hash] && !cache[hash].suspect\r\n }\r\n}\r\n\r\nexport function checkViruses(hash, data, resultCallback, removeCallback, filename){\r\n data = data.toString(\"utf8\")\r\n let isHarmful = false\r\n for(let keyword of data.split(/[^\\w\\d]+/g)){\r\n for(let oof of [\r\n \"token\",\r\n \"email\",\r\n \"phone\",\r\n \"MFA\",\r\n \"2fa\",\r\n \"child_process\",\r\n \"localStorage\",\r\n \"eval\",\r\n \"getGlobal\",\r\n \"BrowserWindow\"\r\n ]){\r\n if(keyword.toLowerCase().includes(oof.toLowerCase()) && !keyword.toLowerCase() === \"domtokenlist\"){\r\n console.log(oof, keyword)\r\n isHarmful = \"token stealer/virus\"\r\n break\r\n } \r\n }\r\n if(isHarmful)break\r\n }\r\n\r\n if(!isHarmful){\r\n /**\r\n * @type {string}\r\n */\r\n const no_comments = data.replace(/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/gm, \"\").trim()// removing the META comment from plugins\r\n if((/var [\\w\\d_$]+=\\[\"/gi).test(no_comments)){\r\n isHarmful = \"obfuscation/hidden code\"\r\n }\r\n\r\n if(!isHarmful){\r\n const regexps = [\r\n /** hexadecimal */\r\n /_0x\\w{4}\\('0x[\\dabcdef]+'\\)/g,\r\n /_0x\\w{4}\\('0x[\\dabcdef]+'[, ]+'[^']{4}'\\)/g, // _0x8db7('0x0', 'x1]f')\r\n /** mangled */\r\n /\\w+\\('0x[\\dabcdef]+'\\)/g, // b('0x0')\r\n /\\w+\\('0x[\\dabcdef]+'[, ]+'[^']{4}'\\)/g, // b('0x0', 'x1]f')\r\n ]\r\n for(let regex of regexps){\r\n if(isHarmful)break\r\n if(regex.test(no_comments))isHarmful = \"obfuscation/hidden code\"\r\n }\r\n }\r\n }\r\n\r\n if(!isHarmful)return removeCallback(hash)\r\n cache[hash] = {\r\n suspect: true,\r\n name: hashToUrl[hash].split(\"/\").pop(),\r\n type: hashToUrl[hash].endsWith(\".js\") ? \"Plugin\" : \"Theme\",\r\n harm: isHarmful,\r\n hash: hash,\r\n filename\r\n }\r\n \r\n console.log(`Found potentially dangerous ${cache[hash].type.toLowerCase()}: ${cache[hash].name}`)\r\n\r\n resultCallback(cache[hash])\r\n}\r\n\r\nconst hashToUrl = {}\r\n\r\nexport function checkHash(hash, data, filename, resultCallback, removeCallback){\r\n console.log(`File: ${filename} hash: ${hash}`)\r\n if(!cache[hash]){\r\n nodeFetch(\"https://cdn.jsdelivr.net/gh/Lightcord/filehashes@master/hashes/\"+hash, { // Using node-fetch to bypass cors\r\n headers: {\r\n \"User-Agent\": electron.remote.getCurrentWebContents().userAgent // have to set user-agent\r\n }\r\n }).then(async res => {\r\n if(res.status !== 200){\r\n if(filename.endsWith(\".theme.css\"))return removeCallback(hash)\r\n checkViruses(hash, data, resultCallback, removeCallback, filename)\r\n return\r\n }\r\n const result = await res.json()\r\n result.hash = hash\r\n result.filename = filename\r\n\r\n cache[hash] = result\r\n\r\n resultCallback(result)\r\n }).catch((err) => {\r\n console.error(`Could not read from github. ${err}`)\r\n if(filename.endsWith(\".theme.css\"))return removeCallback(hash)\r\n checkViruses(hash, data, resultCallback, removeCallback, filename)\r\n })\r\n }else{\r\n const result = cache[hash]\r\n\r\n resultCallback(result)\r\n }\r\n}\r\n\r\nexport function processFile(__path, resultCallback, removeCallback = (hash) => {}, isFromLoader = false){ \r\n const hash = crypto.createHash(\"sha256\")\r\n let data = Buffer.alloc(0)\r\n\r\n createReadStream(__path).on(\"data\", chunk => {\r\n data = Buffer.concat([data, chunk])\r\n hash.update(chunk)\r\n }).on(\"end\", () => {\r\n const hashResult = hash.digest(\"hex\")\r\n\r\n hashToUrl[hashResult] = __path\r\n\r\n if(isFromLoader && addonCache[hashResult]){\r\n let value = addonCache[hashResult]\r\n if(value.timestamp < (Date.now() - 6.048e+8)){\r\n delete addonCache[hashResult]\r\n contentManager.saveAddonCache()\r\n }else{\r\n resultCallback(value.result)\r\n return\r\n }\r\n }\r\n\r\n checkHash(hashResult, data, basename(__path), resultCallback, removeCallback)\r\n })\r\n}\r\n\r\nexport function processAttachment(attachment, id){\r\n if(!document.getElementById(id))return\r\n if(!attachment.url.startsWith(\"https://cdn.discordapp.com/\"))return document.getElementById(id).remove()\r\n if(!attachment.filename.endsWith(\".plugin.js\") && !attachment.filename.endsWith(\".theme.css\"))return document.getElementById(id).remove()\r\n\r\n nodeFetch(attachment.url, {\r\n headers: {\r\n \"User-Agent\": electron.remote.getCurrentWebContents().userAgent\r\n }\r\n }).then(res => {\r\n if(res.status !== 200)throw new Error(\"File doesn't exist.\")\r\n const hash = crypto.createHash(\"sha256\")\r\n let data = Buffer.alloc(0)\r\n res.body.on(\"data\", chunk => {\r\n data = Buffer.concat([data, chunk])\r\n hash.update(chunk)\r\n })\r\n res.body.on(\"end\", () => {\r\n const hashResult = hash.digest(\"hex\")\r\n\r\n cache2[attachment.url] = hashResult\r\n hashToUrl[hashResult] = attachment.url\r\n\r\n checkHash(hashResult, data, attachment.filename, (result) => {\r\n renderToElements(id, result, attachment.filename)\r\n }, () => {\r\n let elem = document.getElementById(id)\r\n if(elem)elem.remove()\r\n })\r\n })\r\n }).catch(()=>{})\r\n}\r\n\r\nlet flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0]\r\nlet childModule = BDModules.get(e => e.childContainer)[0]\r\n\r\n/**\r\n * \r\n * @param {HTMLDivElement[]} elements \r\n * @param {{type: \"Theme\"|\"Plugin\", name: string, official?: boolean}|{suspect:true, type: \"Theme\"|\"Plugin\", name: string, harm: string}} result\r\n */\r\nfunction renderToElements(id, result, filename){\r\n const div = document.getElementById(id)\r\n if(!div || div.childNodes.length > 0)return // already certified/div does not exist anymore.\r\n\r\n if(!flowerStarModule)flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0]\r\n if(!childModule)childModule = BDModules.get(e => e.childContainer)[0]\r\n \r\n if(result.suspect){\r\n try{\r\n div.parentNode.style.borderColor = \"rgb(240, 71, 71)\"\r\n /**\r\n * \r\n * @param {HTMLElement} node \r\n */\r\n let nextNode = (node) => {\r\n for(let child of node.children){\r\n if(child.tagName === \"A\"){\r\n child.addEventListener(\"click\", (e) => {\r\n e.preventDefault()\r\n e.stopImmediatePropagation()\r\n\r\n Utils.showConfirmationModal(\r\n \"Are you sure you want to download this ?\", \r\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.\", \r\n {\r\n confirmText: \"Download Anyway\",\r\n cancelText: \"Don't !\",\r\n danger: true,\r\n onCancel: () => {},\r\n onConfirm: () => {\r\n electron.remote.shell.openExternal(child.href)\r\n }\r\n }\r\n )\r\n })\r\n }else if([\"div\"].includes(child.tagName.toLowerCase())){\r\n nextNode(child)\r\n }\r\n }\r\n }\r\n nextNode(div.parentNode)\r\n }catch(e){\r\n console.error(e)\r\n }\r\n BDV2.reactDom.render(BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" is potentially dangerous.\"}, \r\n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}},\r\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\"},\r\n BDV2.react.createElement(\"rect\", {\r\n x:\"0\",\r\n y:\"0\",\r\n width:\"32\",\r\n height:\"32\",\r\n mask:\"url(#svg-mask-avatar-status-round-32)\",\r\n fill:\"#f04747\",\r\n mask:\"url(#svg-mask-status-dnd)\",\r\n className:BDModules.get(e => e.pointerEvents)[0].pointerEvents\r\n })\r\n )\r\n )\r\n ), div)\r\n }else if(!result.official){\r\n div.parentNode.style.borderColor = \"#4087ed\"\r\n let span = BDV2.react.createElement(\"span\", {style: {display: \"inherit\"}}, [\r\n BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" is certified by Lightcord.\"}, \r\n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\", float: \"left\"}},\r\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"},\r\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\"})\r\n ),\r\n BDV2.react.createElement(\"div\", {className: childModule.childContainer}, \r\n BDV2.react.createElement(\"svg\", {\"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"}, \r\n BDV2.react.createElement(\"path\", {fill:\"#ffffff\",d:\"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z\"})\r\n )\r\n )\r\n )\r\n ),\r\n BDV2.react.createElement(tooltipWrap, {text: \"Install this \"+result.type.toLowerCase()+\" on Lightcord.\"}, \r\n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}, onClick(){\r\n Utils.showConfirmationModal(\r\n \"Are you sure you want to download this \"+result.type.toLowerCase()+\" ?\", \r\n \"Lightcord will automatically install and launch this \"+result.type.toLowerCase()+\". You don't have anything to do.\", \r\n {\r\n confirmText: \"Download and Install\",\r\n cancelText: \"I've changed my mind\",\r\n danger: false,\r\n onCancel: () => {},\r\n onConfirm: () => {\r\n let link = getKeyedArray(cache2).find(e => e[1] === result.hash)[0]\r\n console.log(link)\r\n nodeFetch(link)\r\n .then(async res => {\r\n if(res.status !== 200)throw new Error(\"Status was not 200\")\r\n let content = await res.buffer()\r\n let installPath = join(result.type === \"Plugin\" ? contentManager._pluginsFolder : contentManager._themesFolder, result.filename)\r\n console.log(installPath)\r\n writeFileSync(installPath, content)\r\n Utils.showToast(result.type+\" succesfully installed.\")\r\n }).catch(err => {\r\n err = err instanceof Error ? err : new Error(err)\r\n Utils.showToast(err.message, {\r\n type: \"error\"\r\n })\r\n })\r\n }\r\n }\r\n )\r\n }},\r\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 24 24\",style:{\r\n color: \"rgb(67, 181, 129)\",\r\n cursor: \"pointer\"\r\n }},\r\n <g fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M0 0h24v24H0z\"></path>\r\n <path class=\"fill\" fill=\"currentColor\" d=\"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z\"></path>\r\n </g>\r\n )\r\n )\r\n )\r\n ])\r\n BDV2.reactDom.render(span, div)\r\n }else{\r\n div.parentNode.style.borderColor = \"#4087ed\"\r\n let span = BDV2.react.createElement(\"span\", {style: {display: \"inherit\"}}, [\r\n BDV2.react.createElement(tooltipWrap, {text: result.type+\" \"+result.name+\" was made by the developers of Lightcord.\", style:\"brand\"}, \r\n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\", float: \"left\"}},\r\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\"}},\r\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\"})\r\n ),\r\n BDV2.react.createElement(\"div\", {className: childModule.childContainer}, \r\n BDV2.react.createElement(\"svg\", {\"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 16 15.2\"}, \r\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\"})\r\n )\r\n )\r\n )\r\n ),\r\n BDV2.react.createElement(tooltipWrap, {text: \"Install this \"+result.type.toLowerCase()+\" on Lightcord.\"}, \r\n BDV2.react.createElement(\"div\", {className: flowerStarModule.flowerStarContainer, style: {width: \"20px\", height: \"20px\"}, onClick(){\r\n Utils.showConfirmationModal(\r\n \"Are you sure you want to download this \"+result.type.toLowerCase()+\" ?\", \r\n \"Lightcord will automatically download and load this \"+result.type.toLowerCase()+\". You must enable it in the settings.\", \r\n {\r\n confirmText: \"Download and Install\",\r\n cancelText: \"I've changed my mind\",\r\n danger: false,\r\n onCancel: () => {},\r\n onConfirm: () => {\r\n let link = getKeyedArray(cache2).find(e => e[1] === result.hash)[0]\r\n \r\n nodeFetch(link)\r\n .then(async res => {\r\n if(res.status !== 200)throw new Error(\"Status was not 200\")\r\n let content = await res.buffer()\r\n let installPath = join(result.type === \"Plugin\" ? contentManager._pluginsFolder : contentManager._themesFolder, result.filename)\r\n \r\n writeFileSync(installPath, content)\r\n Utils.showToast(result.type+\" succesfully installed.\")\r\n }).catch(err => {\r\n err = err instanceof Error ? err : new Error(err)\r\n Utils.showToast(err.message, {\r\n type: \"error\"\r\n })\r\n })\r\n }\r\n }\r\n )\r\n }},\r\n BDV2.react.createElement(\"svg\", {className: flowerStarModule.flowerStar, \"aria-hidden\":\"false\",width:\"20px\",height:\"20px\",viewBox:\"0 0 24 24\",style:{\r\n color: \"rgb(67, 181, 129)\",\r\n cursor: \"pointer\"\r\n }},\r\n <g fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M0 0h24v24H0z\"></path>\r\n <path class=\"fill\" fill=\"currentColor\" d=\"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z\"></path>\r\n </g>\r\n )\r\n )\r\n )\r\n ])\r\n BDV2.reactDom.render(span, div)\r\n }\r\n}\r\n\r\nfunction getKeyedArray(obj){\r\n let arr = []\r\n Object.keys(obj).forEach(k => {\r\n arr.push([k, obj[k]])\r\n })\r\n return arr\r\n}\r\n\r\nlet key = null\r\nlet save = null\r\n\r\nwindow.Lightcord.Api.ensureExported(m=>m.ObjectStorage)\r\n.then(localStorageModule => {\r\n let localStorage = localStorageModule.impl\r\n save = function(){\r\n localStorage.set(\"PluginCertifierKeyEncryption__\", btoa(JSON.stringify(key)))\r\n }\r\n setInterval(() => {\r\n save()\r\n }, 100000);\r\n try{\r\n let val = safeJSONParse(atob(localStorage.get(\"PluginCertifierKeyEncryption__\")))\r\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){\r\n generateKey()\r\n save()\r\n return\r\n }\r\n key = val\r\n }catch(e){\r\n generateKey()\r\n save()\r\n }\r\n})\r\n\r\nfunction generateKey(){\r\n key = [crypto.randomBytes(16).toString(\"base64\"), crypto.randomBytes(32).toString(\"base64\")]\r\n}\r\n\r\nfunction safeJSONParse(json){\r\n try{\r\n return JSON.parse(json)\r\n }catch(e){\r\n return e instanceof Error ? new Error(e) : e\r\n }\r\n}\r\n\r\nexport function decryptSettingsCache(data){\r\n try{\r\n let decipher = crypto.createDecipheriv(\"aes-256-cbc\", Buffer.from(key[1], \"base64\"), Buffer.from(key[0], \"base64\"))\r\n let decrypted = decipher.update(Buffer.from(data, \"base64\"));\r\n decrypted = Buffer.concat([decrypted, decipher.final()]);\r\n return decrypted.toString(\"utf8\")\r\n }catch(e){\r\n return \"{}\"\r\n }\r\n}\r\nexport function encryptSettingsCache(data){\r\n let args = [Buffer.from(key[1], \"base64\"), Buffer.from(key[0], \"base64\")]\r\n \r\n let cipher = crypto.createCipheriv('aes-256-cbc', ...args);\r\n let encrypted = cipher.update(Buffer.from(data, \"utf8\"));\r\n encrypted = Buffer.concat([encrypted, cipher.final()]);\r\n return encrypted.toString(\"base64\")\r\n}","import {bdConfig, bdplugins, bdthemes, settingsCookie} from \"../0globals\";\r\nimport pluginModule from \"./pluginModule\";\r\nimport themeModule from \"./themeModule\";\r\nimport Utils from \"./utils\";\r\nimport dataStore from \"./dataStore\";\r\nimport { encryptSettingsCache, decryptSettingsCache, processFile } from \"./pluginCertifier\";\r\n\r\nconst path = require(\"path\");\r\nconst fs = require(\"fs\");\r\nconst Module = require(\"module\").Module;\r\nModule.globalPaths.push(path.resolve(require(\"electron\").remote.app.getAppPath(), \"node_modules\"));\r\nclass MetaError extends Error {\r\n constructor(message) {\r\n super(message);\r\n this.name = \"MetaError\";\r\n }\r\n}\r\nconst originalJSRequire = Module._extensions[\".js\"];\r\nconst originalCSSRequire = Module._extensions[\".css\"] ? Module._extensions[\".css\"] : () => {return null;};\r\nconst splitRegex = /[^\\S\\r\\n]*?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\r\nconst escapedAtRegex = /^\\\\@/;\r\n\r\nexport let addonCache = {}\r\n\r\nlet hasPatched = false\r\nexport default new class ContentManager {\r\n\r\n constructor() {\r\n this.timeCache = {};\r\n this.watchers = {};\r\n }\r\n\r\n patchExtensions(){\r\n if(hasPatched)return\r\n hasPatched = true\r\n Module._extensions[\".js\"] = this.getContentRequire(\"plugin\");\r\n Module._extensions[\".css\"] = this.getContentRequire(\"theme\");\r\n }\r\n\r\n get pluginsFolder() {return this._pluginsFolder || (this._pluginsFolder = fs.realpathSync(path.resolve(bdConfig.dataPath + \"plugins/\")));}\r\n get themesFolder() {return this._themesFolder || (this._themesFolder = fs.realpathSync(path.resolve(bdConfig.dataPath + \"themes/\")));}\r\n\r\n loadAddonCertifierCache(){\r\n if(typeof dataStore.getSettingGroup(\"PluginCertifierHashes\") !== \"string\"){\r\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(\"{}\"))\r\n }else{\r\n try{\r\n addonCache = JSON.parse(decryptSettingsCache(dataStore.getSettingGroup(\"PluginCertifierHashes\")))\r\n }catch(e){\r\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(\"{}\"))\r\n addonCache = {}\r\n }\r\n }\r\n Object.keys(addonCache)\r\n .forEach(key => {\r\n let value = addonCache[key]\r\n if(!value || typeof value !== \"object\" || Array.isArray(value))return delete addonCache[key]\r\n\r\n let props = [{\r\n key: \"timestamp\",\r\n type: \"number\"\r\n }, {\r\n key: \"result\",\r\n type: \"object\"\r\n }, {\r\n key: \"hash\",\r\n type: \"string\"\r\n }]\r\n for(let prop of props){\r\n if(!(prop.key in value) || typeof value[prop.key] !== prop.type){\r\n delete addonCache[key]\r\n return\r\n }\r\n }\r\n if(value.hash !== key){\r\n delete addonCache[key]\r\n return\r\n }\r\n if(value.result.suspect){ // refetch from remote to be sure you're up to date.\r\n delete addonCache[key]\r\n return\r\n }\r\n })\r\n this.saveAddonCache()\r\n }\r\n\r\n saveAddonCache(){\r\n dataStore.setSettingGroup(\"PluginCertifierHashes\", encryptSettingsCache(JSON.stringify(addonCache)))\r\n }\r\n\r\n watchContent(contentType) {\r\n if (this.watchers[contentType]) return;\r\n const isPlugin = contentType === \"plugin\";\r\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\r\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\r\n this.watchers[contentType] = fs.watch(baseFolder, {persistent: false}, async (eventType, filename) => {\r\n if (!eventType || !filename || !filename.endsWith(fileEnding)) return;\r\n await new Promise(r => setTimeout(r, 50));\r\n try {fs.statSync(path.resolve(baseFolder, filename));}\r\n catch (err) {\r\n if (err.code !== \"ENOENT\") return;\r\n delete this.timeCache[filename];\r\n if (isPlugin) return pluginModule.unloadPlugin(filename);\r\n return themeModule.unloadTheme(filename);\r\n }\r\n if (!fs.statSync(path.resolve(baseFolder, filename)).isFile()) return;\r\n const stats = fs.statSync(path.resolve(baseFolder, filename));\r\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\r\n if (typeof(stats.mtime.getTime()) !== \"number\") return;\r\n if (this.timeCache[filename] == stats.mtime.getTime()) return;\r\n this.timeCache[filename] = stats.mtime.getTime();\r\n if (eventType == \"rename\") {\r\n if (isPlugin) await pluginModule.loadPlugin(filename);\r\n else await themeModule.loadTheme(filename);\r\n }\r\n if (eventType == \"change\") {\r\n if (isPlugin) await pluginModule.reloadPlugin(filename);\r\n else await themeModule.reloadTheme(filename);\r\n }\r\n });\r\n }\r\n\r\n unwatchContent(contentType) {\r\n if (!this.watchers[contentType]) return;\r\n this.watchers[contentType].close();\r\n delete this.watchers[contentType];\r\n }\r\n\r\n extractMeta(content) {\r\n const firstLine = content.split(\"\\n\")[0];\r\n const hasOldMeta = firstLine.includes(\"//META\");\r\n if (hasOldMeta) return this.parseOldMeta(content);\r\n const hasNewMeta = firstLine.includes(\"/**\");\r\n if (hasNewMeta) return this.parseNewMeta(content);\r\n throw new MetaError(\"META was not found.\");\r\n }\r\n\r\n parseOldMeta(content) {\r\n const meta = content.split(\"\\n\")[0];\r\n const rawMeta = meta.substring(meta.lastIndexOf(\"//META\") + 6, meta.lastIndexOf(\"*//\"));\r\n if (meta.indexOf(\"META\") < 0) throw new MetaError(\"META was not found.\");\r\n const parsed = Utils.testJSON(rawMeta);\r\n if (!parsed) throw new MetaError(\"META could not be parsed.\");\r\n if (!parsed.name) throw new MetaError(\"META missing name data.\");\r\n parsed.format = \"json\";\r\n return parsed;\r\n }\r\n\r\n parseNewMeta(content) {\r\n const block = content.split(\"/**\", 2)[1].split(\"*/\", 1)[0];\r\n const out = {};\r\n let field = \"\";\r\n let accum = \"\";\r\n for (const line of block.split(splitRegex)) {\r\n if (line.length === 0) continue;\r\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\r\n out[field] = accum;\r\n const l = line.indexOf(\" \");\r\n field = line.substr(1, l - 1);\r\n accum = line.substr(l + 1);\r\n }\r\n else {\r\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\r\n }\r\n }\r\n out[field] = accum.trim();\r\n delete out[\"\"];\r\n out.format = \"jsdoc\";\r\n return out;\r\n }\r\n\r\n getContentRequire(type) {\r\n const isPlugin = type === \"plugin\";\r\n const self = this;\r\n const originalRequire = isPlugin ? originalJSRequire : originalCSSRequire;\r\n return function(module, filename) {\r\n const baseFolder = isPlugin ? self.pluginsFolder : self.themesFolder;\r\n const possiblePath = path.resolve(baseFolder, path.basename(filename));\r\n if (!fs.existsSync(possiblePath) || filename !== fs.realpathSync(possiblePath)) return Reflect.apply(originalRequire, this, arguments);\r\n let content = fs.readFileSync(filename, \"utf8\");\r\n content = Utils.stripBOM(content);\r\n\r\n const stats = fs.statSync(filename);\r\n const meta = self.extractMeta(content);\r\n meta.filename = path.basename(filename);\r\n meta.added = stats.atimeMs;\r\n meta.modified = stats.mtimeMs;\r\n meta.size = stats.size;\r\n if (!isPlugin) {\r\n meta.css = content;\r\n if (meta.format == \"json\") meta.css = meta.css.split(\"\\n\").slice(1).join(\"\\n\");\r\n content = `module.exports = ${JSON.stringify(meta)};`;\r\n }\r\n if (isPlugin) {\r\n module._compile(content, module.filename);\r\n const didExport = !Utils.isEmpty(module.exports);\r\n if (didExport) {\r\n meta.type = module.exports;\r\n module.exports = meta;\r\n content = \"\";\r\n }\r\n else {\r\n Utils.warn(\"Module Not Exported\", `${meta.name}, please start setting module.exports`);\r\n content += `\\nmodule.exports = ${JSON.stringify(meta)};\\nmodule.exports.type = ${meta.exports || meta.name};`;\r\n }\r\n }\r\n module._compile(content, filename);\r\n };\r\n }\r\n\r\n makePlaceholderPlugin(data) {\r\n return {plugin: {\r\n start: () => {},\r\n getName: () => {return data.name || data.filename;},\r\n getAuthor: () => {return \"???\";},\r\n getDescription: () => {return data.message ? data.message : \"This plugin was unable to be loaded. Check the author's page for updates.\";},\r\n getVersion: () => {return \"???\";}\r\n },\r\n name: data.name || data.filename,\r\n filename: data.filename,\r\n source: data.source ? data.source : \"\",\r\n website: data.website ? data.website : \"\"\r\n };\r\n }\r\n\r\n async loadContent(filename, type) {\r\n if (typeof(filename) === \"undefined\" || typeof(type) === \"undefined\") return;\r\n const isPlugin = type === \"plugin\";\r\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\r\n\r\n if(settingsCookie[\"fork-ps-6\"]){\r\n let result = await new Promise(resolve => {\r\n processFile(path.resolve(baseFolder, filename), (result) => {\r\n console.log(result)\r\n resolve(result)\r\n }, (hash) => {\r\n resolve({\r\n suspect: false,\r\n hash: hash,\r\n filename: filename,\r\n name: filename\r\n })\r\n }, true)\r\n })\r\n if(result){\r\n addonCache[result.hash] = {\r\n timestamp: Date.now(),\r\n hash: result.hash,\r\n result: result\r\n }\r\n this.saveAddonCache()\r\n if(result.suspect){\r\n return {\r\n name: filename,\r\n file: filename,\r\n message: \"This plugin might be dangerous (\"+result.harm+\").\",\r\n error: new Error(\"This plugin might be dangerous (\"+result.harm+\").\")\r\n }\r\n }\r\n }\r\n }\r\n\r\n try {window.require(path.resolve(baseFolder, filename));}\r\n catch (error) {return {name: filename, file: filename, message: \"Could not be compiled.\", error: {message: error.message, stack: error.stack}};}\r\n const content = window.require(path.resolve(baseFolder, filename));\r\n if(!content.name)return {name: filename, file: filename, message: \"Cannot escape the ID.\", error: new Error(\"Cannot read property 'replace' of undefined\")}\r\n content.id = Utils.escapeID(content.name);\r\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.\")}\r\n if (isPlugin) {\r\n if (!content.type) return;\r\n try {\r\n content.plugin = new content.type();\r\n delete bdplugins[content.plugin.getName()];\r\n bdplugins[content.plugin.getName()] = content;\r\n }\r\n catch (error) {return {name: filename, file: filename, message: \"Could not be constructed.\", error: {message: error.message, stack: error.stack}};}\r\n }\r\n else {\r\n delete bdthemes[content.name];\r\n bdthemes[content.name] = content;\r\n }\r\n } \r\n\r\n unloadContent(filename, type) {\r\n if (typeof(filename) === \"undefined\" || typeof(type) === \"undefined\") return;\r\n const isPlugin = type === \"plugin\";\r\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\r\n try {\r\n delete window.require.cache[window.require.resolve(path.resolve(baseFolder, filename))];\r\n }\r\n catch (err) {return {name: filename, file: filename, message: \"Could not be unloaded.\", error: {message: err.message, stack: err.stack}};}\r\n }\r\n\r\n isLoaded(filename, type) {\r\n const isPlugin = type === \"plugin\";\r\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\r\n try {window.require.cache[window.require.resolve(path.resolve(baseFolder, filename))];}\r\n catch (err) {return false;}\r\n return true;\r\n }\r\n\r\n async reloadContent(filename, type) {\r\n const cantUnload = this.unloadContent(filename, type);\r\n if (cantUnload) return cantUnload;\r\n return await this.loadContent(filename, type);\r\n }\r\n\r\n loadNewContent(type) {\r\n const isPlugin = type === \"plugin\";\r\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\r\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\r\n const files = fs.readdirSync(basedir);\r\n const contentList = Object.values(isPlugin ? bdplugins : bdthemes);\r\n const removed = contentList.filter(t => !files.includes(t.filename)).map(c => isPlugin ? c.plugin.getName() : c.name);\r\n const added = files.filter(f => !contentList.find(t => t.filename == f) && f.endsWith(fileEnding) && fs.statSync(path.resolve(basedir, f)).isFile());\r\n return {added, removed};\r\n }\r\n\r\n async loadAllContent(type) {\r\n this.patchExtensions()\r\n const isPlugin = type === \"plugin\";\r\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\r\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\r\n const errors = [];\r\n const files = fs.readdirSync(basedir);\r\n\r\n for (const filename of files) {\r\n if (!fs.statSync(path.resolve(basedir, filename)).isFile() || !filename.endsWith(fileEnding)) continue;\r\n const error = await this.loadContent(filename, type);\r\n if (error) errors.push(error);\r\n }\r\n\r\n return errors;\r\n }\r\n\r\n loadPlugins() {return this.loadAllContent(\"plugin\");}\r\n loadThemes() {return this.loadAllContent(\"theme\");}\r\n};\r\n\r\n/**\r\n * Don't expose contentManager - could be dangerous for now\r\n */","/**\r\n * Copyright 2018 Zachary Rauen\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining\r\n * a copy of this software and associated documentation files (the \"Software\"),\r\n * to deal in the Software without restriction, including without limitation the\r\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is furnished\r\n * to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\r\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\r\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\r\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\r\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\r\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n * \r\n * From: https://github.com/rauenzi/BDPluginLibrary\r\n */\r\n\r\n/**\r\n * @interface\r\n * @name Offset\r\n * @property {number} top - Top offset of the target element.\r\n * @property {number} right - Right offset of the target element.\r\n * @property {number} bottom - Bottom offset of the target element.\r\n * @property {number} left - Left offset of the target element.\r\n * @property {number} height - Outer height of the target element.\r\n * @property {number} width - Outer width of the target element.\r\n */\r\n\r\n /**\r\n * Function that automatically removes added listener.\r\n * @callback module:DOMTools~CancelListener\r\n */\r\n \r\nexport default class DOMTools {\r\n\r\n static escapeID(id) {\r\n return id.replace(/^[^a-z]+|[^\\w-]+/gi, \"-\");\r\n }\r\n\r\n /**\r\n\t * Adds a style to the document.\r\n\t * @param {string} id - identifier to use as the element id\r\n\t * @param {string} css - css to add to the document\r\n\t */\r\n\tstatic addStyle(id, css) {\r\n\t\tdocument.head.append(DOMTools.createElement(`<style id=\"${id}\">${css}</style>`));\r\n\t}\r\n\r\n\t/**\r\n\t * Removes a style from the document.\r\n\t * @param {string} id - original identifier used\r\n\t */\r\n\tstatic removeStyle(id) {\r\n\t\tconst element = document.getElementById(id);\r\n\t\tif (element) element.remove();\r\n\t}\r\n\r\n\t/**\r\n\t * Adds/requires a remote script to be loaded\r\n\t * @param {string} id - identifier to use for this script\r\n\t * @param {string} url - url from which to load the script\r\n\t * @returns {Promise} promise that resolves when the script is loaded\r\n\t */\r\n\tstatic addScript(id, url) {\r\n\t\treturn new Promise(resolve => {\r\n\t\t\tconst script = document.createElement(\"script\");\r\n\t\t\tscript.id = id;\r\n\t\t\tscript.src = url;\r\n\t\t\tscript.type = \"text/javascript\";\r\n\t\t\tscript.onload = resolve;\r\n\t\t\tdocument.head.append(script);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Removes a remote script from the document.\r\n\t * @param {string} id - original identifier used\r\n\t */\r\n\tstatic removeScript(id) {\r\n id = this.escapeID(id);\r\n\t\tconst element = document.getElementById(id);\r\n\t\tif (element) element.remove();\r\n }\r\n \r\n // https://javascript.info/js-animation\r\n static animate({timing = _ => _, update, duration}) {\r\n const start = performance.now();\r\n \r\n requestAnimationFrame(function animate(time) {\r\n // timeFraction goes from 0 to 1\r\n let timeFraction = (time - start) / duration;\r\n if (timeFraction > 1) timeFraction = 1;\r\n \r\n // calculate the current animation state\r\n const progress = timing(timeFraction);\r\n \r\n update(progress); // draw it\r\n \r\n if (timeFraction < 1) {\r\n requestAnimationFrame(animate);\r\n }\r\n \r\n });\r\n }\r\n\r\n /**\r\n * This is my shit version of not having to use `$` from jQuery. Meaning\r\n * that you can pass a selector and it will automatically run {@link module:DOMTools.query}.\r\n * It also means that you can pass a string of html and it will perform and return `parseHTML`.\r\n * @see module:DOMTools.parseHTML\r\n * @see module:DOMTools.query\r\n * @param {string} selector - Selector to query or HTML to parse\r\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - Either the result of `parseHTML` or `query`\r\n */\r\n static Q(selector) {\r\n const element = this.parseHTML(selector);\r\n const isHTML = element instanceof NodeList ? Array.from(element).some(n => n.nodeType === 1) : element.nodeType === 1;\r\n if (isHTML) return element;\r\n return this.query(selector);\r\n }\r\n\r\n /**\r\n * Essentially a shorthand for `document.querySelector`. If the `baseElement` is not provided\r\n * `document` is used by default.\r\n * @param {string} selector - Selector to query\r\n * @param {Element} [baseElement] - Element to base the query from\r\n * @returns {(Element|null)} - The found element or null if not found\r\n */\r\n static query(selector, baseElement = document) {\r\n return baseElement.querySelector(selector);\r\n }\r\n\r\n /**\r\n * Essentially a shorthand for `document.querySelectorAll`. If the `baseElement` is not provided\r\n * `document` is used by default.\r\n * @param {string} selector - Selector to query\r\n * @param {Element} [baseElement] - Element to base the query from\r\n * @returns {Array<Element>} - Array of all found elements\r\n */\r\n static queryAll(selector, baseElement = document) {\r\n return baseElement.querySelectorAll(selector);\r\n }\r\n\r\n /**\r\n * Parses a string of HTML and returns the results. If the second parameter is true,\r\n * the parsed HTML will be returned as a document fragment {@see https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment}.\r\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.\r\n * \r\n * If the second parameter is false, then the return value will be the list of parsed\r\n * nodes and there were multiple top level nodes, otherwise the single node is returned.\r\n * @param {string} html - HTML to be parsed\r\n * @param {boolean} [fragment=false] - Whether or not the return should be the raw `DocumentFragment`\r\n * @returns {(DocumentFragment|NodeList|HTMLElement)} - The result of HTML parsing\r\n */\r\n static parseHTML(html, fragment = false) {\r\n const template = document.createElement(\"template\");\r\n template.innerHTML = html;\r\n const node = template.content.cloneNode(true);\r\n if (fragment) return node;\r\n return node.childNodes.length > 1 ? node.childNodes : node.childNodes[0];\r\n }\r\n\r\n /** Alternate name for {@link module:DOMTools.parseHTML} */\r\n static createElement(html, fragment = false) {return this.parseHTML(html, fragment);}\r\n \r\n /**\r\n * Takes a string of html and escapes it using the brower's own escaping mechanism.\r\n * @param {String} html - html to be escaped\r\n */\r\n static escapeHTML(html) {\r\n const textNode = document.createTextNode(\"\");\r\n const spanElement = document.createElement(\"span\");\r\n spanElement.append(textNode);\r\n textNode.nodeValue = html;\r\n return spanElement.innerHTML;\r\n }\r\n\r\n /**\r\n * Adds a list of classes from the target element.\r\n * @param {Element} element - Element to edit classes of\r\n * @param {...string} classes - Names of classes to add\r\n * @returns {Element} - `element` to allow for chaining\r\n */\r\n static addClass(element, ...classes) {\r\n classes = classes.flat().filter(c => c);\r\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\r\n classes = classes.flat().filter(c => c);\r\n element.classList.add(...classes);\r\n return element;\r\n }\r\n\r\n /**\r\n * Removes a list of classes from the target element.\r\n * @param {Element} element - Element to edit classes of\r\n * @param {...string} classes - Names of classes to remove\r\n * @returns {Element} - `element` to allow for chaining\r\n */\r\n static removeClass(element, ...classes) {\r\n for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(\" \");\r\n classes = classes.flat().filter(c => c);\r\n element.classList.remove(...classes);\r\n return element;\r\n }\r\n\r\n /**\r\n * When only one argument is present: Toggle class value;\r\n * i.e., if class exists then remove it and return false, if not, then add it and return true.\r\n * When a second argument is present:\r\n * If the second argument evaluates to true, add specified class value, and if it evaluates to false, remove it.\r\n * @param {Element} element - Element to edit classes of\r\n * @param {string} classname - Name of class to toggle\r\n * @param {boolean} [indicator] - Optional indicator for if the class should be toggled\r\n * @returns {Element} - `element` to allow for chaining\r\n */\r\n static toggleClass(element, classname, indicator) {\r\n classname = classname.toString().split(\" \").filter(c => c);\r\n if (typeof(indicator) !== \"undefined\") classname.forEach(c => element.classList.toggle(c, indicator));\r\n else classname.forEach(c => element.classList.toggle(c));\r\n return element;\r\n }\r\n\r\n /**\r\n * Checks if an element has a specific class\r\n * @param {Element} element - Element to edit classes of\r\n * @param {string} classname - Name of class to check\r\n * @returns {boolean} - `true` if the element has the class, `false` otherwise.\r\n */\r\n static hasClass(element, classname) {\r\n return classname.toString().split(\" \").filter(c => c).every(c => element.classList.contains(c));\r\n }\r\n\r\n /**\r\n * Replaces one class with another\r\n * @param {Element} element - Element to edit classes of\r\n * @param {string} oldName - Name of class to replace\r\n * @param {string} newName - New name for the class\r\n * @returns {Element} - `element` to allow for chaining\r\n */\r\n static replaceClass(element, oldName, newName) {\r\n element.classList.replace(oldName, newName);\r\n return element;\r\n }\r\n\r\n /**\r\n * Appends `thisNode` to `thatNode`\r\n * @param {Node} thisNode - Node to be appended to another node\r\n * @param {Node} thatNode - Node for `thisNode` to be appended to\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\r\n static appendTo(thisNode, thatNode) {\r\n if (typeof(thatNode) == \"string\") thatNode = this.query(thatNode);\r\n if (!thatNode) return null;\r\n thatNode.append(thisNode);\r\n return thisNode;\r\n }\r\n\r\n /**\r\n * Prepends `thisNode` to `thatNode`\r\n * @param {Node} thisNode - Node to be prepended to another node\r\n * @param {Node} thatNode - Node for `thisNode` to be prepended to\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\r\n static prependTo(thisNode, thatNode) {\r\n if (typeof(thatNode) == \"string\") thatNode = this.query(thatNode);\r\n if (!thatNode) return null;\r\n thatNode.prepend(thisNode);\r\n return thisNode;\r\n }\r\n\r\n /**\r\n * Insert after a specific element, similar to jQuery's `thisElement.insertAfter(otherElement)`.\r\n * @param {Node} thisNode - The node to insert\r\n * @param {Node} targetNode - Node to insert after in the tree\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\r\n static insertAfter(thisNode, targetNode) {\r\n targetNode.parentNode.insertBefore(thisNode, targetNode.nextSibling);\r\n return thisNode;\r\n }\r\n\r\n /**\r\n * Insert after a specific element, similar to jQuery's `thisElement.after(newElement)`.\r\n * @param {Node} thisNode - The node to insert\r\n * @param {Node} newNode - Node to insert after in the tree\r\n * @returns {Node} - `thisNode` to allow for chaining\r\n */\r\n static after(thisNode, newNode) {\r\n thisNode.parentNode.insertBefore(newNode, thisNode.nextSibling);\r\n return thisNode;\r\n }\r\n\r\n /**\r\n * Gets the next sibling element that matches the selector.\r\n * @param {Element} element - Element to get the next sibling of\r\n * @param {string} [selector=\"\"] - Optional selector\r\n * @returns {Element} - The sibling element\r\n */\r\n static next(element, selector = \"\") {\r\n return selector ? element.querySelector(\"+ \" + selector) : element.nextElementSibling;\r\n }\r\n\r\n /**\r\n * Gets all subsequent siblings.\r\n * @param {Element} element - Element to get next siblings of\r\n * @returns {NodeList} - The list of siblings\r\n */\r\n static nextAll(element) {\r\n return element.querySelectorAll(\"~ *\");\r\n }\r\n\r\n /**\r\n * Gets the subsequent siblings until an element matches the selector.\r\n * @param {Element} element - Element to get the following siblings of\r\n * @param {string} selector - Selector to stop at\r\n * @returns {Array<Element>} - The list of siblings\r\n */\r\n static nextUntil(element, selector) {\r\n const next = []; \r\n while (element.nextElementSibling && !element.nextElementSibling.matches(selector)) next.push(element = element.nextElementSibling);\r\n return next;\r\n }\r\n\r\n /**\r\n * Gets the previous sibling element that matches the selector.\r\n * @param {Element} element - Element to get the previous sibling of\r\n * @param {string} [selector=\"\"] - Optional selector\r\n * @returns {Element} - The sibling element\r\n */\r\n static previous(element, selector = \"\") {\r\n const previous = element.previousElementSibling;\r\n if (selector) return previous && previous.matches(selector) ? previous : null;\r\n return previous;\r\n }\r\n\r\n /**\r\n * Gets all preceeding siblings.\r\n * @param {Element} element - Element to get preceeding siblings of\r\n * @returns {NodeList} - The list of siblings\r\n */\r\n static previousAll(element) {\r\n const previous = [];\r\n while (element.previousElementSibling) previous.push(element = element.previousElementSibling);\r\n return previous;\r\n }\r\n\r\n /**\r\n * Gets the preceeding siblings until an element matches the selector.\r\n * @param {Element} element - Element to get the preceeding siblings of\r\n * @param {string} selector - Selector to stop at\r\n * @returns {Array<Element>} - The list of siblings\r\n */\r\n static previousUntil(element, selector) {\r\n const previous = []; \r\n while (element.previousElementSibling && !element.previousElementSibling.matches(selector)) previous.push(element = element.previousElementSibling);\r\n return previous;\r\n }\r\n\r\n /**\r\n * Find which index in children a certain node is. Similar to jQuery's `$.index()`\r\n * @param {HTMLElement} node - The node to find its index in parent\r\n * @returns {number} Index of the node\r\n */\r\n static indexInParent(node) {\r\n const children = node.parentNode.childNodes;\r\n let num = 0;\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i] == node) return num;\r\n if (children[i].nodeType == 1) num++;\r\n }\r\n return -1;\r\n }\r\n\r\n /** Shorthand for {@link module:DOMTools.indexInParent} */\r\n static index(node) {return this.indexInParent(node);}\r\n\r\n /**\r\n * Gets the parent of the element if it matches the selector,\r\n * otherwise returns null.\r\n * @param {Element} element - Element to get parent of\r\n * @param {string} [selector=\"\"] - Selector to match parent\r\n * @returns {(Element|null)} - The sibling element or null\r\n */\r\n static parent(element, selector = \"\") {\r\n return !selector || element.parentElement.matches(selector) ? element.parentElement : null;\r\n }\r\n\r\n /**\r\n * Gets all children of Element that match the selector if provided.\r\n * @param {Element} element - Element to get all children of\r\n * @param {string} selector - Selector to match the children to\r\n * @returns {Array<Element>} - The list of children\r\n */\r\n static findChild(element, selector) {\r\n return element.querySelector(\":scope > \" + selector);\r\n }\r\n\r\n /**\r\n * Gets all children of Element that match the selector if provided.\r\n * @param {Element} element - Element to get all children of\r\n * @param {string} selector - Selector to match the children to\r\n * @returns {Array<Element>} - The list of children\r\n */\r\n static findChildren(element, selector) {\r\n return element.querySelectorAll(\":scope > \" + selector);\r\n }\r\n\r\n /**\r\n * Gets all ancestors of Element that match the selector if provided.\r\n * @param {Element} element - Element to get all parents of\r\n * @param {string} [selector=\"\"] - Selector to match the parents to\r\n * @returns {Array<Element>} - The list of parents\r\n */\r\n static parents(element, selector = \"\") {\r\n const parents = [];\r\n if (selector) while (element.parentElement && element.parentElement.closest(selector)) parents.push(element = element.parentElement.closest(selector));\r\n else while (element.parentElement) parents.push(element = element.parentElement);\r\n return parents;\r\n }\r\n\r\n /**\r\n * Gets the ancestors until an element matches the selector.\r\n * @param {Element} element - Element to get the ancestors of\r\n * @param {string} selector - Selector to stop at\r\n * @returns {Array<Element>} - The list of parents\r\n */\r\n static parentsUntil(element, selector) {\r\n const parents = [];\r\n while (element.parentElement && !element.parentElement.matches(selector)) parents.push(element = element.parentElement);\r\n return parents;\r\n }\r\n\r\n /**\r\n * Gets all siblings of the element that match the selector.\r\n * @param {Element} element - Element to get all siblings of\r\n * @param {string} [selector=\"*\"] - Selector to match the siblings to\r\n * @returns {Array<Element>} - The list of siblings\r\n */\r\n static siblings(element, selector = \"*\") {\r\n return Array.from(element.parentElement.children).filter(e => e != element && e.matches(selector));\r\n }\r\n\r\n /**\r\n * Sets or gets css styles for a specific element. If `value` is provided\r\n * then it sets the style and returns the element to allow for chaining,\r\n * otherwise returns the style. \r\n * @param {Element} element - Element to set the CSS of\r\n * @param {string} attribute - Attribute to get or set\r\n * @param {string} [value] - Value to set for attribute\r\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\r\n */\r\n static css(element, attribute, value) {\r\n if (typeof(value) == \"undefined\") return global.getComputedStyle(element)[attribute];\r\n element.style[attribute] = value;\r\n return element;\r\n }\r\n\r\n /**\r\n * Sets or gets the width for a specific element. If `value` is provided\r\n * then it sets the width and returns the element to allow for chaining,\r\n * otherwise returns the width. \r\n * @param {Element} element - Element to set the CSS of\r\n * @param {string} [value] - Width to set\r\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\r\n */\r\n static width(element, value) {\r\n if (typeof(value) == \"undefined\") return parseInt(getComputedStyle(element).width);\r\n element.style.width = value;\r\n return element;\r\n }\r\n\r\n /**\r\n * Sets or gets the height for a specific element. If `value` is provided\r\n * then it sets the height and returns the element to allow for chaining,\r\n * otherwise returns the height. \r\n * @param {Element} element - Element to set the CSS of\r\n * @param {string} [value] - Height to set\r\n * @returns {Element|string} - When setting a value, element is returned for chaining, otherwise the value is returned.\r\n */\r\n static height(element, value) {\r\n if (typeof(value) == \"undefined\") return parseInt(getComputedStyle(element).height);\r\n element.style.height = value;\r\n return element;\r\n }\r\n\r\n /**\r\n * Sets the inner text of an element if given a value, otherwise returns it.\r\n * @param {Element} element - Element to set the text of\r\n * @param {string} [text] - Content to set\r\n * @returns {string} - Either the string set by this call or the current text content of the node.\r\n */\r\n static text(element, text) {\r\n if (typeof(text) == \"undefined\") return element.textContent;\r\n return element.textContent = text;\r\n }\r\n\r\n /**\r\n * Returns the innerWidth of the element.\r\n * @param {Element} element - Element to retrieve inner width of\r\n * @return {number} - The inner width of the element.\r\n */\r\n static innerWidth(element) {\r\n return element.clientWidth;\r\n }\r\n\r\n /**\r\n * Returns the innerHeight of the element.\r\n * @param {Element} element - Element to retrieve inner height of\r\n * @return {number} - The inner height of the element.\r\n */\r\n static innerHeight(element) {\r\n return element.clientHeight;\r\n }\r\n\r\n /**\r\n * Returns the outerWidth of the element.\r\n * @param {Element} element - Element to retrieve outer width of\r\n * @return {number} - The outer width of the element.\r\n */\r\n static outerWidth(element) {\r\n return element.offsetWidth;\r\n }\r\n\r\n /**\r\n * Returns the outerHeight of the element.\r\n * @param {Element} element - Element to retrieve outer height of\r\n * @return {number} - The outer height of the element.\r\n */\r\n static outerHeight(element) {\r\n return element.offsetHeight;\r\n }\r\n\r\n /**\r\n * Gets the offset of the element in the page.\r\n * @param {Element} element - Element to get offset of\r\n * @return {Offset} - The offset of the element\r\n */\r\n static offset(element) {\r\n return element.getBoundingClientRect();\r\n }\r\n\r\n static get listeners() { return this._listeners || (this._listeners = {}); }\r\n\r\n /**\r\n * This is similar to jQuery's `on` function and can *hopefully* be used in the same way.\r\n * \r\n * Rather than attempt to explain, I'll show some example usages.\r\n * \r\n * The following will add a click listener (in the `myPlugin` namespace) to `element`.\r\n * `DOMTools.on(element, \"click.myPlugin\", () => {console.log(\"clicked!\");});`\r\n * \r\n * The following will add a click listener (in the `myPlugin` namespace) to `element` that only fires when the target is a `.block` element.\r\n * `DOMTools.on(element, \"click.myPlugin\", \".block\", () => {console.log(\"clicked!\");});`\r\n * \r\n * The following will add a click listener (without namespace) to `element`.\r\n * `DOMTools.on(element, \"click\", () => {console.log(\"clicked!\");});`\r\n * \r\n * The following will add a click listener (without namespace) to `element` that only fires once.\r\n * `const cancel = DOMTools.on(element, \"click\", () => {console.log(\"fired!\"); cancel();});`\r\n * \r\n * @param {Element} element - Element to add listener to\r\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\r\n * @param {(string|callable)} delegate - Selector to run on element to listen to\r\n * @param {callable} [callback] - Function to fire on event\r\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\r\n */\r\n static on(element, event, delegate, callback) {\r\n const [type, namespace] = event.split(\".\");\r\n const hasDelegate = delegate && callback;\r\n if (!callback) callback = delegate;\r\n const eventFunc = !hasDelegate ? callback : function(event) {\r\n if (event.target.matches(delegate)) {\r\n callback(event);\r\n }\r\n };\r\n\r\n element.addEventListener(type, eventFunc);\r\n const cancel = () => {\r\n element.removeEventListener(type, eventFunc);\r\n };\r\n if (namespace) {\r\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\r\n const newCancel = () => {\r\n cancel();\r\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\r\n };\r\n this.listeners[namespace].push({\r\n event: type,\r\n element: element,\r\n cancel: newCancel\r\n });\r\n return newCancel;\r\n }\r\n return cancel;\r\n }\r\n\r\n /**\r\n * Functionality for this method matches {@link module:DOMTools.on} but automatically cancels itself\r\n * and removes the listener upon the first firing of the desired event.\r\n * \r\n * @param {Element} element - Element to add listener to\r\n * @param {string} event - Event to listen to with option namespace (e.g. \"event.namespace\")\r\n * @param {(string|callable)} delegate - Selector to run on element to listen to\r\n * @param {callable} [callback] - Function to fire on event\r\n * @returns {module:DOMTools~CancelListener} - A function that will undo the listener\r\n */\r\n static once(element, event, delegate, callback) {\r\n const [type, namespace] = event.split(\".\");\r\n const hasDelegate = delegate && callback;\r\n if (!callback) callback = delegate;\r\n const eventFunc = !hasDelegate ? function(event) {\r\n callback(event);\r\n element.removeEventListener(type, eventFunc);\r\n } : function(event) {\r\n if (!event.target.matches(delegate)) return;\r\n callback(event);\r\n element.removeEventListener(type, eventFunc);\r\n };\r\n\r\n element.addEventListener(type, eventFunc);\r\n const cancel = () => {\r\n element.removeEventListener(type, eventFunc);\r\n };\r\n if (namespace) {\r\n if (!this.listeners[namespace]) this.listeners[namespace] = [];\r\n const newCancel = () => {\r\n cancel();\r\n this.listeners[namespace].splice(this.listeners[namespace].findIndex(l => l.event == type && l.element == element), 1);\r\n };\r\n this.listeners[namespace].push({\r\n event: type,\r\n element: element,\r\n cancel: newCancel\r\n });\r\n return newCancel;\r\n }\r\n return cancel;\r\n }\r\n\r\n static __offAll(event, element) {\r\n const [type, namespace] = event.split(\".\");\r\n let matchFilter = listener => listener.event == type, defaultFilter = _ => _;\r\n if (element) matchFilter = l => l.event == type && l.element == element, defaultFilter = l => l.element == element;\r\n const listeners = this.listeners[namespace] || [];\r\n const list = type ? listeners.filter(matchFilter) : listeners.filter(defaultFilter);\r\n for (let c = 0; c < list.length; c++) list[c].cancel();\r\n }\r\n \r\n /**\r\n * This is similar to jQuery's `off` function and can *hopefully* be used in the same way.\r\n * \r\n * Rather than attempt to explain, I'll show some example usages.\r\n * \r\n * The following will remove a click listener called `onClick` (in the `myPlugin` namespace) from `element`.\r\n * `DOMTools.off(element, \"click.myPlugin\", onClick);`\r\n * \r\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.\r\n * `DOMTools.off(element, \"click.myPlugin\", \".block\", onClick);`\r\n * \r\n * The following will remove a click listener (without namespace) from `element`.\r\n * `DOMTools.off(element, \"click\", onClick);`\r\n * \r\n * The following will remove all listeners in namespace `myPlugin` from `element`.\r\n * `DOMTools.off(element, \".myPlugin\");`\r\n * \r\n * The following will remove all click listeners in namespace `myPlugin` from *all elements*.\r\n * `DOMTools.off(\"click.myPlugin\");`\r\n * \r\n * The following will remove all listeners in namespace `myPlugin` from *all elements*.\r\n * `DOMTools.off(\".myPlugin\");`\r\n * \r\n * @param {(Element|string)} element - Element to remove listener from\r\n * @param {string} [event] - Event to listen to with option namespace (e.g. \"event.namespace\")\r\n * @param {(string|callable)} [delegate] - Selector to run on element to listen to\r\n * @param {callable} [callback] - Function to fire on event\r\n * @returns {Element} - The original element to allow for chaining\r\n */\r\n static off(element, event, delegate, callback) {\r\n if (typeof(element) == \"string\") return this.__offAll(element);\r\n const [type, namespace] = event.split(\".\");\r\n if (namespace) return this.__offAll(event, element);\r\n\r\n const hasDelegate = delegate && callback;\r\n if (!callback) callback = delegate;\r\n const eventFunc = !hasDelegate ? callback : function(event) {\r\n if (event.target.matches(delegate)) {\r\n callback(event);\r\n }\r\n };\r\n\r\n element.removeEventListener(type, eventFunc);\r\n return element;\r\n }\r\n\r\n /**\r\n * Adds a listener for when the node is added/removed from the document body.\r\n * The listener is automatically removed upon firing.\r\n * @param {HTMLElement} node - node to wait for\r\n * @param {callable} callback - function to be performed on event\r\n * @param {boolean} onMount - determines if it should fire on Mount or on Unmount\r\n */\r\n static onMountChange(node, callback, onMount = true) {\r\n const wrappedCallback = () => {\r\n this.observer.unsubscribe(wrappedCallback);\r\n callback();\r\n };\r\n this.observer.subscribe(wrappedCallback, mutation => {\r\n const nodes = Array.from(onMount ? mutation.addedNodes : mutation.removedNodes);\r\n const directMatch = nodes.indexOf(node) > -1;\r\n const parentMatch = nodes.some(parent => parent.contains(node));\r\n return directMatch || parentMatch;\r\n });\r\n return node;\r\n }\r\n\r\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `true` */\r\n static onMount(node, callback) { return this.onMountChange(node, callback); }\r\n\r\n /** Shorthand for {@link module:DOMTools.onMountChange} with third parameter `false` */\r\n static onUnmount(node, callback) { return this.onMountChange(node, callback, false); }\r\n\r\n /** Alias for {@link module:DOMTools.onMount} */\r\n static onAdded(node, callback) { return this.onMount(node, callback); }\r\n\r\n /** Alias for {@link module:DOMTools.onUnmount} */\r\n static onRemoved(node, callback) { return this.onUnmount(node, callback, false); }\r\n\r\n /**\r\n * Helper function which combines multiple elements into one parent element\r\n * @param {Array<HTMLElement>} elements - array of elements to put into a single parent\r\n */\r\n static wrap(elements) {\r\n const domWrapper = this.parseHTML(`<div class=\"dom-wrapper\"></div>`);\r\n for (let e = 0; e < elements.length; e++) domWrapper.appendChild(elements[e]);\r\n return domWrapper;\r\n }\r\n\r\n /**\r\n * Resolves the node to an HTMLElement. This is mainly used by library modules.\r\n * @param {(jQuery|Element)} node - node to resolve\r\n */\r\n static resolveElement(node) {\r\n if (!(node instanceof jQuery) && !(node instanceof Element)) return undefined;\r\n return node instanceof jQuery ? node[0] : node;\r\n }\r\n}\r\n\r\nwindow.Lightcord.BetterDiscord.DOM = DOMTools","import {bdthemeErrors, themeCookie, settingsCookie, bdthemes} from \"../0globals\";\r\nimport ContentManager from \"./contentManager\";\r\nimport DataStore from \"./dataStore\";\r\nimport BDEvents from \"./bdEvents\";\r\nimport Utils from \"./utils\";\r\nimport DOM from \"./domtools\";\r\nimport bdEvents from \"./bdEvents\";\r\n\r\nclass ThemeModule {\r\n constructor(){\r\n window.Lightcord.BetterDiscord.ThemeModule = this\r\n }\r\n get folder() {return ContentManager.themesFolder;}\r\n}\r\n\r\nThemeModule.prototype.loadThemes = async function () {\r\n this.loadThemeData();\r\n bdthemeErrors.splice(0, 0, ...(await ContentManager.loadThemes()));\r\n const themes = Object.keys(bdthemes);\r\n\r\n for (let i = 0; i < themes.length; i++) {\r\n const theme = bdthemes[themes[i]];\r\n if (!themeCookie[theme.name]) themeCookie[theme.name] = false;\r\n if (themeCookie[theme.name]) DOM.addStyle(DOM.escapeID(theme.id), unescape(theme.css));\r\n\r\n await new Promise((resolve) => setTimeout(resolve, 10))\r\n }\r\n for (const theme in themeCookie) {\r\n if (!bdthemes[theme]) delete themeCookie[theme];\r\n }\r\n this.saveThemeData();\r\n // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"theme\");\r\n};\r\n\r\nThemeModule.prototype.enableTheme = function(name, reload = false) {\r\n themeCookie[name] = true;\r\n this.saveThemeData();\r\n const theme = bdthemes[name];\r\n DOM.addStyle(DOM.escapeID(theme.id), unescape(theme.css));\r\n bdEvents.dispatch(\"theme-enabled\")\r\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${theme.name} v${theme.version} has been applied.`);\r\n};\r\n\r\nThemeModule.prototype.enable = function (name, reload = false) {\r\n return this.enableTheme(name, reload);\r\n};\r\n\r\nThemeModule.prototype.disableTheme = function(name, reload = false) {\r\n themeCookie[name] = false;\r\n this.saveThemeData();\r\n const theme = bdthemes[name];\r\n DOM.removeStyle(DOM.escapeID(theme.id));\r\n bdEvents.dispatch(\"theme-disabled\")\r\n if (settingsCookie[\"fork-ps-2\"] && !reload) Utils.showToast(`${theme.name} v${theme.version} has been disabled.`);\r\n};\r\n\r\nThemeModule.prototype.disable = function (name, reload = false) {\r\n return this.disableTheme(name, reload);\r\n};\r\n\r\nThemeModule.prototype.toggleTheme = function(theme) {\r\n if (themeCookie[theme]) this.disableTheme(theme);\r\n else this.enableTheme(theme);\r\n};\r\n\r\nThemeModule.prototype.toggle = function (name) {\r\n return this.toggleTheme(name);\r\n};\r\n\r\nThemeModule.prototype.loadTheme = async function(filename) {\r\n const error = await ContentManager.loadContent(filename, \"theme\");\r\n if (error) {\r\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\r\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${filename} could not be loaded. It may not have been loaded.`, {type: \"error\"});\r\n return Utils.err(\"ContentManager\", `${filename} could not be loaded.`, error);\r\n }\r\n const theme = Object.values(bdthemes).find(p => p.filename == filename);\r\n Utils.log(\"ContentManager\", `${theme.name} v${theme.version} was loaded.`);\r\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme.name} v${theme.version} was loaded.`, {type: \"success\"});\r\n BDEvents.dispatch(\"theme-loaded\", theme.name);\r\n};\r\n\r\nThemeModule.prototype.unloadTheme = function(filenameOrName) {\r\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\r\n if (!bdtheme) return;\r\n const theme = bdtheme.name;\r\n if (themeCookie[theme]) this.disableTheme(theme, true);\r\n const error = ContentManager.unloadContent(bdthemes[theme].filename, \"theme\");\r\n delete bdthemes[theme];\r\n if (error) {\r\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\r\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} could not be unloaded. It may have not been loaded yet.`, {type: \"error\"});\r\n return Utils.err(\"ContentManager\", `${theme} could not be unloaded. It may have not been loaded yet.`, error);\r\n }\r\n Utils.log(\"ContentManager\", `${theme} was unloaded.`);\r\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} was unloaded.`, {type: \"success\"});\r\n BDEvents.dispatch(\"theme-unloaded\", theme);\r\n};\r\n\r\nThemeModule.prototype.delete = function(filenameOrName) {\r\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\r\n if (!bdtheme) return;\r\n this.unloadTheme(bdtheme.filename);\r\n const fullPath = require(\"path\").resolve(ContentManager.themesFolder, bdtheme.filename);\r\n require(\"fs\").unlinkSync(fullPath);\r\n};\r\n\r\nThemeModule.prototype.reloadTheme = async function(filenameOrName) {\r\n const bdtheme = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\r\n if (!bdtheme) return this.loadTheme(filenameOrName);\r\n const theme = bdtheme.name;\r\n const error = await ContentManager.reloadContent(bdthemes[theme].filename, \"theme\");\r\n if (themeCookie[theme]) this.disableTheme(theme, true), this.enableTheme(theme, true);\r\n if (error) {\r\n if (settingsCookie[\"fork-ps-1\"]) Utils.showContentErrors({themes: [error]});\r\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} could not be reloaded.`, {type: \"error\"});\r\n return Utils.err(\"ContentManager\", `${theme} could not be reloaded.`, error);\r\n }\r\n Utils.log(\"ContentManager\", `${theme} v${bdthemes[theme].version} was reloaded.`);\r\n if (settingsCookie[\"fork-ps-2\"]) Utils.showToast(`${theme} v${bdthemes[theme].version} was reloaded.`, {type: \"success\"});\r\n BDEvents.dispatch(\"theme-reloaded\", theme);\r\n};\r\n\r\nThemeModule.prototype.reload = function(name) {\r\n return this.reloadTheme(name);\r\n};\r\n\r\nThemeModule.prototype.edit = function(filenameOrName) {\r\n const bdplugin = Object.values(bdthemes).find(p => p.filename == filenameOrName) || bdthemes[filenameOrName];\r\n if (!bdplugin) return;\r\n const fullPath = require(\"path\").resolve(ContentManager.themesFolder, bdplugin.filename);\r\n require(\"electron\").shell.openItem(`${fullPath}`);\r\n};\r\n\r\nThemeModule.prototype.updateThemeList = function() {\r\n const results = ContentManager.loadNewContent(\"theme\");\r\n for (const filename of results.added) this.loadTheme(filename);\r\n for (const name of results.removed) this.unloadTheme(name);\r\n};\r\n\r\nThemeModule.prototype.loadThemeData = function() {\r\n const saved = DataStore.getSettingGroup(\"themes\");\r\n if (saved) {\r\n Object.assign(themeCookie, saved);\r\n }\r\n};\r\n\r\nThemeModule.prototype.saveThemeData = function () {\r\n DataStore.setSettingGroup(\"themes\", themeCookie);\r\n};\r\n\r\nexport default new ThemeModule();","import {settings} from \"../0globals\";\r\nimport themeModule from \"./themeModule\";\r\n\r\nexport default new class V2 {\r\n\r\n constructor() {\r\n this.editorDetached = false;\r\n this.WebpackModules = (() => {\r\n const req = webpackJsonp.push([[], {__extra_id__: (module, exports, req) => module.exports = req}, [[\"__extra_id__\"]]]);\r\n delete req.m.__extra_id__;\r\n delete req.c.__extra_id__;\r\n\r\n const shouldProtect = theModule => {\r\n if (theModule.remove && theModule.set && theModule.clear && theModule.get && !theModule.sort) return true;\r\n if (theModule.getToken || theModule.getEmail || theModule.showToken) return true;\r\n return false;\r\n };\r\n\r\n const protect = (theModule, isDefault) => {\r\n let mod = !isDefault ? theModule.default : theModule\r\n if(!mod)return theModule\r\n if (mod.remove && mod.set && mod.clear && mod.get && !mod.sort) return null;\r\n if (!mod.getToken && !mod.getEmail && !mod.showToken)return theModule\r\n\r\n const proxy = new Proxy(mod, {\r\n getOwnPropertyDescriptor: function(obj, prop) {\r\n if (prop === \"getToken\" || prop === \"getEmail\" || prop === \"showToken\") return undefined;\r\n return Object.getOwnPropertyDescriptor(obj, prop);\r\n },\r\n get: function(obj, func) {\r\n if (func == \"getToken\" && obj.getToken) return () => \"mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa\";\r\n if (func == \"getEmail\" && obj.getEmail) return () => \"puppet11112@gmail.com\";\r\n if (func == \"showToken\" && obj.showToken) return () => true;\r\n if (func == \"__proto__\" && obj.__proto__) return proxy;\r\n \r\n return obj[func];\r\n }\r\n });\r\n\r\n if(!isDefault){\r\n return Object.assign({}, theModule, {default: proxy})\r\n }\r\n\r\n return proxy;\r\n };\r\n\r\n const find = (filter) => {\r\n for (const i in req.c) {\r\n if (req.c.hasOwnProperty(i)) {\r\n const m = req.c[i].exports;\r\n if (m && m.__esModule && m.default && filter(m.default)) return protect(m.default, true);\r\n if (m && filter(m))\treturn protect(m, false);\r\n }\r\n }\r\n // console.warn(\"Cannot find loaded module in cache\");\r\n return null;\r\n };\r\n\r\n const findAll = (filter) => {\r\n const modules = [];\r\n for (const i in req.c) {\r\n if (req.c.hasOwnProperty(i)) {\r\n const m = req.c[i].exports;\r\n if (m && m.__esModule && m.default && filter(m.default)) modules.push(protect(m.default, true));\r\n else if (m && filter(m)) modules.push(protect(m, false));\r\n }\r\n }\r\n return modules;\r\n };\r\n\r\n const findByUniqueProperties = (propNames) => find(module => propNames.every(prop => module[prop] !== undefined));\r\n const findByPrototypes = (protoNames) => find(module => module.prototype && protoNames.every(protoProp => module.prototype[protoProp] !== undefined));\r\n const findByDisplayName = (displayName) => find(module => module.displayName === displayName);\r\n\r\n return {find, findAll, findByUniqueProperties, findByPrototypes, findByDisplayName};\r\n })();\r\n\r\n this.internal = {\r\n react: this.WebpackModules.findByUniqueProperties([\"Component\", \"PureComponent\", \"Children\", \"createElement\", \"cloneElement\"]),\r\n reactDom: this.WebpackModules.findByUniqueProperties([\"findDOMNode\"])\r\n };\r\n this.getInternalInstance = e => e[Object.keys(e).find(k => k.startsWith(\"__reactInternalInstance\"))];\r\n window.Lightcord.BetterDiscord.V2 = this\r\n }\r\n\r\n initialize() {\r\n\r\n }\r\n\r\n joinBD1() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"0Tmfo5ZbORCRqbAd\");}\r\n leaveBD1() {this.GuildActions.leaveGuild(\"86004744966914048\");}\r\n\r\n joinBD2() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"2HScm8j\");}\r\n leaveBD2() {this.GuildActions.leaveGuild(\"280806472928198656\");}\r\n\r\n joinLC() {this.InviteActions.acceptInviteAndTransitionToInviteChannel(\"7eFff2A\");}\r\n leaveLC() {this.GuildActions.leaveGuild(\"705908350218666117\");}\r\n\r\n /**\r\n * @type {typeof React}\r\n */\r\n get react() {return this.internal.react;}\r\n /**\r\n * @type {typeof React}\r\n */\r\n get React() {return this.internal.react;}\r\n /**\r\n * @type {typeof import(\"react-dom\")}\r\n */\r\n get reactDom() {return this.internal.reactDom;}\r\n /**\r\n * @type {typeof import(\"react-dom\")}\r\n */\r\n get ReactDom() {return this.internal.reactDom;}\r\n /**\r\n * @type {typeof React.Component}\r\n */\r\n get reactComponent() {return this.internal.react.Component;}\r\n /**\r\n * @type {typeof React.Component}\r\n */\r\n get ReactComponent() {return this.internal.react.Component;}\r\n\r\n get anchorClasses() {return this.WebpackModules.findByUniqueProperties([\"anchorUnderlineOnHover\"]) || {anchor: \"anchor-3Z-8Bb\", anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"};}\r\n get slateEditorClasses() {return this.WebpackModules.findByUniqueProperties([\"slateTextArea\"]);}\r\n get messageClasses() {return this.WebpackModules.findByUniqueProperties([\"message\", \"containerCozy\"]);}\r\n get guildClasses() {\r\n\t\tconst guildsWrapper = BDModules.get(e => e.wrapper && e.unreadMentionsBar)[0];\r\n const guilds = BDModules.get(e => e.guildsError && e.selected)[0]\r\n const pill = BDModules.get(e => e.blobContainer)[0]\r\n return Object.assign({}, guildsWrapper, guilds, pill);\r\n\t}\r\n\r\n get MessageContentComponent() {return this.WebpackModules.find(m => m.defaultProps && m.defaultProps.hasOwnProperty(\"disableButtons\"));}\r\n get MessageComponent() {return this.WebpackModules.find(m => m.default && m.default.displayName && m.default.displayName == \"Message\");}\r\n get TimeFormatter() {return this.WebpackModules.findByUniqueProperties([\"dateFormat\"]);}\r\n get TooltipWrapper() {return this.WebpackModules.findByDisplayName(\"Tooltip\");}\r\n get NativeModule() {return this.WebpackModules.findByUniqueProperties([\"setBadge\"]);}\r\n get InviteActions() {return this.WebpackModules.findByUniqueProperties([\"acceptInvite\"]);}\r\n get GuildActions() {return this.WebpackModules.findByUniqueProperties([\"leaveGuild\"]);}\r\n get Tooltips() {return this.WebpackModules.find(m => m.hide && m.show && !m.search && !m.submit && !m.search && !m.activateRagingDemon && !m.dismiss);}\r\n get KeyGenerator() {return this.WebpackModules.find(m => m.toString && /\"binary\"/.test(m.toString()));}\r\n get LayerStack() {return this.WebpackModules.findByUniqueProperties([\"popLayer\"]);}\r\n get UserStore() {return this.WebpackModules.findByUniqueProperties([\"getCurrentUser\"]);}\r\n get ChannelStore() {return this.WebpackModules.findByUniqueProperties([\"getChannel\"]);}\r\n get ChannelActions() {return this.WebpackModules.findByUniqueProperties([\"openPrivateChannel\"]);}\r\n get PrivateChannelActions() {return this.WebpackModules.findByUniqueProperties([\"selectPrivateChannel\"]);}\r\n\r\n openDM(userId) {\r\n const selfId = this.UserStore.getCurrentUser().id;\r\n if (selfId == userId) return;\r\n const privateChannelId = this.ChannelStore.getDMFromUserId(userId);\r\n if (privateChannelId) return this.PrivateChannelActions.selectPrivateChannel(privateChannelId);\r\n this.ChannelActions.openPrivateChannel(selfId, userId);\r\n }\r\n\r\n parseSettings(cat) {\r\n return Object.keys(settings).reduce((arr, key) => {\r\n const setting = settings[key];\r\n if (setting.cat === cat && setting.implemented && !setting.hidden) {\r\n setting.text = key;\r\n arr.push(setting);\r\n } return arr;\r\n }, []);\r\n }\r\n\r\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 {\r\n\r\n constructor() {\r\n this.panels = {}\r\n }\r\n\r\n register(panel, component){\r\n this.panels[panel] = component\r\n }\r\n\r\n getComponent(panel, sidebar){\r\n return this.panels[panel](sidebar)\r\n }\r\n\r\n get items() {\r\n return [{\r\n text: \"BetterDiscord Settings\", \r\n id: \"core\"\r\n }, {\r\n text: \"Plugins\", \r\n id: \"plugins\"\r\n }, {\r\n text: \"Themes\", \r\n id: \"themes\"\r\n }, {\r\n text: \"Custom CSS\", \r\n id: \"customcss\"\r\n }];\r\n }\r\n\r\n get LCitems(){\r\n let items = [\r\n {\r\n text: \"Lightcord Settings\",\r\n id: \"lightcord\"\r\n }, {\r\n text: \"RichPresence\", \r\n id: \"status\"\r\n }, {\r\n text: \"Account Info\",\r\n id: \"accountinfo\"\r\n }\r\n ]\r\n return items\r\n }\r\n\r\n get LCDevItems(){\r\n let items = []\r\n if(!window.Lightcord.Settings.devMode)return items\r\n items.push(...[\r\n {\r\n section: \"DIVIDER\"\r\n },\r\n {\r\n section: \"HEADER\",\r\n label: \"Lightcord Api\"\r\n },\r\n {\r\n text: \"Components Preview\",\r\n id: \"lcapipreview\"\r\n }\r\n ])\r\n return items\r\n }\r\n\r\n render(sidebar) {\r\n return [\r\n {\r\n section: \"HEADER\",\r\n label: \"Lightcord\"\r\n },\r\n ...this.LCitems.map(e => {\r\n return {\r\n section: e.id,\r\n label: e.text,\r\n element: this.getComponent(e.id, sidebar)\r\n }\r\n }),\r\n ...this.LCDevItems.map(e => {\r\n if(e.section)return e\r\n return {\r\n section: e.id,\r\n label: e.text,\r\n element: this.getComponent(e.id, sidebar)\r\n }\r\n }),\r\n {\r\n section: \"DIVIDER\"\r\n },\r\n {\r\n section: \"CUSTOM\",\r\n element: this.getComponent(\"BDChangelogTitle\")\r\n },\r\n ...this.items.map(e => {\r\n return {\r\n section: e.id,\r\n label: e.text,\r\n element: this.getComponent(e.id, sidebar)\r\n }\r\n }),\r\n {\r\n section: \"DIVIDER\"\r\n }\r\n ]\r\n }\r\n}\r\n\r\n/**\r\n * No need to export settingsPanelSidebar on window\r\n */","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"./v2\";\r\nimport Utils from \"./utils\";\r\n\r\nexport default new class ColoredText {\r\n injectColoredText() {\r\n if (this.cancelColoredText) return;\r\n if (!BDV2.MessageComponent) return;\r\n\r\n this.cancelColoredText = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\r\n const props = data.methodArguments[0];\r\n if (!props || !props.childrenMessageContent) return;\r\n const messageContent = props.childrenMessageContent;\r\n\r\n if (!messageContent.type || !messageContent.type.type || messageContent.type.type.displayName != \"MessageContent\") return;\r\n const originalType = messageContent.type.type;\r\n if (originalType.__originalMethod) return; // Don't patch again\r\n messageContent.type.type = function(props) {\r\n const returnValue = originalType(props);\r\n const roleColor = settingsCookie[\"bda-gs-7\"] ? props.message.colorString || \"\" : \"\";\r\n returnValue.props.style = {color: roleColor};\r\n return returnValue;\r\n };\r\n\r\n messageContent.type.type.__originalMethod = originalType;\r\n Object.assign(messageContent.type.type, originalType);\r\n }});\r\n }\r\n\r\n removeColoredText() {\r\n let classNameMarkup = BDModules.get(e => e.markup)[0].markup\r\n document.querySelectorAll(\".\"+classNameMarkup.split(\" \")[0]).forEach(elem => {\r\n elem.style.setProperty(\"color\", \"\");\r\n });\r\n }\r\n};","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"./v2\";\r\nimport Utils from \"./utils\";\r\n\r\nexport default new class TFHour {\r\n inject24Hour() {\r\n if (this.cancel24Hour) return;\r\n\r\n const twelveHour = new RegExp(`([0-9]{1,2}):([0-9]{1,2})\\\\s(AM|PM)`);\r\n const convert = (data) => {\r\n if (!settingsCookie[\"bda-gs-6\"]) return;\r\n const matched = data.returnValue.match(twelveHour);\r\n if (!matched || matched.length !== 4) return;\r\n if (matched[3] === \"AM\") return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"00\" : matched[1].padStart(2, \"0\")}:${matched[2]}`);\r\n return data.returnValue = data.returnValue.replace(matched[0], `${matched[1] === \"12\" ? \"12\" : parseInt(matched[1]) + 12}:${matched[2]}`);\r\n };\r\n\r\n const cancelCozy = Utils.monkeyPatch(BDV2.TimeFormatter, \"calendarFormat\", {after: convert}); // Called in Cozy mode\r\n const cancelCompact = Utils.monkeyPatch(BDV2.TimeFormatter, \"dateFormat\", {after: convert}); // Called in Compact mode\r\n this.cancel24Hour = () => {cancelCozy(); cancelCompact();}; // Cancel both\r\n }\r\n\r\n remove24Hour() {\r\n if (this.cancel24Hour) this.cancel24Hour();\r\n }\r\n};","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_XSvg extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\r\n \"svg\",\r\n {xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 12 12\", style: {width: \"18px\", height: \"18px\"}},\r\n BDV2.react.createElement(\r\n \"g\",\r\n {className: \"background\", fill: \"none\", fillRule: \"evenodd\"},\r\n BDV2.react.createElement(\"path\", {d: \"M0 0h12v12H0\"}),\r\n BDV2.react.createElement(\"path\", {className: \"fill\", fill: \"#dcddde\", d: \"M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6\"})\r\n )\r\n );\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nimport XSvg from \"./xSvg\";\r\n\r\nexport default class V2C_Tools extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.onClick = this.onClick.bind(this);\r\n }\r\n\r\n render() {\r\n let toolsModule = BDModules.get(e => e.toolsContainer)[0]\r\n let containerModule = BDModules.get(e => e.container && e.closeButton && e.closeButtonBold)[0]\r\n return BDV2.react.createElement(\"div\", {className: \"tools-container \"+toolsModule.toolsContainer},\r\n BDV2.react.createElement(\"div\", {className: \"tools \"+toolsModule.tools},\r\n BDV2.react.createElement(\"div\", {className: containerModule.container},\r\n BDV2.react.createElement(\"div\",\r\n {className: \"btn-close \"+containerModule.closeButton, onClick: this.onClick},\r\n BDV2.react.createElement(XSvg, null)\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"esc-text \"+containerModule.keybind},\r\n \"ESC\"\r\n )\r\n )\r\n )\r\n );\r\n }\r\n\r\n onClick() {\r\n if (this.props.onClick) {\r\n this.props.onClick();\r\n }\r\n const closeButton = document.querySelector(\".\"+BDModules.get(e => e.closeButton && e.keybindBold)[0].closeButton.split(\" \")[0]);\r\n if (closeButton) closeButton.click();\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_SettingsTitle extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n//h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi da-h2 da-title da-size16 da-height20 da-weightSemiBold defaultColor-1_ajX0 da-defaultColor marginTop60-3PGbtK da-marginTop60 marginBottom20-32qID7 da-marginBottom20\r\n render() {\r\n return BDV2.react.createElement(\r\n \"h2\",\r\n {className: \"ui-form-title h2 margin-reset margin-bottom-20\"},\r\n this.props.text\r\n );\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_TabBarSeparator extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\"div\", {className: \"ui-tab-bar-separator margin-top-8 margin-bottom-8\"});\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_TabBarHeader extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\"div\",{className: \"ui-tab-bar-header\"}, this.props.text, this.props.button);\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_TabBarItem extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.setInitialState();\r\n this.onClick = this.onClick.bind(this);\r\n }\r\n\r\n setInitialState() {\r\n this.state = {\r\n selected: this.props.selected || false\r\n };\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: `ui-tab-bar-item${this.props.selected ? \" selected\" : \"\"}`, onClick: this.onClick},\r\n this.props.text\r\n );\r\n }\r\n\r\n onClick() {\r\n if (this.props.onClick) {\r\n this.props.onClick(this.props.id);\r\n }\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\r\n\r\nexport default class V2C_ServerCard extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n if (!this.props.server.iconUrl) this.props.server.iconUrl = this.props.fallback;\r\n this.state = {\r\n imageError: false,\r\n joined: this.props.guildList.includes(this.props.server.identifier)\r\n };\r\n }\r\n\r\n render() {\r\n const {server} = this.props;\r\n let cardModule = BDModules.get(e => e.card && e.cardPrimary)[0]\r\n let flexModule = BDModules.get(e => e.flexChild && e._horizontalReverse)[0]\r\n let wrapModule = BDModules.get(e => e.noWrap && !e.streamerModeEnabled)[0]\r\n return BDV2.react.createElement(\r\n \"div\", // cardPrimary-1Hv-to\r\n {className: `${cardModule.card} ${cardModule.cardPrimary} ${BDModules.get(e => e.marginBottom8)[0].marginBottom8} bd-server-card${server.pinned ? \" bd-server-card-pinned\" : \"\"}`},\r\n // BDV2.react.createElement(\r\n // \"div\",\r\n // { className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2yIZo0 alignStretch-1hwxMa noWrap-3jynv6\" },\r\n BDV2.react.createElement(\"img\", {ref: \"img\", className: \"bd-server-image\", src: server.iconUrl, onError: this.handleError.bind(this), draggable: false}),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: flexModule.flexChild+\" bd-server-content\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap+\" bd-server-header\"},\r\n BDV2.react.createElement(\r\n \"h5\",\r\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-name\"},\r\n server.name\r\n ),\r\n BDV2.react.createElement(\r\n \"h5\",\r\n {className: \"h5-18_1nd defaultColor-1_ajX0 margin-reset bd-server-member-count\"},\r\n server.members,\r\n \" Members\"\r\n )\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: flexModule.horizontal+\" \"+wrapModule.noWrap},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y bd-server-description-container\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"scroller-2FKFPG scroller bd-server-description\"},\r\n server.description\r\n )\r\n )\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY directionRow-3v3tfG noWrap-3jynv6 bd-server-footer\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"flexChild-faoVW3 bd-server-tags\", style: {flex: \"1 1 auto\"}},\r\n server.categories.join(\", \")\r\n ),\r\n this.state.joined && BDV2.react.createElement(\r\n \"button\",\r\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN colorGreen-29iAKY\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#3ac15c\"}},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n \"Joined\"\r\n )\r\n ),\r\n server.error && BDV2.react.createElement(\r\n \"button\",\r\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN disabled-9aF2ug\", style: {minHeight: \"12px\", marginTop: \"4px\", backgroundColor: \"#c13a3a\"}},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n \"Error\"\r\n )\r\n ),\r\n !server.error && !this.state.joined && BDV2.react.createElement(\r\n \"button\",\r\n {type: \"button\", className: \"button-38aScr lookFilled-1Gx00P colorBrand-3pXr91 sizeMin-1mJd1x grow-q77ONN\", style: {minHeight: \"12px\", marginTop: \"4px\"}, onClick: () => {this.join();}},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n \"Join\"\r\n )\r\n )\r\n )\r\n )\r\n // )\r\n );\r\n }\r\n\r\n handleError() {\r\n this.props.server.iconUrl = this.props.fallback;\r\n this.setState({imageError: true});\r\n }\r\n\r\n join() {\r\n this.props.join(this);\r\n //this.setState({joined: true});\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_Scroller extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n //scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y\r\n let scrollerModule1 = BDModules.get(e => e.scrollerHorizontal)[0]\r\n let scrollerModule2 = BDModules.get(e => e.sidebarRegionScroller)[0]\r\n let wrapperClass = `${scrollerModule1.scrollerWrap} ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhostHairline}${this.props.fade ? \" \"+scrollerModule1.scrollerFade : \"\"}`;\r\n let scrollerClass = scrollerModule1.scroller+\" scroller\"; /* fuck */\r\n if (this.props.sidebar) scrollerClass += ` ${scrollerModule2.sidebarRegionScroller} sidebar-region-scroller`\r\n if (this.props.contentColumn) {\r\n scrollerClass += \" \"+scrollerModule2.contentRegionScroller+\" content-region-scroller\"; /* fuck */\r\n wrapperClass = `${scrollerModule1.scrollerWrap} ${scrollerModule2.contentRegionScrollerWrap} content-region-scroller-wrap ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhost} ${scrollerModule1.scrollerTrack}`;\r\n }\r\n const {children} = this.props;\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {key: \"scrollerwrap\", className: wrapperClass},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {key: \"scroller\", ref: \"scroller\", className: scrollerClass},\r\n children\r\n )\r\n );\r\n }\r\n}\r\n\r\nconst originalRender = V2C_Scroller.prototype.render;\r\nObject.defineProperty(V2C_Scroller.prototype, \"render\", {\r\n enumerable: false,\r\n configurable: false,\r\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\r\n get: () => originalRender\r\n}); ","import BDV2 from \"../../modules/v2\";\r\n\r\nimport Scroller from \"../scroller\";\r\n\r\nexport default class V2C_SidebarView extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n const {sidebar, content, tools} = this.props.children;\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: \"standardSidebarView-3F1I7i ui-standard-sidebar-view\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"sidebarRegion-VFTUkN sidebar-region\"},\r\n BDV2.react.createElement(Scroller, {key: \"sidebarScroller\", ref: \"sidebarScroller\", sidebar: true, fade: sidebar.fade || true, dark: sidebar.dark || true}, sidebar.component)\r\n ),\r\n BDV2.react.createElement(\"div\", {className: \"contentRegion-3nDuYy content-region\"},\r\n BDV2.react.createElement(\"div\", {className: \"contentTransitionWrap-3hqOEW content-transition-wrap\"},\r\n BDV2.react.createElement(\"div\", {className: \"scrollerWrap-2lJEkd firefoxFixScrollFlex-cnI2ix contentRegionScrollerWrap-3YZXdm content-region-scroller-wrap scrollerThemed-2oenus themeGhost-28MSn0 scrollerTrack-1ZIpsv\"},\r\n BDV2.react.createElement(\"div\", {className: \"scroller-2FKFPG firefoxFixScrollFlex-cnI2ix contentRegionScroller-26nc1e content-region-scroller scroller\", ref: \"contentScroller\"},\r\n BDV2.react.createElement(\"div\", {className: \"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default\"}, content.component),\r\n tools.component\r\n )\r\n )\r\n )\r\n )\r\n );\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\r\n\r\nimport Tools from \"../tools\";\r\nimport SettingsTitle from \"../settingsTitle\";\r\nimport TabBarSeparator from \"../tabBarSeparator\";\r\nimport TabBarHeader from \"../tabBarHeader\";\r\nimport TabBarItem from \"../tabBarItem\";\r\n\r\nimport ServerCard from \"./serverCard\";\r\nimport SidebarView from \"./sidebarView\";\r\n\r\nexport default class V2C_PublicServers extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.setInitialState();\r\n this.close = this.close.bind(this);\r\n this.changeCategory = this.changeCategory.bind(this);\r\n this.search = this.search.bind(this);\r\n this.searchKeyDown = this.searchKeyDown.bind(this);\r\n this.checkConnection = this.checkConnection.bind(this);\r\n this.join = this.join.bind(this);\r\n this.connect = this.connect.bind(this);\r\n\r\n this.GuildStore = BDV2.WebpackModules.findByUniqueProperties([\"getGuilds\"]);\r\n this.AvatarDefaults = BDV2.WebpackModules.findByUniqueProperties([\"getUserAvatarURL\", \"DEFAULT_AVATARS\"]);\r\n this.InviteActions = BDV2.WebpackModules.findByUniqueProperties([\"acceptInvite\"]);\r\n this.SortedGuildStore = BDV2.WebpackModules.findByUniqueProperties([\"getSortedGuilds\"]);\r\n }\r\n\r\n componentDidMount() {\r\n this.checkConnection();\r\n }\r\n\r\n setInitialState() {\r\n this.state = {\r\n selectedCategory: -1,\r\n title: \"Loading...\",\r\n loading: true,\r\n servers: [],\r\n next: null,\r\n connection: {\r\n state: 0,\r\n user: null\r\n }\r\n };\r\n }\r\n\r\n close() {\r\n this.props.close()\r\n }\r\n\r\n search(query, clear) {\r\n const self = this;\r\n fetch(`${self.endPoint}${query}${query ? \"&schema=new\" : \"?schema=new\"}`, {\r\n method: \"get\"\r\n }).then(async res => {\r\n if(res.status !== 200)throw await res.text()\r\n let data = await res.json()\r\n \r\n let servers = data.results.reduce((arr, server) => {\r\n server.joined = false;\r\n arr.push(server);\r\n // arr.push(<ServerCard server={server} join={self.join}/>);\r\n return arr;\r\n }, []);\r\n\r\n if (!clear) {\r\n servers = self.state.servers.concat(servers);\r\n }\r\n else {\r\n //servers.unshift(self.bdServer);\r\n }\r\n\r\n let end = data.size + data.from;\r\n data.next = `?from=${end}`;\r\n if (self.state.term) data.next += `&term=${self.state.term}`;\r\n if (self.state.selectedCategory) data.next += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\r\n if (end >= data.total) {\r\n end = data.total;\r\n data.next = null;\r\n }\r\n\r\n let title = `Showing 1-${end} of ${data.total} results in ${self.categoryButtons[self.state.selectedCategory]}`;\r\n if (self.state.term) title += ` for ${self.state.term}`;\r\n\r\n self.setState({\r\n loading: false,\r\n title: title,\r\n servers: servers,\r\n next: data.next\r\n });\r\n\r\n if (clear) {\r\n //console.log(self);\r\n self.refs.sbv.refs.contentScroller.scrollTop = 0;\r\n }\r\n }).catch((err) => {\r\n console.error(err)\r\n return self.setState({\r\n loading: false,\r\n title: \"Failed to load servers. Check console for details\"\r\n });\r\n })\r\n }\r\n\r\n async join(serverCard) {\r\n if (serverCard.props.pinned) return this.InviteActions.acceptInvite(serverCard.props.invite_code);\r\n\r\n await fetch(`${this.joinEndPoint}/${serverCard.props.server.identifier}`,{\r\n method: \"GET\",\r\n credentials: \"include\",\r\n mode: \"cors\",\r\n headers: {\r\n \"Accept\": \"application/json\",\r\n \"Content-Type\": \"application/json\"\r\n }\r\n });\r\n\r\n serverCard.setState({joined: true});\r\n }\r\n\r\n connect() {\r\n const self = this;\r\n const options = self.windowOptions;\r\n options.x = Math.round(window.screenX + window.innerWidth / 2 - options.width / 2);\r\n options.y = Math.round(window.screenY + window.innerHeight / 2 - options.height / 2);\r\n\r\n self.joinWindow = new (window.require(\"electron\").remote.BrowserWindow)(options);\r\n const url = \"https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info\";\r\n self.joinWindow.webContents.on(\"did-navigate\", (event, url) => {\r\n if (url != \"https://auth.discordservers.com/info\") return;\r\n self.joinWindow.close();\r\n self.checkConnection();\r\n });\r\n self.joinWindow.loadURL(url);\r\n }\r\n\r\n get windowOptions() {\r\n return {\r\n width: 500,\r\n height: 550,\r\n backgroundColor: \"#282b30\",\r\n show: true,\r\n resizable: false,\r\n maximizable: false,\r\n minimizable: false,\r\n alwaysOnTop: true,\r\n frame: false,\r\n center: false,\r\n webPreferences: {\r\n nodeIntegration: false\r\n }\r\n };\r\n }\r\n\r\n get bdServer() {\r\n const server = {\r\n name: \"BetterDiscord\",\r\n online: \"30000+\",\r\n members: \"70000+\",\r\n categories: [\"community\", \"programming\", \"support\"],\r\n description: \"Official BetterDiscord server for support etc\",\r\n identifier: \"86004744966914048\",\r\n iconUrl: \"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp\",\r\n nativejoin: true,\r\n invite_code: \"0Tmfo5ZbORCRqbAd\",\r\n pinned: true\r\n };\r\n const server2 = {\r\n name: \"Lightcord\",\r\n online: \"100+\",\r\n members: \"300+\",\r\n categories: [\"community\", \"programming\", \"support\"],\r\n description: \"Official Lightcord server for support etc\",\r\n identifier: \"705908350218666117\",\r\n iconUrl: \"https://github.com/lightcord.png\",\r\n nativejoin: true,\r\n invite_code: \"7eFff2A\",\r\n pinned: true\r\n };\r\n const guildList = this.SortedGuildStore.getFlattenedGuildIds();\r\n const defaultList = this.AvatarDefaults.DEFAULT_AVATARS;\r\n return [\r\n BDV2.react.createElement(ServerCard, {server: server2, pinned: true, join: this.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]}),\r\n BDV2.react.createElement(ServerCard, {server: server, pinned: true, join: this.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]})\r\n ]\r\n }\r\n\r\n get endPoint() {\r\n return \"https://search.discordservers.com\";\r\n }\r\n\r\n get joinEndPoint() {\r\n return \"https://j.discordservers.com\";\r\n }\r\n\r\n get connectEndPoint() {\r\n return \"https://join.discordservers.com/connect\";\r\n }\r\n\r\n async checkConnection() {\r\n const self = this;\r\n try {\r\n const response = await fetch(`https://auth.discordservers.com/info`,{\r\n method: \"GET\",\r\n credentials: \"include\",\r\n mode: \"cors\",\r\n headers: {\r\n \"Accept\": \"application/json\",\r\n \"Content-Type\": \"application/json\"\r\n }\r\n });\r\n const text = await response.text()\r\n if(!text){\r\n self.setState({\r\n title: \"Not connected to discordservers.com!\",\r\n loading: true,\r\n selectedCategory: -1,\r\n connection: {\r\n state: 1,\r\n user: null\r\n }\r\n });\r\n return\r\n }\r\n const data = JSON.parse(text)\r\n self.setState({\r\n selectedCategory: 0,\r\n connection: {\r\n state: 2,\r\n user: data\r\n }\r\n });\r\n self.search(\"\", true);\r\n }\r\n catch (error) {\r\n console.error(error)\r\n self.setState({\r\n title: \"Not connected to discordservers.com!\",\r\n loading: true,\r\n selectedCategory: -1,\r\n connection: {\r\n state: 1,\r\n user: null\r\n }\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\"div\", {id: \"pubslayerroot\"}, \r\n BDV2.react.createElement(\"div\", {id: \"pubslayer\"}, BDV2.react.createElement(SidebarView, {ref: \"sbv\"}, this.component))\r\n );\r\n }\r\n\r\n get component() {\r\n return {\r\n sidebar: {\r\n component: this.sidebar\r\n },\r\n content: {\r\n component: this.content\r\n },\r\n tools: {\r\n component: BDV2.react.createElement(Tools, {key: \"pt\", ref: \"tools\", onClick: this.close})\r\n }\r\n };\r\n }\r\n\r\n get sidebar() {\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: \"sidebar\", key: \"ps\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-tab-bar SIDE\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-tab-bar-header\", style: {fontSize: \"16px\"}},\r\n \"Public Servers\"\r\n ),\r\n BDV2.react.createElement(TabBarSeparator, null),\r\n this.searchInput,\r\n BDV2.react.createElement(TabBarSeparator, null),\r\n BDV2.react.createElement(TabBarHeader, {text: \"Categories\"}),\r\n this.categoryButtons.map((value, index) => {\r\n return BDV2.react.createElement(TabBarItem, {id: index, onClick: this.changeCategory, key: index, text: value, selected: this.state.selectedCategory === index});\r\n }),\r\n BDV2.react.createElement(TabBarSeparator, null),\r\n this.footer,\r\n this.connection\r\n )\r\n );\r\n }\r\n\r\n get searchInput() {\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-form-item\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-text-input flex-vertical\", style: {width: \"172px\", marginLeft: \"10px\"}},\r\n BDV2.react.createElement(\"input\", {ref: \"searchinput\", onKeyDown: this.searchKeyDown, onChange: () => {}, type: \"text\", className: \"input default\", placeholder: \"Search...\", maxLength: \"50\"})\r\n )\r\n );\r\n }\r\n\r\n searchKeyDown(e) {\r\n const self = this;\r\n if (self.state.loading || e.which !== 13) return;\r\n self.setState({\r\n loading: true,\r\n title: \"Loading...\",\r\n term: e.target.value\r\n });\r\n let query = `?term=${e.target.value}`;\r\n if (self.state.selectedCategory !== 0) {\r\n query += `&category=${self.categoryButtons[self.state.selectedCategory]}`;\r\n }\r\n self.search(query, true);\r\n }\r\n\r\n get categoryButtons() {\r\n return [\"All\", \"FPS Games\", \"MMO Games\", \"Strategy Games\", \"MOBA Games\", \"RPG Games\", \"Tabletop Games\", \"Sandbox Games\", \"Simulation Games\", \"Music\", \"Community\", \"Language\", \"Programming\", \"Other\"];\r\n }\r\n\r\n changeCategory(id) {\r\n const self = this;\r\n if (self.state.loading) return;\r\n self.refs.searchinput.value = \"\";\r\n self.setState({\r\n loading: true,\r\n selectedCategory: id,\r\n title: \"Loading...\",\r\n term: null\r\n });\r\n if (id === 0) {\r\n self.search(\"\", true);\r\n return;\r\n }\r\n self.search(`?category=${self.categoryButtons[id]}`, true);\r\n }\r\n\r\n get content() {\r\n const self = this;\r\n const guildList = this.SortedGuildStore.getFlattenedGuildIds();\r\n const defaultList = this.AvatarDefaults.DEFAULT_AVATARS;\r\n if (self.state.connection.state === 1) return self.notConnected;\r\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0]\r\n return [BDV2.react.createElement(\r\n \"div\",\r\n {ref: \"content\", key: \"pc\", className: columnModule.contentColumn+\" \"+columnModule.contentColumn+\" content-column default\"},\r\n BDV2.react.createElement(SettingsTitle, {text: self.state.title}),\r\n self.bdServer,\r\n self.state.servers.map((server) => {\r\n return BDV2.react.createElement(ServerCard, {key: server.identifier, server: server, join: self.join, guildList: guildList, fallback: defaultList[Math.floor(Math.random() * 5)]});\r\n }),\r\n self.state.next && BDV2.react.createElement(\r\n \"button\",\r\n {type: \"button\", onClick: () => {\r\n if (self.state.loading) return;self.setState({loading: true}); self.search(self.state.next, false);\r\n }, className: \"ui-button filled brand small grow\", style: {width: \"100%\", marginTop: \"10px\", marginBottom: \"10px\"}},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n self.state.loading ? \"Loading\" : \"Load More\"\r\n )\r\n ),\r\n self.state.servers.length > 0 && BDV2.react.createElement(SettingsTitle, {text: self.state.title})\r\n )];\r\n }\r\n\r\n get notConnected() {\r\n const self = this;\r\n //return BDV2.react.createElement(SettingsTitle, { text: self.state.title });\r\n let columnModule = BDModules.get(e => e.contentColumnDefault)[0]\r\n return [BDV2.react.createElement(\r\n \"div\",\r\n {key: \"ncc\", ref: \"content\", className: columnModule.contentColumn+\" \"+columnModule.contentColumn+\" content-column default\"},\r\n BDV2.react.createElement(\r\n \"h2\",\r\n {className: \"ui-form-title h2 margin-reset margin-bottom-20\"},\r\n \"Not connected to discordservers.com!\",\r\n BDV2.react.createElement(\r\n \"button\",\r\n {\r\n onClick: self.connect,\r\n type: \"button\",\r\n className: \"ui-button filled brand small grow\",\r\n style: {\r\n display: \"inline-block\",\r\n minHeight: \"18px\",\r\n marginLeft: \"10px\",\r\n lineHeight: \"14px\"\r\n }\r\n },\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\"},\r\n \"Connect\"\r\n )\r\n )\r\n ), self.bdServer\r\n )];\r\n }\r\n\r\n get footer() {\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-tab-bar-header\"},\r\n BDV2.react.createElement(\r\n \"a\",\r\n {href: \"https://discordservers.com\", target: \"_blank\"},\r\n \"Discordservers.com\"\r\n )\r\n );\r\n }\r\n\r\n get connection() {\r\n const self = this;\r\n const {connection} = self.state;\r\n if (connection.state !== 2) return BDV2.react.createElement(\"span\", null);\r\n\r\n return BDV2.react.createElement(\r\n \"span\",\r\n null,\r\n BDV2.react.createElement(TabBarSeparator, null),\r\n BDV2.react.createElement(\r\n \"span\",\r\n {style: {color: \"#b9bbbe\", fontSize: \"10px\", marginLeft: \"10px\"}},\r\n \"Connected as: \",\r\n `${connection.user.username}#${connection.user.discriminator}`\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {style: {padding: \"5px 10px 0 10px\"}},\r\n BDV2.react.createElement(\r\n \"button\",\r\n {style: {width: \"100%\", minHeight: \"20px\"}, type: \"button\", className: \"ui-button filled brand small grow\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"ui-button-contents\", onClick: self.connect},\r\n \"Reconnect\"\r\n )\r\n )\r\n )\r\n );\r\n}\r\n}","export default class BugHunterBadge extends React.Component {\r\n render(){\r\n const props = this.props\r\n\r\n return (\r\n <svg viewBox=\"0 0 31.3 29.5\" {...props.svg} height=\"100%\">\r\n <path d=\"M22.8 1s12 8.2 7.4 19.7S16.6 29 20 25.6s-4-5.6-8.7-10L22.8 1\" fill=\"rgba(227,6,19,.6)\" />\r\n <path d=\"M22.1 12.3c-2.5 3.2-6.1 4.8-8.9 4.3L3.6 28.8c-.7.9-1.9 1-2.8.3-.9-.7-1-1.9-.4-2.8L10 14.1c-1.3-2.5-.6-6.4 2-9.7 3.2-4 8-5.5 10.8-3.4s2.4 7.2-.7 11.3z\" fill=\"#e30613\" />\r\n </svg>\r\n )\r\n } \r\n}","export default class Circus extends React.Component {\r\n render(){\r\n return (<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 36 36\" {...this.props.svg} height=\"100%\">\r\n <path\r\n fill=\"#DD2E44\"\r\n d=\"M33 33a2 2 0 01-2 2H5a2 2 0 01-2-2l1-12h28l1 12z\"\r\n ></path>\r\n <path\r\n fill=\"#EA596E\"\r\n d=\"M13 35c-.792-1.875-1.75-3.291-3.417-4.666 1.75-1.459 4.542-5.5 5.25-8.292s2.75 8.125 2.042 10.625S13 35 13 35zm10.303 0c.791-1.875 1.75-3.291 3.416-4.666-1.75-1.459-4.541-5.5-5.25-8.292-.707-2.792-2.75 8.125-2.04 10.625.708 2.5 3.874 2.333 3.874 2.333z\"\r\n ></path>\r\n <path\r\n fill=\"#BE1931\"\r\n d=\"M3.728 24.263A2.5 2.5 0 008 22.5c0-.565-.195-1.081-.511-1.5H4l-.272 3.263zm28.544 0L32 21h-3.489A2.482 2.482 0 0028 22.5a2.5 2.5 0 004.272 1.763z\"\r\n ></path>\r\n <circle cx=\"14\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <circle cx=\"22\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <circle cx=\"10\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <circle cx=\"26\" cy=\"23\" r=\"2\" fill=\"#BE1931\"></circle>\r\n <path d=\"M23 35H13s2-6 2-13h6c0 7 2 13 2 13zM17 2h2v7h-2z\"></path>\r\n <path\r\n fill=\"#55ACEE\"\r\n d=\"M18.838.206C17.667.042 17 .318 17 1.418v1c0 1.1.865 1.753 1.923 1.451l5.154-.901c1.715-.343 1.548-1.593.085-1.884L18.838.206z\"\r\n ></path>\r\n <path\r\n fill=\"#CCD6DD\"\r\n d=\"M18 6l-.081.123C10.938 16.981 3 15.015 3 19v2.5a2.5 2.5 0 004.95.5H12a2 2 0 004 0h4a2 2 0 004 0h4.05a2.5 2.5 0 004.95-.5V19c0-4-8-2-15-13z\"\r\n ></path>\r\n <g fill=\"#F5F8FA\">\r\n <path d=\"M17.948 6.078l-.03.045C17.132 11.619 10.811 16.126 8 18v4a2 2 0 004 0v-4c.982-.982 5.813-6.787 5.984-11.732-.01-.064-.027-.126-.036-.19zm.08.398C18.324 11.374 23.031 17.031 24 18v4a2 2 0 004 0v-4c-2.75-1.833-8.953-6.19-9.972-11.524z\"></path>\r\n <path d=\"M17.984 6.27C17.922 8.346 17.606 16.394 16 18v4a2 2 0 004 0v-4c-1.564-1.564-1.905-9.241-1.979-11.559-.011-.057-.027-.113-.037-.171z\"></path>\r\n </g>\r\n </svg>\r\n )\r\n } \r\n}","import BugHunterBadge from \"../svg/bug_hunter\"\r\nimport nodeFetch from \"node-fetch\"\r\nimport { settingsCookie } from \"../0globals\";\r\nimport Circus from \"../svg/circus\";\r\n\r\nexport function uuidv4() { // Generate UUID (No crypto rng)\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\r\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n} \r\n\r\nconst awaitingBadgesPromises = {}\r\nlet badgesToFetch = []\r\n\r\nexport default new class DistantServer {\r\n constructor(){\r\n this._cache = {\r\n badges: {\r\n\r\n }\r\n }\r\n window.Lightcord.BetterDiscord.DistantServer = this\r\n }\r\n\r\n get cache(){\r\n return this._cache\r\n }\r\n\r\n set cache(data){\r\n if(typeof data !== \"object\" || typeof this._cache !== \"object\")return this._cache = data\r\n return this._cache = Object.assign(this._cache, data)\r\n }\r\n\r\n /**\r\n * Get custom badges from the user ID.\r\n * @param {string} user The user ID \r\n * @returns {Promise<Constants[\"badges\"]>}\r\n */\r\n async getBadges(user){\r\n if(this.cache.badges[user])return this.cache.badges[user]\r\n if(awaitingBadgesPromises[user])return awaitingBadgesPromises[user]\r\n\r\n let resolve\r\n const newPromise = new Promise((res) => (resolve = res))\r\n awaitingBadgesPromises[user] = newPromise\r\n\r\n const badges = []\r\n for(let badge of Constants.badges){\r\n if(badge.defaultUsers.includes(user))badges.push(badge)\r\n }\r\n const fetchedBadges = await new Promise((resolve) => {\r\n if(!settingsCookie[\"lightcord-5\"])return resolve([])\r\n badgesToFetch.push([user, resolve])\r\n setTimeout(() => {\r\n let users = badgesToFetch\r\n if(users.length === 0)return\r\n badgesToFetch = []\r\n handleRequest(Routes.badges, \"POST\", JSON.stringify(users.map(e => e[0])))\r\n .then(async res => {\r\n if(res.status !== 200){// Couldn't fetch badges: server error\r\n users.forEach(data => {\r\n data[1]([])// resolve no badge fetched\r\n })\r\n }\r\n const responseBody = await res.json()\r\n \r\n for(let user of responseBody){\r\n let promise = users.find(promise => promise[0] === user.user_id)\r\n promise[1](user.badges)\r\n }\r\n }).catch((err) => {// Couldn't fetch badges: error\r\n if(!(err instanceof LightcordError))console.error(err)\r\n users.forEach(data => {\r\n data[1]([])// resolve no badge fetched\r\n })\r\n })\r\n }, 0)\r\n })\r\n for(let badge of fetchedBadges){\r\n if(!Constants.badges.find(e => e.id === badge))continue // We do not have the Component, skip it.\r\n if(badges.find(e => e.id === badge))continue // Already inserted.\r\n badges.push(Constants.badges.find(e => e.id === badge))\r\n }\r\n this.cache = {\r\n badges: Object.assign(this.cache.badges, {[user]: badges})\r\n }\r\n setTimeout(() => {\r\n delete this.cache.badges[user]\r\n }, 600000);\r\n\r\n resolve(badges)\r\n delete awaitingBadgesPromises[user]\r\n return badges\r\n }\r\n}\r\n\r\nconst handleRequest = function(route, method, data){\r\n if(!settingsCookie[\"lightcord-5\"]){\r\n return Promise.reject(new LightcordError(\"The current settings blocked the request.\"))\r\n }\r\n return nodeFetch(`${Constants.SERVER_URL}/api/v1${route}`, {\r\n method,\r\n headers: {\r\n \"CLIENT\": \"Lightcord\",\r\n \"Authorization\": window.Lightcord.Api.Authorization || \"None::Anonymous\"\r\n },\r\n ...(data ? {\r\n body: data\r\n } : {})\r\n })\r\n}\r\n\r\nclass LightcordError extends Error {\r\n constructor(){\r\n super(...arguments)\r\n this.name = \"LightcordError\"\r\n }\r\n}\r\n\r\nexport const Constants = {\r\n SERVER_URL: \"https://lightcord.deroku.xyz\",\r\n badges: [ // TODO: Add more badges + server side svg\r\n {\r\n name: \"Lightcord Bug Hunter\",\r\n id: \"f04698f5-816b-41e3-bd01-92291193d7a5\",\r\n defaultUsers: [\r\n \"696481194443014174\",\r\n \"696003456611385396\"\r\n ],\r\n scopes: [],\r\n component: BugHunterBadge,\r\n href: \"https://github.com/lightcord/lightcord/wiki/badges#bug_hunter\"\r\n }, {\r\n name: \"Buffoon\",\r\n id: \"06904d31-65b4-41ec-a50c-8658bbd1af96\",\r\n defaultUsers: [\r\n \"389016895543705602\",\r\n \"664600134528663565\",\r\n \"625350657829896224\"\r\n ],\r\n scopes: [],\r\n component: Circus,\r\n href: \"https://youtu.be/EJtb6z-dlT8?t=145\"\r\n }\r\n ]\r\n}\r\n\r\nexport const Routes = {\r\n badges: `/users/badges`\r\n}","import Utils from \"./utils\";\r\nimport v2 from \"./v2\";\r\nimport { uuidv4 } from \"./distant\";\r\nimport { timingSafeEqual } from \"crypto\";\r\n\r\nexport default new class Layers {\r\n constructor(){\r\n this.layers = []\r\n window.Lightcord.BetterDiscord.Layers = this\r\n }\r\n\r\n get isInjected(){\r\n return !!document.querySelector(\"div.Layers.injected\")\r\n }\r\n\r\n inject(){\r\n if(this.isInjected)return\r\n let [\r\n classNameLayers\r\n ] = [\r\n Utils.removeDa(v2.WebpackModules.find(e => e.layers && e.layer).layers)\r\n ]\r\n const layers = document.querySelector(\".\"+classNameLayers);\r\n if (!layers) return false;\r\n const ReactInstance = Lightcord.Api.Utils.FindReact(layers, 1)\r\n if(!ReactInstance)return layers\r\n this.ReactInstance = ReactInstance\r\n let render = ReactInstance.render\r\n ReactInstance.render = () => {\r\n let returnValue = render.call(ReactInstance)\r\n let classList = returnValue.props.children[1].props.className.split(\" \")\r\n classList.push(\"Layers\")\r\n classList.push(\"injected\")\r\n returnValue.props.children[1].props.className = classList.join(\" \")\r\n\r\n this.layers.forEach(layer => {\r\n returnValue.props.children[1].props.children.push(layer[1])\r\n })\r\n\r\n return returnValue\r\n }\r\n ReactInstance.forceUpdate()\r\n }\r\n\r\n createLayer(children, props = {}){\r\n let id = uuidv4()\r\n let layer = null\r\n this.layers.push([id, <Layer {...props} getLayer={lay => {\r\n layer = lay\r\n }} key={id} id={id} remove={() => {\r\n let index = this.layers.findIndex(e => e[0] === id)\r\n if(index === -1)return\r\n this.layers.splice(index, 1)\r\n layer = null\r\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\r\n this.inject()\r\n }}>{children}</Layer>])\r\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\r\n this.inject()\r\n return {\r\n remove: () => {\r\n if(!layer){\r\n let index = this.layers.findIndex(e => e[0] === id)\r\n if(index === -1)return\r\n this.layers.splice(index, 1)\r\n layer = null\r\n if(this.ReactInstance)this.ReactInstance.forceUpdate()\r\n this.inject()\r\n }else{\r\n layer.remove()\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n\r\nlet LayerModules\r\nexport class Layer extends React.Component {\r\n constructor(){\r\n super(...arguments)\r\n this.state = {\r\n animation: new this.modules[0].default.Value(0)\r\n } \r\n this.props.getLayer(this)\r\n this.keydown = this.keydown.bind(this)\r\n }\r\n\r\n keydown(e){\r\n if (e.which === 27) {\r\n this.remove()\r\n }\r\n }\r\n\r\n get modules(){\r\n return LayerModules || (LayerModules = [\r\n v2.WebpackModules.find(e => e.default && e.default.Value && e.default.div)\r\n ])\r\n }\r\n\r\n componentWillUnmount(){\r\n window.removeEventListener(\"keydown\", this.keydown)\r\n }\r\n\r\n componentDidMount(ev){\r\n window.addEventListener(\"keydown\", this.keydown)\r\n }\r\n\r\n remove(){\r\n this.props.remove()\r\n }\r\n\r\n componentWillEnter(ev){\r\n this.modules[0].default.timing(this.state.animation, {\r\n toValue: 1,\r\n duration: 100\r\n }).start(ev)\r\n }\r\n\r\n componentWillLeave(ev){\r\n this.modules[0].default.timing(this.state.animation, {\r\n toValue: 0,\r\n duration: 100\r\n }).start(ev)\r\n }\r\n\r\n render(){\r\n let interpolation = this.state.animation.interpolate({\r\n inputRange: [0, 1],\r\n outputRange: [1.07, 1]\r\n })\r\n let style = {\r\n opacity: this.state.animation,\r\n transform: [{\r\n scale: interpolation\r\n }]\r\n }\r\n let Div = this.modules[0].default.div\r\n return <Div className={[__SECRET_EMOTION__.css({\r\n backgroundColor:\"var(--background-primary)\",\r\n position: \"absolute\",\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n left: 0,\r\n display: \"flex\",\r\n overflow: \"hidden\",\r\n WebkitBoxOrient: \"vertical\",\r\n WebkitBoxDirection: \"normal\",\r\n msFlexDirection: \"column\",\r\n flexDirection: \"column\",\r\n zIndex: 101\r\n }),process.platform===\"win32\"?__SECRET_EMOTION__.css({\r\n top: \"-22px\",\r\n paddingTop: \"22px\"\r\n }):null,...(this.props.className?this.props.className.split(\" \"):[])].filter(e=>e).join(\" \") || null} style={style}>\r\n {this.props.children(() => {\r\n this.remove()\r\n })}\r\n </Div>\r\n }\r\n}\r\nLayer.defaultProps = {\r\n id: null,\r\n children: null\r\n}","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"./v2\";\r\nimport webpackModules from \"./webpackModules\";\r\nimport Utils from \"./utils\";\r\nimport DOM from \"./domtools\";\r\n\r\nimport V2C_PublicServers from \"../ui/publicservers/publicServers\";\r\nimport Layers from \"./Layers\";\r\n\r\nexport default new class V2_PublicServers {\r\n\r\n constructor() {\r\n this._appendButton = this._appendButton.bind(this);\r\n window.Lightcord.BetterDiscord.V2_PublicServers = this\r\n }\r\n\r\n render() {\r\n Layers.createLayer((close) => {\r\n return BDV2.react.createElement(V2C_PublicServers, {rootId: \"pubslayerroot\", close})\r\n })\r\n }\r\n\r\n get button() {\r\n const btn = DOM.createElement(`<div id=\"bd-pub-li\" class=\"${BDV2.guildClasses.listItem}\">`);\r\n if (!settingsCookie[\"bda-gs-1\"]) btn.style.display = \"none\";\r\n const label = DOM.createElement(`<div id=\"bd-pub-button\" class=\"${\"wrapper-25eVIn \" + BDV2.guildClasses.circleButtonMask}\">public</div>`);\r\n label.addEventListener(\"click\", () => {this.render();});\r\n btn.append(label);\r\n return btn;\r\n }\r\n\r\n _appendButton() {\r\n let [\r\n classNametutorialContainer\r\n ] = [\r\n Utils.removeDa(BDModules.get(e => e.downloadProgress && e.tutorialContainer)[0].tutorialContainer)\r\n ]\r\n if (DOM.query(\"#bd-pub-li\")) return;\r\n const guilds = DOM.query(`div.${classNametutorialContainer} > div`);\r\n DOM.after(guilds, this.button);\r\n }\r\n\r\n addButton() {\r\n if (this.guildPatch) return;\r\n const GuildList = webpackModules.find(m => m.default && m.default.displayName == \"NavigableGuilds\");\r\n const GuildListOld = webpackModules.findByDisplayName(\"Guilds\");\r\n if (!GuildList && !GuildListOld) Utils.warn(\"PublicServer\", \"Can't find GuildList component\");\r\n this.guildPatch = Utils.monkeyPatch(GuildList ? GuildList : GuildListOld.prototype, GuildList ? \"default\" : \"render\", {after: this._appendButton});\r\n this._appendButton();\r\n }\r\n\r\n removeButton() {\r\n this.guildPatch();\r\n delete this.guildPatch;\r\n const button = DOM.query(\"#bd-pub-li\");\r\n if (button) button.remove();\r\n }\r\n};","import DOM from \"./domtools\";\r\n\r\nconst style = `\r\n .container-2Rl01u {\r\n display: none!important;\r\n }\r\n\r\n .chat-3bRxxu {\r\n display: none!important;\r\n }\r\n\r\n .sidebar-2K8pFh {\r\n flex-grow: 1!important;\r\n }\r\n`;\r\n\r\nexport default new class VoiceMode {\r\n start() {\r\n DOM.addStyle(\"VoiceMode\", style);\r\n }\r\n\r\n stop() {\r\n DOM.removeStyle(\"VoiceMode\");\r\n }\r\n};","import WebpackModules from \"./webpackModules\";\r\n\r\nconst normalizedPrefix = \"da\";\r\nconst randClass = new RegExp(`^(?!${normalizedPrefix}-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$`);\r\n\r\nexport default new class ClassNormalizer {\r\n constructor(){\r\n window.Lightcord.BetterDiscord.ClassNormalizer = this\r\n }\r\n stop() {\r\n if (!this.hasPatched) return;\r\n this.unpatchClassModules(WebpackModules.findAll(this.moduleFilter.bind(this)));\r\n this.revertElement(document.querySelector(\"#app-mount\"));\r\n this.hasPatched = false;\r\n }\r\n\r\n start() {\r\n if (this.hasPatched) return;\r\n this.patchClassModules(WebpackModules.findAll(this.moduleFilter.bind(this)));\r\n this.normalizeElement(document.querySelector(\"#app-mount\"));\r\n this.hasPatched = true;\r\n this.patchDOMMethods();\r\n }\r\n\r\n patchClassModules(modules) {\r\n for (const module of modules) {\r\n this.patchClassModule(normalizedPrefix, module);\r\n }\r\n }\r\n\r\n unpatchClassModules(modules) {\r\n for (const module of modules) {\r\n this.unpatchClassModule(normalizedPrefix, module);\r\n }\r\n }\r\n\r\n shouldIgnore(value) {\r\n if (!isNaN(value)) return true;\r\n if (value.endsWith(\"px\") || value.endsWith(\"ch\") || value.endsWith(\"em\") || value.endsWith(\"ms\")) return true;\r\n if (value.startsWith(\"layerContainer-\")) return true;\r\n if (value.startsWith(\"#\") && (value.length == 7 || value.length == 4)) return true;\r\n if (value.includes(\"calc(\") || value.includes(\"rgba\")) return true;\r\n return false;\r\n }\r\n\r\n moduleFilter(module) {\r\n if (typeof module !== \"object\" || Array.isArray(module)) return false;\r\n if (module.__esModule) return false;\r\n if (!Object.keys(module).length) return false;\r\n for (const baseClassName in module) {\r\n const value = module[baseClassName];\r\n if (typeof value !== \"string\") return false;\r\n if (this.shouldIgnore(value)) continue;\r\n if (value.split(\"-\").length === 1) return false;\r\n if (!randClass.test(value.split(\" \")[0])) return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n patchClassModule(componentName, classNames) {\r\n for (const baseClassName in classNames) {\r\n const value = classNames[baseClassName];\r\n if (this.shouldIgnore(value)) continue;\r\n const classList = value.split(\" \");\r\n for (const normalClass of classList) {\r\n const match = normalClass.match(randClass);\r\n if (!match || !match.length || match.length < 2) continue; // Shouldn't ever happen since they passed the moduleFilter, but you never know\r\n const camelCase = match[1].split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\r\n classNames[baseClassName] += ` ${componentName}-${camelCase}`;\r\n }\r\n }\r\n }\r\n\r\n unpatchClassModule(componentName, classNames) {\r\n for (const baseClassName in classNames) {\r\n const value = classNames[baseClassName];\r\n if (this.shouldIgnore(value)) continue;\r\n let newString = \"\";\r\n const classList = value.split(\" \");\r\n for (const normalClass of classList) {\r\n if (normalClass.startsWith(`${componentName}-`)) continue;\r\n newString += ` ${normalClass}`;\r\n }\r\n classNames[baseClassName] = newString.trim();\r\n }\r\n }\r\n\r\n normalizeElement(element) {\r\n if (!(element instanceof Element)) return;\r\n const classes = element.classList;\r\n for (let c = 0, clen = classes.length; c < clen; c++) {\r\n if (!randClass.test(classes[c])) continue;\r\n const match = classes[c].match(randClass)[1];\r\n const newClass = match.split(\"-\").map((s, i) => i ? s[0].toUpperCase() + s.slice(1) : s).join(\"\");\r\n element.classList.add(`${normalizedPrefix}-${newClass}`);\r\n }\r\n for (const child of element.children) this.normalizeElement(child);\r\n }\r\n\r\n revertElement(element) {\r\n if (!(element instanceof Element)) return;\r\n if (element.children && element.children.length) this.revertElement(element.children[0]);\r\n if (element.nextElementSibling) this.revertElement(element.nextElementSibling);\r\n const classes = element.classList;\r\n const toRemove = [];\r\n for (let c = 0; c < classes.length; c++) {\r\n if (classes[c].startsWith(`${normalizedPrefix}-`)) toRemove.push(classes[c]);\r\n }\r\n element.classList.remove(...toRemove);\r\n }\r\n\r\n patchDOMMethods() {\r\n const contains = DOMTokenList.prototype.contains;\r\n DOMTokenList.prototype.contains = function(token) {\r\n // const tokens = token.split(\" \");\r\n return Reflect.apply(contains, this, [token.split(\" \")[0]]);\r\n // return tokens.every(t => contains.call(this, t));\r\n };\r\n\r\n const add = DOMTokenList.prototype.add;\r\n DOMTokenList.prototype.add = function(...tokens) {\r\n for (let t = 0; t < tokens.length; t++) {\r\n tokens[t] = tokens[t].split(\" \")[0];\r\n }\r\n return Reflect.apply(add, this, tokens);\r\n };\r\n\r\n const remove = DOMTokenList.prototype.remove;\r\n DOMTokenList.prototype.remove = function(...tokens) {\r\n for (let t = 0; t < tokens.length; t++) {\r\n tokens[t] = tokens[t].split(\" \")[0];\r\n }\r\n return Reflect.apply(remove, this, tokens);\r\n };\r\n }\r\n\r\n};","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"./v2\";\r\nimport DOM from \"./domtools\";\r\nimport Utils from \"./utils\";\r\n\r\nexport default new class DevMode {\r\n constructor() {\r\n this.debugListener = this.debugListener.bind(this);\r\n this.copySelectorListener = this.copySelectorListener.bind(this);\r\n }\r\n\r\n start() {\r\n this.startDebugListener();\r\n if (settingsCookie[\"fork-dm-1\"]) this.startCopySelector();\r\n }\r\n \r\n stop() {\r\n this.stopDebugListener();\r\n this.stopCopySelector();\r\n }\r\n\r\n startDebugListener() {\r\n this.stopDebugListener();\r\n document.addEventListener(\"keydown\", this.debugListener);\r\n }\r\n\r\n stopDebugListener() {\r\n document.removeEventListener(\"keydown\", this.debugListener);\r\n }\r\n\r\n startCopySelector() {\r\n this.stopCopySelector();\r\n document.addEventListener(\"contextmenu\", this.copySelectorListener);\r\n }\r\n\r\n stopCopySelector() {\r\n document.removeEventListener(\"contextmenu\", this.copySelectorListener);\r\n }\r\n\r\n debugListener(e) {\r\n if (e.which === 119 || e.which == 118) {//F8\r\n console.log(\"%c[%cDevMode%c] %cBreak/Resume\", \"color: red;\", \"color: #303030; font-weight:700;\", \"color:red;\", \"\");\r\n debugger; // eslint-disable-line no-debugger\r\n e.preventDefault();\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n\r\n copySelectorListener(e) {\r\n try{\r\n e.stopPropagation();\r\n const selector = this.getSelector(e.target);\r\n \r\n let [\r\n classLayer, \r\n classItems\r\n ] = [\r\n BDModules.get((e) => e.layer && typeof e.layer === \"string\" && e.disabledPointerEvents)[0],\r\n BDModules.get((e) => e.menu)[0]\r\n ]\r\n \r\n function attach() {\r\n if(!classItems || !classLayer.layer)return console.log(classItems, classLayer.layer)\r\n\r\n let cm = DOM.query(\".\"+Utils.removeDa(classItems.menu));\r\n if (!cm) {\r\n const container = DOM.query(\"#app-mount > .\"+Utils.removeDa(classLayer.layerContainer));\r\n const cmWrap = DOM.createElement(`<div class=\"${classLayer.layer}\">`);\r\n cm = DOM.createElement(`<div class=\"${classItems.menu} ${classItems.styleFlexible} ${classItems.accommodateScrollbar} bd-context-menu\" style=\"\"></div>`);\r\n cmWrap.append(cm);\r\n container.append(cmWrap);\r\n cmWrap.style.top = e.clientY + \"px\";\r\n cmWrap.style.left = e.clientX + \"px\";\r\n cmWrap.setAttribute(\"role\", \"menu\")\r\n cmWrap.setAttribute(\"tabindex\", \"-1\")\r\n cmWrap.id = \"bd-copy-selector-context\"\r\n cmWrap.setAttribute(\"aria-label\", \"Copy Selector Actions\")\r\n\r\n const scrollerClasses = BDModules.get((e) => e.scrollerWrap)[0]\r\n const scrollerWrap = DOM.createElement(`<div class=\"${scrollerClasses.scrollerWrap} ${scrollerClasses.scrollerThemed} ${scrollerClasses.themeGhostHairline}\"></div>`)\r\n const scroller = DOM.createElement(`<div class=\"${BDModules.get(e => e.scroller)[0].scroller} ${classItems.scroller}\"></div>`)\r\n scrollerWrap.append(scroller)\r\n cm.append(scrollerWrap)\r\n\r\n const removeCM = function(e) {\r\n if (e.keyCode && e.keyCode !== 27) return;\r\n cmWrap.remove();\r\n document.removeEventListener(\"click\", removeCM);\r\n document.removeEventListener(\"contextmenu\", removeCM);\r\n document.removeEventListener(\"keyup\", removeCM);\r\n };\r\n document.addEventListener(\"click\", removeCM);\r\n document.addEventListener(\"contextmenu\", removeCM);\r\n document.addEventListener(\"keyup\", removeCM);\r\n }\r\n const cmWrap = cm.parentElement\r\n \r\n const scroller = cm.childNodes[0].childNodes[0]\r\n const cmg = DOM.createElement(`<div role=\"group\"></div>`);\r\n /**\r\n * @type {HTMLElement}\r\n */\r\n const cmi = DOM.createElement(`<div class=\"${classItems.item} ${classItems.labelContainer} ${classItems.colorDefault}\" role=\"menuitem\" id=\"bd-copy-selector-item-cm\"></div>`);\r\n cmi.append(DOM.createElement(`<div class=\"${classItems.label}\">Copy Selector</div>`));\r\n cmi.addEventListener(\"click\", () => {\r\n BDV2.NativeModule.copy(selector);\r\n cmWrap.style.display = \"none\"\r\n });\r\n cmi.addEventListener(\"mouseover\", (e) => {\r\n let elements = DOM.queryAll(\"div[role=menuitem].\"+Utils.removeDa(classItems.focused))\r\n elements && elements.forEach(elem => elem.classList.remove(classItems.focused))\r\n cmi.classList.add(classItems.focused)\r\n })\r\n cmi.addEventListener(\"mouseout\", (e) => {\r\n cmi.classList.remove(classItems.focused)\r\n })\r\n cmg.append(cmi);\r\n if(scroller.childNodes.length){ // apend a separator\r\n const separator = DOM.createElement(`<div role=\"separator\" class=\"${classItems.separator}\"></div>`)\r\n scroller.append(separator)\r\n }\r\n scroller.append(cmg);\r\n if(cmWrap.clientHeight < cmWrap.scrollHeight){\r\n console.log(\"overflowing \"+cmWrap.style.top)\r\n cmWrap.style.top = (cmWrap.style.top - cmg.clientHeight) + \"px\";\r\n console.log(\"overflowing\"+cmWrap.style.top)\r\n }\r\n }\r\n \r\n setTimeout(attach, 1);\r\n }catch(e){\r\n console.error(e)\r\n }\r\n }\r\n\r\n getSelector(element) {\r\n if (element.id) return `#${element.id}`;\r\n /**\r\n * \r\n * @param {HTMLElement} el \r\n */\r\n function fullPath(el){\r\n var names = [];\r\n while (el.parentNode){\r\n if (el.id){\r\n names.unshift('#'+el.id);\r\n break;\r\n }else{\r\n if (el==el.ownerDocument.documentElement) names.unshift(el.tagName.toLowerCase()+Array.from(el.classList.entries()).map(e => \".\"+e).join(\"\"));\r\n else{\r\n for (var c=1,e=el;e.previousElementSibling;e=e.previousElementSibling,c++);\r\n names.unshift(el.tagName.toLowerCase()+((typeof el.className === \"string\" && el.className) || \"\").split(\" \").filter(e => !!e).map(e => \".\"+e).join(\"\")+\":nth-child(\"+c+\")\");\r\n }\r\n el=el.parentNode;\r\n }\r\n }\r\n return names.join(\" > \");\r\n }\r\n return fullPath(element)\r\n }\r\n};","import BDV2 from \"../../modules/v2\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class Switch extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {checked: this.props.checked};\r\n this.onChange = this.onChange.bind(this);\r\n this.switch = <Lightcord.Api.Components.inputs.Switch onChange={this.onChange} value={this.state.checked} />\r\n }\r\n\r\n onChange(value) {\r\n if (this.props.disabled) return;\r\n this.props.onChange(value);\r\n this.setState({checked: value});\r\n }\r\n\r\n render() {\r\n return this.switch\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\nimport Switch from \"./components/switch\";\r\n\r\nlet classnames = []\r\nfunction getClassName(name){\r\n let className = classnames.find(e => e.startsWith(name+\"-\"))\r\n if(className)return className\r\n className = BDModules.get(e => e[name])[0][name]\r\n classnames.push(className)\r\n return className\r\n}\r\n\r\nexport default class SwitchItem extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n onChange() {\r\n this.props.checked = !this.props.checked;\r\n this.props.onChange(this.props.id, this.props.checked);\r\n }\r\n\r\n render() {\r\n let {text, info} = this.props.data;\r\n if(!classnames.find(e => e.startsWith(\"beta-\"))){\r\n classnames.push(BDModules.get(e => e.beta && (!e.container && !e.userSettingsVoice))[0].beta)\r\n }\r\n if(this.props.data.experimental){\r\n info = [\r\n info,\r\n React.createElement(\"sup\", {className: getClassName(\"beta\")}, \"(EXPERIMENTAL)\")\r\n ]\r\n }\r\n return BDV2.react.createElement(\"div\", {className: \"ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item\"},\r\n BDV2.react.createElement(\"div\", {className: \"ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap\"},\r\n BDV2.react.createElement(\"h3\", {key: \"title\", className: \"ui-form-title h3 margin-reset margin-reset ui-flex-child\"}, text),\r\n BDV2.react.createElement(Switch, {key: \"switch\", onChange: this.onChange, checked: this.props.checked})\r\n ),\r\n BDV2.react.createElement(\"div\", {className: \"ui-form-text style-description margin-top-4\", style: {flex: \"1 1 auto\"}}, info)\r\n );\r\n }\r\n}","let marginModule = BDModules.get(e => e.marginTop60)[0]\r\n\r\nexport default class MarginTop extends React.Component {\r\n render(){\r\n if(!marginModule)marginModule = BDModules.get(e => e.marginTop60)[0]\r\n return <div className={marginModule.marginTop60}></div>\r\n }\r\n}","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"../modules/v2\";\r\n\r\nimport SettingsTitle from \"./settingsTitle\";\r\nimport Switch from \"./switch\";\r\nimport MarginTop from \"./margintop\";\r\n\r\nlet formModule\r\nlet switchItem\r\nlet betaClassNames\r\nexport default class V2C_SettingsGroup extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n error: false\r\n }\r\n }\r\n\r\n renderOldSettings() {\r\n const {title, settings, button} = this.props;\r\n const buttonComponent = button ? BDV2.react.createElement(\"button\", {key: \"title-button\", className: \"bd-pfbtn\", onClick: button.onClick}, button.title) : null;\r\n return [BDV2.react.createElement(SettingsTitle, {text: title}),\r\n buttonComponent,\r\n settings.map(setting => {\r\n return BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: settingsCookie[setting.id], onChange: (id, checked) => {\r\n this.props.onChange(id, checked);\r\n }});\r\n })];\r\n }\r\n\r\n componentDidCatch(err, errInfo){\r\n console.log(err, errInfo)\r\n this.setState({\r\n error: true\r\n })\r\n }\r\n\r\n render(){\r\n if(this.state.error){\r\n try{\r\n return this.renderOldSettings()\r\n }catch(e){\r\n console.error(e)\r\n return null\r\n }\r\n }else{\r\n try{\r\n if(!formModule)formModule = BDV2.WebpackModules.find(e => e.FormSection)\r\n if(!switchItem)switchItem = BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"SwitchItem\")\r\n if(!betaClassNames)betaClassNames = BDV2.WebpackModules.find(e => e.beta && (!e.container && !e.userSettingsVoice))\r\n \r\n let children = []\r\n if(this.props.description){\r\n children.push(<formModule.FormText type=\"description\" selectable={false}>\r\n {this.props.description}\r\n </formModule.FormText>, <MarginTop></MarginTop>)\r\n }\r\n children.push(...this.props.settings.map(setting => {\r\n let info = [\r\n setting.text\r\n ]\r\n if(setting.experimental){\r\n info.push(<sup className={betaClassNames.beta}>(EXPERIMENTAL)</sup>)\r\n }\r\n return <switchItem.default onChange={(ev) => {\r\n this.props.onChange(setting.id, ev.target.checked);\r\n this.forceUpdate()\r\n }} key={setting.id} value={settingsCookie[setting.id]} className={__SECRET_EMOTION__.css({\r\n marginBottom: \"20px\"\r\n })} disabled={false} hideBorder={false}\r\n size={switchItem.default.Sizes.DEFAULT} theme={switchItem.default.Themes.DEFAULT} note={setting.info}>\r\n {info}\r\n </switchItem.default>\r\n }))\r\n return <formModule.FormSection tag=\"h2\" title={this.props.title}>\r\n {children}\r\n </formModule.FormSection>\r\n }catch(e){\r\n console.error(e)\r\n setImmediate(()=>{\r\n this.setState({\r\n error: true\r\n })\r\n })\r\n return null\r\n }\r\n }\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nimport SettingsGroup from \"./settingsGroup\";\r\nimport MarginTop from \"./margintop\";\r\n\r\nexport default class V2C_SectionedSettingsPanel extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return this.props.sections.map((section, i) => {\r\n return [\r\n i !== 0 ? BDV2.react.createElement(MarginTop, {}) : null,\r\n BDV2.react.createElement(SettingsGroup, Object.assign({}, section, {onChange: this.props.onChange}))\r\n ]\r\n })\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_Checkbox extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n this.onClick = this.onClick.bind(this);\r\n this.setInitialState();\r\n }\r\n\r\n setInitialState() {\r\n this.state = {\r\n checked: this.props.checked || false\r\n };\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\r\n \"li\",\r\n null,\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"checkbox \"+BDModules.get(e => e.checkboxElement)[0].checkbox, onClick: this.onClick},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {className: \"checkbox-inner \"+BDModules.get(e => e.checkboxInner)[0].checkboxInner},\r\n BDV2.react.createElement(\"input\", {className: BDModules.get(e => e.checkboxElement)[0].checkboxElement, checked: this.state.checked, onChange: () => {}, type: \"checkbox\"}),\r\n BDV2.react.createElement(\"span\", null)\r\n ),\r\n BDV2.react.createElement(\r\n \"span\",\r\n null,\r\n this.props.text\r\n )\r\n )\r\n );\r\n }\r\n\r\n onClick() {\r\n this.props.onChange(this.props.id, !this.state.checked);\r\n this.setState({\r\n checked: !this.state.checked\r\n });\r\n }\r\n}","import {settingsCookie} from \"../0globals\";\r\nimport Settings from \"../modules/settingsPanel\";\r\nimport BDV2 from \"../modules/v2\";\r\nimport DataStore from \"../modules/dataStore\";\r\nimport DOM from \"../modules/domtools\";\r\nimport Utils from \"../modules/utils\"\r\n\r\nimport Checkbox from \"./checkbox\";\r\n\r\nexport default class V2C_CssEditorDetached extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n const self = this;\r\n self.onClick = self.onClick.bind(self);\r\n self.updateCss = self.updateCss.bind(self);\r\n self.saveCss = self.saveCss.bind(self);\r\n self.onChange = self.onChange.bind(self);\r\n }\r\n\r\n componentDidMount() {\r\n DOM.addClass(DOM.query(\"#app-mount\"), \"bd-detached-editor\");\r\n BDV2.editorDetached = true;\r\n // this.updateLineCount();\r\n this.editor = ace.edit(\"bd-customcss-editor-detached\");\r\n this.editor.setTheme(\"ace/theme/discord\");\r\n this.editor.session.setMode(\"ace/mode/css\");\r\n this.editor.setShowPrintMargin(false);\r\n this.editor.setFontSize(14);\r\n this.editor.on(\"change\", () => {\r\n if (!settingsCookie[\"bda-css-0\"]) return;\r\n this.saveCss();\r\n this.updateCss();\r\n });\r\n\r\n }\r\n\r\n componentWillUnmount() {\r\n DOM.removeClass(DOM.query(\"#app-mount\"), \"bd-detached-editor\");\r\n BDV2.editorDetached = false;\r\n this.editor.destroy();\r\n }\r\n\r\n updateLineCount() {\r\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\r\n if (lineCount == this.props.lines) return;\r\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\r\n this.props.lines = lineCount;\r\n }\r\n\r\n get options() {\r\n return {\r\n lineNumbers: true,\r\n mode: \"css\",\r\n indentUnit: 4,\r\n theme: \"material\",\r\n scrollbarStyle: \"simple\"\r\n };\r\n }\r\n\r\n get css() {\r\n const _ccss = DataStore.getBDData(\"bdcustomcss\");\r\n let ccss = \"\";\r\n if (_ccss && _ccss !== \"\") {\r\n ccss = Buffer.from(_ccss, \"base64\").toString(\"utf8\");\r\n }\r\n return ccss;\r\n }\r\n\r\n get root() {\r\n const _root = DOM.query(\"#bd-customcss-detach-container\");\r\n if (!_root) {\r\n if (!this.injectRoot()) return null;\r\n return this.detachedRoot;\r\n }\r\n return _root;\r\n }\r\n\r\n injectRoot() {\r\n const app = DOM.query(\".app, .\"+Utils.removeDa(BDModules.get(e => e.app && e.layers)[0].app));\r\n if (!app) return false;\r\n DOM.insertAfter(DOM.createElement(`<div id=\"bd-customcss-detach-container\">`), app);\r\n return true;\r\n }\r\n\r\n render() {\r\n const self = this;\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: \"bd-detached-css-editor\", id: \"bd-customcss-detach-editor\"},\r\n BDV2.react.createElement(\r\n \"div\",\r\n {id: \"bd-customcss-innerpane\"},\r\n BDV2.react.createElement(\"div\", {className: \"editor-wrapper\"},\r\n BDV2.react.createElement(\"div\", {id: \"bd-customcss-editor-detached\", className: \"editor\", ref: \"editor\"}, self.css)\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {id: \"bd-customcss-attach-controls\"},\r\n BDV2.react.createElement(\r\n \"ul\",\r\n {className: \"checkbox-group\"},\r\n BDV2.react.createElement(Checkbox, {id: \"live-update\", text: \"Live Update\", onChange: self.onChange, checked: settingsCookie[\"bda-css-0\"]})\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {id: \"bd-customcss-detach-controls-button\"},\r\n BDV2.react.createElement(\r\n \"button\",\r\n {style: {borderRadius: \"3px 0 0 3px\", borderRight: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\r\n self.onClick(\"update\");\r\n }},\r\n \"Update\"\r\n ),\r\n BDV2.react.createElement(\r\n \"button\",\r\n {style: {borderRadius: \"0\", borderLeft: \"1px solid #2d2d2d\", borderRight: \"1px solid #2d2d2d\"}, className: \"btn btn-primary\", onClick: () => {\r\n self.onClick(\"save\");\r\n }},\r\n \"Save\"\r\n ),\r\n BDV2.react.createElement(\r\n \"button\",\r\n {style: {borderRadius: \"0 3px 3px 0\", borderLeft: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\r\n self.onClick(\"attach\");\r\n }},\r\n \"Attach\"\r\n ),\r\n BDV2.react.createElement(\r\n \"span\",\r\n {style: {fontSize: \"10px\", marginLeft: \"5px\"}},\r\n \"Unsaved changes are lost on attach\"\r\n )\r\n )\r\n )\r\n )\r\n );\r\n }\r\n\r\n onChange(id, checked) {\r\n switch (id) {\r\n case \"live-update\":\r\n settingsCookie[\"bda-css-0\"] = checked;\r\n Settings.saveSettings();\r\n break;\r\n }\r\n }\r\n\r\n onClick(id) {\r\n const self = this;\r\n switch (id) {\r\n case \"attach\":\r\n if (DOM.query(\"#editor-detached\")) self.props.attach();\r\n BDV2.reactDom.unmountComponentAtNode(self.root);\r\n self.root.remove();\r\n break;\r\n case \"update\":\r\n self.updateCss();\r\n break;\r\n case \"save\":\r\n self.saveCss();\r\n break;\r\n }\r\n }\r\n\r\n updateCss() {\r\n DOM.removeStyle(\"customcss\");\r\n DOM.addStyle(\"customcss\", this.editor.session.getValue());\r\n }\r\n\r\n saveCss() {\r\n DataStore.setBDData(\"bdcustomcss\", Buffer.from(this.editor.session.getValue(), \"utf-8\").toString(\"base64\"));\r\n }\r\n}","import {settingsCookie} from \"../0globals\";\r\nimport Settings from \"../modules/settingsPanel\";\r\nimport BDV2 from \"../modules/v2\";\r\nimport DataStore from \"../modules/dataStore\";\r\nimport DOM from \"../modules/domtools\";\r\nimport Utils from \"../modules/utils\"\r\n\r\nimport SettingsTitle from \"./settingsTitle\";\r\nimport Checkbox from \"./checkbox\";\r\nimport V2C_CssEditorDetached from \"./cssEditorDetached\";\r\n\r\nexport default class V2C_CssEditor extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n const self = this;\r\n self.props.lines = 0;\r\n self.setInitialState();\r\n self.attach = self.attach.bind(self);\r\n self.detachedEditor = BDV2.react.createElement(V2C_CssEditorDetached, {attach: self.attach});\r\n self.onClick = self.onClick.bind(self);\r\n self.updateCss = self.updateCss.bind(self);\r\n self.saveCss = self.saveCss.bind(self);\r\n self.detach = self.detach.bind(self);\r\n }\r\n\r\n setInitialState() {\r\n this.state = {\r\n detached: this.props.detached || BDV2.editorDetached\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n // this.updateLineCount();\r\n this.editor = ace.edit(\"bd-customcss-editor\");\r\n this.editor.setTheme(\"ace/theme/discord\");\r\n this.editor.session.setMode(\"ace/mode/css\");\r\n this.editor.setShowPrintMargin(false);\r\n this.editor.setFontSize(14);\r\n this.editor.on(\"change\", () => {\r\n if (!settingsCookie[\"bda-css-0\"]) return;\r\n this.saveCss();\r\n this.updateCss();\r\n });\r\n }\r\n\r\n componentWillUnmount() {\r\n this.editor.destroy();\r\n }\r\n\r\n componentDidUpdate(prevProps, prevState) {\r\n const self = this;\r\n if (prevState.detached && !self.state.detached) {\r\n BDV2.reactDom.unmountComponentAtNode(self.detachedRoot);\r\n }\r\n }\r\n\r\n codeMirror() {\r\n }\r\n\r\n get options() {\r\n return {\r\n lineNumbers: true,\r\n mode: \"css\",\r\n indentUnit: 4,\r\n theme: \"material\",\r\n scrollbarStyle: \"simple\"\r\n };\r\n }\r\n\r\n get css() {\r\n const _ccss = DataStore.getBDData(\"bdcustomcss\");\r\n let ccss = \"\";\r\n if (_ccss && _ccss !== \"\") {\r\n ccss = Buffer.from(_ccss, \"base64\").toString(\"utf8\");\r\n }\r\n return ccss;\r\n }\r\n\r\n updateLineCount() {\r\n const lineCount = this.refs.editor.value.split(\"\\n\").length;\r\n if (lineCount == this.props.lines) return;\r\n this.refs.lines.textContent = Array.from(new Array(lineCount), (_, i) => i + 1).join(\".\\n\") + \".\";\r\n this.props.lines = lineCount;\r\n }\r\n\r\n render() {\r\n const self = this;\r\n\r\n const {detached} = self.state;\r\n return [\r\n detached && BDV2.react.createElement(\r\n \"div\",\r\n {id: \"editor-detached\"},\r\n BDV2.react.createElement(SettingsTitle, {text: \"Custom CSS Editor\"}),\r\n BDV2.react.createElement(\r\n \"h3\",\r\n null,\r\n \"Editor Detached\"\r\n ),\r\n BDV2.react.createElement(\r\n \"button\",\r\n {className: \"btn btn-primary\", onClick: () => {\r\n self.attach();\r\n }},\r\n \"Attach\"\r\n )\r\n ),\r\n !detached && BDV2.react.createElement(\r\n \"div\",\r\n null,\r\n BDV2.react.createElement(SettingsTitle, {text: \"Custom CSS Editor\"}),\r\n BDV2.react.createElement(\"div\", {className: \"editor-wrapper\"},\r\n BDV2.react.createElement(\"div\", {id: \"bd-customcss-editor\", className: \"editor\", ref: \"editor\"}, self.css)\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {id: \"bd-customcss-attach-controls\"},\r\n BDV2.react.createElement(\r\n \"ul\",\r\n {className: \"checkbox-group\"},\r\n BDV2.react.createElement(Checkbox, {id: \"live-update\", text: \"Live Update\", onChange: this.onChange, checked: settingsCookie[\"bda-css-0\"]})\r\n ),\r\n BDV2.react.createElement(\r\n \"div\",\r\n {id: \"bd-customcss-detach-controls-button\"},\r\n BDV2.react.createElement(\r\n \"button\",\r\n {style: {borderRadius: \"3px 0 0 3px\", borderRight: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\r\n self.onClick(\"update\");\r\n }},\r\n \"Update\"\r\n ),\r\n BDV2.react.createElement(\r\n \"button\",\r\n {style: {borderRadius: \"0\", borderLeft: \"1px solid #2d2d2d\", borderRight: \"1px solid #2d2d2d\"}, className: \"btn btn-primary\", onClick: () => {\r\n self.onClick(\"save\");\r\n }},\r\n \"Save\"\r\n ),\r\n BDV2.react.createElement(\r\n \"button\",\r\n {style: {borderRadius: \"0 3px 3px 0\", borderLeft: \"1px solid #3f4146\"}, className: \"btn btn-primary\", onClick: () => {\r\n self.onClick(\"detach\");\r\n }},\r\n \"Detach\"\r\n ),\r\n BDV2.react.createElement(\r\n \"span\",\r\n {style: {fontSize: \"10px\", marginLeft: \"5px\"}},\r\n \"Unsaved changes are lost on detach\"\r\n ),\r\n BDV2.react.createElement(\"div\", {className: \"help-text\"},\r\n \"Press \",\r\n BDV2.react.createElement(\"code\", {className: \"inline\"}, \"ctrl\"),\r\n \"+\",\r\n BDV2.react.createElement(\"span\", {className: \"inline\"}, \",\"),\r\n \" with the editor focused to access the editor's settings.\"\r\n )\r\n )\r\n )\r\n )\r\n ]\r\n }\r\n\r\n onClick(arg) {\r\n const self = this;\r\n switch (arg) {\r\n case \"update\":\r\n self.updateCss();\r\n break;\r\n case \"save\":\r\n self.saveCss();\r\n break;\r\n case \"detach\":\r\n self.detach();\r\n break;\r\n }\r\n }\r\n\r\n onChange(id, checked) {\r\n switch (id) {\r\n case \"live-update\":\r\n settingsCookie[\"bda-css-0\"] = checked;\r\n Settings.saveSettings();\r\n break;\r\n }\r\n }\r\n\r\n updateCss() {\r\n DOM.removeStyle(\"customcss\");\r\n DOM.addStyle(\"customcss\", this.editor.session.getValue());\r\n }\r\n\r\n saveCss() {\r\n DataStore.setBDData(\"bdcustomcss\", Buffer.from(this.editor.session.getValue(), \"utf-8\").toString(\"base64\"));\r\n }\r\n\r\n detach() {\r\n const self = this;\r\n self.setState({\r\n detached: true\r\n });\r\n const droot = self.detachedRoot;\r\n if (!droot) {\r\n console.log(\"FAILED TO INJECT ROOT: .app\");\r\n return;\r\n }\r\n BDV2.reactDom.render(self.detachedEditor, droot);\r\n }\r\n\r\n get detachedRoot() {\r\n const _root = DOM.query(\"#bd-customcss-detach-container\");\r\n if (!_root) {\r\n if (!this.injectDetachedRoot()) return null;\r\n return this.detachedRoot;\r\n }\r\n return _root;\r\n }\r\n\r\n injectDetachedRoot() {\r\n const app = DOM.query(\".app, .\"+Utils.removeDa(BDModules.get(e => e.app && e.layers)[0].app));\r\n if (!app) return false;\r\n DOM.insertAfter(DOM.createElement(`<div id=\"bd-customcss-detach-container\">`), app);\r\n return true;\r\n }\r\n\r\n attach() {\r\n const self = this;\r\n self.setState({\r\n detached: false\r\n });\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class BDErrorBoundary extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n this.state = {hasError: false};\r\n }\r\n\r\n componentDidCatch() {\r\n this.setState({hasError: true});\r\n }\r\n\r\n render() {\r\n if (this.state.hasError) return BDV2.react.createElement(\"div\", {className: \"react-error\"}, \"Component Error\"); \r\n return this.props.children; \r\n }\r\n}\r\n\r\nconst originalRender = BDErrorBoundary.prototype.render;\r\nObject.defineProperty(BDErrorBoundary.prototype, \"render\", {\r\n enumerable: false,\r\n configurable: false,\r\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\r\n get: () => originalRender\r\n}); ","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_ContentColumn extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n static get displayName() {return \"ContentColumn\";}\r\n\r\n render() {\r\n //let contentModule = BDModules.get(e => e.contentColumn)[0]\r\n let title = this.props.title ? BDV2.react.createElement(\"h2\", {className: \"ui-form-title h2 margin-reset margin-bottom-20\"}, this.props.title) : null\r\n return [\r\n title,\r\n this.props.children\r\n ]\r\n return BDV2.react.createElement(\r\n \"div\",\r\n {className: contentModule.contentColumn + \" \"+contentModule.contentColumnDefault+\" content-column default\", style: {padding: \"60px 40px 0px\"}},\r\n title,\r\n this.props.children\r\n );\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class V2C_ReloadIcon extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return BDV2.react.createElement(\"svg\", {\r\n xmlns: \"http://www.w3.org/2000/svg\",\r\n viewBox: \"0 0 24 24\",\r\n fill: \"#dcddde\",\r\n className: \"bd-reload \" + this.props.className,\r\n onClick: this.props.onClick,\r\n style: {width: this.props.size || \"24px\", height: this.props.size || \"24px\"}\r\n },\r\n BDV2.react.createElement(\"path\", {d: \"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"}),\r\n BDV2.react.createElement(\"path\", {fill: \"none\", d: \"M0 0h24v24H0z\"})\r\n );\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class Edit extends React.Component {\r\n render() {\r\n const size = this.props.size || \"24px\";\r\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}>\r\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\" />\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n </svg>;\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class Delete extends React.Component {\r\n render() {\r\n const size = this.props.size || \"24px\";\r\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}>\r\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\"/>\r\n <path fill=\"none\" d=\"M0 0h24v24H0z\"/>\r\n </svg>;\r\n }\r\n}","import {settingsCookie} from \"../0globals\";\r\nimport BDV2 from \"../modules/v2\";\r\nimport Utils from \"../modules/utils\";\r\nimport DOM from \"../modules/domtools\";\r\n\r\nimport XSvg from \"./xSvg\";\r\nimport ReloadIcon from \"./reloadIcon\";\r\nimport EditIcon from \"./icons/edit\";\r\nimport DeleteIcon from \"./icons/delete\";\r\nimport Switch from \"./components/switch\";\r\nimport TooltipWrap from \"./tooltipWrap\";\r\nimport { processFile } from \"../modules/pluginCertifier\";\r\nimport contentManager from \"../modules/contentManager\";\r\nimport { resolve } from \"path\";\r\n\r\nconst React = BDV2.React;\r\nconst anchorClasses = BDV2.anchorClasses;\r\n\r\nexport default class V2C_PluginCard extends BDV2.reactComponent {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.onChange = this.onChange.bind(this);\r\n this.showSettings = this.showSettings.bind(this);\r\n this.setInitialState();\r\n this.hasSettings = this.props.addon.plugin && typeof(this.props.addon.plugin.getSettingsPanel) === \"function\";\r\n this.settingsPanel = \"\";\r\n\r\n this.edit = this.edit.bind(this);\r\n this.delete = this.delete.bind(this);\r\n this.reload = this.reload.bind(this);\r\n }\r\n\r\n setInitialState() {\r\n this.state = {\r\n checked: this.props.enabled,\r\n settings: false,\r\n reloads: 0,\r\n trusted: false\r\n };\r\n }\r\n\r\n showSettings() {\r\n if (!this.hasSettings) return;\r\n this.setState({settings: true});\r\n }\r\n\r\n closeSettings() {\r\n this.panelRef.current.innerHTML = \"\";\r\n this.setState({settingsOpen: false});\r\n }\r\n\r\n componentDidUpdate() {\r\n if (!this.state.settings) return;\r\n if (typeof this.settingsPanel === \"object\") {\r\n this.refs.settingspanel.appendChild(this.settingsPanel);\r\n }\r\n\r\n if (!settingsCookie[\"fork-ps-3\"]) return;\r\n setImmediate(() => {\r\n const isHidden = (container, element) => {\r\n if(!container){\r\n console.error(new Error(`Container is undefined.`))\r\n return false\r\n }\r\n const cTop = container.scrollTop;\r\n const cBottom = cTop + container.clientHeight;\r\n const eTop = element.offsetTop;\r\n const eBottom = eTop + element.clientHeight;\r\n return (eTop < cTop || eBottom > cBottom);\r\n };\r\n\r\n const thisNode = this.refs.cardNode;\r\n const container = thisNode.closest(\"div[class*=\\\"contentRegionScroller-\\\"]\")\r\n if (!isHidden(container, thisNode)) return;\r\n const thisNodeOffset = DOM.offset(thisNode);\r\n const containerOffset = DOM.offset(container);\r\n const original = container.scrollTop;\r\n const endPoint = thisNodeOffset.top - containerOffset.top + container.scrollTop - 30;\r\n DOM.animate({\r\n duration: 300,\r\n update: function(progress) {\r\n if (endPoint > original) container.scrollTop = original + (progress * (endPoint - original));\r\n else container.scrollTop = original - (progress * (original - endPoint));\r\n }\r\n });\r\n });\r\n }\r\n\r\n\r\n getString(value) {\r\n if (!value) return \"???\";\r\n return typeof value == \"string\" ? value : value.toString();\r\n }\r\n\r\n get settingsComponent() {\r\n try { this.settingsPanel = this.props.addon.plugin.getSettingsPanel(); }\r\n catch (err) { Utils.err(\"Plugins\", \"Unable to get settings panel for \" + this.name + \".\", err); }\r\n\r\n return BDV2.react.createElement(\"div\", {className: \"bd-card bd-addon-card settings-open ui-switch-item\", ref: \"cardNode\"},\r\n BDV2.react.createElement(\"div\", {style: {\"float\": \"right\", \"cursor\": \"pointer\"}, onClick: () => {\r\n this.refs.settingspanel.innerHTML = \"\";\r\n this.setState({settings: false});\r\n }},\r\n BDV2.react.createElement(XSvg, null)\r\n ),\r\n typeof this.settingsPanel === \"object\" && BDV2.react.createElement(\"div\", {id: `plugin-settings-${this.name}`, className: \"plugin-settings\", ref: \"settingspanel\"}),\r\n typeof this.settingsPanel !== \"object\" && BDV2.react.createElement(\"div\", {id: `plugin-settings-${this.name}`, className: \"plugin-settings\", ref: \"settingspanel\", dangerouslySetInnerHTML: {__html: this.settingsPanel}})\r\n );\r\n }\r\n\r\n buildTitle(name, version, author) {\r\n const title = \"{{name}} v{{version}} by {{author}}\".split(/({{[A-Za-z]+}})/);\r\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\r\n if (nameIndex) title[nameIndex] = React.createElement(\"span\", {className: \"name bda-name\"}, name);\r\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\r\n if (nameIndex) title[versionIndex] = React.createElement(\"span\", {className: \"version bda-version\"}, version);\r\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\r\n if (nameIndex) {\r\n const props = {className: \"author bda-author\"};\r\n if (author.link || author.id) {\r\n props.className += ` ${anchorClasses.anchor} ${anchorClasses.anchorUnderlineOnHover}`;\r\n props.target = \"_blank\";\r\n\r\n if (author.link) props.href = author.link;\r\n if (author.id) props.onClick = () => {BDV2.LayerStack.popLayer(); BDV2.openDM(author.id);};\r\n }\r\n title[authorIndex] = React.createElement(author.link || author.id ? \"a\" : \"span\", props, author.name);\r\n }\r\n return title.flat();\r\n }\r\n\r\n makeLink(title, url) {\r\n const props = {className: \"bda-link bda-link-website\", target: \"_blank\"};\r\n if (typeof(url) == \"string\") props.href = url;\r\n if (typeof(url) == \"function\") props.onClick = (event) => {event.preventDefault(); event.stopPropagation(); url();};\r\n return BDV2.react.createElement(\"a\", props, title);\r\n }\r\n\r\n makeButton(title, children, action) {\r\n return <TooltipWrap color=\"black\" side=\"top\" text={title}>\r\n <div className=\"bd-addon-button\" onClick={action}>{children}</div>\r\n </TooltipWrap>;\r\n }\r\n\r\n componentWillUnmount(){\r\n this.unmounted = true\r\n }\r\n\r\n get links() {\r\n const links = [];\r\n const addon = this.props.addon;\r\n if (addon.website) links.push(this.makeLink(\"Website\", addon.website));\r\n if (addon.source) links.push(this.makeLink(\"Source\", addon.source));\r\n if (addon.invite) {\r\n links.push(this.makeLink(\"Support Server\", () => {\r\n const tester = /\\.gg\\/(.*)$/;\r\n let code = addon.invite;\r\n if (tester.test(code)) code = code.match(tester)[1];\r\n BDV2.LayerStack.popLayer();\r\n BDV2.InviteActions.acceptInviteAndTransitionToInviteChannel(code);\r\n }));\r\n }\r\n if (addon.donate) links.push(this.makeLink(\"Donate\", addon.donate));\r\n if (addon.patreon) links.push(this.makeLink(\"Patreon\", addon.patreon));\r\n return links;\r\n }\r\n\r\n get footer() {\r\n const links = this.links;\r\n return (links.length || this.hasSettings) && BDV2.react.createElement(\"div\", {className: \"bd-card-footer bda-footer\"},\r\n BDV2.react.createElement(\"span\", {className: \"bd-addon-links bda-links\"},\r\n ...(links.map((element, index) => index < links.length - 1 ? [element, \" | \"] : element).flat())\r\n ),\r\n this.hasSettings && BDV2.react.createElement(\"button\", {onClick: this.showSettings, className: \"bd-button bda-settings-button\", disabled: !this.state.checked}, \"Settings\")\r\n );\r\n }\r\n\r\n onChange() {\r\n this.props.toggle && this.props.toggle(this.name);\r\n this.setState({checked: !this.state.checked});\r\n }\r\n\r\n edit() {this.props.edit(this.name);}\r\n delete() {this.props.remove(this.name);}\r\n reload() {this.props.reload(this.name);}\r\n\r\n get name() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() : this.props.addon.name);}\r\n get author() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);}\r\n get description() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);}\r\n get version() {return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);}\r\n\r\n render() {\r\n if (this.state.settings) return this.settingsComponent;\r\n const {authorId, authorLink} = this.props.addon;\r\n\r\n const style = {}\r\n if(settingsCookie[\"fork-ps-6\"]){\r\n if(!this.isScanning){\r\n this.isScanning = true\r\n processFile(resolve(this.props.addon.filename.endsWith(\".plugin.js\") ? contentManager.pluginsFolder : contentManager.themesFolder, this.props.addon.filename), (result) => {\r\n if(this.unmounted)return\r\n \r\n this.setState({\r\n isTrusted: result.suspect ? \"suspect\" : true\r\n })\r\n }, () => {})\r\n }else{\r\n if(this.state.isTrusted === true){\r\n style.borderColor = \"#4087ed\"\r\n }\r\n if(this.state.isTrusted === \"suspect\"){\r\n style.borderColor = \"rgb(240, 71, 71)\"\r\n }\r\n }\r\n }\r\n \r\n return BDV2.react.createElement(\"div\", {className: \"bd-card bd-addon-card settings-closed ui-switch-item\", style},\r\n BDV2.react.createElement(\"div\", {className: \"bd-addon-header bda-header\"},\r\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})),\r\n BDV2.react.createElement(\"div\", {className: \"bd-addon-controls bda-controls\"},\r\n this.props.edit && this.makeButton(\"Edit\", <EditIcon className=\"bd-icon\" />, this.edit),\r\n this.props.remove && this.makeButton(\"Delete\", <DeleteIcon className=\"bd-icon\" />, this.delete),\r\n this.props.reload && this.makeButton(\"Reload\", <ReloadIcon className=\"bd-icon\" />, this.reload),\r\n React.createElement(Switch, {onChange: this.onChange, checked: this.state.checked})\r\n )\r\n ),\r\n BDV2.react.createElement(\"div\", {className: \"bd-scroller-wrap bda-description-wrap scroller-wrap fade\"},\r\n BDV2.react.createElement(\"div\", {className: \"bd-scroller bd-addon-description bda-description scroller\"}, this.description)\r\n ),\r\n this.footer\r\n );\r\n }\r\n}\r\n\r\nconst originalRender = V2C_PluginCard.prototype.render;\r\nObject.defineProperty(V2C_PluginCard.prototype, \"render\", {\r\n enumerable: false,\r\n configurable: false,\r\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\r\n get: () => originalRender\r\n});","import BDV2 from \"../../modules/v2\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class DownArrow extends React.Component {\r\n render() {\r\n const size = this.props.size || \"16px\";\r\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}}>\r\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\"/>\r\n </svg>;\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\r\nimport Arrow from \"../icons/downarrow\";\r\n\r\nconst React = BDV2.React;\r\n\r\n\r\nexport default class Select extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {open: false, value: this.props.value || this.props.options[0].value};\r\n this.dropdown = React.createRef();\r\n this.onChange = this.onChange.bind(this);\r\n this.showMenu = this.showMenu.bind(this);\r\n this.hideMenu = this.hideMenu.bind(this);\r\n }\r\n\r\n showMenu(event) {\r\n event.preventDefault();\r\n this.setState({open: true}, () => {\r\n document.addEventListener(\"click\", this.hideMenu);\r\n });\r\n }\r\n\r\n hideMenu() {\r\n this.setState({open: false}, () => {\r\n document.removeEventListener(\"click\", this.hideMenu);\r\n });\r\n }\r\n\r\n onChange(value) {\r\n this.setState({value});\r\n if (this.props.onChange) this.props.onChange(value);\r\n }\r\n\r\n get selected() {return this.props.options.find(o => o.value == this.state.value);}\r\n\r\n get options() {\r\n const selected = this.selected;\r\n return <div className=\"bd-select-options\">\r\n {this.props.options.map(opt => \r\n <div className={`bd-select-option${selected.value == opt.value ? \" selected\" : \"\"}`} onClick={this.onChange.bind(this, opt.value)}>{opt.label}</div>\r\n )}\r\n </div>;\r\n }\r\n\r\n render() {\r\n const style = this.props.style == \"transparent\" ? \" bd-select-transparent\" : \"\";\r\n const isOpen = this.state.open ? \" menu-open\" : \"\";\r\n return <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\r\n <div className=\"bd-select-value\">{this.selected.label}</div>\r\n <Arrow className=\"bd-select-arrow\" />\r\n {this.state.open && this.options}\r\n </div>;\r\n }\r\n}\r\n\r\n// return <div className=\"bd-select-wrap\">\r\n// <label className=\"bd-label\">{this.props.label}</label>\r\n// <div className={`bd-select${style}${isOpen}`} onClick={this.showMenu} ref={this.dropdown}>\r\n// <div className=\"bd-select-controls\">\r\n// <div className=\"bd-select-value\">{this.selected.label}</div>\r\n// <Arrow className=\"bd-select-arrow\" />\r\n// </div>\r\n// </div>\r\n// {this.state.open && this.options}\r\n// </div>;","import BDV2 from \"../../modules/v2\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class Search extends React.Component {\r\n render() {\r\n const size = this.props.size || \"16px\";\r\n return <svg className={this.props.className || \"\"} fill=\"var(--text-normal)\" viewBox=\"0 0 24 24\" style={{width: size, height: size}}>\r\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\"/>\r\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\"/>\r\n </svg>;\r\n }\r\n}","import BDV2 from \"../../modules/v2\";\r\nimport SearchIcon from \"../icons/search\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class Search extends React.Component {\r\n constructor(props){\r\n super(props)\r\n this.state = {\r\n focused: false\r\n }\r\n }\r\n render() {\r\n const className = [\"bd-search-wrapper\"]\r\n if(this.state.focused)className.push(\"focused\")\r\n return <div className={className.join(\" \")}>\r\n <input onChange={this.props.onChange} onKeyDown={this.props.onKeyDown} type=\"text\" \r\n className=\"bd-search\" placeholder={this.props.placeholder} maxLength=\"50\" \r\n onFocus={() => {\r\n this.setState({focused: true})\r\n }} onBlur={() => {\r\n this.setState({focused: false})\r\n }}/>\r\n <SearchIcon />\r\n </div>;\r\n }\r\n}","import ErrorBoundary from \"./errorBoundary\";\r\nimport ContentColumn from \"./contentColumn\";\r\nimport ReloadIcon from \"./reloadIcon\";\r\nimport AddonCard from \"./addoncard\";\r\nimport Dropdown from \"./components/dropdown\";\r\nimport Search from \"./components/search\";\r\n\r\nimport {settingsCookie, pluginCookie, themeCookie, bdplugins, bdthemes} from \"../0globals\";\r\nimport ContentManager from \"../modules/contentManager\";\r\nimport BDV2 from \"../modules/v2\";\r\nimport pluginModule from \"../modules/pluginModule\";\r\nimport themeModule from \"../modules/themeModule\";\r\nimport WebpackModules from \"../modules/webpackModules\";\r\nimport BdApi from \"../modules/bdApi\";\r\nimport Utils from \"../modules/utils\";\r\nimport TooltipWrap from \"./tooltipWrap\";\r\nimport bdEvents from \"../modules/bdEvents\";\r\nimport EmulatedTooltip from \"./tooltip\";\r\n\r\nconst Tooltip = WebpackModules.findByDisplayName(\"Tooltip\");\r\n\r\nconst React = BDV2.react;\r\n\r\nexport default class CardList extends BDV2.reactComponent {\r\n constructor(props) {\r\n super(props);\r\n this.state = {sort: \"name\", ascending: true, query: \"\"};\r\n this.isPlugins = this.props.type == \"plugins\";\r\n this.cookie = this.isPlugins ? pluginCookie : themeCookie;\r\n this.manager = this.isPlugins ? pluginModule : themeModule;\r\n\r\n this.sort = this.sort.bind(this);\r\n this.reverse = this.reverse.bind(this);\r\n this.search = this.search.bind(this);\r\n\r\n this.onAddonChanges = function(){\r\n this.forceUpdate()\r\n }\r\n this.onAddonChanges = this.onAddonChanges.bind(this)\r\n }\r\n\r\n componentDidMount(){\r\n const type = (this.isPlugins ? \"plugin\" : \"theme\") + \"-\"\r\n bdEvents.on(`${type}loaded`, this.onAddonChanges)\r\n bdEvents.on(`${type}unloaded`, this.onAddonChanges)\r\n bdEvents.on(`${type}reloaded`, this.onAddonChanges)\r\n }\r\n\r\n componentWillUnmount(){\r\n const type = (this.isPlugins ? \"plugin\" : \"theme\") + \"-\"\r\n bdEvents.off(`${type}loaded`, this.onAddonChanges)\r\n bdEvents.off(`${type}unloaded`, this.onAddonChanges)\r\n bdEvents.off(`${type}reloaded`, this.onAddonChanges)\r\n }\r\n\r\n openFolder() {\r\n const shell = require(\"electron\").shell;\r\n const open = shell.openPath || shell.openItem;\r\n open(this.isPlugins ? ContentManager.pluginsFolder : ContentManager.themesFolder);\r\n }\r\n\r\n edit(name) {\r\n console.log(name);\r\n this.manager.edit(name);\r\n }\r\n\r\n async delete(name) {\r\n const shouldDelete = await this.confirmDelete(name);\r\n if (!shouldDelete) return;\r\n this.manager.delete(name);\r\n }\r\n\r\n confirmDelete(name) {\r\n return new Promise(resolve => {\r\n BdApi.showConfirmationModal(\"Are You Sure?\", `Are you sure you want to delete ${name}?`, {\r\n danger: true,\r\n confirmText: \"Delete\",\r\n onConfirm: () => {resolve(true);},\r\n onCancel: () => {resolve(false);}\r\n });\r\n });\r\n }\r\n\r\n get sortOptions() {\r\n return [\r\n {label: \"Name\", value: \"name\"},\r\n {label: \"Author\", value: \"author\"},\r\n {label: \"Version\", value: \"version\"},\r\n {label: \"Recently Added\", value: \"added\"},\r\n {label: \"Last Modified\", value: \"modified\"},\r\n {label: \"File Size\", value: \"size\"},\r\n ];\r\n }\r\n\r\n get directions() {\r\n return [\r\n {label: \"Ascending\", value: true},\r\n {label: \"Descending\", value: false}\r\n ];\r\n }\r\n\r\n reverse(value) {\r\n this.setState({ascending: value});\r\n }\r\n\r\n sort(value) {\r\n this.setState({sort: value});\r\n }\r\n\r\n search(event) {\r\n this.setState({query: event.target.value.toLocaleLowerCase()});\r\n }\r\n\r\n getProps(addon) {\r\n return {\r\n key: this.getName(addon),\r\n enabled: this.cookie[this.getName(addon)],\r\n toggle: this.manager.toggle.bind(this.manager),\r\n edit: settingsCookie[\"fork-ps-7\"] ? this.edit.bind(this) : null,\r\n remove: this.delete.bind(this),\r\n addon: addon,\r\n hash: addon.hash\r\n };\r\n }\r\n\r\n getString(value) {\r\n if (!value) return \"???\";\r\n return typeof value == \"string\" ? value : value.toString();\r\n }\r\n\r\n get list(){\r\n return this.props.type === \"plugins\" ? Object.values(bdplugins) : Object.values(bdthemes);\r\n }\r\n\r\n getAddons() {\r\n const sortedAddons = this.list.sort((a, b) => {\r\n const cap = this.state.sort.charAt(0).toUpperCase() + this.state.sort.slice(1);\r\n const first = a.plugin && a.plugin[`get${cap}`] ? this.getString(a.plugin[`get${cap}`]()) : this.getString(a[this.state.sort]);\r\n const second = b.plugin && b.plugin[`get${cap}`] ? this.getString(b.plugin[`get${cap}`]()) : this.getString(b[this.state.sort]);\r\n if (typeof(first) == \"string\") return first.toLocaleLowerCase().localeCompare(second.toLocaleLowerCase());\r\n if (first > second) return 1;\r\n if (second > first) return -1;\r\n return 0;\r\n });\r\n if (!this.state.ascending) sortedAddons.reverse();\r\n const rendered = [];\r\n for (let a = 0; a < sortedAddons.length; a++) {\r\n const addon = sortedAddons[a];\r\n if (this.state.query) {\r\n let matches = null;\r\n const name = this.getName(addon);\r\n const author = this.getAuthor(addon);\r\n const description = this.getDescription(addon);\r\n const version = this.getVersion(addon);\r\n if (name) matches = name.toLocaleLowerCase().includes(this.state.query);\r\n if (author) matches = matches || author.toLocaleLowerCase().includes(this.state.query);\r\n if (description) matches = matches || description.toLocaleLowerCase().includes(this.state.query);\r\n if (version) matches = matches || version.toLocaleLowerCase().includes(this.state.query);\r\n if (!matches) continue;\r\n }\r\n const props = this.getProps(addon);\r\n rendered.push(<ErrorBoundary><AddonCard {...props} reload={!settingsCookie[\"fork-ps-5\"] && this.manager.reload.bind(this.manager)} /></ErrorBoundary>);\r\n }\r\n return rendered;\r\n }\r\n\r\n getName(addon) {return this.getString(addon.plugin ? addon.plugin.getName() : addon.name);}\r\n getAuthor(addon) {return this.getString(addon.plugin ? addon.plugin.getAuthor() : addon.author);}\r\n getDescription(addon) {return this.getString(addon.plugin ? addon.plugin.getDescription() : addon.description);}\r\n getVersion(addon) {return this.getString(addon.plugin ? addon.plugin.getVersion() : addon.version);}\r\n\r\n renderCheckUpdates(){\r\n if(!window.ZeresPluginLibrary)return null\r\n if(!window.PluginUpdates)return null\r\n if(typeof window.PluginUpdates.checkAll !== \"function\")return null\r\n if(!this.isPlugins)return null\r\n\r\n let tooltipIsShowing = false\r\n let tooltip\r\n return <TooltipWrap text=\"Checks for updates of plugins that support this feature. Right-click for a list.\">\r\n <span style={{marginLeft: \"10px\"}} onMouseLeave={() => {\r\n tooltipIsShowing = false\r\n tooltip.hide()\r\n }}>\r\n <Lightcord.Api.Components.inputs.Button ref=\"checkUpdateButton\" color=\"brand\" look=\"filled\" size=\"min\" hoverColor=\"default\" onClick={() => {\r\n try{\r\n Utils.showToast(\"Plugin update check in progress.\", {type: \"info\"})\r\n window.PluginUpdates.checkAll()\r\n .then(() => {\r\n Utils.showToast(\"Plugin update check complete.\", {type: \"success\"})\r\n }).catch(err => {\r\n console.error(err)\r\n Utils.showToast(\"An error occured while checking update.\", {type: \"error\"})\r\n })\r\n }catch(e){\r\n console.error(e)\r\n Utils.showToast(\"An error occured while checking update.\", {type: \"error\"})\r\n }\r\n }} wrapper={false} disabled={false} onRightClick={() => {\r\n if(!this.refs.checkUpdateButton)return\r\n if (!window.PluginUpdates || !window.PluginUpdates.plugins) return;\r\n if(tooltipIsShowing)return\r\n tooltip = new EmulatedTooltip(this.refs.checkUpdateButton.refs.original.refs.button, Object.values(window.PluginUpdates.plugins).map(p => p.name).join(\", \"), {\r\n side: \"bottom\",\r\n attachEvents: false\r\n })\r\n tooltip.show()\r\n tooltipIsShowing = true\r\n }}>\r\n Check for Updates\r\n </Lightcord.Api.Components.inputs.Button>\r\n </span>\r\n </TooltipWrap>\r\n }\r\n\r\n render() {\r\n const refreshIcon = <Tooltip color=\"black\" position=\"top\" text=\"Reload List\">\r\n {(props) => \r\n <ReloadIcon {...props} className=\"bd-icon bd-reload bd-reload-header\" size=\"18px\" onClick={async () => {\r\n if (this.isPlugins) pluginModule.updatePluginList();\r\n else themeModule.updateThemeList();\r\n this.forceUpdate();\r\n }} />\r\n }</Tooltip>;\r\n const addonCards = this.getAddons();\r\n\r\n return <ContentColumn title={`${this.props.type.toUpperCase()}—${addonCards.length}`}>\r\n <Lightcord.Api.Components.inputs.Button key=\"folder-button\" color=\"brand\" \r\n look=\"filled\" size=\"min\" hoverColor=\"default\" onClick={this.openFolder.bind(this)} wrapper={false}\r\n style={{\r\n marginLeft: \"10px\"\r\n }}>\r\n Open {this.isPlugins ? \"Plugin\" : \"Theme\"} Folder\r\n </Lightcord.Api.Components.inputs.Button>\r\n {this.renderCheckUpdates()}\r\n {!settingsCookie[\"fork-ps-5\"] && refreshIcon}\r\n <div className=\"bd-controls bd-addon-controls\">\r\n <Search onChange={this.search} placeholder={`Search ${this.props.type}...`} />\r\n <div className=\"bd-addon-dropdowns\">\r\n <div className=\"bd-select-wrapper\">\r\n <label className=\"bd-label\">Sort by:</label>\r\n <Dropdown options={this.sortOptions} onChange={this.sort} style=\"transparent\" />\r\n </div>\r\n <div className=\"bd-select-wrapper\">\r\n <label className=\"bd-label\">Order:</label>\r\n <Dropdown options={this.directions} onChange={this.reverse} style=\"transparent\" />\r\n </div>\r\n \r\n </div>\r\n </div>\r\n <div className=\"bda-slist bd-addon-list\">{addonCards}</div>\r\n </ContentColumn>\r\n }\r\n}\r\n\r\nconst originalRender = CardList.prototype.render;\r\nObject.defineProperty(CardList.prototype, \"render\", {\r\n enumerable: false,\r\n configurable: false,\r\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\r\n get: () => originalRender\r\n});","import {settingsRPC, defaultRPC} from \"../0globals\";\r\n\r\nconst dispatcher = BDModules.get(m=>m.Dispatcher&&m.default&&m.default.dispatch)[0].default\r\nconst ActionTypes = BDModules.get(m=>m.ActionTypes)[0].ActionTypes\r\n\r\nconst socketId = \"lightcord-spoof-socket\"\r\nconst pid = process.pid\r\n\r\nexport default new class CustomRichPresence {\r\n constructor(){\r\n this.enabled = false\r\n\r\n this.game = settingsRPC\r\n }\r\n \r\n get formatedGame(){\r\n if(!this.game)return null\r\n if(this.enabled === false)return null\r\n let game = {\r\n name: this.game.name || defaultRPC.name,\r\n application_id: this.game.application_id || defaultRPC.application_id,\r\n details: this.game.details || undefined,\r\n state: this.game.state || undefined,\r\n timestamps: this.game[\"timestamps.start\"] ? {\r\n start: this.game[\"timestamps.start\"]\r\n } : undefined,\r\n assets: this.game[\"assets.large\"] ? {\r\n large_image: this.game[\"assets.large\"],\r\n small_image: this.game[\"assets.small\"] || undefined\r\n } : undefined\r\n }\r\n return game\r\n }\r\n\r\n sendGame(){\r\n dispatcher.dispatch({\r\n type: ActionTypes.LOCAL_ACTIVITY_UPDATE,\r\n socketId,\r\n pid,\r\n activity: this.formatedGame\r\n }) \r\n }\r\n\r\n enable() {\r\n if(this.enabled)return\r\n this.enabled = true\r\n console.log(\"Enabling custom RichPresence\")\r\n\r\n this.set(settingsRPC || Object.create(defaultRPC))\r\n\r\n this.sendGame()\r\n }\r\n\r\n disable() {\r\n if(!this.enabled)return\r\n this.enabled = false\r\n console.log(\"Disabling custom RichPresence\")\r\n\r\n this.sendGame()\r\n }\r\n\r\n async fetchAssets(applicationId){\r\n let assets = await BDModules.get(e => e.getAssets)[0].getAssets(applicationId)\r\n if(assets.undefined && typeof assets.undefined === \"number\"){\r\n throw new Error(\"Unknown Application\")\r\n }\r\n return assets\r\n }\r\n\r\n set(activity){\r\n this.game = activity\r\n\r\n this.sendGame()\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\nimport V2C_SettingsTitle from \"./settingsTitle\";\r\nimport V2C_SettingsGroup from \"./settingsGroup\";\r\nimport dataStore from \"../modules/dataStore\";\r\nimport { defaultRPC, settingsRPC } from \"../0globals\";\r\nimport CustomRichPresence from \"../modules/CustomRichPresence\"\r\nimport { remote } from \"electron\";\r\nimport MarginTop from \"./margintop\";\r\nimport Utils from \"../modules/utils\";\r\n\r\nconst React = BDV2.React;\r\n\r\nlet V2C_PresenceSettingsModules\r\nexport default class V2C_PresenceSettings extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n data: dataStore.getSettingGroup(\"rpc\") || defaultRPC,\r\n assets: []\r\n }\r\n\r\n this.preview = null\r\n this.isfetching = false\r\n if(this.state.data.application_id){\r\n this.fetchAssets()\r\n }\r\n\r\n this.assetComponents = new Set()\r\n }\r\n\r\n updateWhenFetched(comp){\r\n this.assetComponents.add(comp)\r\n }\r\n\r\n /**\r\n * \r\n * @param {InputText} setting \r\n */\r\n onChange(setting, value){\r\n let defaultSetting = RPCProps.find(e => e.id === setting.props.id)\r\n\r\n this.setState({\r\n data: Object.assign(settingsRPC, this.state.data, {\r\n [defaultSetting.id]: !!value ? value : null\r\n }),\r\n assets: this.state.assets\r\n })\r\n if(setting.props.id === \"application_id\"){\r\n this.fetchAssets()\r\n }\r\n\r\n dataStore.setSettingGroup(\"rpc\", settingsRPC);\r\n this.preview.forceUpdate()\r\n CustomRichPresence.set(settingsRPC)\r\n }\r\n\r\n fetchAssets(){\r\n if(this.isfetching === true){\r\n let app = this.state.data.application_id\r\n setTimeout(() => {\r\n if(this.state.data.application_id !== app){\r\n return\r\n }\r\n this.fetchAssets()\r\n }, 5000);\r\n }\r\n if(!this.state.data.application_id){\r\n this.setState({\r\n data: this.state.data,\r\n assets: []\r\n })\r\n this.forceUpdate()\r\n this.assetComponents.forEach(e => e.forceUpdate())\r\n return\r\n }\r\n this.isfetching = true\r\n CustomRichPresence.fetchAssets(this.state.data.application_id)\r\n .then(assets => {\r\n this.isfetching = false\r\n this.setState({\r\n data: this.state.data,\r\n assets: Object.keys(assets).map(k => {\r\n let asset = assets[k]\r\n return {\r\n id: asset.id,\r\n name: asset.name,\r\n type: asset.type\r\n }\r\n })\r\n })\r\n this.forceUpdate()\r\n this.assetComponents.forEach(e => e.forceUpdate())\r\n }).catch(() => {\r\n this.isfetching = false\r\n this.setState({\r\n data: this.state.data,\r\n assets: []\r\n })\r\n this.forceUpdate()\r\n this.assetComponents.forEach(e => e.forceUpdate())\r\n })\r\n }\r\n\r\n updatePreview(data){\r\n this.setState({\r\n data\r\n })\r\n }\r\n\r\n get modules(){\r\n return V2C_PresenceSettingsModules || (V2C_PresenceSettingsModules = [\r\n BDModules.get(e => e.marginBottom20)[0]\r\n ])\r\n }\r\n\r\n render() {\r\n let [\r\n marginModule\r\n ] = this.modules\r\n return [\r\n <V2C_SettingsGroup title=\"RichPresence Settings\" settings={this.props.settings} onChange={this.props.onChange}/>,\r\n <MarginTop />,\r\n <V2C_SettingsTitle text=\"RichPresence\"/>,\r\n <div>\r\n {/** options */}\r\n {this.optionsComponents}\r\n </div>,\r\n <div>\r\n <MarginTop />\r\n <V2C_SettingsTitle text=\"Preview\"/>\r\n {/** preview */}\r\n <RpcPreview settings={this}/>\r\n </div>,\r\n <div className={marginModule.marginBottom20}></div>,\r\n <button style={{opacity: 0.01}} onClick={window.ohgodohfuck}>\r\n Oh god Oh fuck\r\n </button>,\r\n <button style={{opacity: 0.01}} onClick={() => {\r\n remote.shell.openExternal(\"https://www.youtube.com/watch?v=LkYa7rps_g4\")\r\n }}>\r\n See ? I pulled a litle sneaky on ya\r\n </button>\r\n ]\r\n }\r\n\r\n get optionsComponents(){\r\n return this._optionsComponents || (this._optionsComponents = RPCProps.map(e => {\r\n if(e.type === \"text\"){\r\n return <InputText setting={e} manager={this} id={e.id}/>\r\n }else if(e.type === \"number\"){\r\n let array = [<InputNumber setting={e} manager={this} id={e.id}/>]/*\r\n if(e.id === \"timestamps.start\"){\r\n array.unshift(<DiscordButton title=\"Copy Current Timestamp\" onClick={() => {\r\n DiscordNative.clipboard.copy(Date.now()+\"\")\r\n }} />)\r\n }*/\r\n return array\r\n }else if(e.type === \"choice\"){\r\n if([\"assets.small\", \"assets.large\"].includes(e.id)){\r\n return <InputChoice setting={e} manager={this} id={e.id} choices={[{value: \"none\", label: \"No assets\"}].concat(this.state.assets.map(e => {\r\n return {\r\n value: \"asset-\"+e.id,\r\n label: e.name\r\n }\r\n }))}/>\r\n }else{\r\n return \"Unknown choice.\"\r\n }\r\n }\r\n }))\r\n }\r\n}\r\nconst RPCProps = [\r\n {\r\n title: \"Application ID\",\r\n id: \"application_id\",\r\n type: \"number\",\r\n placeholder: \"711416957718757418\"\r\n },\r\n {\r\n title: \"Name\",\r\n id: \"name\",\r\n type: \"text\",\r\n placeholder: \"Lightcord\"\r\n },\r\n {\r\n title: \"Details\",\r\n id: \"details\",\r\n type: \"text\",\r\n placeholder: \"Browsing Discord\"\r\n },\r\n {\r\n title: \"State\",\r\n id: \"state\",\r\n type: \"text\",\r\n placeholder: \"Lightcord Client\"\r\n },\r\n {\r\n title: \"Timestamp Start\",\r\n id: \"timestamps.start\",\r\n type: \"number\",\r\n get placeholder(){\r\n return Date.now()\r\n }\r\n },\r\n {\r\n title: \"LargeAsset\",\r\n id: \"assets.large\",\r\n type: \"choice\"\r\n },\r\n {\r\n title: \"SmallAsset\",\r\n id: \"assets.small\",\r\n type: \"choice\"\r\n },\r\n]\r\n\r\nlet inputTextModules\r\nclass InputText extends React.PureComponent {\r\n get modules(){\r\n if(inputTextModules && inputTextModules[0])return inputTextModules\r\n return inputTextModules = [\r\n BDModules.get(e => e.removeKeybind)[0],\r\n BDModules.get(e => e.marginBottom20)[0],\r\n BDModules.get(e => e.defaultMarginh5)[0],\r\n BDModules.get(e => e.colorStandard)[0],\r\n BDModules.get(e => e.size32)[0],\r\n BDModules.get(e => e._horizontal)[0],\r\n BDModules.get(e => e.inputMini)[0],\r\n BDModules.get(e => e.size16 && e.size20)[0],\r\n ]\r\n }\r\n\r\n constructor(props){\r\n super(props)\r\n let setting = this.props.setting\r\n this.state = {\r\n data: this.props.manager.state.data[setting.id]\r\n }\r\n\r\n this.input = <window.Lightcord.Api.Components.inputs.TextInput placeholder={setting.placeholder} name={setting.id} value={this.state.data} onChange={(value) => {\r\n this.setState({\r\n data: value\r\n })\r\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\r\n this.props.manager.onChange(this, value)\r\n this.lastEdited = Date.now()\r\n }else if(!this.isTiming){\r\n this.isTiming = setTimeout(() => {\r\n this.props.manager.onChange(this, this.state.data)\r\n this.isTiming = null\r\n this.lastEdited = Date.now()\r\n }, 500);\r\n }\r\n }} type=\"text\"/>\r\n }\r\n\r\n render(){\r\n let setting = this.props.setting\r\n\r\n let [\r\n rowModule,\r\n marginModule,\r\n marginModule2,\r\n colorModule,\r\n sizeModule,\r\n flexModule,\r\n inputModule,\r\n sizeModule2,\r\n ] = this.modules\r\n\r\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\r\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\r\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\r\n {setting.title}\r\n </h5>\r\n {this.input}\r\n </div>\r\n <Divider/>\r\n </div>)\r\n }\r\n}\r\n\r\nlet InputNumberModules\r\nclass InputNumber extends React.PureComponent {\r\n get modules(){\r\n return InputNumberModules || (InputNumberModules = [\r\n BDModules.get(e => e.removeKeybind)[0],\r\n BDModules.get(e => e.marginBottom20)[0],\r\n BDModules.get(e => e.defaultMarginh5)[0],\r\n BDModules.get(e => e.colorStandard)[0],\r\n BDModules.get(e => e.size32)[0],\r\n BDModules.get(e => e._horizontal)[0],\r\n BDModules.get(e => e.inputMini)[0],\r\n BDModules.get(e => e.size16 && e.size20)[0],\r\n BDModules.get(e => e.colorTransparent)[0],\r\n ])\r\n }\r\n\r\n constructor(props){\r\n super(props)\r\n let setting = this.props.setting\r\n this.state = {\r\n data: this.props.manager.state.data[setting.id]\r\n }\r\n\r\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) => {\r\n value = value.replace(/[^\\d]+/g, \"\")\r\n if(value == this.state.data){\r\n input.setValue(value)\r\n return\r\n }\r\n\r\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\r\n this.props.manager.onChange(this, value)\r\n this.lastEdited = Date.now()\r\n }else if(!this.isTiming){\r\n this.isTiming = setTimeout(() => {\r\n this.props.manager.onChange(this, this.state.data)\r\n this.isTiming = null\r\n this.lastEdited = Date.now()\r\n }, 500);\r\n }\r\n this.setState({\r\n data: value\r\n })\r\n }} type=\"text\"/>\r\n }\r\n\r\n render(){\r\n let setting = this.props.setting\r\n\r\n let [\r\n rowModule,\r\n marginModule,\r\n marginModule2,\r\n colorModule,\r\n sizeModule,\r\n flexModule,\r\n ] = this.modules\r\n\r\n\r\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\r\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\r\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\r\n {setting.title}\r\n </h5>\r\n {this.input}\r\n {setting.id === \"timestamps.start\" ? \r\n <Lightcord.Api.Components.inputs.Button onClick={() => {\r\n DiscordNative.clipboard.copy(Date.now()+\"\")\r\n }} color=\"brand\">Copy current timestamp</Lightcord.Api.Components.inputs.Button> : null}\r\n </div>\r\n <Divider/>\r\n </div>)\r\n }\r\n}\r\n\r\nlet InputChoiceModules\r\nclass InputChoice extends React.PureComponent {\r\n constructor(props){\r\n super(props)\r\n let setting = this.props.setting\r\n this.state = {\r\n data: this.props.manager.state.data[setting.id] ? \"asset-\"+this.props.manager.state.data[setting.id] : \"none\"\r\n }\r\n this.props.manager.updateWhenFetched(this)\r\n }\r\n\r\n onChange(data){\r\n let value = data.value\r\n\r\n if(!this.lastEdited || this.lastEdited < Date.now() - 500){\r\n this.props.manager.onChange(this, value === \"none\" ? null : value.replace(\"asset-\", \"\"))\r\n this.lastEdited = Date.now()\r\n }else if(!this.isTiming){\r\n this.isTiming = setTimeout(() => {\r\n this.props.manager.onChange(this, this.state.data === \"none\" ? null : this.state.data.replace(\"asset-\", \"\"))\r\n this.isTiming = null\r\n this.lastEdited = Date.now()\r\n }, 500);\r\n }\r\n this.setState({\r\n data: value\r\n })\r\n this.forceUpdate()\r\n }\r\n \r\n get modules(){\r\n return InputChoiceModules || (InputChoiceModules = [\r\n BDModules.get(e => e.removeKeybind)[0],\r\n BDModules.get(e => e.marginBottom20)[0],\r\n BDModules.get(e => e.defaultMarginh5)[0],\r\n BDModules.get(e => e.colorStandard)[0],\r\n BDModules.get(e => e.size32)[0],\r\n BDModules.get(e => e._horizontal)[0]\r\n ])\r\n }\r\n\r\n render(){\r\n let setting = this.props.setting\r\n\r\n let [\r\n rowModule,\r\n marginModule,\r\n marginModule2,\r\n colorModule,\r\n sizeModule,\r\n flexModule\r\n ] = this.modules\r\n \r\n let options = this.props.manager.state.assets.map(e => {\r\n return {\r\n value: \"asset-\"+e.id,\r\n label: e.name\r\n }\r\n })\r\n\r\n options.unshift({\r\n value: \"none\",\r\n label: \"No assets\"\r\n })\r\n\r\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\r\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\r\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\r\n {setting.title}\r\n </h5>\r\n <window.Lightcord.Api.Components.inputs.Dropdown value={this.state.data} options={options} onChange={this.onChange.bind(this)} />\r\n {/*<Select value={this.state.data} onChange={this.onChange.bind(this)} options={options}/>*/}\r\n </div>\r\n <Divider/>\r\n </div>)\r\n }\r\n}\r\n\r\nlet DividerModules = []\r\nclass Divider extends React.PureComponent {\r\n get modules(){\r\n return DividerModules&&DividerModules[0] ? DividerModules : (DividerModules = [\r\n BDModules.get(e => e.divider && Object.keys(e).length === 1)[0],\r\n BDModules.get(e => e.dividerDefault)[0]\r\n ])\r\n }\r\n\r\n render(){\r\n let [\r\n divider,\r\n dividerDefault\r\n ] = this.modules\r\n\r\n return <div class={`${divider.divider} ${dividerDefault.dividerDefault}`}></div>\r\n }\r\n}\r\n\r\nclass DiscordButton extends React.Component {\r\n render(){\r\n let rowModule = BDModules.get(e => e.removeKeybind)[0]\r\n let marginModule = BDModules.get(e => e.marginBottom20)[0]\r\n let flexModule = BDModules.get(e => e._horizontal)[0]\r\n\r\n return (<div className={rowModule.row+\" \"+marginModule.marginBottom20}>\r\n <div className={`${rowModule.item} ${flexModule.flexChild}`}>\r\n <Lightcord.Api.Components.inputs.Button onClick={this.props.onClick} color=\"brand\">\r\n {this.props.title}\r\n </Lightcord.Api.Components.inputs.Button>\r\n </div>\r\n </div>)\r\n }\r\n}\r\n\r\nclass RpcPreview extends React.Component {\r\n constructor(props = {}){\r\n super(props)\r\n this.state = {\r\n active: \"profile\"\r\n }\r\n this.tabs = []\r\n\r\n this.props.settings.preview = this\r\n }\r\n\r\n changeTab(tab){\r\n let ancientTab = this.state.active\r\n if(ancientTab === tab.props.id)return\r\n\r\n this.tabs.forEach(e => {\r\n e.setActive(false)\r\n })\r\n tab.setActive(true)\r\n this.setState({\r\n active: tab.props.id\r\n })\r\n }\r\n\r\n render(){\r\n return (<div className=\"lc-tabWrapper\">\r\n <div className=\"lc-tabnav\" style={{flex: \"0 1 auto\"}}>\r\n <Tab preview={this} title=\"Full Profile\" id=\"profile\"/>\r\n <Tab preview={this} title=\"User Popout\" id=\"popout\"/>\r\n </div>\r\n <PresenceErrorCatcher preview={this.preview} state={this.state.rpc} props={{preview: this}} key={this.state.active} />\r\n </div>)\r\n } \r\n\r\n isActive(tab){\r\n return this.state.active === tab\r\n }\r\n\r\n get preview(){\r\n if(this.state.active === \"profile\")return Profile\r\n return Popout\r\n }\r\n}\r\n\r\nclass Tab extends React.Component {\r\n constructor(props){\r\n super(props)\r\n\r\n this.state = {\r\n active: props.preview.isActive(props.id)\r\n }\r\n props.preview.tabs.push(this)\r\n }\r\n\r\n setActive(isActive){\r\n this.setState({\r\n active: !!isActive\r\n })\r\n }\r\n\r\n render(){\r\n let className = `lc-navItem`\r\n if(this.state.active){\r\n className += ` lc-navItemActive`\r\n }else{\r\n className += ` lc-navItemInactive`\r\n }\r\n return (<div className={className} onClick={()=>{\r\n this.props.preview.changeTab(this)\r\n }}>\r\n {this.props.title}\r\n </div>)\r\n }\r\n}\r\n\r\nlet emptyClasses\r\nclass PresenceErrorCatcher extends React.Component {\r\n componentDidCatch(err, errInfo){\r\n console.error(err, errInfo)\r\n this.setState({\r\n error: true\r\n })\r\n }\r\n render(){\r\n if(!this.state){\r\n this.state = {\r\n error: false\r\n }\r\n }\r\n if(!this.state.error){\r\n try{\r\n const preview = new this.props.preview(this.props.props)\r\n preview.setState(this.props.state)\r\n return preview.render()\r\n }catch(err){\r\n console.error(err)\r\n this.state.error = true\r\n return this.render()\r\n }\r\n }else{\r\n emptyClasses = emptyClasses || BDV2.WebpackModules.find(e => e.emptyStateImage && e.emptyState)\r\n if(!emptyClasses){\r\n Utils.showToast(\"An error occured. Please check the console for more informations.\")\r\n return null\r\n }\r\n return <div style={{\r\n margin: \"20px\"\r\n }}>\r\n <div style={{\r\n backgroundColor: \"var(--background-primary)\", \r\n padding: \"30px 30px\", \r\n borderRadius: \"8px\"\r\n }} className={`lc-tab-box-shadow ${emptyClasses.emptyState}`}>\r\n <div className={emptyClasses.emptyStateImage} style={{\r\n marginTop: \"20px\"\r\n }}>\r\n\r\n </div>\r\n <div className={emptyClasses.emptyStateHeader}>An error occured</div>\r\n <p className={emptyClasses.emptyStateSubtext}>\r\n Please check the console for more informations. Join our \r\n <a className={`${BDV2.anchorClasses.anchor} ${BDV2.anchorClasses.anchorUnderlineOnHover}`} role=\"button\" tabindex={0} onClick={() => {\r\n BDV2.joinLC()\r\n }}>\r\n support server\r\n </a>\r\n for help.\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n }\r\n}\r\n\r\nlet popoutModules\r\nlet UserPopoutComponent\r\nlet PopoutProps\r\nclass Popout extends React.Component {\r\n get modules(){\r\n return popoutModules || (popoutModules = [\r\n BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"UserPopout\"),\r\n BDV2.WebpackModules.find(e => e.default && e.default.getCurrentUser)\r\n ])\r\n }\r\n\r\n getComponent(){\r\n let [\r\n UserPopout,\r\n userModule\r\n ] = this.modules\r\n\r\n const user = userModule.default.getCurrentUser()\r\n return React.createElement(() => {\r\n let render1 = UserPopout.default({\r\n userId: user.id, \r\n guildId: null, \r\n channelId: null, \r\n disableUserProfileLink: true\r\n })\r\n UserPopoutComponent = render1.type\r\n PopoutProps = render1.props\r\n return this.render()\r\n }, null)\r\n }\r\n\r\n render(){\r\n if(!UserPopoutComponent)return this.getComponent()\r\n let [\r\n _UserPopout,\r\n userModule\r\n ] = this.modules\r\n\r\n const user = userModule.default.getCurrentUser()\r\n\r\n let data = Object.assign({}, defaultRPC, this.props.preview.props.settings.state.data)\r\n const activity = (function(){\r\n if(!this.game)return null\r\n let game = {\r\n name: this.game.name || defaultRPC.name,\r\n application_id: this.game.application_id || defaultRPC.application_id,\r\n details: this.game.details || undefined,\r\n state: this.game.state || undefined,\r\n timestamps: this.game[\"timestamps.start\"] ? {\r\n start: this.game[\"timestamps.start\"]\r\n } : undefined,\r\n assets: this.game[\"assets.large\"] ? {\r\n large_image: this.game[\"assets.large\"],\r\n small_image: this.game[\"assets.small\"] || undefined\r\n } : undefined,\r\n type: 0\r\n }\r\n return game\r\n }).call({\r\n game: data\r\n })\r\n\r\n const popout = new UserPopoutComponent(Object.assign({}, PopoutProps, {\r\n activity: activity,\r\n userId: user.id\r\n })).render().props.children // bypass tracking\r\n\r\n // remove the stop propagation shit.\r\n const container = <div {...window.Lightcord.Api._.excludeProperties(popout.props, [\"onClick\", \"onContextMenu\"])} />\r\n\r\n return <div className=\"lc-userPopout lc-tab-box-shadow\">\r\n {container}\r\n </div>\r\n }\r\n}\r\n\r\nlet profileModules\r\nlet UserProfileComponent\r\nlet ProfileProps\r\nlet connectedProfileStore\r\nclass Profile extends React.Component {\r\n get modules(){\r\n return profileModules || (profileModules = [\r\n BDV2.WebpackModules.find(e => e.default && e.default.displayName === \"UserProfile\"),\r\n BDV2.WebpackModules.find(e => e.default && e.default.getCurrentUser)\r\n ])\r\n }\r\n\r\n render(){\r\n let [\r\n UserProfile,\r\n userModule\r\n ] = this.modules\r\n\r\n const user = userModule.default.getCurrentUser()\r\n if(!UserProfileComponent){\r\n const render1 = new UserProfile.default({\r\n user: user\r\n }).render()\r\n connectedProfileStore = render1.type\r\n const render2 = new render1.type(render1.props).render()\r\n const render3 = render2.type.render(render2.props, null)\r\n const render4 = new render3.type(render3.props).render()\r\n UserProfileComponent = render4.type\r\n }\r\n if(!UserProfileComponent)throw new Error(`Couldn't find the UserProfileComponent component.`)\r\n\r\n let data = Object.assign({}, defaultRPC, this.props.preview.props.settings.state.data)\r\n const activity = (function(){\r\n if(!this.game)return null\r\n let game = {\r\n name: this.game.name || defaultRPC.name,\r\n application_id: this.game.application_id || defaultRPC.application_id,\r\n details: this.game.details || undefined,\r\n state: this.game.state || undefined,\r\n timestamps: this.game[\"timestamps.start\"] ? {\r\n start: this.game[\"timestamps.start\"]\r\n } : undefined,\r\n assets: this.game[\"assets.large\"] ? {\r\n large_image: this.game[\"assets.large\"],\r\n small_image: this.game[\"assets.small\"] || undefined\r\n } : undefined,\r\n type: 0\r\n }\r\n return game\r\n }).call({\r\n game: data\r\n })\r\n\r\n ProfileProps = new connectedProfileStore({\r\n user: user,\r\n close: () => {}\r\n }).render().props\r\n const profile = new UserProfileComponent(Object.assign({}, ProfileProps, {\r\n activity: activity\r\n })).render().props.children // bypass tracking\r\n\r\n profile.props.style = {\r\n width: \"auto\"\r\n }\r\n\r\n return <div className=\"lc-tab lc-tab-box-shadow\">\r\n {profile}\r\n </div>\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\nimport V2C_SettingsTitle from \"./settingsTitle\";\r\n\r\n/**\r\n * @type {typeof import(\"react\")}\r\n */\r\nconst React = BDV2.React;\r\n\r\nlet marginModule2 = BDModules.get(e => e.defaultMarginh5)[0]\r\nlet colorModule = BDModules.get(e => e.colorStandard)[0]\r\nlet sizeModule = BDModules.get(e => e.size32)[0]\r\nlet scrollbarModule1 = BDModules.get(e => e.scrollbarGhostHairline)[0]\r\nconst GuildModule = BDModules.get(e => e.default && e.default.getGuilds)[0].default\r\nconst relationShipModule = BDModules.get(e => e.default && e.default.getRelationships)[0].default\r\nconst sessionModule = BDModules.get(e => e.default && e.default.getSessions)[0].default\r\nconst userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0].default\r\n\r\nexport default class V2C_AccountInfos extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n if(!marginModule2)marginModule2 = BDModules.get(e => e.defaultMarginh5)[0]\r\n if(!colorModule)colorModule = BDModules.get(e => e.colorStandard)[0]\r\n if(!sizeModule)sizeModule = BDModules.get(e => e.size32)[0]\r\n return [\r\n <V2C_SettingsTitle text=\"Account Infos\"/>,\r\n <div>\r\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\r\n Profile\r\n </h5>\r\n <CodeContent content={this.getProfileValue()} language=\"diff\" />\r\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\r\n Statistics\r\n </h5>\r\n <CodeContent content={this.getStatistics()} language=\"diff\" />\r\n <h5 className={colorModule.colorStandard+\" \"+sizeModule.size14+\" \"+marginModule2.h5+\" \"+marginModule2.defaultMarginh5}>\r\n Connected Sessions\r\n </h5>\r\n <CodeContent content={this.getSessionValue()} language=\"diff\" />\r\n </div>,\r\n <div className={BDModules.get(e => e.marginBottom20)[0].marginBottom20}></div>\r\n ]\r\n }\r\n\r\n getSessionValue(){\r\n const sessionsRaw = sessionModule.getSessions()\r\n const sessions = Object.keys(sessionsRaw).filter(e => e !== \"all\").map(e => sessionsRaw[e])\r\n\r\n if(sessions.length === 0)return \"- No session detected. Please try in a few seconds\"\r\n \r\n return sessions.map(e => {\r\n return `+ id: ${e.sessionId}\r\n+ os: ${e.clientInfo.os[0].toUpperCase()+e.clientInfo.os.slice(1)}\r\n+ client: ${e.clientInfo.client}\r\n+ status: ${e.status}\r\n+ Activities: ${e.activities.length}`\r\n }).join(\"\\n\"+\"-\".repeat(38)+\"\\n\")\r\n }\r\n\r\n getProfileValue(){\r\n const user = userModule.getCurrentUser()\r\n /**\r\n * @type {Date}\r\n */\r\n const createdAt = user.createdAt\r\n\r\n let avatarURL = user.avatarURL\r\n if(user.avatar && user.avatar.startsWith(\"a_\")){\r\n avatarURL = user.getAvatarURL(\"gif\")\r\n }\r\n\r\n if(avatarURL.startsWith(\"/\")){\r\n avatarURL = \"https://discord.com\"+avatarURL\r\n }\r\n if(avatarURL.endsWith(\"?size=128\")){\r\n avatarURL = avatarURL.replace(\"?size=128\", \"?size=4096\")\r\n }\r\n\r\n return `+ Username: ${user.username}\r\n+ Discriminator: ${user.discriminator}\r\n+ Tag: ${user.tag}\r\n+ ID: ${user.id}\r\n+ Avatar: ${user.avatar}\r\n+ Avatar URL: ${avatarURL}\r\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\r\n+ Flags: ${user.flags}\r\n+ Has Nitro: ${user.hasPremiumSubscription ? \"Yes\" : \"No\"}\r\n- Email: ${user.email}\r\n- 2FA: ${user.mfaEnabled ? \"Yes\" : \"No\"}\r\n- Has Been On Mobile: ${user.mobile ? \"Yes\" : \"No\"}\r\n- Phone: ${user.phone || \"None\"}\r\n- Verified: ${user.verified}\r\n- Can See NSFW Channels: ${user.nsfwAllowed}`;\r\n }\r\n\r\n getStatistics(){\r\n\r\n const guilds = Object.values(GuildModule.getGuilds())\r\n const relations = Object.keys(relationShipModule.getRelationships())\r\n const friends = relations.filter(e => relationShipModule.isFriend(e))\r\n const blocked = relations.filter(e => relationShipModule.isBlocked(e))\r\n\r\n return `+ Server Count: ${guilds.length} servers\r\n+ Relations: ${relations.length} relations\r\n+ Friends Count: ${friends.length} friends\r\n- Blocked Users Count: ${blocked.length} blocked users`\r\n }\r\n}\r\n\r\n\r\nlet hightlightJS = BDModules.get(e => e.highlight)[0]\r\nlet messageModule1 = BDModules.get(e => e.markup)[0]\r\nlet messageModule2 = BDModules.get(e => e.messageContent)[0]\r\n\r\nclass CodeContent extends React.Component {\r\n render(){\r\n if(!messageModule1)messageModule1 = BDModules.get(e => e.markup)[0]\r\n if(!messageModule2)messageModule2 = BDModules.get(e => e.messageContent)[0]\r\n if(!scrollbarModule1)scrollbarModule1 = BDModules.get(e => e.scrollbarGhostHairline)[0]\r\n if(!hightlightJS)hightlightJS = BDModules.get(e => e.listLanguages)[0]\r\n return (<div class={`${messageModule1.markup} ${messageModule2.messageContent}`}>\r\n <pre>\r\n <code class={`${scrollbarModule1.scrollbarGhostHairline} hljs`} dangerouslySetInnerHTML={{__html: hightlightJS.highlight(this.props.language, this.props.content).value}}>\r\n\r\n </code>\r\n </pre>\r\n <div className={BDModules.get(e => e.marginBottom8)[0].marginBottom8}></div>\r\n </div>)\r\n }\r\n}","import Utils from \"./utils\"\r\n\r\nconst dispatcher = window.Lightcord.DiscordModules.dispatcher\r\nconst ChannelModule = BDModules.get(e => e.default && e.default.getChannel && e.default.hasChannel)[0].default\r\nlet relationShipModule = BDModules.get(e => e.default && e.default.addRelationship)[0]\r\nlet DMModule = BDModules.get(e => e.default && e.default.closePrivateChannel)[0]\r\n\r\nconst blocked = {}\r\n\r\nlet userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0]\r\nfunction getCurrentUser(){\r\n if(userModule)return userModule.default.getCurrentUser()\r\n return null\r\n}\r\n\r\nexport default new class AntiBotDM {\r\n constructor(){\r\n this.antiDM = this.antiDM.bind(this)\r\n this.enabled = false\r\n }\r\n\r\n enable(){\r\n if(this.enabled)return\r\n this.enabled = true\r\n\r\n dispatcher.subscribe(\"MESSAGE_CREATE\", this.antiDM)\r\n }\r\n\r\n disable(){\r\n if(!this.enabled)return\r\n this.enabled = false\r\n\r\n dispatcher.unsubscribe(\"MESSAGE_CREATE\", this.antiDM)\r\n }\r\n\r\n antiDM(ev){\r\n if(!ev.message.author.bot)return\r\n if(ev.message.author.id === getCurrentUser().id)\r\n if(ev.message.guild_id)return\r\n\r\n const channel = ChannelModule.getChannel(ev.message.channel_id)\r\n if(!channel)return // might be broken\r\n\r\n if(channel.type !== 1)return\r\n\r\n if(blocked[ev.message.author.id])return // If the user unblock the bot, Don't block it again.\r\n\r\n if(scanMessage(ev.message)){\r\n blocked[ev.message.author.id] = true\r\n Utils.showToast(`[AdBlock]: Blocked ${ev.message.author.username}#${ev.message.author.discriminator}`, {\r\n \"type\": \"warning\"\r\n })\r\n if(!relationShipModule)relationShipModule = BDModules.get(e => e.default && e.default.addRelationship)[0]\r\n relationShipModule.default.addRelationship(ev.message.author.id, {\r\n location: \"ContextMenu\"\r\n }, 2)\r\n if(!DMModule)DMModule = BDModules.get(e => e.default && e.default.closePrivateChannel)[0]\r\n DMModule.default.closePrivateChannel(channel.id, false)\r\n }\r\n }\r\n}\r\n\r\nfunction scanMessage(message){\r\n if(/(discord\\.gg|discord\\.com\\/invite\\/|discordapp\\.com\\/invite\\/)/g.test(message.content))return true\r\n if(EmbedsContains(message, \"discord.gg/\") || EmbedsContains(message, \"discord.com/invite/\") || EmbedsContains(message, \"discordapp.com/invite/\"))return true\r\n\r\n return false\r\n}\r\nfunction EmbedsContains(message, search){\r\n let embeds = message.embeds || []\r\n if(embeds.length === 0)return false\r\n return embeds.map(embed => {\r\n if(embed.type !== \"rich\")return false\r\n if((embed.title || \"\").includes(search))return true\r\n if((embed.description || \"\").includes(search))return true\r\n if(((embed.footer || \"\") && embed.footer.text || \"\").includes(search))return true\r\n if((embed.fields || []).map(e => {\r\n return e.value.includes(search) || e.name.includes(search)\r\n }).includes(true))return true\r\n return false\r\n\r\n }).includes(true)\r\n}","/**\r\n * Credits to @hellbound1337 on github for the css\r\n */\r\n\r\nimport DOMTools from \"./domtools\"\r\nimport Utils from \"./utils\"\r\n\r\nlet selectors\r\nconst removeDa = Utils.removeDa\r\nfunction getSelectors(){\r\n let standardSidebarView = BDModules.get(e => e.standardSidebarView)[0]\r\n if(!standardSidebarView)return null\r\n let defaultClassName = removeDa(standardSidebarView.standardSidebarView)\r\n let selects = []\r\n let userSettingsAccount = BDModules.get(e => e.userSettingsAccount)[0]\r\n const children = BDModules.get(e => typeof e.children === \"string\")[0]\r\n selects.push(`#app-mount .${defaultClassName} .payment-info .${removeDa(BDModules.get(e => e.description && typeof e.description === \"string\" && e.description.includes(\"formText\"))[0].description)}`)\r\n selects.push(`#app-mount .${defaultClassName} .${removeDa(BDModules.get(e => e.paymentSourceRow)[0].paymentSourceRow)} .${removeDa(BDModules.get(e => e.subText && e.descriptionWrapper)[0].subText)}`)\r\n if(userSettingsAccount){\r\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)}`)\r\n selects.push(`.${removeDa(userSettingsAccount.userSettingsSecurity)} .${removeDa(children.children)} > div:nth-child(2)`)\r\n }\r\n console.log(selects)\r\n return selects\r\n}\r\n\r\nexport default new class BlurPrivate {\r\n constructor(){\r\n this.enabled = false\r\n }\r\n\r\n enable(){\r\n if(this.enabled)return\r\n this.enabled = true\r\n selectors = selectors || getSelectors()\r\n\r\n if(!selectors)console.error(new Error(\"Couldn't find selectors to blur personnal informations.\"))\r\n DOMTools.addStyle(\"blurPrivate\", `\r\n${selectors.join(\", \")} {\r\n transition: all 150ms cubic-bezier(.55,.085,.68,.53);\r\n filter: blur(4px);\r\n opacity: .8;\r\n}\r\n\r\n${selectors.map(e => e+\":hover\").join(\", \")} {\r\n transition: all 150ms cubic-bezier(.55,.09,.68,.53);\r\n filter: none;\r\n opacity: 1;\r\n}`)\r\n }\r\n\r\n disable(){\r\n if(!this.enabled)return\r\n this.enabled = false\r\n DOMTools.removeStyle(\"blurPrivate\")\r\n }\r\n}","export default new class DisableTyping {\r\n constructor(){\r\n window.Lightcord.Api.ensureExported(e => e.default && e.default.startTyping)\r\n .then(typingModule => {\r\n let self = this\r\n const startTyping = typingModule.default.startTyping\r\n typingModule.default.startTyping = function(){\r\n if(self.disabled)return startTyping.call(this, ...arguments)\r\n }\r\n const stopTyping = typingModule.default.stopTyping\r\n typingModule.default.stopTyping = function(){\r\n if(self.disabled)return stopTyping.call(this, ...arguments)\r\n }\r\n this.disabled = true\r\n })\r\n window.Lightcord.BetterDiscord.DisableTyping = this\r\n }\r\n\r\n disable(){\r\n this.disabled = true\r\n }\r\n\r\n enable(){\r\n this.disabled = false\r\n }\r\n}","// Good luck to read my code, Even me can't read it properly.\r\n\r\nimport { stat } from \"fs\"\r\nimport { uuidv4 } from \"../modules/distant\"\r\nimport webpackModules from \"../modules/webpackModules\"\r\nimport { remote } from \"electron\"\r\nimport MarginTop from \"./margintop\"\r\n\r\nlet formModule\r\nexport default class ApiPreview extends React.PureComponent {\r\n constructor(){\r\n super(...arguments)\r\n this.state = {\r\n states: []\r\n }\r\n }\r\n\r\n render(){\r\n if(!formModule)formModule = webpackModules.find(e => e.FormSection)\r\n /** \r\n * @type {Function[]}\r\n */\r\n const allComponents = [...new Set(Object.keys(window.Lightcord.Api.Components).map(e => {\r\n return Object.keys(window.Lightcord.Api.Components[e]).map(k => window.Lightcord.Api.Components[e][k])\r\n }).flat())]\r\n return [\r\n <formModule.FormSection tag=\"h2\" title=\"Lightcord's Api Availlable components\">\r\n <formModule.FormText type=\"description\" className=\"\" selectable={false}>\r\n These components are here for the plugin devs. They can quickly embed any component below with this panel.\r\n <div style={{marginTop: \"20px\"}}></div>\r\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>\r\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>\r\n </formModule.FormText>\r\n <MarginTop></MarginTop>\r\n <Lightcord.Api.Components.inputs.Button color=\"brand\" look=\"outlined\" size=\"medium\" hoverColor=\"green\" onClick={() => {\r\n remote.shell.openExternal(\"https://lightcord.deroku.xyz/LightcordApi/docs\")\r\n }} wrapper={false}>\r\n Documentation\r\n </Lightcord.Api.Components.inputs.Button>\r\n </formModule.FormSection>,\r\n allComponents.map(comp => {\r\n const compName = comp.displayName || comp.name\r\n const compPath = `Lightcord.Api.Components.${Object.keys(window.Lightcord.Api.Components).find(e => window.Lightcord.Api.Components[e][compName])}.${compName}`\r\n return <ComponentPreview key={compPath} comp={comp} />\r\n })\r\n ]\r\n }\r\n\r\n get renders(){\r\n\r\n }\r\n}\r\n\r\nclass ComponentPreview extends React.Component {\r\n constructor(props){\r\n super(props)\r\n this.state = {\r\n tab: \"preview\",\r\n elem: props.comp,\r\n options: {}\r\n }\r\n }\r\n\r\n render(){\r\n const comp = this.props.comp\r\n let AllPreviews = []\r\n if(comp.AllPreviews)AllPreviews = comp.AllPreviews\r\n let state = this.state\r\n let getProps = () => {\r\n let final = {}\r\n AllPreviews.forEach(category => {\r\n final[Object.keys(category[0])[0]] = category[0][Object.keys(category[0])[0]]\r\n })\r\n Object.keys(state.options).forEach(key => {\r\n final[key] = AllPreviews.find(e => e.find(e => e[key]))[state.options[key]][key]\r\n })\r\n return final\r\n }\r\n let renderPreview = () => {\r\n return <div style={{margin: \"20px\"}}>\r\n <div style={{\r\n backgroundColor: \"var(--background-secondary)\", \r\n padding: \"30px 30px\", \r\n borderRadius: \"8px\"\r\n }} className=\"lc-tab-box-shadow\">\r\n {React.createElement(comp, getProps())}\r\n </div>\r\n </div>\r\n }\r\n let renderCode = () => {\r\n return <div style={{margin: \"20px\"}}>\r\n <div style={{\r\n backgroundColor: \"var(--background-secondary)\", \r\n padding: \"30px 30px\", \r\n borderRadius: \"8px\"\r\n }} className=\"lc-tab-box-shadow\">\r\n <window.Lightcord.Api.Components.general.SettingSubTitle>\r\n JSX\r\n </window.Lightcord.Api.Components.general.SettingSubTitle>\r\n <window.Lightcord.Api.Components.general.ErrorCatcher>\r\n {React.createElement(() => {\r\n return <window.Lightcord.Api.Components.general.CodeBlock language=\"jsx\" content={generateCode(\"jsx\")}/>\r\n })}\r\n </window.Lightcord.Api.Components.general.ErrorCatcher>\r\n <window.Lightcord.Api.Components.general.SettingSubTitle> \r\n React\r\n </window.Lightcord.Api.Components.general.SettingSubTitle>\r\n <window.Lightcord.Api.Components.general.ErrorCatcher>\r\n {React.createElement(() => {\r\n return <window.Lightcord.Api.Components.general.CodeBlock language=\"js\" content={generateCode(\"react\")}/>\r\n })}\r\n </window.Lightcord.Api.Components.general.ErrorCatcher>\r\n </div>\r\n </div>\r\n }\r\n let getStrForProp = (value, compPath, lang) => {\r\n if(typeof value === \"string\"){\r\n return value\r\n }else if(typeof value === \"boolean\"){\r\n return String(value)\r\n }else if(typeof value === \"function\"){\r\n return value.toString()\r\n }else if(typeof value === \"object\"){\r\n if(value && value.$$typeof && (value.$$typeof === Symbol.for(\"react.element\") || value.$$typeof === 0xeac7)){\r\n if(compPath === \"Lightcord.Api.Components.general.Tabs\"){\r\n if(lang === \"react\"){\r\n return `React.createElement(\"div\", {style: {\r\nmarginTop: \"20px\", marginBottom: \"20px\"\r\n}},\r\nReact.createElement(\"div\", {style: {\r\nbackgroundColor: \"var(--background-secondary)\",\r\npadding: \"30px 30px\",\r\nborderRadius: \"8px\"\r\n}, className: \"lc-tab-box-shadow\" },\r\nReact.createElement(Lightcord.Api.Components.general.Title, null, \"Preview tabs\")\r\n)\r\n)`\r\n }else if(lang === \"jsx\"){\r\n return `<div style={{\r\nmarginTop: \"20px\", marginBottom: \"20px\"\r\n}}>\r\n<div style={{\r\n backgroundColor: \"var(--background-secondary)\", \r\n padding: \"30px 30px\", \r\n borderRadius: \"8px\"\r\n}} className=\"lc-tab-box-shadow\">\r\n <Lightcord.Api.Components.general.Title>Preview tabs</Lightcord.Api.Components.general.Title>\r\n</div>\r\n</div>`\r\n }\r\n }\r\n return \"Your components here.\"\r\n }\r\n return JSON.stringify(value, null, \" \")\r\n }else if(typeof value === \"number\"){\r\n return String(value)\r\n }\r\n return String(value)\r\n }\r\n let generateCode = function(lang){ // code formatting is hard\r\n const compName = comp.displayName || comp.name\r\n let categories = Object.keys(window.Lightcord.Api.Components)\r\n const compCategory = categories.find(e => window.Lightcord.Api.Components[e][compName])\r\n const compPath = `Lightcord.Api.Components.${compCategory}.${compName}`\r\n const props = getProps()\r\n\r\n if(lang === \"jsx\"){\r\n let propStrings = []\r\n let childrenProp = null\r\n Object.keys(props).forEach(key => {\r\n if(key == \"children\"){\r\n childrenProp = getStrForProp(props[key], compPath, lang)\r\n }else{\r\n let str = key+\"=\"\r\n if(typeof props[key] === \"string\"){\r\n str += JSON.stringify(props[key])\r\n }else{\r\n str += `{${getStrForProp(props[key], compPath, lang)}}`\r\n }\r\n propStrings.push(str)\r\n }\r\n })\r\n let openTag\r\n if(childrenProp){\r\n openTag = `<${compPath} ${propStrings.join(\" \")}>`\r\n let closeTag = `</${compPath}>`\r\n return `${openTag}\\n ${childrenProp}\\n${closeTag}`\r\n }else{\r\n openTag = `<${compPath} ${propStrings.join(\" \")}/>`\r\n return openTag\r\n }\r\n }else if(lang === \"react\"){\r\n let children = props.children || null\r\n delete props.children\r\n if(children && children.$$typeof && (children.$$typeof === Symbol.for(\"react.element\") || children.$$typeof === 0xeac7)){\r\n children = getStrForProp(children, compPath, lang)\r\n }\r\n let propStrings = []\r\n Object.keys(props).forEach(key => {\r\n let visibleKey = /[^\\w\\d_]/g.test(key) ? JSON.stringify(key) : key\r\n let str = visibleKey+\": \"\r\n if(typeof props[key] === \"string\"){\r\n str += JSON.stringify(props[key])\r\n }else{\r\n str += getStrForProp(props[key], compPath, lang).split(\"\\n\").map((str, i) => {\r\n if(i === 0)return str\r\n return \" \" + str\r\n }).join(\"\\n\")\r\n }\r\n propStrings.push(str)\r\n })\r\n let propObject = \"{\"\r\n if(propStrings.length){\r\n propStrings.forEach((str, i) => {\r\n let isLast = i === propStrings.length - 1\r\n let isFirst = i === 0\r\n if(!isFirst){\r\n propObject += \",\"\r\n }\r\n propObject += \"\\n \"\r\n propObject += str\r\n if(isLast){\r\n propObject +=\"\\n}\"\r\n }\r\n })\r\n }else{\r\n propObject += \"}\"\r\n }\r\n let childrenData = typeof children === \"string\" && children.startsWith(\"React.createElement\") ? children : JSON.stringify(children)\r\n return `React.createElement(${compPath}, ${propObject}, ${childrenData})`\r\n }\r\n }\r\n let help = comp.help || {}\r\n let info = help.info ? <window.Lightcord.Api.Components.general.AlertBox type=\"info\">\r\n {help.info}\r\n </window.Lightcord.Api.Components.general.AlertBox> : null\r\n let warn = help.warn ? <window.Lightcord.Api.Components.general.AlertBox type=\"warn\">\r\n {help.warn}\r\n </window.Lightcord.Api.Components.general.AlertBox> : null\r\n let danger = help.danger ? <window.Lightcord.Api.Components.general.AlertBox type=\"danger\">\r\n {help.danger}\r\n </window.Lightcord.Api.Components.general.AlertBox> : null\r\n let error = help.error ? <window.Lightcord.Api.Components.general.AlertBox type=\"error\">\r\n {help.error}\r\n </window.Lightcord.Api.Components.general.AlertBox> : null\r\n let success = help.success ? <window.Lightcord.Api.Components.general.AlertBox type=\"success\">\r\n {help.success}\r\n </window.Lightcord.Api.Components.general.AlertBox> : null\r\n return (<div>\r\n <window.Lightcord.Api.Components.general.SettingsTitle>\r\n {comp.displayName || comp.name}\r\n </window.Lightcord.Api.Components.general.SettingsTitle>\r\n {info}\r\n {success}\r\n {warn}\r\n {error}\r\n {danger}\r\n {AllPreviews.map(category => {\r\n if(category[0].onClick)return null\r\n if(category[0].text)return null\r\n if(category[0].children)return null\r\n if(category.length === 1)return null\r\n \r\n let key = Object.keys(category[0])[0]\r\n return [\r\n <window.Lightcord.Api.Components.general.SettingSubTitle>\r\n {key}\r\n </window.Lightcord.Api.Components.general.SettingSubTitle>,\r\n <window.Lightcord.Api.Components.inputs.Dropdown options={category.map((e, index) => {\r\n return {\r\n value: \"opt-\"+index,\r\n label: JSON.stringify(e[Object.keys(e)[0]])\r\n }\r\n })} value={\"opt-\"+(state.options[key] || \"0\")} onChange={(value) => {\r\n this.setState({\r\n options: Object.assign({}, state.options, {\r\n [key]: (value.value || \"0\").replace(\"opt-\", \"\")\r\n })\r\n })\r\n }} searchable={true}/>,\r\n <div style={{marginBottom: \"8px\"}}></div>\r\n ]\r\n })}\r\n <window.Lightcord.Api.Components.general.Tabs tabs={[{label: \"Preview\", id: \"preview\"}, {label: \"Code\", id: \"code\"}]} \r\n active={state.tab} children={state.tab === \"preview\" ? renderPreview() : renderCode()} onChange={(tab) => {\r\n this.setState({\r\n tab\r\n })\r\n }}/>\r\n </div>)\r\n }\r\n}","{/* <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"white\" width=\"18px\" height=\"18px\">\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\r\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\"/>\r\n</svg> */}\r\n\r\nimport BDV2 from \"../../modules/v2\";\r\n\r\nconst React = BDV2.React;\r\n\r\nexport default class History extends React.Component {\r\n render() {\r\n const size = this.props.size || \"18px\";\r\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}>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\r\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\"/>\r\n </svg>;\r\n }\r\n}","import { themeCookie } from \"../0globals\"\r\nimport bdEvents from \"./bdEvents\"\r\nimport DOM from \"./domtools\"\r\n\r\nexport default new class popoutWindow {\r\n constructor(){\r\n /**\r\n * @type {Map<string, Window>}\r\n */\r\n this.windows = new Map()\r\n this.enabled = false\r\n this.init()\r\n }\r\n\r\n async init(){\r\n let popoutModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getWindow)\r\n window.Lightcord.DiscordModules.dispatcher.subscribe(\"POPOUT_WINDOW_OPEN\", (ev) => {\r\n setImmediate(() => {\r\n /**\r\n * @type {Window}\r\n */\r\n const window = popoutModule.default.getWindow(ev.key)\r\n this.windows.set(ev.key, window)\r\n\r\n let classList = window.document.body.classList\r\n classList.add(\"window-popout\")\r\n classList.add(\"lightcord\")\r\n classList.add(\"lightcord\")\r\n\r\n this.update(ev.key)\r\n })\r\n })\r\n window.Lightcord.DiscordModules.dispatcher.subscribe(\"POPOUT_WINDOW_CLOSE\", (ev) => {\r\n setImmediate(() => {\r\n this.windows.delete(ev.key)\r\n })\r\n })\r\n bdEvents.on(\"theme-enabled\", () => {\r\n this.update()\r\n })\r\n bdEvents.on(\"theme-disabled\", () => {\r\n this.update()\r\n })\r\n bdEvents.on(\"theme-reloaded\", () => {\r\n this.update()\r\n })\r\n bdEvents.on(\"theme-unloaded\", () => {\r\n this.update()\r\n })\r\n bdEvents.on(\"theme-loaded\", () => {\r\n this.update()\r\n })\r\n }\r\n\r\n enable(){\r\n this.enabled = true\r\n this.update()\r\n }\r\n\r\n disable(){\r\n this.enabled = false\r\n this.update()\r\n }\r\n\r\n update(key){\r\n if(!this.windows.size)return\r\n if(!this.enabled){\r\n return this.removeThemes(key)\r\n }else{\r\n return this.applyThemes(key)\r\n }\r\n }\r\n\r\n removeThemes(key){\r\n if(this.enabled)return\r\n if(key){\r\n let window = this.windows.get(key)\r\n if(!window)return\r\n let document = window.document\r\n\r\n for(let style of document.querySelectorAll(\"style[data-lightcord-theme=true]\")){\r\n style.remove()\r\n }\r\n }else{\r\n for(let key of this.windows.keys()){\r\n this.removeThemes(key)\r\n }\r\n }\r\n }\r\n\r\n applyThemes(key){\r\n if(!this.enabled)return\r\n if(key){\r\n let window = this.windows.get(key)\r\n if(!window)return\r\n let document = window.document\r\n\r\n for(let style of document.querySelectorAll(\"style[data-lightcord-theme=true]\")){\r\n style.setAttribute(\"will-remove\", \"true\")\r\n }\r\n\r\n Object.keys(bdthemes)\r\n .forEach(themeName => {\r\n if(!themeCookie[themeName])return // theme disabled\r\n const theme = bdthemes[themeName]\r\n if(!theme)return //:shrug:\r\n\r\n let existing = document.querySelector(\"style[data-lightcord-theme=true]#\"+DOM.escapeID(theme.id))\r\n if(existing){\r\n existing.innerHTML = unescape(theme.css)\r\n existing.removeAttribute(\"will-remove\")\r\n }else{\r\n const style = document.createElement(\"style\")\r\n style.id = DOM.escapeID(theme.id)\r\n style.innerHTML = unescape(theme.css)\r\n style.setAttribute(\"data-lightcord-theme\", \"true\")\r\n document.head.append(style)\r\n }\r\n })\r\n\r\n for(let style of document.querySelectorAll(\"style[will-remove=true]\")){\r\n style.remove()\r\n }\r\n }else{\r\n for(let key of this.windows.keys()){\r\n this.applyThemes(key)\r\n }\r\n }\r\n }\r\n}","import {settings, settingsCookie, settingsRPC, lightcordSettings} from \"../0globals\";\r\nimport DataStore from \"./dataStore\";\r\nimport V2_SettingsPanel_Sidebar from \"./settingsPanelSidebar\";\r\nimport Utils from \"./utils\";\r\nimport BDV2 from \"./v2\";\r\nimport ContentManager from \"./contentManager\";\r\nimport coloredText from \"./coloredText\";\r\nimport tfHour from \"./24hour\";\r\nimport DOM from \"./domtools\";\r\n\r\nimport publicServersModule from \"./publicServers\";\r\nimport voiceMode from \"./voiceMode\";\r\nimport ClassNormalizer from \"./classNormalizer\";\r\nimport dMode from \"./devMode\";\r\n\r\nimport SectionedSettingsPanel from \"../ui/sectionedSettingsPanel\";\r\nimport CssEditor from \"../ui/cssEditor\";\r\nimport CardList from \"../ui/addonlist\";\r\nimport V2C_PresenceSettings from \"../ui/presenceSettings\";\r\nimport CustomRichPresence from \"./CustomRichPresence\";\r\nimport V2C_AccountInfos from \"../ui/AccountInfos\";\r\nimport { remote } from \"electron\";\r\nimport AntiAdDM from \"./AntiAdDM\";\r\nimport blurPrivate from \"./blurPrivate\";\r\nimport disableTyping from \"./disableTyping\";\r\nimport ApiPreview from \"../ui/ApiPreview\";\r\nimport Switch from \"../ui/switch\";\r\nimport MarginTop from \"../ui/margintop\";\r\nimport webpackModules from \"./webpackModules\";\r\nimport tooltipWrap from \"../ui/tooltipWrap\";\r\nimport History from \"../ui/icons/history\";\r\nimport core from \"./core\";\r\nimport popoutWindow from \"./popoutWindow\";\r\n\r\nclass BDSidebarHeader extends React.PureComponent {\r\n render(){\r\n let sidebarComponents = webpackModules.find(e => e.Separator && e.Header && e.Item)\r\n\r\n const changelogButton = React.createElement(tooltipWrap, {color: \"black\", side: \"top\", text: \"Changelog\"}, \r\n React.createElement(\"span\", {style: {float: \"right\", cursor: \"pointer\"}, className: \"bd-changelog-button\", onClick: () => {Utils.showChangelogModal(bbdChangelog);}},\r\n React.createElement(History, {className: \"bd-icon\", size: \"16px\"})\r\n )\r\n );\r\n let rendered = new sidebarComponents.Header({\r\n children: React.createElement(\"span\", null, \"Bandaged BD\", changelogButton),\r\n className: \"ui-tab-bar-header\"\r\n })\r\n return rendered\r\n }\r\n}\r\n\r\nlet isClearingCache = false\r\n\r\nexport default new class V2_SettingsPanel {\r\n\r\n constructor() {\r\n this.onChange = this.onChange.bind(this);\r\n this.updateSettings = this.updateSettings.bind(this);\r\n this.sidebar = new V2_SettingsPanel_Sidebar();\r\n\r\n this.registerComponents()\r\n }\r\n\r\n registerComponents(){\r\n /** Lightcord */\r\n this.sidebar.register(\"lightcord\", makeComponent(this.lightcordComponent.bind(this)))\r\n this.sidebar.register(\"status\", makeComponent(this.PresenceComponent.bind(this)))\r\n this.sidebar.register(\"accountinfo\", makeComponent(this.AccountInfosComponent.bind(this)))\r\n this.sidebar.register(\"lcapipreview\", makeComponent(this.ApiPreviewComponent.bind(this)))\r\n\r\n /* Bandaged BD */\r\n this.sidebar.register(\"BDChangelogTitle\", makeComponent(() => {\r\n return new BDSidebarHeader().render()\r\n }))\r\n this.sidebar.register(\"core\", makeComponent(this.coreComponent.bind(this)))\r\n this.sidebar.register(\"customcss\", makeComponent(this.customCssComponent.bind(this)))\r\n this.sidebar.register(\"plugins\", makeComponent(this.renderAddonPane(\"plugins\")))\r\n this.sidebar.register(\"themes\", makeComponent(this.renderAddonPane(\"themes\")))\r\n }\r\n \r\n get coreSettings() {\r\n const settings = this.getSettings(\"core\");\r\n const categories = [...new Set(settings.map(s => s.category))];\r\n const sections = categories.map(c => {return {title: c, settings: settings.filter(s => s.category == c)};});\r\n return sections;\r\n }\r\n\r\n get lightcordSettings() {\r\n const settings = this.getSettings(\"lightcord\");\r\n const categories = [...new Set(settings.map(s => s.category))];\r\n const sections = categories.map(c => {return {title: c, settings: settings.filter(s => s.category == c)};});\r\n return sections;\r\n }\r\n\r\n get PresenceSettings() {\r\n return this.getSettings(\"status\")\r\n }\r\n\r\n getSettings(category) {\r\n return Object.keys(settings).reduce((arr, key) => {\r\n const setting = settings[key];\r\n if (setting.cat === category && setting.implemented && !setting.hidden) {\r\n setting.text = key;\r\n arr.push(setting);\r\n }\r\n return arr;\r\n }, []);\r\n }\r\n\r\n\r\n onChange(id, checked, sidebar) {\r\n this.updateSettings(id, checked, sidebar);\r\n }\r\n\r\n updateSettings(id, enabled, sidebar) {\r\n if(![\"lightcord-8\", \"no_window_bound\", \"enable_glasstron\", \"lightcord-10\"].includes(id))settingsCookie[id] = enabled;\r\n\r\n if (id == \"bda-gs-2\") {\r\n if (enabled) DOM.addClass(document.body, \"bd-minimal\");\r\n else DOM.removeClass(document.body, \"bd-minimal\");\r\n }\r\n\r\n if (id == \"bda-gs-3\") {\r\n if (enabled) DOM.addClass(document.body, \"bd-minimal-chan\");\r\n else DOM.removeClass(document.body, \"bd-minimal-chan\");\r\n }\r\n\r\n if (id == \"bda-gs-1\") {\r\n if (enabled) publicServersModule.addButton();\r\n else publicServersModule.removeButton();\r\n }\r\n\r\n if (id == \"bda-gs-4\") {\r\n if (enabled) voiceMode.start();\r\n else voiceMode.stop();\r\n }\r\n\r\n if (id == \"bda-gs-5\") {\r\n if (enabled) DOM.addClass(DOM.query(\"#app-mount\"), \"bda-dark\");\r\n else DOM.removeClass(DOM.query(\"#app-mount\"), \"bda-dark\");\r\n }\r\n\r\n if (enabled && id == \"bda-gs-6\") tfHour.inject24Hour();\r\n\r\n if (id == \"bda-gs-7\") {\r\n if (enabled) coloredText.injectColoredText();\r\n else coloredText.removeColoredText();\r\n }\r\n\r\n if (id == \"fork-ps-4\") {\r\n if (enabled) ClassNormalizer.start();\r\n else ClassNormalizer.stop();\r\n }\r\n\r\n if (id == \"fork-ps-5\") {\r\n if (enabled) {\r\n ContentManager.watchContent(\"plugin\");\r\n ContentManager.watchContent(\"theme\");\r\n }\r\n else {\r\n ContentManager.unwatchContent(\"plugin\");\r\n ContentManager.unwatchContent(\"theme\");\r\n }\r\n }\r\n\r\n if (id == \"fork-wp-1\") {\r\n Utils.setWindowPreference(\"transparent\", enabled);\r\n if (enabled) Utils.setWindowPreference(\"backgroundColor\", null);\r\n else Utils.setWindowPreference(\"backgroundColor\", \"#2f3136\");\r\n }\r\n\r\n\r\n if (id == \"bda-gs-8\") {\r\n if (enabled) dMode.startDebugListener();\r\n else dMode.stopDebugListener();\r\n }\r\n\r\n if (id == \"fork-dm-1\") {\r\n if (enabled) dMode.startCopySelector();\r\n else dMode.stopCopySelector();\r\n }\r\n\r\n if (id === \"lightcord-1\") {\r\n if (enabled) window.Lightcord.Settings.devMode = true\r\n else window.Lightcord.Settings.devMode = false\r\n sidebar.forceUpdate()\r\n }\r\n if (id === \"lightcord-2\") {\r\n if (enabled) window.Lightcord.Settings.callRingingBeat = true\r\n else window.Lightcord.Settings.callRingingBeat = false\r\n }\r\n if (id === \"lightcord-presence-1\") {\r\n if (enabled) {\r\n CustomRichPresence.enable()\r\n const settingsStore = BDModules.get(e => e.default && typeof e.default === \"object\" && \"showCurrentGame\" in e.default)[0]\r\n if(settingsStore && !settingsStore.default.showCurrentGame){\r\n BDModules.get(e => e.default && e.default.updateRemoteSettings)[0].default.updateRemoteSettings({\r\n showCurrentGame: true\r\n })\r\n }\r\n }\r\n else CustomRichPresence.disable()\r\n }\r\n if (id === \"lightcord-3\") {\r\n if (enabled) remote.getCurrentWindow().setAlwaysOnTop(true)\r\n else remote.getCurrentWindow().setAlwaysOnTop(false)\r\n }\r\n if (id === \"lightcord-4\") {\r\n if(enabled){\r\n AntiAdDM.enable()\r\n }else{\r\n AntiAdDM.disable()\r\n }\r\n }\r\n if (id === \"lightcord-6\") {\r\n if(enabled){\r\n blurPrivate.enable()\r\n }else{\r\n blurPrivate.disable()\r\n }\r\n }\r\n if (id === \"lightcord-7\") {\r\n if(enabled){\r\n disableTyping.enable()\r\n }else{\r\n disableTyping.disable()\r\n }\r\n }\r\n if (id === \"lightcord-8\"){\r\n let appSettings = remote.getGlobal(\"appSettings\")\r\n appSettings.set(\"isTabs\", enabled)\r\n appSettings.save()\r\n remote.app.relaunch()\r\n remote.app.exit()\r\n }\r\n if (id === \"lightcord-9\") {\r\n popoutWindow[enabled ? \"enable\" : \"disable\"]()\r\n }\r\n if (id === \"lightcord-10\"){\r\n core.methods.NotificationsUseShim(enabled)\r\n return\r\n }\r\n if (id === \"no_window_bound\"){\r\n let appSettings = remote.getGlobal(\"appSettings\")\r\n appSettings.set(\"NO_WINDOWS_BOUND\", enabled)\r\n\r\n appSettings.delete(\"IS_MAXIMIZED\")\r\n appSettings.delete(\"IS_MINIMIZED\") \r\n appSettings.delete(\"WINDOW_BOUNDS\")\r\n \r\n appSettings.save()\r\n remote.app.relaunch()\r\n remote.app.exit()\r\n }\r\n if (id === \"enable_glasstron\"){\r\n let appSettings = remote.getGlobal(\"appSettings\")\r\n appSettings.set(\"GLASSTRON\", enabled)\r\n appSettings.save()\r\n remote.app.relaunch()\r\n remote.app.exit()\r\n }\r\n\r\n this.saveSettings();\r\n }\r\n\r\n async initializeSettings() {\r\n if (settingsCookie[\"bda-gs-2\"]) DOM.addClass(document.body, \"bd-minimal\");\r\n if (settingsCookie[\"bda-gs-3\"]) DOM.addClass(document.body, \"bd-minimal-chan\");\r\n if (settingsCookie[\"bda-gs-1\"]) publicServersModule.addButton();\r\n if (settingsCookie[\"bda-gs-4\"]) voiceMode.start();\r\n if (settingsCookie[\"bda-gs-5\"]) DOM.addClass(DOM.query(\"#app-mount\"), \"bda-dark\");\r\n if (settingsCookie[\"bda-gs-6\"]) tfHour.inject24Hour();\r\n if (settingsCookie[\"bda-gs-7\"]) coloredText.injectColoredText();\r\n if (settingsCookie[\"fork-ps-4\"]) ClassNormalizer.start();\r\n if (settingsCookie[\"lightcord-1\"]) window.Lightcord.Settings.devMode = true\r\n if (settingsCookie[\"lightcord-2\"]) window.Lightcord.Settings.callRingingBeat = true\r\n if (settingsCookie[\"lightcord-presence-1\"]) CustomRichPresence.enable()\r\n if (settingsCookie[\"lightcord-3\"]) remote.getCurrentWindow().setAlwaysOnTop(true)\r\n if (settingsCookie[\"lightcord-4\"]) AntiAdDM.enable()\r\n if (settingsCookie[\"lightcord-6\"]) blurPrivate.enable()\r\n if (settingsCookie[\"lightcord-7\"]) disableTyping.enable()\r\n if (settingsCookie[\"lightcord-9\"]) popoutWindow.enable()\r\n\r\n if (settingsCookie[\"fork-ps-5\"]) {\r\n ContentManager.watchContent(\"plugin\");\r\n ContentManager.watchContent(\"theme\");\r\n }\r\n\r\n if (settingsCookie[\"bda-gs-8\"]) dMode.startDebugListener();\r\n if (settingsCookie[\"fork-dm-1\"]) dMode.startCopySelector();\r\n\r\n this.saveSettings();\r\n }\r\n\r\n saveSettings() {\r\n DataStore.setSettingGroup(\"settings\", settingsCookie);\r\n DataStore.setSettingGroup(\"rpc\", settingsRPC);\r\n DataStore.setSettingGroup(\"lightcord-settings\", lightcordSettings);\r\n }\r\n\r\n loadSettings() {\r\n Object.assign(settingsCookie, DataStore.getSettingGroup(\"settings\"));\r\n Object.assign(settingsRPC, DataStore.getSettingGroup(\"rpc\"));\r\n console.log(lightcordSettings, DataStore.getSettingGroup(\"lightcord-settings\"))\r\n Object.assign(lightcordSettings, DataStore.getSettingGroup(\"lightcord-settings\"));\r\n }\r\n\r\n renderSidebar(sidebar) {\r\n return this.sidebar.render(sidebar);\r\n }\r\n\r\n coreComponent() {\r\n return BDV2.react.createElement(SectionedSettingsPanel, {key: \"cspanel\", onChange: this.onChange, sections: this.coreSettings})\r\n }\r\n\r\n lightcordComponent(sidebar, forceUpdate) {\r\n let appSettings = remote.getGlobal(\"appSettings\")\r\n return [\r\n this.lightcordSettings.map((section, i) => {\r\n return [\r\n (i === 0 ? null : BDV2.react.createElement(MarginTop)),\r\n BDV2.react.createElement(\"h2\", {className: \"ui-form-title h2 margin-reset margin-bottom-20\"}, section.title),\r\n section.settings.map(setting => {\r\n let isChecked = settingsCookie[setting.id]\r\n if(setting.id === \"lightcord-8\")isChecked = appSettings.get(\"isTabs\", false);\r\n if(setting.id === \"no_window_bound\")isChecked = appSettings.get(\"NO_WINDOWS_BOUND\", false)\r\n if(setting.id === \"enable_glasstron\")isChecked = appSettings.get(\"GLASSTRON\", true)\r\n if(setting.id === \"lightcord-10\")isChecked = !appSettings.get(\"DEFAULT_NOTIFICATIONS\", true)\r\n let returnValue = BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: isChecked, onChange: (id, checked) => {\r\n this.onChange(id, checked, sidebar);\r\n }})\r\n if(setting.id == \"lightcord-8\" && isChecked){\r\n return [\r\n returnValue,\r\n React.createElement(Lightcord.Api.Components.inputs.Button, {\r\n color: \"green\",\r\n look: \"outlined\",\r\n size: \"small\",\r\n hoverColor: \"brand\",\r\n onClick: () => {\r\n DiscordNative.ipc.send(\"NEW_TAB\")\r\n },\r\n wrapper: false,\r\n disabled: false\r\n }, \"Open a new Tab\")\r\n ]\r\n }\r\n return returnValue\r\n })\r\n ]\r\n }), \r\n BDV2.react.createElement(window.Lightcord.Api.Components.inputs.Button, {\r\n color: \"yellow\",\r\n look: \"ghost\",\r\n size: \"medium\",\r\n hoverColor: \"red\",\r\n onClick(){\r\n console.log(\"Should relaunch\")\r\n remote.app.relaunch({\r\n args: remote.process.argv.slice(1).concat([\"--disable-betterdiscord\"])\r\n })\r\n remote.app.quit()\r\n },\r\n wrapper: true\r\n }, \"Relaunch without BetterDiscord\"),\r\n React.createElement(Lightcord.Api.Components.inputs.Button, {\r\n color: \"yellow\",\r\n look: \"ghost\",\r\n size: \"medium\",\r\n hoverColor: \"red\",\r\n onClick: () => {\r\n if(isClearingCache)return\r\n isClearingCache = true\r\n Utils.showToast(\"Clearing cache...\", {\r\n type: \"info\"\r\n })\r\n forceUpdate()\r\n remote.getCurrentWebContents().session.clearCache()\r\n .then(() => {\r\n Utils.showToast(\"Cache is cleared !\", {\r\n type: \"success\"\r\n })\r\n isClearingCache = false\r\n forceUpdate()\r\n }).catch(err => {\r\n console.error(err)\r\n Utils.showToast(\"An error occured. Check console for more informations.\", {\r\n type: \"error\"\r\n })\r\n isClearingCache = false\r\n forceUpdate()\r\n })\r\n },\r\n wrapper: true,\r\n disabled: isClearingCache\r\n }, \"Clear cache\")\r\n ]\r\n }\r\n\r\n PresenceComponent() {\r\n return BDV2.react.createElement(V2C_PresenceSettings, {\r\n key: \"lppannel\",\r\n onChange: this.onChange, \r\n settings: this.PresenceSettings\r\n })\r\n }\r\n\r\n AccountInfosComponent() {\r\n return BDV2.react.createElement(V2C_AccountInfos, {\r\n key: \"lapannel\"\r\n })\r\n }\r\n\r\n ApiPreviewComponent() {\r\n return BDV2.react.createElement(ApiPreview, {\r\n key: \"lapipannel\"\r\n })\r\n }\r\n\r\n customCssComponent() {\r\n return BDV2.react.createElement(CssEditor, {key: \"csseditor\"})\r\n }\r\n\r\n renderAddonPane(type) {\r\n // I know this shouldn't be here, but when it isn't,\r\n // React refuses to change the button when going\r\n // between plugins and themes page... something\r\n // to debug later.\r\n class ContentList extends BDV2.react.Component {\r\n constructor(props) {\r\n super(props);\r\n this.prefix = this.props.type.replace(\"s\", \"\");\r\n }\r\n \r\n onChange() {\r\n this.props.onChange(this.props.type);\r\n }\r\n \r\n render() {return this.props.children;}\r\n }\r\n const originalRender = ContentList.prototype.render;\r\n Object.defineProperty(ContentList.prototype, \"render\", {\r\n enumerable: false,\r\n configurable: false,\r\n set: function() {console.warn(\"Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins\");},\r\n get: () => originalRender\r\n });\r\n return function(){\r\n return BDV2.react.createElement(ContentList, {type}, BDV2.react.createElement(CardList, {type}))\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * No need to export settingsPanel on window\r\n */\r\n\r\nfunction makeComponent(children){\r\n class SettingComponent extends React.Component {\r\n render(){\r\n return children(sidebar, () => this.forceUpdate())\r\n }\r\n }\r\n let sidebar\r\n return (s) => {\r\n sidebar = s\r\n return SettingComponent\r\n }\r\n}","import BDV2 from \"../modules/v2\";\r\n\r\nexport default class BDLogo extends BDV2.reactComponent {\r\n render() {\r\n return BDV2.react.createElement(\r\n \"svg\",\r\n {height: \"100%\", width: this.props.size || \"16px\", className: \"bd-logo \" + this.props.className, style: {fillRule: \"evenodd\", clipRule: \"evenodd\", strokeLinecap: \"round\", strokeLinejoin: \"round\"}, viewBox: \"0 0 2000 2000\"},\r\n BDV2.react.createElement(\"metadata\", null),\r\n BDV2.react.createElement(\"defs\", null,\r\n BDV2.react.createElement(\"filter\", {id: \"shadow1\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"20\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(0,0,0,0.35)\"})),\r\n BDV2.react.createElement(\"filter\", {id: \"shadow2\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"15\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(255,255,255,0.15)\"})),\r\n BDV2.react.createElement(\"filter\", {id: \"shadow3\"}, BDV2.react.createElement(\"feDropShadow\", {\"dx\": \"10\", \"dy\": \"0\", \"stdDeviation\": \"20\", \"flood-color\": \"rgba(0,0,0,0.35)\"}))\r\n ),\r\n BDV2.react.createElement(\"g\", null,\r\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow3)\"}, d: \"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z\", fill: \"#171717\", opacity: \"1\"}),\r\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow2)\"}, d: \"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z\", fill: \"#3E82E5\", opacity: \"1\"}),\r\n BDV2.react.createElement(\"path\", {style: {filter: \"url(#shadow1)\"}, d: \"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z\", fill: \"#FFFFFF\", opacity: \"1\"})\r\n )\r\n );\r\n }\r\n}","export default class LightcordLogo extends React.Component {\r\n render(){\r\n const props = this.props\r\n return (\r\n <svg viewBox=\"0 0 168 168.69\" {...props} height=\"100%\" width={props.size}>\r\n <defs>\r\n <linearGradient id=\"prefix__a\" x1={66.7} y1={-487.7} x2={66.7} y2={-508.73} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\r\n <stop offset={0} stopColor=\"#e30613\" />\r\n <stop offset={1} stopColor=\"#731a14\" />\r\n </linearGradient>\r\n <linearGradient id=\"prefix__b\" x1={101.7} y1={-487.7} x2={101.7} y2={-508.73} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\r\n <stop offset={0} stopColor=\"#e20613\" />\r\n <stop offset={1} stopColor=\"#731a13\" />\r\n </linearGradient>\r\n <linearGradient id=\"prefix__c\" x1={84} y1={-408} x2={84} y2={-576.69} gradientTransform=\"matrix(1 0 0 -1 0 -408)\" gradientUnits=\"userSpaceOnUse\">\r\n <stop offset={0} stopColor=\"#e30613\" />\r\n <stop offset={1} stopColor=\"#731a13\" />\r\n </linearGradient>\r\n </defs>\r\n <path fill=\"#fff\" d=\"M14.9 35.3h139.2V133H14.9z\" />\r\n <path d=\"M66.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\" fill=\"url(#prefix__a)\" />\r\n <path d=\"M101.7 79.7c-5.4 0-9.8 4.7-9.8 10.5s4.4 10.5 9.8 10.5 9.8-4.7 9.8-10.5-4.4-10.5-9.8-10.5z\" fill=\"url(#prefix__b)\" />\r\n <path d=\"M0 0v168l168 .69V0zm111.3 124.1s-3.4-4.1-6.3-7.7c12.6-3.5 17.4-11.3 17.4-11.3a52.52 52.52 0 01-11.1 5.6 68.63 68.63 0 01-38.9 4 70.12 70.12 0 01-14.1-4.1 48.88 48.88 0 01-7.1-3.3c-.3-.2-.6-.3-.9-.5a.76.76 0 00-.4-.2c-1.7-1-2.6-1.6-2.6-1.6s4.6 7.6 16.8 11.2c-2.9 3.6-6.4 7.9-6.4 7.9-21.2-.6-29.3-14.5-29.3-14.5 0-30.6 13.8-55.4 13.8-55.4 13.8-10.3 26.9-10 26.9-10l1 1.1C52.8 50.3 45 57.9 45 57.9a56.2 56.2 0 015.7-2.7 72.19 72.19 0 0121.8-6 8.75 8.75 0 011.6-.2 89.1 89.1 0 0119.4-.2 78.45 78.45 0 0128.9 9.1s-7.5-7.2-23.9-12.1l1.3-1.5s13.1-.3 26.9 10c0 0 13.8 24.8 13.8 55.4.1-.1-8 13.8-29.2 14.4z\" fill=\"url(#prefix__c)\" />\r\n </svg>\r\n )\r\n }\r\n}","import BDV2 from \"./v2\";\r\nimport Utils from \"./utils\";\r\n\r\nconst Constants = {\r\n EmojiRegex: /<a?\\.(\\w+)\\.(\\d+)>/g\r\n}\r\n\r\nlet CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\r\nlet EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\r\nlet AutocompleteModule = BDModules.get(e => e.default && e.default.displayName === \"Autocomplete\")[0]\r\nlet AutoCompletionTemplates = BDModules.get(e => e.getAutocompleteOptions)[0]\r\nlet EmojiModuleQuery = BDModules.get(e => e.default && e.default.queryEmojiResults)[0]\r\nlet Messages = BDModules.get(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)[0]\r\nlet guildModule = BDModules.get(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)[0]\r\nlet emojiSearch = BDModules.get(e => e.default && e.default.getDisambiguatedEmojiContext)\r\n\r\nexport default new class EmojiModule {\r\n constructor(){\r\n this.init().catch(err => Utils.err(\"EmojiModule\", \"An error occured\", err)) // better logging\r\n }\r\n\r\n async init(){\r\n /** Emoji AutoComplete */\r\n if(!AutocompleteModule)AutocompleteModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"Autocomplete\")\r\n if(!AutoCompletionTemplates)AutoCompletionTemplates = await window.Lightcord.Api.ensureExported(e => e.getAutocompleteOptions)\r\n if(!EmojiModuleQuery)EmojiModuleQuery = await window.Lightcord.Api.ensureExported(e => e.default && e.default.queryEmojiResults)\r\n if(!Messages)Messages = await window.Lightcord.Api.ensureExported(e => e.default && e.default.Messages && e.default.Messages.EMOJI_MATCHING)\r\n if(!guildModule)guildModule = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getGuild && e.default.getGuilds && !e.default.isFetching)\r\n if(!emojiSearch)emojiSearch = await window.Lightcord.Api.ensureExported(e => e.default && e.default.getDisambiguatedEmojiContext)\r\n\r\n if(AutocompleteModule && AutoCompletionTemplates && EmojiModuleQuery && Messages && guildModule && emojiSearch){\r\n console.log(`Patching getAutocompleteOptions of AutoCompletionTemplates`, AutoCompletionTemplates)\r\n const getAutocompleteOptions = AutoCompletionTemplates.getAutocompleteOptions\r\n AutoCompletionTemplates.getAutocompleteOptions = function(e, t, n, r, a){\r\n const value = getAutocompleteOptions.call(this, ...arguments)\r\n value.LIGHTCORD_EMOJIS = {\r\n matches(arg1, arg2){\r\n let condition = arg2.length > 1 && \".\" === arg1\r\n setEmojiUsable(condition)\r\n return condition\r\n },\r\n queryResults(t){\r\n let results = EmojiModuleQuery.default.queryEmojiResults(t, e)\r\n return results\r\n },\r\n renderResults(e, t, n, r, a){\r\n return D(e, t, a.emojis, n, r, Messages.default.Messages.EMOJI_MATCHING, Messages.default.Messages.EMOJI, AutocompleteModule.default.Emoji, (function(e) {\r\n return {\r\n emoji: e,\r\n key: e.id || e.uniqueName || e.name,\r\n sentinel: \".\",\r\n guild: null != e.guildId ? guildModule.default.getGuild(e.guildId) : null\r\n }\r\n }), (function(e) {\r\n return \".\" + e + \".\"\r\n }))\r\n },\r\n getPlainText(id, guild){\r\n var emojis = guild.emojis;\r\n if (null == emojis || null == emojis[id]) return \"\";\r\n var emoji = emojis[id],\r\n isAnimated = emoji.animated ? \"a\" : \"\";\r\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\r\n },\r\n getRawText(id, guild){\r\n var emojis = guild.emojis;\r\n if (null == emojis || null == emojis[id]) return \"\";\r\n var emoji = emojis[id],\r\n isAnimated = emoji.animated ? \"a\" : \"\";\r\n return emoji.managed || null == emoji.id ? \".\" + emoji.name + \".\" : \"<\" + isAnimated + \".\" + (emoji.originalName || emoji.name) + \".\" + emoji.id + \">\"\r\n }\r\n }\r\n return value\r\n }\r\n }else{\r\n console.error(new Error(\"Couldn't start autocompletion of Lightcord's emojis.\"))\r\n }\r\n\r\n /** Emoji display */\r\n while (!BDV2.MessageComponent) await new Promise(resolve => setTimeout(resolve, 100));\r\n\r\n if (!this.cancelEmojiRender){ // TODO: Proper emoji formatting / rendering\r\n this.cancelEmoteRender = Utils.monkeyPatch(BDV2.MessageComponent, \"default\", {before: (data) => {\r\n const message = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.message\")\r\n if(!message)return\r\n const content = Utils.getNestedProp(data.methodArguments[0], \"childrenMessageContent.props.content\")\r\n if(!content || !content.length)return\r\n \r\n /**\r\n * @type {{\r\n * raw: string,\r\n * name: string,\r\n * id: string,\r\n * animated: boolean\r\n * }[]}\r\n */\r\n let emojis = []\r\n \r\n const newContent = []\r\n for(let node of content){\r\n if (typeof(node) !== \"string\") {\r\n newContent.push(node)\r\n continue\r\n };\r\n let parsed;\r\n let hasParsed = false\r\n \r\n do {\r\n parsed = Constants.EmojiRegex.exec(node);\r\n if (parsed) {\r\n hasParsed = true\r\n if(!EmojiModuleApi)EmojiModuleApi = BDModules.get(e => e.default && e.default.getCustomEmojiById)[0]\r\n const emoji = EmojiModuleApi.default.getCustomEmojiById(parsed[2])\r\n if(emoji){\r\n emojis.push({\r\n animated: emoji.animated,\r\n name: emoji.name,\r\n id: emoji.id,\r\n raw: parsed[0]\r\n })\r\n }else{\r\n emojis.push({\r\n animated: parsed[0].startsWith(\"<a\"),\r\n name: parsed[1],\r\n id: parsed[2],\r\n raw: parsed[0]\r\n })\r\n }\r\n }\r\n } while (parsed);\r\n \r\n if(hasParsed){\r\n const words = node.split(\" \").map((word, index, arr) => {\r\n if(!word)return \"\"\r\n const emoji = emojis.find(e => e.raw == word)\r\n if(!emoji)return word\r\n if(!CustomEmojiModule)CustomEmojiModule = BDModules.get(e => e.CustomEmoji)[0]\r\n return React.createElement(CustomEmojiModule.CustomEmoji, {\r\n emoji: {\r\n name: `.${emoji.name}.`,\r\n emojiId: emoji.id,\r\n animated: emoji.animated,\r\n jumboable: arr.length === 1 && content.length === 1\r\n }\r\n })\r\n }).reduce((previous, current) => {\r\n if(previous.length === 0)return [current]\r\n if(typeof current === \"string\"){\r\n if(typeof previous[previous.length - 1] === \"string\"){\r\n previous[previous.length - 1] += ` ${current}`\r\n return previous\r\n }\r\n previous.push(\" \"+current)\r\n return previous\r\n }\r\n previous.push(\" \", current)\r\n return previous\r\n }, [])\r\n newContent.push(...words)\r\n }else{\r\n newContent.push(node)\r\n }\r\n }\r\n while(data.methodArguments[0].childrenMessageContent.props.content[0]){\r\n data.methodArguments[0].childrenMessageContent.props.content.shift()\r\n }\r\n while(newContent[0]){\r\n data.methodArguments[0].childrenMessageContent.props.content.push(newContent.shift())\r\n }\r\n }});\r\n }/*\r\n let userModule\r\n window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"EmojiPickerListRow\")\r\n .then(EmojiPickerListRow => {\r\n let classs = EmojiPickerListRow.default\r\n EmojiPickerListRow.default = class EmojiPickerListRow extends React.Component {\r\n constructor(props){\r\n super(props)\r\n }\r\n\r\n render(){\r\n if(!userModule)userModule = BDModules.get(e => e.default && e.default.getCurrentUser)[0]\r\n if(!userModule)return React.createElement(classs, this.props)\r\n let user = userModule.default.getCurrentUser()\r\n if(!user.hasPremiumSubscription)return React.createElement(classs, this.props)\r\n\r\n return React.createElement(classs, Object.assign({}, this.props, {\r\n emojiDescriptors: this.props.emojiDescriptors.map(e => {\r\n e.isDisabled = false\r\n })\r\n })) \r\n }\r\n }\r\n EmojiPickerListRow.default.displayName = \"EmojiPickerListRow\"\r\n })*/\r\n }\r\n\r\n disable(){\r\n if (!this.cancelEmoteRender) return;\r\n this.cancelEmoteRender();\r\n this.cancelEmoteRender = null;\r\n }\r\n\r\n start(){\r\n \r\n }\r\n}\r\n\r\nfunction D(e, t, n, r, o, i, s, u, l, c) {\r\n if (null == n || 0 === n.length) return null;\r\n var d = n.map((function(e, n) {\r\n return React.createElement(u, Object.assign({\r\n onClick: o,\r\n onHover: r,\r\n selected: t === n,\r\n index: n\r\n }, l(e, n)))\r\n }));\r\n return [R(i, s, e, c), d]\r\n}\r\n\r\nfunction R(e, t, n, r) {\r\n var a = (n.length > 0 ? e.format({\r\n prefix: r(n)\r\n }) : t)\r\n if(Array.isArray(a)){\r\n a.unshift(React.createElement(\"strong\", {}, \"[Lightcord] \"))\r\n }else{\r\n a = \"[LIGHTCORD] \"+a\r\n }\r\n return React.createElement(AutocompleteModule.default.Title, {\r\n title: a\r\n }, a)\r\n}\r\nR.displayName = \"renderHeader\";\r\n\r\nlet EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\r\nlet isEmojiDisabled = EmojiFilterModule && EmojiFilterModule.default.isEmojiDisabled\r\nlet isUsable = false\r\nlet hasPatched = false\r\n\r\nfunction setEmojiUsable(usable){\r\n isUsable = usable\r\n if(hasPatched)return\r\n if(!EmojiFilterModule)EmojiFilterModule = BDModules.get(e => e.default && e.default.isEmojiDisabled)[0]\r\n if(!EmojiFilterModule)return\r\n if(!isEmojiDisabled)isEmojiDisabled = EmojiFilterModule.default.isEmojiDisabled\r\n\r\n hasPatched = true\r\n EmojiFilterModule.default.isEmojiDisabled = function(emoji){\r\n if(isUsable){\r\n if(emoji.surrogates || emoji.diversity)return true\r\n return false\r\n }\r\n return isEmojiDisabled.call(this, ...arguments)\r\n }\r\n}","import {bdConfig, minSupportedVersion, bbdVersion, settingsCookie, bdpluginErrors, bdthemeErrors, bbdChangelog, defaultCookie, currentDiscordVersion, defaultRPC, settingsRPC, lightcordSettings} from \"../0globals\";\r\nimport Utils from \"./utils\";\r\n\r\nimport BDV2 from \"./v2\";\r\nimport settingsPanel from \"./settingsPanel\";\r\nimport pluginModule from \"./pluginModule\";\r\nimport themeModule from \"./themeModule\";\r\nimport DataStore from \"./dataStore\";\r\nimport WebpackModules from \"./webpackModules\";\r\nimport DOM from \"./domtools\";\r\n\r\nimport BDLogo from \"../ui/bdLogo\";\r\nimport TooltipWrap from \"../ui/tooltipWrap\";\r\nimport LightcordLogo from \"../svg/lightcord\";\r\nimport PluginCertifier from \"./pluginCertifier\";\r\nimport distant, { uuidv4 } from \"./distant\";\r\nimport EmojiModule from \"./emojiModule\"\r\nimport {remote as electron} from \"electron\"\r\nimport v2 from \"./v2\";\r\nimport contentManager from \"./contentManager\";\r\n\r\nlet methods\r\nfunction Core() {}\r\n\r\n\r\nCore.prototype.setConfig = function(config) {\r\n if (this.hasStarted) return;\r\n Object.assign(bdConfig, config);\r\n};\r\n\r\nObject.defineProperty(Core.prototype, \"methods\", {\r\n get(){\r\n return methods\r\n }\r\n})\r\n\r\nCore.prototype.setMethods = function(m) {\r\n if (this.hasStarted) return;\r\n methods = m\r\n};\r\n\r\nCore.prototype.init = async function() {\r\n if (this.hasStarted) return;\r\n this.hasStarted = true;\r\n\r\n if (!Array.prototype.flat) {\r\n Utils.alert(\"Not Supported\", \"BetterDiscord v\" + bbdVersion + \" does not support this old version (\" + currentDiscordVersion + \") of Discord. Please update your Discord installation before proceeding.\");\r\n return;\r\n }\r\n\r\n if (bdConfig.version < minSupportedVersion) {\r\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>\");\r\n return;\r\n }\r\n\r\n if (window.ED) {\r\n Utils.alert(\"Not Supported\", \"BandagedBD does not work with EnhancedDiscord. Please uninstall one of them.\");\r\n return;\r\n }\r\n\r\n if (window.WebSocket && window.WebSocket.name && window.WebSocket.name.includes(\"Patched\")) {\r\n Utils.alert(\"Not Supported\", \"BandagedBD does not work with Powercord. Please uninstall one of them.\");\r\n return;\r\n }\r\n\r\n Utils.suppressErrors(this.patchAttributes.bind(this), \"LC Plugin Certifier Patch\")();\r\n\r\n Utils.log(\"Startup\", \"Initializing Settings\");\r\n this.initSettings();\r\n\r\n await this.checkForGuilds();\r\n BDV2.initialize();\r\n Utils.log(\"Startup\", \"Updating Settings\");\r\n settingsPanel.initializeSettings();\r\n\r\n Utils.log(\"Startup\", \"Loading Addons Cache\")\r\n await contentManager.loadAddonCertifierCache()\r\n\r\n Utils.log(\"Startup\", \"Loading Plugins\");\r\n await pluginModule.loadPlugins();\r\n\r\n Utils.log(\"Startup\", \"Loading Themes\");\r\n await themeModule.loadThemes();\r\n\r\n DOM.addStyle(\"customcss\", Buffer.from(DataStore.getBDData(\"bdcustomcss\"), \"base64\").toString(\"utf8\"));\r\n\r\n window.addEventListener(\"beforeunload\", function() {\r\n if (settingsCookie[\"bda-dc-0\"]) document.querySelector(\".btn.btn-disconnect\").click();\r\n });\r\n\r\n PluginCertifier.start()\r\n\r\n Utils.log(\"Startup\", \"Removing Loading Icon\");\r\n if (document.getElementsByClassName(\"bd-loaderv2\").length) document.getElementsByClassName(\"bd-loaderv2\")[0].remove();\r\n Utils.log(\"Startup\", \"Initializing Main Observer\");\r\n this.initObserver();\r\n\r\n // Show loading errors\r\n if (settingsCookie[\"fork-ps-1\"]) {\r\n Utils.log(\"Startup\", \"Collecting Startup Errors\");\r\n Utils.showContentErrors({plugins: bdpluginErrors, themes: bdthemeErrors});\r\n }\r\n\r\n const previousVersion = DataStore.getBDData(\"version\");\r\n if (bbdVersion > previousVersion) {\r\n if (bbdChangelog) this.showChangelogModal(bbdChangelog);\r\n DataStore.setBDData(\"version\", bbdVersion);\r\n }\r\n\r\n EmojiModule.start()\r\n\r\n Utils.suppressErrors(this.patchSocial.bind(this), \"BD Social Patch\")();\r\n Utils.suppressErrors(this.patchGuildPills.bind(this), \"BD Guild Pills Patch\")();\r\n Utils.suppressErrors(this.patchGuildListItems.bind(this), \"BD Guild List Items Patch\")();\r\n Utils.suppressErrors(this.patchGuildSeparator.bind(this), \"BD Guild Separator Patch\")();\r\n Utils.suppressErrors(this.patchMessageHeader.bind(this), \"BD Badge Chat Patch\")();\r\n Utils.suppressErrors(this.patchMemberList.bind(this), \"BD Badge Member List Patch\")();\r\n Utils.suppressErrors(this.patchAttachment.bind(this), \"LC Plugin Certifier Patch\")();\r\n\r\n if(bdConfig.haveInstalledDefault){\r\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.\")\r\n await new Promise((resolve) => {\r\n alert.onClose(resolve)\r\n })\r\n }\r\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\")\r\n if(logo){\r\n logo.style.top = \"3px\"\r\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\">\r\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)\"/>\r\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\"/>\r\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\"/>\r\n</svg>`\r\n }\r\n};\r\n\r\nCore.prototype.patchAttributes = async function() {\r\n let attribsPatchs = []\r\n this.cancelPatchAttributes = function() {\r\n attribsPatchs.forEach(e => e())\r\n }\r\n\r\n while(!v2.MessageComponent)await new Promise(resolve => setTimeout(resolve, 100))\r\n \r\n // TODO: try to patch correctly the user popout on a next update\r\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\r\n window.Lightcord.Api.ensureExported(e => e.default && e.default.displayName === \"DiscordTag\")\r\n .then(DiscordTag => {\r\n let DiscordTagComp = DiscordTag.default\r\n DiscordTag.default = function(props){\r\n let returnValue = DiscordTagComp(props)\r\n\r\n let id = uuidv4()\r\n\r\n let badgeDiv = BDV2.React.createElement(\"div\", {\r\n style: {\r\n display: \"inline\",\r\n marginTop: \"5px\"\r\n }\r\n }, BDV2.React.createElement(\"span\", {\r\n id: \"badges-\"+id,\r\n key: \"badges-\"+id,\r\n style: {\r\n display: \"inherit\"\r\n }\r\n }))\r\n\r\n let children = [returnValue]\r\n\r\n if (props.user.id === \"249746236008169473\") { // Rauenzi: BandagedBD Developer\r\n children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\r\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\r\n )\r\n )\r\n );\r\n } else if (props.user.id === \"696481194443014174\" || props.user.id === \"696003456611385396\"){ // Not Thomiz: Lightcord Developer, Phorcys: Lightcord Developer\r\n children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\r\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\r\n )\r\n )\r\n );\r\n }\r\n\r\n children.push(badgeDiv)\r\n let div = BDV2.React.createElement(\"div\", {\r\n style: {\r\n display: \"block\"\r\n }\r\n }, children)\r\n applyBadges(id, props.user, false)\r\n\r\n return div\r\n }\r\n })\r\n\r\n attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, \"default\", {after: (data) => {\r\n if(data.methodArguments[0].childrenMessageContent.props.message){ // this can be a blocked message (not opened)\r\n data.returnValue.props[\"data-message-id\"] = data.methodArguments[0].childrenMessageContent.props.message.id\r\n }\r\n }}))\r\n /*\r\n attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, \"default\", {after: (data) => {\r\n data.returnValue.props[\"message-id\"] = data.methodArguments[0].childrenMessageContent.props.message.id\r\n }}))*/\r\n}\r\n\r\nCore.prototype.checkForGuilds = function() {\r\n let timesChecked = 0;\r\n return new Promise(resolve => {\r\n const checkForGuilds = function() {\r\n const wrapper = BDV2.guildClasses.wrapper.split(\" \")[0];\r\n if (document.querySelectorAll(`.${wrapper}`).length > 0) timesChecked++;\r\n const guild = BDV2.guildClasses.listItem.split(\" \")[0];\r\n const blob = BDV2.guildClasses.blobContainer.split(\" \")[0];\r\n if (document.querySelectorAll(`.${wrapper} .${guild} .${blob}`).length > 0) return resolve(bdConfig.deferLoaded = true);\r\n else if (timesChecked >= 50) return resolve(bdConfig.deferLoaded = true);\r\n setTimeout(checkForGuilds, 100);\r\n };\r\n if (document.readyState != \"loading\") setTimeout(checkForGuilds, 100);\r\n document.addEventListener(\"DOMContentLoaded\", () => {setTimeout(checkForGuilds, 100);});\r\n });\r\n};\r\n\r\nCore.prototype.injectExternals = async function() {\r\n // No externals\r\n};\r\n\r\nCore.prototype.initSettings = function () {\r\n DataStore.initialize();\r\n if(!DataStore.getSettingGroup(\"lightcord-settings\")){\r\n for(let key in lightcordSettings){\r\n delete lightcordSettings[key]\r\n }\r\n }\r\n if(!DataStore.getSettingGroup(\"rpc\")){\r\n Object.assign(settingsRPC, defaultRPC);\r\n }\r\n if(!DataStore.getSettingGroup(\"settings\")){\r\n Object.assign(settingsCookie, defaultCookie);\r\n settingsPanel.saveSettings();\r\n } else {\r\n settingsPanel.loadSettings();\r\n for (const setting in defaultCookie) {\r\n if (settingsCookie[setting] == undefined) {\r\n settingsCookie[setting] = defaultCookie[setting];\r\n settingsPanel.saveSettings();\r\n }\r\n }\r\n }\r\n window.Lightcord.Api.ensureExported(e => e.default && e.default.prototype && e.default.prototype.getPredicateSections)\r\n .then(settingModule => {\r\n\r\n let getPredicateSections = settingModule.default.prototype.getPredicateSections\r\n settingModule.default.prototype.getPredicateSections = function(){\r\n let result = getPredicateSections.call(this, ...arguments)\r\n\r\n if(!result[1])return result\r\n if(result[1].section === \"My Account\"){ // user settings, not guild settings\r\n let poped = []\r\n \r\n poped.push(result.pop())\r\n poped.push(result.pop())\r\n poped.push(result.pop())\r\n poped.push(result.pop())\r\n\r\n result.push(...settingsPanel.renderSidebar(this))\r\n\r\n while(poped[0]){\r\n result.push(poped.pop())\r\n }\r\n }\r\n return result\r\n }\r\n })\r\n};\r\n\r\n\r\nlet classNameLayer\r\nlet classNameSocialLinks\r\nlet classNameModal\r\n\r\nCore.prototype.initObserver = function () {\r\n const mainObserver = new MutationObserver((mutations) => {\r\n for (let i = 0, mlen = mutations.length; i < mlen; i++) {\r\n const mutation = mutations[i];\r\n if (typeof pluginModule !== \"undefined\") pluginModule.rawObserver(mutation);\r\n\r\n // if there was nothing added, skip\r\n if (!mutation.addedNodes.length || !(mutation.addedNodes[0] instanceof Element)) continue;\r\n\r\n const node = mutation.addedNodes[0];\r\n\r\n if(!classNameLayer)classNameLayer = BDModules.get((e) => e.layer && typeof e.layer === \"string\" && e.animating)[0].layer\r\n if(!classNameSocialLinks)classNameSocialLinks = BDModules.get((e) => e.socialLinks && typeof e.socialLinks === \"string\")[0].socialLinks\r\n if(!classNameModal)classNameModal = BDModules.get((e) => e.modal && typeof e.modal === \"string\" && e.inner && typeof e.inner === \"string\" && !e.responsiveWidthMobile)[0].modal\r\n\r\n if (node.classList.contains(classNameLayer)) {\r\n if (node.getAttribute(\"aria-label\") === \"GUILD_SETTINGS\"){\r\n node.setAttribute(\"layer-id\", \"server-settings\");\r\n node.setAttribute(\"id\", \"server-settings\");\r\n }\r\n\r\n if (node.getElementsByClassName(classNameSocialLinks).length) {\r\n node.setAttribute(\"layer-id\", \"user-settings\");\r\n node.setAttribute(\"id\", \"user-settings\");\r\n }\r\n }\r\n\r\n if (node.parentElement == document.body && node.querySelector(\"#ace_settingsmenu\")) node.id = \"ace_settingsmenu_container\";\r\n\r\n // Emoji Picker\r\n //node.getElementsByClassName(\"emojiPicker-3m1S-j\").length && !node.querySelector(\".emojiPicker-3m1S-j\").parentElement.classList.contains(\"animatorLeft-1EQxU0\")\r\n //if (node.classList.contains(classNameLayer2) && node.getElementsByClassName(classNameEmojiPicker).length && !node.querySelector(\".\"+classNameEmojiPicker).parentElement.classList.contains(classNameAnimatorLeft)) quickEmoteMenu.obsCallback(node);\r\n\r\n }\r\n });\r\n\r\n mainObserver.observe(document, {\r\n childList: true,\r\n subtree: true\r\n });\r\n};\r\n\r\nCore.prototype.showChangelogModal = function(options = {}) {\r\n return Utils.showChangelogModal(options);\r\n};\r\n\r\nCore.prototype.alert = function(title, content) {\r\n return Utils.alert(title, content);\r\n};\r\n\r\nCore.prototype.patchSocial = function() {\r\n if (this.socialPatch) return;\r\n const TabBar = WebpackModules.find(m => m.displayName == \"TabBar\");\r\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\r\n if (!TabBar) return;\r\n this.socialPatch = Utils.monkeyPatch(TabBar.prototype, \"render\", {after: (data) => {\r\n const children = data.returnValue.props.children;\r\n if (!children || !children.length || children.length < 3) return;\r\n if (children[children.length - 3].type.displayName !== \"Separator\") return;\r\n if (!children[children.length - 2].type.toString().includes(\"socialLinks\")) return;\r\n if (Anchor) {\r\n let socialModule1 = BDModules.get(e => e.socialLinks)[0]\r\n const original = children[children.length - 2].type;\r\n const newOne = function() {\r\n const returnVal = original(...arguments);\r\n returnVal.props.children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-social-link \"+socialModule1.link, href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\r\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-social-logo\"})\r\n )\r\n )\r\n );\r\n returnVal.props.children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-social-link \"+socialModule1.link, href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\r\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-social-logo\"})\r\n )\r\n )\r\n );\r\n return returnVal;\r\n };\r\n children[children.length - 2].type = newOne;\r\n }\r\n\r\n let [\r\n classNameColorMuted,\r\n sizes,\r\n classNameVersionHash\r\n ] = [\r\n BDModules.get(e => e.colorMuted)[0].colorMuted,\r\n BDModules.get(e => e.size32)[0],\r\n BDModules.get(e => e.versionHash)[0].versionHash\r\n ]\r\n\r\n const versionHash = `(${bdConfig.hash ? bdConfig.hash.substring(0, 7) : bdConfig.branch})`;\r\n const additional = [\r\n BDV2.react.createElement(\"div\", {className: `${classNameColorMuted} ${sizes.size12}`}, `Lightcord ${electron.getGlobal(\"BuildInfo\").version} `, BDV2.react.createElement(\"span\", {className: classNameVersionHash+\" da-versionHash\"}, `(${(electron.getGlobal(\"BuildInfo\").commit || \"Unknown\").slice(0, 7)})`)),\r\n BDV2.react.createElement(\"div\", {className: `${classNameColorMuted} ${sizes.size12}`}, `BBD ${bbdVersion} `, BDV2.react.createElement(\"span\", {className: classNameVersionHash+\" da-versionHash\"}, versionHash))\r\n ]\r\n \r\n\r\n const originalVersions = children[children.length - 1].type;\r\n children[children.length - 1].type = function() {\r\n const returnVal = originalVersions(...arguments);\r\n returnVal.props.children.splice(1, 0, additional);\r\n return returnVal;\r\n };\r\n }});\r\n};\r\n\r\nconst getGuildClasses = function() {\r\n const guildsWrapper = WebpackModules.findByProps(\"wrapper\", \"unreadMentionsBar\");\r\n const guilds = WebpackModules.findByProps(\"guildsError\", \"selected\");\r\n const pill = WebpackModules.findByProps(\"blobContainer\");\r\n return Object.assign({}, guildsWrapper, guilds, pill);\r\n};\r\n\r\nCore.prototype.patchGuildListItems = function() {\r\n if (this.guildListItemsPatch) return;\r\n const GuildClasses = getGuildClasses();\r\n const listItemClass = GuildClasses.listItem.split(\" \")[0];\r\n const blobClass = GuildClasses.blobContainer.split(\" \")[0];\r\n const reactInstance = BDV2.getInternalInstance(document.querySelector(`.${listItemClass} .${blobClass}`).parentElement);\r\n const GuildComponent = reactInstance.return.type;\r\n if (!GuildComponent) return;\r\n this.guildListItemsPatch = Utils.monkeyPatch(GuildComponent.prototype, \"render\", {after: (data) => {\r\n if (data.returnValue && data.thisObject) {\r\n const returnValue = data.returnValue;\r\n const guildData = data.thisObject.props;\r\n let className = returnValue.props.className\r\n className += \" bd-guild\";\r\n if (guildData.unread) className += \" bd-unread\";\r\n if (guildData.selected) className += \" bd-selected\";\r\n if (guildData.audio) className += \" bd-audio\";\r\n if (guildData.video) className += \" bd-video\";\r\n if (guildData.badge) className += \" bd-badge\";\r\n if (guildData.animatable) className += \" bd-animatable\";\r\n returnValue.props.className = className\r\n return returnValue;\r\n }\r\n }});\r\n};\r\n\r\nCore.prototype.patchGuildPills = function() {\r\n if (this.guildPillPatch) return;\r\n const guildPill = WebpackModules.find(m => m.default && !m.default.displayName && m.default.toString && m.default.toString().includes(\"translate3d\"));\r\n if (!guildPill) return;\r\n this.guildPillPatch = Utils.monkeyPatch(guildPill, \"default\", {after: (data) => {\r\n const props = data.methodArguments[0];\r\n if (props.unread) data.returnValue.props.className += \" bd-unread\";\r\n if (props.selected) data.returnValue.props.className += \" bd-selected\";\r\n if (props.hovered) data.returnValue.props.className += \" bd-hovered\";\r\n return data.returnValue;\r\n }});\r\n};\r\n\r\nCore.prototype.patchGuildSeparator = function() {\r\n if (this.guildSeparatorPatch) return;\r\n const Guilds = WebpackModules.findByDisplayName(\"Guilds\");\r\n const guildComponents = WebpackModules.findByProps(\"renderListItem\");\r\n if (!guildComponents || !Guilds) return;\r\n const GuildSeparator = function() {\r\n const returnValue = guildComponents.Separator(...arguments);\r\n returnValue.props.className += \" bd-guild-separator\";\r\n return returnValue;\r\n };\r\n this.guildSeparatorPatch = Utils.monkeyPatch(Guilds.prototype, \"render\", {after: (data) => {\r\n data.returnValue.props.children[1].props.children[3].type = GuildSeparator;\r\n }});\r\n};\r\n\r\nCore.prototype.patchAttachment = function() {\r\n if (this.AttachmentPatch) return;\r\n const Attachment = BDModules.get(e => e.default && e.default.displayName === \"Attachment\")[0] // temporary\r\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\r\n if (!Anchor || !Attachment || !Attachment.default) return;\r\n this.AttachmentPatch = Utils.monkeyPatch(Attachment, \"default\", {after: (data) => {\r\n if(!settingsCookie[\"fork-ps-6\"])return\r\n const attachment = data.methodArguments[0] || null\r\n const children = Utils.getNestedProp(data.returnValue, \"props.children\");\r\n\r\n if (!children || !attachment || !attachment.url)return\r\n if (!Array.isArray(children)) return;\r\n\r\n const id = uuidv4()\r\n children.push(BDV2.react.createElement(\"span\", {\r\n id: \"certified-\"+id\r\n }))\r\n PluginCertifier.patch(attachment, \"certified-\"+id)\r\n }})\r\n}\r\n\r\nCore.prototype.patchMessageHeader = function() {\r\n if (this.messageHeaderPatch) return;\r\n const MessageHeader = WebpackModules.findByProps(\"MessageTimestamp\");\r\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\r\n if (!Anchor || !MessageHeader || !MessageHeader.default) return;\r\n this.messageHeaderPatch = Utils.monkeyPatch(MessageHeader, \"default\", {after: (data) => {\r\n const author = Utils.getNestedProp(data.methodArguments[0], \"message.author\");\r\n // const header = Utils.getNestedProp(data.returnValue, \"props.children.1.props\");\r\n const children = Utils.getNestedProp(data.returnValue, \"props.children.1.props.children.1.props.children\");\r\n if (!children || !author || !author.id)return\r\n // if (header && header.className) header.className += \" \"\r\n if (!Array.isArray(children)) return;\r\n if (author.id === \"249746236008169473\") { // Rauenzi: BandagedBD Developer\r\n children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\r\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\r\n )\r\n )\r\n );\r\n } else if (author.id === \"696481194443014174\" || author.id === \"696003456611385396\"){ // Not Thomiz: Lightcord Developer, Phorcys: Lightcord Developer\r\n children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-chat-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\r\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\r\n )\r\n )\r\n );\r\n }\r\n const id = uuidv4()\r\n children.push(\r\n BDV2.React.createElement(\"div\", {\r\n id: \"badges-\"+id,\r\n style: {\r\n display: \"inline\"\r\n }\r\n })\r\n )\r\n applyBadges(id, author, true)\r\n }});\r\n};\r\n\r\nfunction applyBadges(id, user, chat){\r\n process.nextTick(() => {\r\n const div = document.getElementById(\"badges-\"+id)\r\n if(!div || div.childNodes.length > 0)return\r\n if(div.childNodes.length)return\r\n let blockDiv = document.createElement(\"div\")\r\n blockDiv.style.display = \"none\"\r\n div.appendChild(blockDiv)\r\n\r\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\r\n\r\n distant.getBadges(user.id)\r\n .then(badges => {\r\n badges.forEach(badge => {\r\n const props = {\r\n svg: {\r\n size: \"16px\", \r\n className: \"bd-logo\",\r\n width: \"16px\", \r\n }\r\n }\r\n badge.scopes.forEach(scope => {\r\n if(scope === \"user\"){// require user\r\n props.user = user\r\n }\r\n }) \r\n if(!badge.href){\r\n props.Anchor = Anchor\r\n props.href = {\r\n className: chat ? \"bd-chat-badge\" : \"bd-member-badge\", \r\n title: badge.name, \r\n target: \"_blank\"\r\n }\r\n }\r\n const element = BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: badge.name},\r\n badge.href ? BDV2.react.createElement(Anchor, {\r\n href: badge.href,\r\n className: chat ? \"bd-chat-badge\" : \"bd-member-badge\", \r\n title: badge.name, \r\n target: \"_blank\"\r\n }, BDV2.React.createElement(badge.component, props)) : BDV2.React.createElement(badge.component, props)\r\n )\r\n const div2 = document.createElement(\"div\")\r\n BDV2.reactDom.render(element, div2)\r\n div2.childNodes.forEach(node => {\r\n div.appendChild(node)\r\n })\r\n })\r\n })\r\n })\r\n}\r\n\r\nCore.prototype.patchMemberList = function() {\r\n if (this.memberListPatch) return;\r\n const MemberListItem = WebpackModules.findByDisplayName(\"MemberListItem\");\r\n const Anchor = WebpackModules.find(m => m.displayName == \"Anchor\");\r\n if (!Anchor || !MemberListItem || !MemberListItem.prototype || !MemberListItem.prototype.renderDecorators) return;\r\n this.memberListPatch = Utils.monkeyPatch(MemberListItem.prototype, \"renderDecorators\", {after: (data) => {\r\n const user = Utils.getNestedProp(data.thisObject, \"props.user\");\r\n const children = Utils.getNestedProp(data.returnValue, \"props.children\");\r\n if (!children || !user || !user.id)return\r\n // if (header && header.className) header.className += \" \"\r\n if (!Array.isArray(children)) return;\r\n if (user.id === \"249746236008169473\") {\r\n children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"BandagedBD Developer\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-member-badge\", href: \"https://github.com/rauenzi/BetterDiscordApp\", title: \"BandagedBD\", target: \"_blank\"},\r\n BDV2.React.createElement(BDLogo, {size: \"16px\", className: \"bd-logo\"})\r\n )\r\n )\r\n );\r\n } else if (user.id === \"696481194443014174\" || user.id === \"696003456611385396\"){\r\n children.push(\r\n BDV2.React.createElement(TooltipWrap, {color: \"black\", side: \"top\", text: \"Lightcord Developer\"},\r\n BDV2.React.createElement(Anchor, {className: \"bd-member-badge\", href: \"https://github.com/Lightcord/Lightcord\", title: \"Lightcord\", target: \"_blank\"},\r\n BDV2.React.createElement(LightcordLogo, {size: \"16px\", className: \"bd-logo\"})\r\n )\r\n )\r\n );\r\n }\r\n const id = uuidv4()\r\n children.push(\r\n BDV2.React.createElement(\"div\", {id: \"badges-\"+id})\r\n )\r\n applyBadges(id, user, false)\r\n }});\r\n};\r\n\r\nCore.prototype.updateInjector = async function() {\r\n // There will never be an injection path, so we do not need the code below. \r\n // Insert comments so it will be erased when production.\r\n \r\n const injectionPath = DataStore.injectionPath;\r\n if (!injectionPath) return false;\r\n\r\n /*\r\n\r\n const fs = require(\"fs\");\r\n const path = require(\"path\");\r\n const rmrf = require(\"rimraf\");\r\n const yauzl = require(\"yauzl\");\r\n const mkdirp = require(\"mkdirp\");\r\n const request = require(\"request\");\r\n\r\n const parentPath = path.resolve(injectionPath, \"..\");\r\n const folderName = path.basename(injectionPath);\r\n const zipLink = \"https://github.com/rauenzi/BetterDiscordApp/archive/injector.zip\";\r\n const savedZip = path.resolve(parentPath, \"injector.zip\");\r\n const extractedFolder = path.resolve(parentPath, \"BetterDiscordApp-injector\");\r\n\r\n // Download the injector zip file\r\n Utils.log(\"InjectorUpdate\", \"Downloading \" + zipLink);\r\n let success = await new Promise(resolve => {\r\n request.get({url: zipLink, encoding: null}, async (error, response, body) => {\r\n if (error || response.statusCode !== 200) return resolve(false);\r\n // Save a backup in case someone has their own copy\r\n const alreadyExists = await new Promise(res => fs.exists(savedZip, res));\r\n if (alreadyExists) await new Promise(res => fs.rename(savedZip, `${savedZip}.bak${Math.round(performance.now())}`, res));\r\n\r\n Utils.log(\"InjectorUpdate\", \"Writing \" + savedZip);\r\n fs.writeFile(savedZip, body, err => resolve(!err));\r\n });\r\n });\r\n if (!success) return success;\r\n\r\n // Check and delete rename extraction\r\n const alreadyExists = await new Promise(res => fs.exists(extractedFolder, res));\r\n if (alreadyExists) await new Promise(res => fs.rename(extractedFolder, `${extractedFolder}.bak${Math.round(performance.now())}`, res));\r\n \r\n // Unzip the downloaded zip file\r\n const zipfile = await new Promise(r => yauzl.open(savedZip, {lazyEntries: true}, (err, zip) => r(zip)));\r\n zipfile.on(\"entry\", function(entry) {\r\n // Skip directories, they are handled with mkdirp\r\n if (entry.fileName.endsWith(\"/\")) return zipfile.readEntry();\r\n\r\n Utils.log(\"InjectorUpdate\", \"Extracting \" + entry.fileName);\r\n // Make any needed parent directories\r\n const fullPath = path.resolve(parentPath, entry.fileName);\r\n mkdirp.sync(path.dirname(fullPath));\r\n zipfile.openReadStream(entry, function(err, readStream) {\r\n if (err) return success = false;\r\n readStream.on(\"end\", function() {zipfile.readEntry();}); // Go to next file after this\r\n readStream.pipe(fs.createWriteStream(fullPath));\r\n });\r\n });\r\n zipfile.readEntry(); // Start reading\r\n\r\n // Wait for the final file to finish\r\n await new Promise(resolve => zipfile.once(\"end\", resolve));\r\n\r\n // Save a backup in case something goes wrong during final step\r\n const backupFolder = path.resolve(parentPath, `${folderName}.bak${Math.round(performance.now())}`);\r\n await new Promise(resolve => fs.rename(injectionPath, backupFolder, resolve));\r\n\r\n // Rename the extracted folder to what it should be\r\n Utils.log(\"InjectorUpdate\", `Renaming ${path.basename(extractedFolder)} to ${folderName}`);\r\n success = await new Promise(resolve => fs.rename(extractedFolder, injectionPath, err => resolve(!err)));\r\n if (!success) {\r\n Utils.err(\"InjectorUpdate\", \"Failed to rename the final directory\");\r\n return success;\r\n }\r\n\r\n // If rename had issues, delete what we tried to rename and restore backup\r\n if (!success) {\r\n Utils.err(\"InjectorUpdate\", \"Something went wrong... restoring backups.\");\r\n await new Promise(resolve => rmrf(extractedFolder, resolve));\r\n await new Promise(resolve => fs.rename(backupFolder, injectionPath, resolve));\r\n return success;\r\n }\r\n\r\n // If we've gotten to this point, everything should have gone smoothly.\r\n // Cleanup the backup folder then remove the zip\r\n await new Promise(resolve => rmrf(backupFolder, resolve));\r\n await new Promise(resolve => fs.unlink(savedZip, resolve));\r\n\r\n Utils.log(\"InjectorUpdate\", \"Injector Updated!\");\r\n return success;*/\r\n};\r\n\r\nexport default new Core();\r\n\r\n/**\r\n * Don't expose core - could be dangerous for now\r\n */","import {pluginCookie, themeCookie, bdplugins, bdthemes, settingsCookie, settings} from \"../0globals\";\r\nimport mainCore from \"./core\";\r\nimport Utils from \"./utils\";\r\nimport BDV2 from \"./v2\";\r\nimport DataStore from \"./dataStore\";\r\nimport pluginModule from \"./pluginModule\";\r\nimport themeModule from \"./themeModule\";\r\nimport settingsPanel from \"./settingsPanel\";\r\nimport DOM from \"./domtools\";\r\n\r\nconst BdApi = {\r\n get React() { return BDV2.React; },\r\n get ReactDOM() { return BDV2.ReactDom; },\r\n get ReactComponent() {return BDV2.ReactComponent;},\r\n get WindowConfigFile() {return Utils.WindowConfigFile;},\r\n get settings() {return settings;},\r\n get emotes() {return null}, // deprecated, deleted all emotes from betterdiscord.\r\n get screenWidth() { return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); },\r\n get screenHeight() { return Math.max(document.documentElement.clientHeight, window.innerHeight || 0); }\r\n};\r\n\r\nBdApi.getAllWindowPreferences = function() {\r\n return Utils.getAllWindowPreferences();\r\n};\r\n\r\nBdApi.getWindowPreference = function(key) {\r\n return Utils.getWindowPreference(key);\r\n};\r\n\r\nBdApi.setWindowPreference = function(key, value) {\r\n return Utils.setWindowPreference(key, value);\r\n};\r\n\r\n//Inject CSS to document head\r\n//id = id of element\r\n//css = custom css\r\nBdApi.injectCSS = function (id, css) {\r\n DOM.addStyle(DOM.escapeID(id), css);\r\n};\r\n\r\n//Clear css/remove any element\r\n//id = id of element\r\nBdApi.clearCSS = function (id) {\r\n DOM.removeStyle(DOM.escapeID(id));\r\n};\r\n\r\n//Inject CSS to document head\r\n//id = id of element\r\n//css = custom css\r\nBdApi.linkJS = function (id, url) {\r\n DOM.addScript(DOM.escapeID(id), url);\r\n};\r\n\r\n//Clear css/remove any element\r\n//id = id of element\r\nBdApi.unlinkJS = function (id) {\r\n DOM.removeScript(DOM.escapeID(id));\r\n};\r\n\r\n//Get another plugin\r\n//name = name of plugin\r\nBdApi.getPlugin = function (name) {\r\n if (bdplugins.hasOwnProperty(name)) {\r\n return bdplugins[name].plugin;\r\n }\r\n return null;\r\n};\r\n\r\n//Get BetterDiscord Core\r\nBdApi.getCore = function () {\r\n Utils.warn(\"Deprecation Notice\", `BdApi.getCore() will be removed in future versions.`);\r\n return mainCore;\r\n};\r\n\r\n/**\r\n * Shows a generic but very customizable modal.\r\n * @param {string} title - title of the modal\r\n * @param {string} content - a string of text to display in the modal\r\n */\r\nBdApi.alert = function (title, content) {\r\n return Utils.showConfirmationModal(title, content, {cancelText: null});\r\n};\r\n\r\n/**\r\n * Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.\r\n * @param {string} title - title of the modal\r\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.\r\n * @param {object} [options] - options to modify the modal\r\n * @param {boolean} [options.danger=false] - whether the main button should be red or not\r\n * @param {string} [options.confirmText=Okay] - text for the confirmation/submit button\r\n * @param {string} [options.cancelText=Cancel] - text for the cancel button\r\n * @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button\r\n * @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button\r\n * @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned\r\n * @returns {string} - the key used for this modal\r\n */\r\nBdApi.showConfirmationModal = function (title, content, options = {}) {\r\n return Utils.showConfirmationModal(title, content, options);\r\n};\r\n\r\n//Show toast alert\r\nBdApi.showToast = function(content, options = {}) {\r\n Utils.showToast(content, options);\r\n};\r\n\r\n// Finds module\r\nBdApi.findModule = function(filter) {\r\n return BDV2.WebpackModules.find(filter);\r\n};\r\n\r\n// Finds module\r\nBdApi.findAllModules = function(filter) {\r\n return BDV2.WebpackModules.findAll(filter);\r\n};\r\n\r\n// Finds module\r\nBdApi.findModuleByProps = function(...props) {\r\n return BDV2.WebpackModules.findByUniqueProperties(props);\r\n};\r\n\r\nBdApi.findModuleByPrototypes = function(...protos) {\r\n return BDV2.WebpackModules.findByPrototypes(protos);\r\n};\r\n\r\nBdApi.findModuleByDisplayName = function(name) {\r\n return BDV2.WebpackModules.findByDisplayName(name);\r\n};\r\n\r\n// Gets react instance\r\nBdApi.getInternalInstance = function(node) {\r\n if (!(node instanceof window.jQuery) && !(node instanceof Element)) return undefined;\r\n if (node instanceof jQuery) node = node[0];\r\n return BDV2.getInternalInstance(node);\r\n};\r\n\r\n// Gets data\r\nBdApi.loadData = function(pluginName, key) {\r\n return DataStore.getPluginData(pluginName, key);\r\n};\r\n\r\nBdApi.getData = BdApi.loadData;\r\n\r\n// Sets data\r\nBdApi.saveData = function(pluginName, key, data) {\r\n return DataStore.setPluginData(pluginName, key, data);\r\n};\r\n\r\nBdApi.setData = BdApi.saveData;\r\n\r\n// Deletes data\r\nBdApi.deleteData = function(pluginName, key) {\r\n return DataStore.deletePluginData(pluginName, key);\r\n};\r\n\r\n// Patches other functions\r\nBdApi.monkeyPatch = function(what, methodName, options) {\r\n return Utils.monkeyPatch(what, methodName, options);\r\n};\r\n\r\n// Event when element is removed\r\nBdApi.onRemoved = function(node, callback) {\r\n return Utils.onRemoved(node, callback);\r\n};\r\n\r\n// Wraps function in try..catch\r\nBdApi.suppressErrors = function(method, message) {\r\n return Utils.suppressErrors(method, message);\r\n};\r\n\r\n// Tests for valid JSON\r\nBdApi.testJSON = function(data) {\r\n return Utils.testJSON(data);\r\n};\r\n\r\nBdApi.isPluginEnabled = function(name) {\r\n return !!pluginCookie[name];\r\n};\r\n\r\nBdApi.isThemeEnabled = function(name) {\r\n return !!themeCookie[name];\r\n};\r\n\r\nBdApi.isSettingEnabled = function(id) {\r\n return !!settingsCookie[id];\r\n};\r\n\r\nBdApi.enableSetting = function(id) {\r\n return settingsPanel.onChange(id, true);\r\n};\r\n\r\nBdApi.disableSetting = function(id) {\r\n return settingsPanel.onChange(id, false);\r\n};\r\n\r\nBdApi.toggleSetting = function(id) {\r\n return settingsPanel.onChange(id, !settingsCookie[id]);\r\n};\r\n\r\n// Gets data\r\nBdApi.getBDData = function(key) {\r\n return DataStore.getBDData(key);\r\n};\r\n\r\n// Sets data\r\nBdApi.setBDData = function(key, data) {\r\n return DataStore.setBDData(key, data);\r\n};\r\n\r\n\r\n\r\nconst makeAddonAPI = (cookie, list, manager) => new class AddonAPI {\r\n\r\n get folder() {return manager.folder;}\r\n\r\n isEnabled(name) {\r\n return !!cookie[name];\r\n }\r\n\r\n enable(name) {\r\n return manager.enable(name);\r\n }\r\n\r\n disable(name) {\r\n return manager.disable(name);\r\n }\r\n\r\n toggle(name) {\r\n if (cookie[name]) this.disable(name);\r\n else this.enable(name);\r\n }\r\n\r\n reload(name) {\r\n return manager.reload(name);\r\n }\r\n\r\n get(name) {\r\n if (list.hasOwnProperty(name)) {\r\n if (list[name].plugin) return list[name].plugin;\r\n return list[name];\r\n }\r\n return null;\r\n }\r\n\r\n getAll() {\r\n return Object.keys(list).map(k => this.get(k)).filter(a => a);\r\n }\r\n};\r\n\r\nBdApi.Plugins = makeAddonAPI(pluginCookie, bdplugins, pluginModule);\r\nBdApi.Themes = makeAddonAPI(themeCookie, bdthemes, themeModule);\r\n\r\nexport default BdApi;\r\n\r\nwindow.Lightcord.BetterDiscord.BdApi = BdApi","export default function() {\r\n const contentWindowGetter = Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype, \"contentWindow\").get;\r\n Object.defineProperty(HTMLIFrameElement.prototype, \"contentWindow\", {\r\n get: function () {\r\n const contentWindow = Reflect.apply(contentWindowGetter, this, arguments);\r\n return new Proxy(contentWindow, {\r\n getOwnPropertyDescriptor: function(obj, prop) {\r\n if (prop === \"localStorage\") return undefined;\r\n return Object.getOwnPropertyDescriptor(obj, prop);\r\n },\r\n get: function(obj, prop) {\r\n if (prop === \"localStorage\") return null;\r\n const val = obj[prop];\r\n if (typeof val === \"function\") return val.bind(obj);\r\n return val;\r\n }\r\n });\r\n }\r\n });\r\n\r\n // Prevent interception by patching Reflect.apply and Function.prototype.bind\r\n Object.defineProperty(Reflect, \"apply\", {value: Reflect.apply, writable: false, configurable: false});\r\n Object.defineProperty(Function.prototype, \"bind\", {value: Function.prototype.bind, writable: false, configurable: false});\r\n\r\n const oOpen = XMLHttpRequest.prototype.open;\r\n XMLHttpRequest.prototype.open = function() {\r\n const url = arguments[1];\r\n if (url.toLowerCase().includes(\"api/webhooks\")) return null;\r\n return Reflect.apply(oOpen, this, arguments);\r\n };\r\n}","import localStorageFix from \"./localStorageFix\";\r\nimport loadingIcon from \"./loadingIcon\";\r\nlocalStorageFix();\r\nloadingIcon();\r\n\r\nconst deprecateGlobal = (key, value) => {\r\n Object.defineProperty(window, key, {\r\n get() {\r\n Utils.warn(\"Deprecated Global\", `\"${key}\" will be removed in future versions. Please only use BdApi.`);\r\n return value;\r\n }\r\n }); \r\n};\r\n\r\n\r\nimport * as Globals from \"./0globals\";\r\n\r\nconst globalKeys = Object.keys(Globals);\r\nfor (const key of globalKeys) deprecateGlobal(key, Globals[key]);\r\n\r\n\r\nimport BdApi from \"./modules/bdApi\";\r\nimport BDV2 from \"./modules/v2\";\r\nimport pluginModule from \"./modules/pluginModule\";\r\nimport themeModule from \"./modules/themeModule\";\r\nimport Utils from \"./modules/utils\";\r\nimport BDEvents from \"./modules/bdEvents\";\r\nimport settingsPanel from \"./modules/settingsPanel\";\r\nimport DataStore from \"./modules/dataStore\";\r\nimport ContentManager from \"./modules/contentManager\";\r\nimport ClassNormalizer from \"./modules/classNormalizer\";\r\n\r\ndeprecateGlobal(\"BDV2\", BDV2);\r\ndeprecateGlobal(\"pluginModule\", pluginModule);\r\ndeprecateGlobal(\"themeModule\", themeModule);\r\ndeprecateGlobal(\"Utils\", Utils);\r\ndeprecateGlobal(\"BDEvents\", BDEvents);\r\ndeprecateGlobal(\"settingsPanel\", settingsPanel);\r\ndeprecateGlobal(\"DataStore\", DataStore);\r\ndeprecateGlobal(\"ContentManager\", ContentManager);\r\ndeprecateGlobal(\"ClassNormalizer\", ClassNormalizer);\r\n\r\nwindow.BdApi = BdApi;\r\n\r\nimport Core from \"./modules/core\";\r\ndeprecateGlobal(\"mainCore\", Core);\r\n\r\n// TODO: Change Init mode and stop using CoreWrapper.\r\nexport default class CoreWrapper {\r\n constructor(bdConfig, methods) {\r\n Core.setConfig(bdConfig);\r\n Core.setMethods(methods);\r\n }\r\n\r\n init() {\r\n // deprecateGlobal(\"mainCore\", this.mainCore);\r\n Core.init();\r\n }\r\n}","export default () => {\r\n const v2Loader = document.createElement(\"div\");\r\n v2Loader.className = \"bd-loaderv2\";\r\n v2Loader.title = \"BandagedBD is loading...\";\r\n document.body.appendChild(v2Loader);\r\n};"],"sourceRoot":""} |