diff --git a/js/main.js b/js/main.js index 4a6b31bd..cf5f21cb 100644 --- a/js/main.js +++ b/js/main.js @@ -875,7 +875,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Modals; });\n/* harmony import */ var data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! data */ \"./src/data/data.js\");\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n\n\nclass Modals {\n static get shouldShowAddonErrors() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(\"settings\", \"addons\", \"addonErrors\");\n }\n\n static get ModalStack() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n }\n\n static get AlertModal() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByPrototypes(\"handleCancel\", \"handleSubmit\", \"handleMinorConfirm\");\n }\n\n static get TextElement() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Sizes\", \"Weights\");\n }\n\n static get ConfirmationModal() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.defaultProps && m.key && m.key() == \"confirm-modal\");\n }\n\n static default(title, content) {\n const backdrop = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"backdrop\") || {\n backdrop: \"backdrop-1wrmKb\"\n };\n const baseModalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.modal && m.inner && !m.sizeMedium) || {\n modal: \"modal-36zFtW\",\n inner: \"inner-2VEzy9\"\n };\n const modalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"sizeMedium\") || {\n modal: \"backdrop-1wrmKb\",\n sizeMedium: \"sizeMedium-ctncE5\",\n content: \"content-2KoCOZ\",\n header: \"header-2nhbou\",\n footer: \"footer-30ewN8\",\n close: \"close-hhyjWJ\",\n inner: \"inner-2Z5QZX\"\n };\n const modal = modules__WEBPACK_IMPORTED_MODULE_1__[\"Utilities\"].parseHTML(`
\n
\n
\n
\n
\n
${title}
\n
\n
\n
\n
\n ${content}\n
\n
\n
\n
\n \n
\n
\n
\n
`);\n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n document.querySelector(\"#app-mount\").append(modal);\n }\n\n static alert(title, content) {\n if (this.ModalStack && this.AlertModal) return this.default(title, content);\n this.ModalStack.push(function (props) {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(this.AlertModal, Object.assign({\n title: title,\n body: content\n }, props));\n });\n }\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)} children - a single or mixed array of react elements and strings. Everything is wrapped in Discord's `TextElement` 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 */\n\n\n static showConfirmationModal(title, content, options = {}) {\n const TextElement = this.TextElement;\n const ConfirmationModal = this.ConfirmationModal;\n const ModalStack = this.ModalStack;\n if (!this.ModalStack || !this.ConfirmationModal || !this.TextElement) return this.alert(title, content);\n const {\n onConfirm,\n onCancel,\n confirmText,\n cancelText,\n danger = false\n } = options;\n if (typeof content == \"string\") content = TextElement.default({\n color: TextElement.Colors.PRIMARY,\n children: [content]\n });else if (Array.isArray(content)) content = TextElement.default({\n color: TextElement.Colors.PRIMARY,\n children: content\n });\n content = [content];\n\n const emptyFunction = () => {};\n\n ModalStack.push(function (props) {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(ConfirmationModal, Object.assign({\n header: title,\n children: content,\n red: danger,\n confirmText: confirmText ? confirmText : modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.okay,\n cancelText: cancelText ? cancelText : modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.cancel,\n onConfirm: onConfirm ? onConfirm : emptyFunction,\n onCancel: onCancel ? onCancel : emptyFunction\n }, props));\n });\n }\n\n static showAddonErrors({\n plugins: pluginErrors = [],\n themes: themeErrors = []\n }) {\n if (!pluginErrors || !themeErrors || !this.shouldShowAddonErrors) return;\n if (!pluginErrors.length && !themeErrors.length) return;\n const backdrop = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"backdrop\") || {\n backdrop: \"backdrop-1wrmKb\"\n };\n const baseModalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.modal && m.inner && !m.sizeMedium) || {\n modal: \"modal-36zFtW\",\n inner: \"inner-2VEzy9\"\n };\n const modalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"sizeMedium\") || {\n modal: \"modal-3v8ziU\",\n sizeMedium: \"sizeMedium-ctncE5\",\n content: \"content-2KoCOZ\",\n header: \"header-2nhbou\",\n footer: \"footer-30ewN8\",\n close: \"close-hhyjWJ\",\n inner: \"inner-2Z5QZX\"\n };\n const modal = $(`
\n
\n
\n
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.addonErrors}
\n
\n
\n
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Panels.plugins}
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Panels.themes}
\n
\n
\n
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.name}
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.message}
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.error}
\n
\n
\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n
`);\n\n const generateTab = function (errors) {\n const container = $(`
`);\n\n for (const err of errors) {\n const error = $(`
\n
${err.name ? err.name : err.file}
\n
${err.message}
\n \n
`);\n container.append(error);\n\n if (err.error) {\n error.find(\"a\").on(\"click\", e => {\n e.preventDefault();\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Logger\"].stacktrace(\"AddonError\", `Error details for ${err.name ? err.name : err.file}.`, err.error);\n });\n }\n }\n\n return container;\n };\n\n const tabs = [generateTab(pluginErrors), generateTab(themeErrors)];\n modal.find(\".tab-bar-item\").on(\"click\", e => {\n e.preventDefault();\n modal.find(\".tab-bar-item\").removeClass(\"selected\");\n $(e.target).addClass(\"selected\");\n modal.find(\".scroller\").empty().append(tabs[$(e.target).index()]);\n });\n modal.find(\".footer button\").on(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n modal.find(\".bd-backdrop\").on(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n modal.appendTo(\"#app-mount\");\n if (pluginErrors.length) modal.find(\".tab-bar-item\")[0].click();else modal.find(\".tab-bar-item\")[1].click();\n }\n\n showChangelogModal(options = {}) {\n const ModalStack = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n const ChangelogClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"fixed\", \"improved\");\n const TextElement = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Sizes\", \"Weights\");\n const FlexChild = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Child\");\n const Titles = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Tags\", \"default\");\n const Changelog = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.defaultProps && m.defaultProps.selectable == false);\n const MarkdownParser = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"defaultRules\", \"parse\");\n if (!Changelog || !ModalStack || !ChangelogClasses || !TextElement || !FlexChild || !Titles || !MarkdownParser) return;\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${data__WEBPACK_IMPORTED_MODULE_0__[\"Config\"].bbdVersion}`,\n footer\n } = options;\n const ce = modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement;\n const changelogItems = [ce(\"img\", {\n src: image\n })];\n if (description) changelogItems.push(ce(\"p\", null, MarkdownParser.parse(description)));\n\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\", {\n className: `${type} ${margin}`\n }, entry.title));\n const list = ce(\"ul\", null, entry.items.map(i => ce(\"li\", null, MarkdownParser.parse(i))));\n changelogItems.push(list);\n }\n\n const renderHeader = function () {\n return ce(FlexChild.Child, {\n grow: 1,\n shrink: 1\n }, ce(Titles.default, {\n tag: Titles.Tags.H4\n }, title), ce(TextElement, {\n size: TextElement.Sizes.SMALL,\n color: TextElement.Colors.PRIMARY,\n className: ChangelogClasses.date\n }, subtitle));\n };\n\n const renderFooter = () => {\n const Anchor = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.displayName == \"Anchor\");\n const AnchorClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"anchorUnderlineOnHover\") || {\n anchor: \"anchor-3Z-8Bb\",\n anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"\n };\n\n const joinSupportServer = click => {\n click.preventDefault();\n click.stopPropagation();\n ModalStack.pop();\n BDV2.joinBD2();\n };\n\n const supportLink = Anchor ? ce(Anchor, {\n onClick: joinSupportServer\n }, \"Join our Discord Server.\") : ce(\"a\", {\n className: `${AnchorClasses.anchor} ${AnchorClasses.anchorUnderlineOnHover}`,\n onClick: joinSupportServer\n }, \"Join our Discord Server.\");\n const defaultFooter = ce(TextElement, {\n size: TextElement.Sizes.SMALL,\n color: TextElement.Colors.PRIMARY\n }, \"Need support? \", supportLink);\n return ce(FlexChild.Child, {\n grow: 1,\n shrink: 1\n }, footer ? footer : defaultFooter);\n };\n\n 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}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL3VpL21vZGFscy5qcz8zYWIyIl0sIm5hbWVzIjpbIk1vZGFscyIsInNob3VsZFNob3dBZGRvbkVycm9ycyIsIlNldHRpbmdzIiwiZ2V0IiwiTW9kYWxTdGFjayIsIldlYnBhY2tNb2R1bGVzIiwiZ2V0QnlQcm9wcyIsIkFsZXJ0TW9kYWwiLCJnZXRCeVByb3RvdHlwZXMiLCJUZXh0RWxlbWVudCIsIkNvbmZpcm1hdGlvbk1vZGFsIiwiZ2V0TW9kdWxlIiwibSIsImRl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gICAgPGRpdiBjbGFzcz1cInNjcm9sbGVyLXdyYXAgZmFkZVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzY3JvbGxlclwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAke2NvbnRlbnR9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb290ZXIgJHttb2RhbENsYXNzZXMuZm9vdGVyfVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgY2xhc3M9XCJiZC1idXR0b25cIj4ke1N0cmluZ3MuTW9kYWxzLm9rYXl9PC9idXR0b24+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgIDwvZGl2PmApO1xyXG4gICAgICAgIG1vZGFsLnF1ZXJ5U2VsZWN0b3IoXCIuZm9vdGVyIGJ1dHRvblwiKS5hZGRFdmVudExpc3RlbmVyKFwiY2xpY2tcIiwgKCkgPT4ge1xyXG4gICAgICAgICAgICBtb2RhbC5hZGRDbGFzcyhcImNsb3NpbmdcIik7XHJcbiAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4geyBtb2RhbC5yZW1vdmUoKTsgfSwgMzAwKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBtb2RhbC5xdWVyeVNlbGVjdG9yKFwiLmJkLWJhY2tkcm9wXCIpLmFkZEV2ZW50TGlzdGVuZXIoXCJjbGlja1wiLCAoKSA9PiB7XHJcbiAgICAgICAg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kaXY+PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJkLW1vZGFsLWJvZHlcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYi1iYXItY29udGFpbmVyXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFiLWJhciBUT1BcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFiLWJhci1pdGVtXCI+JHtTdHJpbmdzLlBhbmVscy5wbHVnaW5zfTwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWItYmFyLWl0ZW1cIj4ke1N0cmluZ3MuUGFuZWxzLnRoZW1lc308L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWhlYWRlclwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tbmFtZVwiPiR7U3RyaW5ncy5Nb2RhbHMubmFtZX08L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWJsZS1jb2x1bW4gY29sdW1uLW1lc3NhZ2VcIj4ke1N0cmluZ3MuTW9kYWxzLm1lc3NhZ2V9PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFibGUtY29sdW1uIGNvbHVtbi1lcnJvclwiPiR7U3RyaW5ncy5Nb2RhbHMuZXJyb3J9PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2Nyb2xsZXItd3JhcCBmYWRlICR7bW9kYWxDbGFzc2VzLmNvbnRlbnR9XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2Nyb2xsZXJcIj5cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvb3RlciAke21vZGFsQ2xhc3Nlcy5mb290ZXJ9XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGNsYXNzPVwiYmQtYnV0dG9uXCI+JHtTdHJpbmdzLk1vZGFscy5va2F5fTwvYnV0dG9uPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PmApO1xyXG5cclxuICAgICAgICBjb25zdCBnZW5lcmF0ZVRhYiA9IGZ1bmN0aW9uKGVycm9ycykge1xyXG4gICAgICAgICAgICBjb25zdCBjb250YWluZXIgPSAkKGA8ZGl2IGNsYXNzPVwiZXJyb3JzXCI+YCk7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgZXJyIG9mIGVycm9ycykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZXJyb3IgPSAkKGA8ZGl2IGNsYXNzPVwiZXJyb3JcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tbmFtZVwiPiR7ZXJyLm5hbWUgPyBlcnIubmFtZSA6IGVyci5maWxlfTwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFibGUtY29sdW1uIGNvbHVtbi1tZXNzYWdlXCI+JHtlcnIubWVzc2FnZX08L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tZXJyb3JcIj48YSBjbGFzcz1cImVycm9yLWxpbmtcIiBocmVmPVwiXCI+JHtlcnIuZXJyb3IgPyBlcnIuZXJyb3IubWVzc2FnZSA6IFwiXCJ9PC9hPjwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PmApO1xyXG4gICAgICAgICAgICAgICAgY29udGFpbmVyLmFwcGVuZChlcnJvcik7XHJcbiAgICAgICAgICAgICAgICBpZiAoZXJyLmVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZXJyb3IuZmluZChcImFcIikub24oXCJjbGlja1wiLCAoZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIExvZ2dlci5zdGFja3RyYWNlKFwiQWRkb25FcnJvclwiLCBgRXJyb3IgZGV0YWlscyBmb3IgJHtlcnIubmFtZSA/IGVyci5uYW1lIDogZXJyLmZpbGV9LmAsIGVyci5lcnJvcik7XHJcbiAgICAgICAgICAgICAgICAgICAgfS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TmVlZCBzdXBwb3J0PyBcIiwgc3VwcG9ydExpbmspO1xyXG4gICAgICAgICAgICByZXR1cm4gY2UoRmxleENoaWxkLkNoaWxkLCB7Z3JvdzogMSwgc2hyaW5rOiAxfSwgZm9vdGVyID8gZm9vdGVyIDogZGVmYXVsdEZvb3Rlcik7XHJcbiAgICAgICAgfTtcclxuICAgIFxyXG4gICAgICAgIE1vZGFsU3RhY2sucHVzaChmdW5jdGlvbihwcm9wcykge1xyXG4gICAgICAgICAgICByZXR1cm4gY2UoQ2hhbmdlbG9nLCBPYmplY3QuYXNzaWduKHtcclxuICAgICAgICAgICAgICAgIGNsYXNzTmFtZTogQ2hhbmdlbG9nQ2xhc3Nlcy5jb250YWluZXIsXHJcbiAgICAgICAgICAgICAgICBzZWxlY3RhYmxlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgb25TY3JvbGw6IF8gPT4gXyxcclxuICAgICAgICAgICAgICAgIG9uQ2xvc2U6IF8gPT4gXyxcclxuICAgICAgICAgICAgICAgIHJlbmRlckhlYWRlcjogcmVuZGVySGVhZGVyLFxyXG4gICAgICAgICAgICAgICAgcmVuZGVyRm9vdGVyOiByZW5kZXJGb290ZXIsXHJcbiAgICAgICAgICAgICAgICBjaGlsZHJlbjogY2hhbmdlbG9nSXRlbXNcclxuICAgICAgICAgICAgfSwgcHJvcHMpKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxufSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/modals.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Modals; });\n/* harmony import */ var data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! data */ \"./src/data/data.js\");\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n\n\nclass Modals {\n static get shouldShowAddonErrors() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"Settings\"].get(\"settings\", \"addons\", \"addonErrors\");\n }\n\n static get ModalStack() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n }\n\n static get AlertModal() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByPrototypes(\"handleCancel\", \"handleSubmit\", \"handleMinorConfirm\");\n }\n\n static get TextElement() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Sizes\", \"Weights\");\n }\n\n static get ConfirmationModal() {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.defaultProps && m.key && m.key() == \"confirm-modal\");\n }\n\n static default(title, content) {\n const backdrop = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"backdrop\") || {\n backdrop: \"backdrop-1wrmKb\"\n };\n const baseModalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.modal && m.inner && !m.sizeMedium) || {\n modal: \"modal-36zFtW\",\n inner: \"inner-2VEzy9\"\n };\n const modalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"sizeMedium\") || {\n modal: \"backdrop-1wrmKb\",\n sizeMedium: \"sizeMedium-ctncE5\",\n content: \"content-2KoCOZ\",\n header: \"header-2nhbou\",\n footer: \"footer-30ewN8\",\n close: \"close-hhyjWJ\",\n inner: \"inner-2Z5QZX\"\n };\n const modal = modules__WEBPACK_IMPORTED_MODULE_1__[\"Utilities\"].parseHTML(`
\n
\n
\n
\n
\n
${title}
\n
\n
\n
\n
\n ${content}\n
\n
\n
\n
\n \n
\n
\n
\n
`);\n modal.querySelector(\".footer button\").addEventListener(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n modal.querySelector(\".bd-backdrop\").addEventListener(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n document.querySelector(\"#app-mount\").append(modal);\n }\n\n static alert(title, content) {\n if (this.ModalStack && this.AlertModal) return this.default(title, content);\n this.ModalStack.push(function (props) {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(this.AlertModal, Object.assign({\n title: title,\n body: content\n }, props));\n });\n }\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)} children - a single or mixed array of react elements and strings. Everything is wrapped in Discord's `TextElement` 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 */\n\n\n static showConfirmationModal(title, content, options = {}) {\n const TextElement = this.TextElement;\n const ConfirmationModal = this.ConfirmationModal;\n const ModalStack = this.ModalStack;\n if (!this.ModalStack || !this.ConfirmationModal || !this.TextElement) return this.alert(title, content);\n const {\n onConfirm,\n onCancel,\n confirmText,\n cancelText,\n danger = false\n } = options;\n if (typeof content == \"string\") content = TextElement.default({\n color: TextElement.Colors.PRIMARY,\n children: [content]\n });else if (Array.isArray(content)) content = TextElement.default({\n color: TextElement.Colors.PRIMARY,\n children: content\n });\n content = [content];\n\n const emptyFunction = () => {};\n\n ModalStack.push(function (props) {\n return modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement(ConfirmationModal, Object.assign({\n header: title,\n children: content,\n red: danger,\n confirmText: confirmText ? confirmText : modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.okay,\n cancelText: cancelText ? cancelText : modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.cancel,\n onConfirm: onConfirm ? onConfirm : emptyFunction,\n onCancel: onCancel ? onCancel : emptyFunction\n }, props));\n });\n }\n\n static showAddonErrors({\n plugins: pluginErrors = [],\n themes: themeErrors = []\n }) {\n if (!pluginErrors || !themeErrors || !this.shouldShowAddonErrors) return;\n if (!pluginErrors.length && !themeErrors.length) return;\n const backdrop = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"backdrop\") || {\n backdrop: \"backdrop-1wrmKb\"\n };\n const baseModalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.modal && m.inner && !m.sizeMedium) || {\n modal: \"modal-36zFtW\",\n inner: \"inner-2VEzy9\"\n };\n const modalClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"sizeMedium\") || {\n modal: \"modal-3v8ziU\",\n sizeMedium: \"sizeMedium-ctncE5\",\n content: \"content-2KoCOZ\",\n header: \"header-2nhbou\",\n footer: \"footer-30ewN8\",\n close: \"close-hhyjWJ\",\n inner: \"inner-2Z5QZX\"\n };\n const modal = $(`
\n
\n
\n
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.addonErrors}
\n
\n
\n
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Panels.plugins}
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Panels.themes}
\n
\n
\n
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.name}
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.message}
\n
${modules__WEBPACK_IMPORTED_MODULE_1__[\"Strings\"].Modals.error}
\n
\n
\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n
`);\n\n const generateTab = function (errors) {\n const container = $(`
`);\n\n for (const err of errors) {\n const error = $(`
\n
${err.name ? err.name : err.file}
\n
${err.message}
\n \n
`);\n container.append(error);\n\n if (err.error) {\n error.find(\"a\").on(\"click\", e => {\n e.preventDefault();\n modules__WEBPACK_IMPORTED_MODULE_1__[\"Logger\"].stacktrace(\"AddonError\", `Error details for ${err.name ? err.name : err.file}.`, err.error);\n });\n }\n }\n\n return container;\n };\n\n const tabs = [generateTab(pluginErrors), generateTab(themeErrors)];\n modal.find(\".tab-bar-item\").on(\"click\", e => {\n e.preventDefault();\n modal.find(\".tab-bar-item\").removeClass(\"selected\");\n $(e.target).addClass(\"selected\");\n modal.find(\".scroller\").empty().append(tabs[$(e.target).index()]);\n });\n modal.find(\".footer button\").on(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n modal.find(\".bd-backdrop\").on(\"click\", () => {\n modal.addClass(\"closing\");\n setTimeout(() => {\n modal.remove();\n }, 300);\n });\n modal.appendTo(\"#app-mount\");\n if (pluginErrors.length) modal.find(\".tab-bar-item\")[0].click();else modal.find(\".tab-bar-item\")[1].click();\n }\n\n showChangelogModal(options = {}) {\n const ModalStack = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"push\", \"update\", \"pop\", \"popWithKey\");\n const ChangelogClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"fixed\", \"improved\");\n const TextElement = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Sizes\", \"Weights\");\n const FlexChild = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Child\");\n const Titles = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"Tags\", \"default\");\n const Changelog = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.defaultProps && m.defaultProps.selectable == false);\n const MarkdownParser = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"defaultRules\", \"parse\");\n if (!Changelog || !ModalStack || !ChangelogClasses || !TextElement || !FlexChild || !Titles || !MarkdownParser) return;\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${data__WEBPACK_IMPORTED_MODULE_0__[\"Config\"].bbdVersion}`,\n footer\n } = options;\n const ce = modules__WEBPACK_IMPORTED_MODULE_1__[\"React\"].createElement;\n const changelogItems = [ce(\"img\", {\n src: image\n })];\n if (description) changelogItems.push(ce(\"p\", null, MarkdownParser.parse(description)));\n\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\", {\n className: `${type} ${margin}`\n }, entry.title));\n const list = ce(\"ul\", null, entry.items.map(i => ce(\"li\", null, MarkdownParser.parse(i))));\n changelogItems.push(list);\n }\n\n const renderHeader = function () {\n return ce(FlexChild.Child, {\n grow: 1,\n shrink: 1\n }, ce(Titles.default, {\n tag: Titles.Tags.H4\n }, title), ce(TextElement, {\n size: TextElement.Sizes.SMALL,\n color: TextElement.Colors.PRIMARY,\n className: ChangelogClasses.date\n }, subtitle));\n };\n\n const renderFooter = () => {\n const Anchor = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getModule(m => m.displayName == \"Anchor\");\n const AnchorClasses = modules__WEBPACK_IMPORTED_MODULE_1__[\"WebpackModules\"].getByProps(\"anchorUnderlineOnHover\") || {\n anchor: \"anchor-3Z-8Bb\",\n anchorUnderlineOnHover: \"anchorUnderlineOnHover-2ESHQB\"\n };\n\n const joinSupportServer = click => {\n click.preventDefault();\n click.stopPropagation();\n ModalStack.pop(); // TODO: BDV2.joinBD2();\n };\n\n const supportLink = Anchor ? ce(Anchor, {\n onClick: joinSupportServer\n }, \"Join our Discord Server.\") : ce(\"a\", {\n className: `${AnchorClasses.anchor} ${AnchorClasses.anchorUnderlineOnHover}`,\n onClick: joinSupportServer\n }, \"Join our Discord Server.\");\n const defaultFooter = ce(TextElement, {\n size: TextElement.Sizes.SMALL,\n color: TextElement.Colors.PRIMARY\n }, \"Need support? \", supportLink);\n return ce(FlexChild.Child, {\n grow: 1,\n shrink: 1\n }, footer ? footer : defaultFooter);\n };\n\n 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}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL3VpL21vZGFscy5qcz8zYWIyIl0sIm5hbWVzIjpbIk1vZGFscyIsInNob3VsZFNob3dBZGRvbkVycm9ycyIsIlNldHRpbmdzIiwiZ2V0IiwiTW9kYWxTdGFjayIsIldlYnBhY2tNb2R1bGVzIiwiZ2V0QnlQcm9wcyIsIkFsZXJ0TW9kYWwiLCJnZXRCeVByb3RvdHlwZXMiLCJUZXh0RWxlbWVudCIsIkNvbmZpcm1hdGlvbk1vZGFsIiwiZ2V0TW9kdWxlIiwibSIsImRlZmF1bHRQcm9wcyIsImtleSIsImRlZmF1bHQiLCJ0aXRsZSIsImNvbnRlbnQiLCJiYWNrZHJvcCIsImJhc2VNb2RhbENsYXNzZXMiLCJtb2RhbCIsImlubmVyIiwic2l6ZU1lZGl1bSIsIm1vZGFsQ2xhc3NlcyIsImhlYWRlciIsImZvb3RlciIsImNsb3NlIiwiVXRpbGl0aWVzIiwicGFyc2VIVE1MIiwiU3RyaW5ncyIsIm9rYXkiLCJxdWVyeVNlbGVjdG9yIiwiYWRkRXZlbnRMaXN0ZW5lciIsImFkZENsYXNzIiwic2V0VGltZW91dCIsInJlbW92ZSIsImRvY3VtZW50IiwiYXBwZW5kIiwiYWxlcnQiLCJwdXNoIiwicHJvcHMiLCJ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jb25zdCBtb2RhbCA9IFV0aWxpdGllcy5wYXJzZUhUTUwoYDxkaXYgY2xhc3M9XCJiZC1tb2RhbC13cmFwcGVyIHRoZW1lLWRhcmtcIj5cclxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJiZC1iYWNrZHJvcCAke2JhY2tkcm9wLmJhY2tkcm9wfVwiPjwvZGl2PlxyXG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJkLW1vZGFsICR7YmFzZU1vZGFsQ2xhc3Nlcy5tb2RhbH1cIj5cclxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYmQtbW9kYWwtaW5uZXIgJHtiYXNlTW9kYWxDbGFzc2VzLmlubmVyfVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiaGVhZGVyIGhlYWRlci0xUl9BakZcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0aXRsZVwiPiR7dGl0bGV9PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYmQtbW9kYWwtYm9keVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNjcm9sbGVyLXdyYXAgZmFkZVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzY3JvbGxlclwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAke2NvbnRlbnR9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb290ZXIg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tVGV4dCwgY2FuY2VsVGV4dCwgZGFuZ2VyID0gZmFsc2V9ID0gb3B0aW9ucztcclxuICAgICAgICBpZiAodHlwZW9mKGNvbnRlbnQpID09IFwic3RyaW5nXCIpIGNvbnRlbnQgPSBUZXh0RWxlbWVudC5kZWZhdWx0KHtjb2xvcjogVGV4dEVsZW1lbnQuQ29sb3JzLlBSSU1BUlksIGNoaWxkcmVuOiBbY29udGVudF19KTtcclxuICAgICAgICBlbHNlIGlmIChBcnJheS5pc0FycmF5KGNvbnRlbnQpKSBjb250ZW50ID0gVGV4dEVsZW1lbnQuZGVmYXVsdCh7Y29sb3I6IFRleHRFbGVtZW50LkNvbG9ycy5QUklNQVJZLCBjaGlsZHJlbjogY29udGVudH0pO1xyXG4gICAgICAgIGNvbnRlbnQgPSBbY29udGVudF07XHJcblxyXG4gICAgICAgIGNvbnN0IGVtcHR5RnVuY3Rpb24gPSAoKSA9PiB7fTtcclxuICAgICAgICBNb2RhbFN0YWNrLnB1c2goZnVuY3Rpb24ocHJvcHMpIHtcclxuICAgICAgICAgICAgcmV0dXJuIFJlYWN0LmNyZWF0ZUVsZW1lbnQoQ29uZmlybWF0aW9uTW9kYWwsIE9iamVjdC5hc3NpZ24oe1xyXG4gICAgICAgICAgICAgICAgaGVhZGVyOiB0aXRsZSxcclxuICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBjb250ZW50LFxyXG4gICAgICAgICAgICAgICAgcmVkOiBkYW5nZXIsXHJcbiAgICAgICAgICAgICAgICBjb25maXJtVGV4dDogY29uZmlybVRleHQgPyBjb25maXJtVGV4dCA6IFN0cmluZ3MuTW9kYWxzLm9rYXksXHJcbiAgICAgICAgICAgICAgICBjYW5jZWxUZXh0OiBjYW5jZWxUZXh0ID8gY2FuY2VsVGV4dCA6IFN0cmluZ3MuTW9kYWxzLmNhbmNlbCxcclxuICAgICAgICAgICAgICAgIG9uQ29uZmlybTogb25Db25maXJtID8gb25Db25maXJtIDogZW1wdHlGdW5jdGlvbixccl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RlcjogXCJmb290ZXItMzBld044XCIsIGNsb3NlOiBcImNsb3NlLWhoeWpXSlwiLCBpbm5lcjogXCJpbm5lci0yWjVRWlhcIn07XHJcbiAgICAgICAgY29uc3QgbW9kYWwgPSAkKGA8ZGl2IGNsYXNzPVwiYmQtbW9kYWwtd3JhcHBlciB0aGVtZS1kYXJrXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJiZC1iYWNrZHJvcCAke2JhY2tkcm9wLmJhY2tkcm9wfVwiPjwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYmQtbW9kYWwgYmQtY29udGVudC1tb2RhbCAke2Jhc2VNb2RhbENsYXNzZXMubW9kYWx9XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYmQtbW9kYWwtaW5uZXIgJHtiYXNlTW9kYWxDbGFzc2VzLmlubmVyfVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJoZWFkZXIgJHttb2RhbENsYXNzZXMuaGVhZGVyfVwiPjxkaXYgY2xhc3M9XCJ0aXRsZVwiPiR7U3RyaW5ncy5Nb2RhbHMuYWRkb25FcnJvcnN9PC9kaXY+PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJkLW1vZGFsLWJvZHlcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYi1iYXItY29udGFpbmVyXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFiLWJhciBUT1BcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFiLWJhci1pdGVtXCI+JHtTdHJpbmdzLlBhbmVscy5wbHVnaW5zfTwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWItYmFyLWl0ZW1cIj4ke1N0cmluZ3MuUGFuZWxzLnRoZW1lc308L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWhlYWRlclwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tbmFtZVwiPiR7U3RyaW5ncy5Nb2RhbHMubmFtZX08L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0YWJsZS1jb2x1bW4gY29sdW1uLW1lc3NhZ2VcIj4ke1N0cmluZ3MuTW9kYWxzLm1lc3NhZ2V9PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFibGUtY29sdW1uIGNvbHVtbi1lcnJvclwiPiR7U3RyaW5ncy5Nb2RhbHMuZXJyb3J9PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2Nyb2xsZXItd3JhcCBmYWRlICR7bW9kYWxDbGFzc2VzLmNvbnRlbnR9XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2Nyb2xsZXJcIj5cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvb3RlciAke21vZGFsQ2xhc3Nlcy5mb290ZXJ9XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGNsYXNzPVwiYmQtYnV0dG9uXCI+JHtTdHJpbmdzLk1vZGFscy5va2F5fTwvYnV0dG9uPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PmApO1xyXG5cclxuICAgICAgICBjb25zdCBnZW5lcmF0ZVRhYiA9IGZ1bmN0aW9uKGVycm9ycykge1xyXG4gICAgICAgICAgICBjb25zdCBjb250YWluZXIgPSAkKGA8ZGl2IGNsYXNzPVwiZXJyb3JzXCI+YCk7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgZXJyIG9mIGVycm9ycykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZXJyb3IgPSAkKGA8ZGl2IGNsYXNzPVwiZXJyb3JcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tbmFtZVwiPiR7ZXJyLm5hbWUgPyBlcnIubmFtZSA6IGVyci5maWxlfTwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGFibGUtY29sdW1uIGNvbHVtbi1tZXNzYWdlXCI+JHtlcnIubWVzc2FnZX08L2Rpdj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRhYmxlLWNvbHVtbiBjb2x1bW4tZXJyb3JcIj48YSBjbGFzcz1cImVycm9yLWxpbmtcIiBocmVmPVwiXCI+JHtlcnIuZXJyb3IgPyBlcnIuZXJyb3IubWVzc2FnZSA6IFwiXCJ9PC9hPjwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PmApO1xyXG4gICAgICAgICAgICAgICAgY29udGFpbmVyLmFwcGVuZChlcnJvcik7XHJcbiAgICAgICAgICAgICAgICBpZiAoZXJyLmVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZXJyb3IuZmluZChcImFcIikub24oXCJjbGlja1wiLCAoZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIExvZ2dlci5zdGFja3RyYWNlKFwiQWRkb25FcnJvclwiLCBgRXJyb3IgZGV0YWlscyBmb3IgJHtlcnIubmFtZSA/IGVyci5uYW1lIDogZXJyLmZpbGV9LmAsIGVyci5lcnJvcik7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGNvbnRhaW5lcjtcclxuICAgICAgICB9O1xyXG5cclxuICAgICAgICBjb25zdCB0YWJzID0gW2dlbmVyYXRlVGFiKHBsdWdpbkVycm9ycyksIGdlbmVyYXRlVGFiKHRoZW1lRXJyb3JzKV07XHJcblxyXG4gICAgICAgIG1vZGFsLmZpbmQoXCIudGFiLWJhci1pdGVtXCIpLm9uKFwiY2xpY2tcIiwgKGUpID0+IHtcclxuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgICAgICBtb2RhbC5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hbmdlbG9nQ2xhc3Nlcy5jb250YWluZXIsXHJcbiAgICAgICAgICAgICAgICBzZWxlY3RhYmxlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgb25TY3JvbGw6IF8gPT4gXyxcclxuICAgICAgICAgICAgICAgIG9uQ2xvc2U6IF8gPT4gXyxcclxuICAgICAgICAgICAgICAgIHJlbmRlckhlYWRlcjogcmVuZGVySGVhZGVyLFxyXG4gICAgICAgICAgICAgICAgcmVuZGVyRm9vdGVyOiByZW5kZXJGb290ZXIsXHJcbiAgICAgICAgICAgICAgICBjaGlsZHJlbjogY2hhbmdlbG9nSXRlbXNcclxuICAgICAgICAgICAgfSwgcHJvcHMpKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxufSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/modals.js\n"); /***/ }), @@ -923,7 +923,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var modu /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return AddonCard; });\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _icons_close__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icons/close */ \"./src/ui/icons/close.jsx\");\n/* harmony import */ var _icons_reload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icons/reload */ \"./src/ui/icons/reload.jsx\");\n/* harmony import */ var _icons_edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/edit */ \"./src/ui/icons/edit.jsx\");\n/* harmony import */ var _icons_delete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/delete */ \"./src/ui/icons/delete.jsx\");\n/* harmony import */ var _components_switch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/switch */ \"./src/ui/settings/components/switch.jsx\");\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n\n\n\n\n\n\nconst Tooltip = modules__WEBPACK_IMPORTED_MODULE_0__[\"WebpackModules\"].getByDisplayName(\"Tooltip\");\nclass AddonCard extends modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].Component {\n constructor(props) {\n super(props);\n this.state = {\n settingsOpen: false\n };\n this.settingsPanel = \"\";\n this.panelRef = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createRef();\n this.onChange = this.onChange.bind(this);\n this.reload = this.reload.bind(this);\n this.showSettings = this.showSettings.bind(this);\n this.closeSettings = this.closeSettings.bind(this);\n }\n\n reload() {\n if (!this.props.reload) return;\n this.props.addon = this.props.reload(this.props.addon.id);\n this.forceUpdate();\n }\n\n componentDidUpdate() {\n if (!this.state.settingsOpen) return;\n if (this.settingsPanel instanceof Node) this.panelRef.current.appendChild(this.settingsPanel); // if (!SettingsCookie[\"fork-ps-3\"]) return;\n\n const isHidden = (container, element) => {\n const cTop = container.scrollTop;\n const cBottom = cTop + container.clientHeight;\n const eTop = element.offsetTop;\n const eBottom = eTop + element.clientHeight;\n return eTop < cTop || eBottom > cBottom;\n };\n\n const panel = $(this.panelRef.current);\n const container = panel.parents(\".scroller-2FKFPG\");\n if (!isHidden(container[0], panel[0])) return;\n container.animate({\n scrollTop: panel.offset().top - container.offset().top + container.scrollTop() - 30\n }, 300);\n }\n\n getString(value) {\n return typeof value == \"string\" ? value : value.toString();\n }\n\n onChange() {\n this.props.onChange && this.props.onChange(this.props.addon.id);\n this.props.enabled = !this.props.enabled;\n }\n\n showSettings() {\n if (!this.props.hasSettings) return;\n this.setState({\n settingsOpen: true\n });\n }\n\n closeSettings() {\n this.panelRef.current.innerHTML = \"\";\n this.setState({\n settingsOpen: false\n });\n }\n\n buildTitle(name, version, author) {\n const title = modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.title.split(/({{[A-Za-z]+}})/);\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\n if (nameIndex) title[nameIndex] = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-name\"\n }, name);\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\n if (nameIndex) title[versionIndex] = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-version\"\n }, version);\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\n if (nameIndex) title[authorIndex] = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-author\"\n }, author);\n return title.flat();\n }\n\n get settingsComponent() {\n const addon = this.props.addon;\n const name = this.getString(addon.name);\n\n try {\n this.settingsPanel = this.props.getSettingsPanel();\n } catch (err) {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Logger\"].stacktrace(\"Addon Settings\", \"Unable to get settings panel for \" + name + \".\", err);\n }\n\n const props = {\n id: `${name}-settings`,\n className: \"addon-settings\",\n ref: this.panelRef\n };\n if (typeof settingsPanel == \"string\") props.dangerouslySetInnerHTML = this.settingsPanel;\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-addon-card settings-open bd-switch-item\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-close\",\n onClick: this.closeSettings\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_close__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null)), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", props, this.settingsPanel instanceof modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].Component ? this.settingsPanel : null));\n }\n\n buildLink(which) {\n const url = this.props.addon[which];\n\n if (which == \"invite\") {\n const onClick = () => {\n const tester = /\\.gg\\/(.*)$/;\n let code = url;\n if (tester.test(code)) code = code.match(tester)[1];\n BDV2.LayerStack.popLayer();\n BDV2.InviteActions.acceptInviteAndTransitionToInviteChannel(code);\n };\n }\n\n if (!url) return null;\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"a\", {\n className: \"bd-link bd-link-website\",\n href: url,\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons[which]);\n }\n\n get footer() {\n const links = [\"website\", \"source\", \"invite\", \"donate\", \"patreon\"];\n if (!links.some(l => this.props.addon[l]) && !this.props.hasSettings) return null;\n const linkComponents = links.map(this.buildLink.bind(this)).filter(c => c);\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-footer\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-links\"\n }, linkComponents.map((comp, i) => i < linkComponents.length - 1 ? [comp, \" | \"] : [comp]).flat()), this.props.hasSettings && modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"button\", {\n onClick: this.showSettings,\n className: \"bd-button bd-button-addon-settings\",\n disabled: !this.props.enabled\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.addonSettings));\n }\n\n makeButton(title, children, action) {\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(Tooltip, {\n color: \"black\",\n position: \"top\",\n text: title\n }, props => {\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", _extends({}, props, {\n className: \"bd-addon-button\",\n onClick: action\n }), children);\n });\n }\n\n render() {\n if (this.state.settingsOpen) return this.settingsComponent;\n const addon = this.props.addon;\n const name = this.getString(addon.name);\n const author = this.getString(addon.author);\n const description = this.getString(addon.description);\n const version = this.getString(addon.version);\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n id: `${addon.id}-card`,\n className: \"bd-addon-card settings-closed\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-addon-header\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-title\"\n }, this.buildTitle(name, version, author)), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-controls\"\n }, this.props.editAddon && this.makeButton(modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.editAddon, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_edit__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null), this.props.editAddon), this.props.deleteAddon && this.makeButton(modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.deleteAddon, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_delete__WEBPACK_IMPORTED_MODULE_4__[\"default\"], null), this.props.deleteAddon), this.props.showReloadIcon && this.makeButton(modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.reload, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_reload__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: \"bd-reload bd-reload-card\"\n }), this.reload), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_components_switch__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n checked: this.props.enabled,\n onChange: this.onChange\n }))), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-description-wrap scroller-wrap fade\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-description scroller\"\n }, description)), this.footer);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIj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iAgICBidWlsZExpbmsod2hpY2gpIHtcclxuICAgICAgICBjb25zdCB1cmwgPSB0aGlzLnByb3BzLmFkZG9uW3doaWNoXTtcclxuICAgICAgICBpZiAod2hpY2ggPT0gXCJpbnZpdGVcIikge1xyXG4gICAgICAgICAgICBjb25zdCBvbkNsaWNrID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdGVzdGVyID0gL1xcLmdnXFwvKC4qKSQvO1xyXG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB1cmw7XHJcbiAgICAgICAgICAgICAgICBpZiAodGVzdGVyLnRlc3QoY29kZSkpIGNvZGUgPSBjb2RlLm1hdGNoKHRlc3RlcilbMV07XHJcbiAgICAgICAgICAgICAgICBCRFYyLkxheWVyU3RhY2sucG9wTGF5ZXIoKTtcclxuICAgICAgICAgICAgICAgIEJEVjIuSW52aXRlQWN0aW9ucy5hY2NlcHRJbnZpdGVBbmRUcmFuc2l0aW9uVG9JbnZpdGVDaGFubmVsKGNvZGUpO1xyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoIXVybCkgcmV0dXJuIG51bGw7XHJcbiAgICAgICAgcmV0dXJuIDxhIGNsYXNzTmFtZT1cImJkLWxpbmsgYmQtbGluay13ZWJzaXRlXCIgaHJlZj17dXJsfSB0YXJnZXQ9XCJfYmxhbmtcIiByZWw9XCJub29wZW5lciBub3JlZmVycmVyXCI+e1N0cmluZ3MuQWRkb25zW3doaWNoXX08L2E+O1xyXG4gICAgfVxyXG5cclxuICAgIGdldCBmb290ZXIoKSB7XHJcbiAgICAgICAgY29uc3QgbGlua3MgPSBbXCJ3ZWJzaXRlXCIsIFwic291cmNlXCIsIFwiaW52aXRlXCIsIFwiZG9uYXRlXCIsIFwicGF0cmVvblwiXTtcclxuICAgICAgICBpZiAoIWxpbmtzLnNvbWUobCA9PiB0aGlzLnByb3BzLmFkZG9uW2xdKSAmJiAhdGhpcy5wcm9wcy5oYXNTZ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CdXR0b24oU3RyaW5ncy5BZGRvbnMuZWRpdEFkZG9uLCA8RWRpdEljb24gLz4sIHRoaXMucHJvcHMuZWRpdEFkZG9uKX1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7dGhpcy5wcm9wcy5kZWxldGVBZGRvbiAmJiB0aGlzLm1ha2VCdXR0b24oU3RyaW5ncy5BZGRvbnMuZGVsZXRlQWRkb24sIDxEZWxldGVJY29uIC8+LCB0aGlzLnByb3BzLmRlbGV0ZUFkZG9uKX1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7dGhpcy5wcm9wcy5zaG93UmVsb2FkSWNvbiAmJiB0aGlzLm1ha2VCdXR0b24oU3RyaW5ncy5BZGRvbnMucmVsb2FkLCA8UmVsb2FkSWNvbiBjbGFzc05hbWU9XCJiZC1yZWxvYWQgYmQtcmVsb2FkLWNhcmRcIiAvPiwgdGhpcy5yZWxvYWQpfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxTd2l0Y2ggY2hlY2tlZD17dGhpcy5wcm9wcy5lbmFibGVkfSBvbkNoYW5nZT17dGhpcy5vbkNoYW5nZX0gLz5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiYmQtZGVzY3JpcHRpb24td3JhcCBzY3JvbGxlci13cmFwIGZhZGVcIj48ZGl2IGNsYXNzTmFtZT1cImJkLWRlc2NyaXB0aW9uIHNjcm9sbGVyXCI+e2Rlc2NyaXB0aW9ufTwvZGl2PjwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgIHt0aGlzLmZvb3Rlcn1cclxuICAgICAgICAgICAgICAgIDwvZGl2PjtcclxuICAgIH1cclxufVxyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/settings/addoncard.jsx\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return AddonCard; });\n/* harmony import */ var modules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! modules */ \"./src/modules/modules.js\");\n/* harmony import */ var _icons_close__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icons/close */ \"./src/ui/icons/close.jsx\");\n/* harmony import */ var _icons_reload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icons/reload */ \"./src/ui/icons/reload.jsx\");\n/* harmony import */ var _icons_edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/edit */ \"./src/ui/icons/edit.jsx\");\n/* harmony import */ var _icons_delete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/delete */ \"./src/ui/icons/delete.jsx\");\n/* harmony import */ var _components_switch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/switch */ \"./src/ui/settings/components/switch.jsx\");\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n\n\n\n\n\n\nconst Tooltip = modules__WEBPACK_IMPORTED_MODULE_0__[\"WebpackModules\"].getByDisplayName(\"Tooltip\");\nclass AddonCard extends modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].Component {\n constructor(props) {\n super(props);\n this.state = {\n settingsOpen: false\n };\n this.settingsPanel = \"\";\n this.panelRef = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createRef();\n this.onChange = this.onChange.bind(this);\n this.reload = this.reload.bind(this);\n this.showSettings = this.showSettings.bind(this);\n this.closeSettings = this.closeSettings.bind(this);\n }\n\n reload() {\n if (!this.props.reload) return;\n this.props.addon = this.props.reload(this.props.addon.id);\n this.forceUpdate();\n }\n\n componentDidUpdate() {\n if (!this.state.settingsOpen) return;\n if (this.settingsPanel instanceof Node) this.panelRef.current.appendChild(this.settingsPanel); // if (!SettingsCookie[\"fork-ps-3\"]) return;\n\n const isHidden = (container, element) => {\n const cTop = container.scrollTop;\n const cBottom = cTop + container.clientHeight;\n const eTop = element.offsetTop;\n const eBottom = eTop + element.clientHeight;\n return eTop < cTop || eBottom > cBottom;\n };\n\n const panel = $(this.panelRef.current);\n const container = panel.parents(\".scroller-2FKFPG\");\n if (!isHidden(container[0], panel[0])) return;\n container.animate({\n scrollTop: panel.offset().top - container.offset().top + container.scrollTop() - 30\n }, 300);\n }\n\n getString(value) {\n return typeof value == \"string\" ? value : value.toString();\n }\n\n onChange() {\n this.props.onChange && this.props.onChange(this.props.addon.id);\n this.props.enabled = !this.props.enabled;\n }\n\n showSettings() {\n if (!this.props.hasSettings) return;\n this.setState({\n settingsOpen: true\n });\n }\n\n closeSettings() {\n this.panelRef.current.innerHTML = \"\";\n this.setState({\n settingsOpen: false\n });\n }\n\n buildTitle(name, version, author) {\n const title = modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.title.split(/({{[A-Za-z]+}})/);\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\n if (nameIndex) title[nameIndex] = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-name\"\n }, name);\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\n if (nameIndex) title[versionIndex] = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-version\"\n }, version);\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\n if (nameIndex) title[authorIndex] = modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-author\"\n }, author);\n return title.flat();\n }\n\n get settingsComponent() {\n const addon = this.props.addon;\n const name = this.getString(addon.name);\n\n try {\n this.settingsPanel = this.props.getSettingsPanel();\n } catch (err) {\n modules__WEBPACK_IMPORTED_MODULE_0__[\"Logger\"].stacktrace(\"Addon Settings\", \"Unable to get settings panel for \" + name + \".\", err);\n }\n\n const props = {\n id: `${name}-settings`,\n className: \"addon-settings\",\n ref: this.panelRef\n };\n if (typeof settingsPanel == \"string\") props.dangerouslySetInnerHTML = this.settingsPanel;\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-addon-card settings-open bd-switch-item\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-close\",\n onClick: this.closeSettings\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_close__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null)), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", props, this.settingsPanel instanceof modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].Component ? this.settingsPanel : null));\n }\n\n buildLink(which) {\n const url = this.props.addon[which];\n\n if (which == \"invite\") {// TODO:\n // const onClick = () => {\n // const tester = /\\.gg\\/(.*)$/;\n // let code = url;\n // if (tester.test(code)) code = code.match(tester)[1];\n // BDV2.LayerStack.popLayer();\n // BDV2.InviteActions.acceptInviteAndTransitionToInviteChannel(code);\n // };\n }\n\n if (!url) return null;\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"a\", {\n className: \"bd-link bd-link-website\",\n href: url,\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons[which]);\n }\n\n get footer() {\n const links = [\"website\", \"source\", \"invite\", \"donate\", \"patreon\"];\n if (!links.some(l => this.props.addon[l]) && !this.props.hasSettings) return null;\n const linkComponents = links.map(this.buildLink.bind(this)).filter(c => c);\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-footer\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-links\"\n }, linkComponents.map((comp, i) => i < linkComponents.length - 1 ? [comp, \" | \"] : [comp]).flat()), this.props.hasSettings && modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"button\", {\n onClick: this.showSettings,\n className: \"bd-button bd-button-addon-settings\",\n disabled: !this.props.enabled\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.addonSettings));\n }\n\n makeButton(title, children, action) {\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(Tooltip, {\n color: \"black\",\n position: \"top\",\n text: title\n }, props => {\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", _extends({}, props, {\n className: \"bd-addon-button\",\n onClick: action\n }), children);\n });\n }\n\n render() {\n if (this.state.settingsOpen) return this.settingsComponent;\n const addon = this.props.addon;\n const name = this.getString(addon.name);\n const author = this.getString(addon.author);\n const description = this.getString(addon.description);\n const version = this.getString(addon.version);\n return modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n id: `${addon.id}-card`,\n className: \"bd-addon-card settings-closed\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-addon-header\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"span\", {\n className: \"bd-title\"\n }, this.buildTitle(name, version, author)), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-controls\"\n }, this.props.editAddon && this.makeButton(modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.editAddon, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_edit__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null), this.props.editAddon), this.props.deleteAddon && this.makeButton(modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.deleteAddon, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_delete__WEBPACK_IMPORTED_MODULE_4__[\"default\"], null), this.props.deleteAddon), this.props.showReloadIcon && this.makeButton(modules__WEBPACK_IMPORTED_MODULE_0__[\"Strings\"].Addons.reload, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_icons_reload__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: \"bd-reload bd-reload-card\"\n }), this.reload), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(_components_switch__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n checked: this.props.enabled,\n onChange: this.onChange\n }))), modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-description-wrap scroller-wrap fade\"\n }, modules__WEBPACK_IMPORTED_MODULE_0__[\"React\"].createElement(\"div\", {\n className: \"bd-description scroller\"\n }, description)), this.footer);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL3VpL3NldHRpbmdzL2FkZG9uY2FyZC5qc3g/NjM3MyJdLCJuYW1lcyI6WyJUb29sdGlwIiwiV2VicGFja01vZHVsZXMiLCJnZXRCeURpc3BsYXlOYW1lIiwiQWRkb25DYXJkIiwiUmVhY3QiLCJDb21wb25lbnQiLCJjb25zdHJ1Y3RvciIsInByb3BzIiwic3RhdGUiLCJzZXR0aW5nc09wZW4iLCJzZXR0aW5nc1BhbmVsIiwicGFuZWxSZWYiLCJjcmVhdGVSZWYiLCJvbkNoYW5nZSIsImJpbmQiLCJyZWxvYWQiLCJzaG93U2V0dGluZ3MiLCJjbG9zZVNldHRpbmdzIiwiYWRkb24iLCJpZCIsImZvcmNlVXBkYXRlIiwiY29tcG9uZW50RGlkVXBkYXRlIiwiTm9kZSIsImN1cnJlbnQiLCJhcHBlbmRDaGlsZCIsImlzSGlkZGVuIiwiY29udGFpbmVyIiwiZWxlbWVudCIsImNUb3AiLCJzY3JvbG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AgICBidWlsZExpbmsod2hpY2gpIHtcclxuICAgICAgICBjb25zdCB1cmwgPSB0aGlzLnByb3BzLmFkZG9uW3doaWNoXTtcclxuICAgICAgICBpZiAod2hpY2ggPT0gXCJpbnZpdGVcIikge1xyXG4gICAgICAgICAgICAvLyBUT0RPOlxyXG4gICAgICAgICAgICAvLyBjb25zdCBvbkNsaWNrID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAvLyAgICAgY29uc3QgdGVzdGVyID0gL1xcLmdnXFwvKC4qKSQvO1xyXG4gICAgICAgICAgICAvLyAgICAgbGV0IGNvZGUgPSB1cmw7XHJcbiAgICAgICAgICAgIC8vICAgICBpZiAodGVzdGVyLnRlc3QoY29kZSkpIGNvZGUgPSBjb2RlLm1hdGNoKHRlc3RlcilbMV07XHJcbiAgICAgICAgICAgIC8vICAgICBCRFYyLkxheWVyU3RhY2sucG9wTGF5ZXIoKTtcclxuICAgICAgICAgICAgLy8gICAgIEJEVjIuSW52aXRlQWN0aW9ucy5hY2NlcHRJbnZpdGVBbmRUcmFuc2l0aW9uVG9JbnZpdGVDaGFubmVsKGNvZGUpO1xyXG4gICAgICAgICAgICAvLyB9O1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoIXVybCkgcmV0dXJuIG51bGw7XHJcbiAgICAgICAgcmV0dXJuIDxhIGNsYXNzTmFtZT1cImJkLWxpbmsgYmQtbGluay13ZWJzaXRlXCIgaHJlZj17dXJsfSB0YXJnZXQ9XCJfYmxhbmtcIiByZWw9XCJub29wZW5lciBub3JlZmVycmVyXCI+e1N0cmluZ3MuQWRkb25zW3doaWNoXX08L2E+O1xyXG4gICAgfVxyXG5cclxuICAgIGdldCBmb290ZXIoKSB7XHJcbiAgICAgICAgY29uc3QgbGlua3MgPSBbXCJ3ZWJzaXRlXCIsIFwic291cmNlXCIsIFwiaW52aXRlXCIsIFwiZG9uYXRlXCIsIFwicGF0cmVvblwiXTtcclxuICAgICAgICBpZiAoIWxpbmtzLnNvbWUobCA9P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mNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/settings/addoncard.jsx\n"); /***/ }), diff --git a/js/main.min.js b/js/main.min.js index 43252239..33398d1a 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -1 +1 @@ -var Core=function(e){var t={};function s(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=6)}([function(e,t){e.exports=require("electron")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("request")},function(e,t){e.exports=require("module")},function(e,t){e.exports=require("events")},function(e,t,s){"use strict";s.r(t);var n={};s.r(n),s.d(n,"EmoteModule",function(){return Ye}),s.d(n,"CustomCSS",function(){return it}),s.d(n,"VoiceMode",function(){return ot}),s.d(n,"ClassNormalizer",function(){return at}),s.d(n,"DeveloperMode",function(){return lt}),s.d(n,"PublicServers",function(){return yt}),s.d(n,"DarkMode",function(){return vt}),s.d(n,"MinimalMode",function(){return wt}),s.d(n,"TwentyFourHour",function(){return Ct}),s.d(n,"ColoredText",function(){return Et}),s.d(n,"VoiceDisconnect",function(){return Pt}),s.d(n,"EmoteMenu",function(){return kt}),s.d(n,"EmoteAutocaps",function(){return Mt}),s.d(n,"WindowPrefs",function(){return Nt});var i={local:!1,localServer:"//localhost:8080",minified:!0,version:"0.3.0",branch:"master",repo:"rauenzi",minSupportedVersion:"0.3.0",bbdVersion:"1.0.0"},o=[{type:"category",id:"general",name:"General",collapsible:!0,settings:[{type:"switch",id:"download",value:!0},{type:"switch",id:"emoteMenu",value:!0},{type:"switch",id:"hideEmojiMenu",value:!1,enableWith:"emoteMenu"},{type:"switch",id:"autoCaps",value:!1},{type:"switch",id:"showNames",value:!0},{type:"switch",id:"modifiers",value:!0},{type:"switch",id:"animateOnHover",value:!1}]},{type:"category",id:"categories",name:"Categories",collapsible:!0,settings:[{type:"switch",id:"twitchglobal",value:!0},{type:"switch",id:"twitchsubscriber",value:!1},{type:"switch",id:"frankerfacez",value:!0},{type:"switch",id:"bttv",value:!0}]}],r=[{type:"category",id:"general",collapsible:!0,settings:[{type:"switch",id:"emotes",value:!0},{type:"switch",id:"publicServers",value:!0},{type:"switch",id:"voiceDisconnect",value:!1},{type:"switch",id:"twentyFourHour",value:!1},{type:"switch",id:"classNormalizer",value:!0},{type:"switch",id:"showToasts",value:!0}]},{type:"category",id:"appearance",collapsible:!0,settings:[{type:"switch",id:"voiceMode",value:!1},{type:"switch",id:"minimalMode",value:!1},{type:"switch",id:"hideChannels",value:!1,enableWith:"minimalMode"},{type:"switch",id:"darkMode",value:!0},{type:"switch",id:"coloredText",value:!1}]},{type:"category",id:"addons",collapsible:!0,shown:!1,settings:[{type:"switch",id:"addonErrors",value:!0},{type:"switch",id:"autoScroll",value:!0},{type:"switch",id:"autoReload",value:!0},{type:"dropdown",id:"editAction",value:"detached",options:[{value:"detached"},{value:"system"}]}]},{type:"category",id:"customcss",collapsible:!0,shown:!1,settings:[{type:"switch",id:"customcss",value:!0},{type:"switch",id:"liveUpdate",value:!1},{type:"dropdown",id:"openAction",value:"settings",options:[{value:"settings"},{value:"detached"},{value:"system"}]}]},{type:"category",id:"developer",collapsible:!0,shown:!1,settings:[{type:"switch",id:"developerMode",value:!1},{type:"switch",id:"copySelector",value:!1,enableWith:"developerMode"}]},{type:"category",id:"window",collapsible:!0,shown:!1,settings:[{type:"switch",id:"transparency",value:!1},{type:"switch",id:"frame",value:!1,hidden:!0}]}],a={Panels:{plugins:"Plugins",themes:"Themes",customcss:"Custom CSS"},Collections:{settings:{name:"Settings",general:{name:"General",emotes:{name:"Emote System",note:"Enables BD's emote system"},publicServers:{name:"Public Servers",note:"Display public servers button"},voiceDisconnect:{name:"Voice Disconnect",note:"Disconnect from voice server when closing Discord"},twentyFourHour:{name:"24-Hour Timestamps",note:"Hides channels when in minimal mode"},classNormalizer:{name:"Normalize Classes",note:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)"},showToasts:{name:"Show Toasts",note:"Shows a small notification for important information"}},appearance:{name:"Appearance",voiceMode:{name:"Voice Mode",note:"Hides everything that isn't voice chat"},minimalMode:{name:"Minimal Mode",note:"Hide elements and reduce the size of elements"},hideChannels:{name:"Hide Channels",note:"Hides channels when in minimal mode"},darkMode:{name:"Dark Mode",note:"Make certain elements dark by default"},coloredText:{name:"Colored Text",note:"Make text colour the same as role color"}},addons:{name:"Addon Manager",addonErrors:{name:"Show Addon Errors",note:"Shows a modal with plugin/theme errors"},autoScroll:{name:"Scroll To Settings",note:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)"},autoReload:{name:"Automatic Loading",note:"Automatically loads, reloads, and unloads plugins and themes"},editAction:{name:"Edit Action",note:"Where plugins & themes appear when editing",options:{detached:"Detached Window",system:"System Editor"}}},customcss:{name:"Custom CSS",customcss:{name:"Custom CSS",note:"Enables the Custom CSS tab"},liveUpdate:{name:"Live Update",note:"Updates the css as you type"},startDetached:{name:"Start Detached",note:"Clicking the Custom CSS tab opens the editor in a separate window"},nativeOpen:{name:"Open in Native Editor",note:"Clicking the Custom CSS tab opens your custom css in your native editor"},openAction:{name:"Editor Location",note:"Where Custom CSS should open by default",options:{settings:"Settings Menu",detached:"Detached Window",system:"System Editor"}}},developer:{name:"Developer Settings",developerMode:{name:"Developer Mode",note:"Allows activating debugger when pressing F8"},copySelector:{name:"Copy Selector",note:'Adds a "Copy Selector" option to context menus when developer mode is active'}},window:{name:"Window Preferences",transparency:{name:"Enable Transparency",note:"Enables the main window to be see-through (requires restart)"},frame:{name:"Window Frame",note:"Adds the native os window frame to the main window"}}},emotes:{name:"Emotes",general:{name:"General",download:{name:"Download Emotes",note:"Download emotes whenever they are out of date"},emoteMenu:{name:"Emote Menu",note:"Show Twitch/Favourite emotes in emote menu"},hideEmojiMenu:{name:"Hide Emoji Menu",note:"Hides Discord's emoji menu when using emote menu"},autoCaps:{name:"Emote Autocapitalization",note:"Autocapitalize emote commands"},showNames:{name:"Show Names",note:"Show emote names on hover"},modifiers:{name:"Show Emote Modifiers",note:"Enable emote mods (flip, spin, pulse, spin2, spin3, 1spin, 2spin, 3spin, tr, bl, br, shake, shake2, shake3, flap)"},animateOnHover:{name:"Animate On Hover",note:"Only animate the emote modifiers on hover"}},categories:{name:"Categories",twitchglobal:{name:"Twitch Globals",note:"Show Twitch global emotes"},twitchsubscriber:{name:"Twitch Subscribers",note:"Show Twitch subscriber emotes"},frankerfacez:{name:"FrankerFaceZ",note:"Show emotes from FFZ"},bttv:{name:"BetterTTV",note:"Show emotes from BTTV"}}}},Addons:{title:"{{name}} v{{version}} by {{author}}",openFolder:"Open {{type}} Folder",reload:"Reload",addonSettings:"Settings",website:"Website",source:"Source",server:"Support Server",donate:"Donate",name:"Name",author:"Author",version:"Version",added:"Date Added",modified:"Date Modified",search:"Search {{type}}",editAddon:"Edit",deleteAddon:"Delete",confirmDelete:"Are you sure you want to delete {{name}}?",confirmationText:"You have unsaved changes to {{name}}. Closing this window will lose all those changes."},Emotes:{loading:"Loading emotes in the background do not reload.",loaded:"All emotes successfully loaded.",clearEmotes:"Clear Emote Data",favoriteAction:"Favorite!"},CustomCSS:{confirmationText:"You have unsaved changes to your Custom CSS. Closing this window will lose all those changes.",update:"Update",save:"Save",openNative:"Open in System Editor",openDetached:"Detach Window",settings:"Editor Settings",editorTitle:"Custom CSS Editor"},PublicServers:{button:"public",join:"Join",joining:"Joining",joined:"Joined",loading:"Loading",loadMore:"Load More",notConnected:"Not connected to DiscordServers.com!",search:"Search",connect:"Connect",reconnect:"Reconnect",categories:"Categories",connection:"Connected as: {{username}}#{{discriminator}}",results:"Showing {{start}}-{{end}} of {{total}} results in {{category}}",query:"for {{query}}"},Modals:{confirmAction:"Are You Sure?",okay:"Okay",cancel:"Cancel",close:"Close",name:"Name",message:"Message",error:"Error",addonErrors:"Addon Errors"},Sorting:{sortBy:"Sort By",order:"Order",ascending:"Ascending",descending:"Descending"}};const l={err:"error",error:"error",dbg:"debug",debug:"debug",log:"log",warn:"warn",info:"info"};class d{static stacktrace(e,t,s){console.error(`%c[${e}]%c ${t}\n\n%c`,"color: #3a71c1; font-weight: 700;","color: red; font-weight: 700;","color: red;",s)}static err(e,...t){d._log(e,t,"error")}static warn(e,...t){d._log(e,t,"warn")}static info(e,...t){d._log(e,t,"info")}static debug(e,...t){d._log(e,t,"debug")}static log(e,...t){d._log(e,t)}static _log(e,t,s="log"){s=d.parseType(s),Array.isArray(t)||(t=[t]),console[s](`%c[BandagedBD]%c [${e}]%c`,"color: #3E82E5; font-weight: 700;","color: #3a71c1;","",...t)}static parseType(e){return l.hasOwnProperty(e)?l[e]:"log"}}class c{static repoUrl(e){return`https://cdn.staticaly.com/gh/${i.repo}/BetterDiscordApp/${i.hash}/${e}`}static parseHTML(e,t=!1){const s=document.createElement("template");s.innerHTML=e;const n=s.content.cloneNode(!0);return t?n:n.childNodes.length>1?n.childNodes:n.childNodes[0]}static getTextArea(){return $(".channelTextArea-1LDbYG textarea")}static insertText(e,t){e.focus(),e.selectionStart=0,e.selectionEnd=e.value.length,document.execCommand("insertText",!1,t)}static escape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}static testJSON(e){try{return JSON.parse(e)}catch(e){return!1}}static suppressErrors(e,t){return(...s)=>{try{return e(...s)}catch(e){d.stacktrace("SuppressedError","Error occurred in "+t,e)}}}static onRemoved(e,t){const s=new MutationObserver(n=>{for(let i=0;i-1,l=r.some(t=>t.contains(e));(a||l)&&(s.disconnect(),t())}});s.observe(document.body,{subtree:!0,childList:!0})}static isEmpty(e){if(null==e||null==e||""==e)return!0;if("object"!=typeof e)return!1;if(Array.isArray(e))return 0==e.length;for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}static memoizeObject(e){const t=new Proxy(e,{get:function(e,t){if(e.hasOwnProperty(t)){if(Object.getOwnPropertyDescriptor(e,t).get){const s=e[t];delete e[t],e[t]=s}return e[t]}},set:function(e,t,s){return e.hasOwnProperty(t)?d.error("MemoizedObject","Trying to overwrite existing property"):(e[t]=s,e[t])}});return Object.defineProperty(t,"hasOwnProperty",{value:function(e){return void 0!==this[e]}}),t}static extend(e,...t){for(let s=0;se.startsWith("__reactInternalInstance"))]||null}static getOwnerInstance(e,{include:t,exclude:s=["Popout","Tooltip","Scroller","BackgroundFlash"],filter:n=(e=>e)}={}){if(void 0===e)return;const i=void 0===t,o=i?s:t;function r(e){const t=function(e){const t=e.type;return t&&(t.displayName||t.name)||null}(e);return null!==t&&!!(o.includes(t)^i)}let a=this.getReactInstance(e);for(a=a&&a.return;null!==a;a=a.return){if(null===a)continue;const e=a.stateNode;if(null!==a&&!(e instanceof HTMLElement)&&r(a)&&n(e))return e}return null}}class h{static byProperties(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&e.every(e=>void 0!==n[e])}}static byPrototypeFields(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&(!!n.prototype&&e.every(e=>void 0!==n.prototype[e]))}}static byCode(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&-1!==n.toString([]).search(e)}}static byString(...e){return t=>{const s=t.toString([]);for(const t of e)if(!s.includes(t))return!1;return!0}}static byDisplayName(e){return t=>t&&t.displayName===e}static combine(...e){return t=>e.every(e=>e(t))}}class u{static find(e,t=!0){return this.getModule(e,t)}static findAll(e){return this.getModule(e,!1)}static findByUniqueProperties(e,t=!0){return t?this.getByProps(...e):this.getAllByProps(...e)}static findByDisplayName(e){return this.getByDisplayName(e)}static getModule(e,t=!0){const s=this.getAllModules(),n=[];for(const i in s){if(!s.hasOwnProperty(i))continue;const o=s[i],{exports:r}=o;let a=null;if(r&&(r.__esModule&&r.default&&e(r.default)&&(a=r.default),e(r)&&(a=r),a)){if(t)return a;n.push(a)}}return t||0==n.length?void 0:n}static getModules(e){return this.getModule(e,!1)}static getByDisplayName(e){return this.getModule(h.byDisplayName(e),!0)}static getByRegex(e,t=!0){return this.getModule(h.byCode(e),t)}static getByPrototypes(...e){return this.getModule(h.byPrototypeFields(e),!0)}static getAllByPrototypes(...e){return this.getModule(h.byPrototypeFields(e),!1)}static getByProps(...e){return this.getModule(h.byProperties(e),!0)}static getAllByProps(...e){return this.getModule(h.byProperties(e),!1)}static getByString(...e){return this.getModule(h.byString(...e),!0)}static getAllByString(...e){return this.getModule(h.byString(...e),!1)}static get require(){if(this._require)return this._require;const e="bbd-webpackmodules",t="function"==typeof window.webpackJsonp?window.webpackJsonp([],{[e]:(e,t,s)=>t.default=s},[e]).default:window.webpackJsonp.push([[],{[e]:(e,t,s)=>e.exports=s},[[e]]]);return delete t.m[e],delete t.c[e],this._require=t}static getAllModules(){return this.require.c}}var p=c.memoizeObject({get React(){return u.getByProps("createElement","cloneElement")},get ReactDOM(){return u.getByProps("render","findDOMNode")},get Flux(){return u.getByProps("connectStores")},get Events(){return u.getByPrototypes("setMaxListeners","emit")},get GuildStore(){return u.getByProps("getGuild")},get SortedGuildStore(){return u.getByProps("getSortedGuilds")},get SelectedGuildStore(){return u.getByProps("getLastSelectedGuildId")},get GuildSync(){return u.getByProps("getSyncedGuilds")},get GuildInfo(){return u.getByProps("getAcronym")},get GuildChannelsStore(){return u.getByProps("getChannels","getDefaultChannel")},get GuildMemberStore(){return u.getByProps("getMember")},get MemberCountStore(){return u.getByProps("getMemberCounts")},get GuildEmojiStore(){return u.getByProps("getEmojis")},get GuildActions(){return u.getByProps("markGuildAsRead")},get GuildPermissions(){return u.getByProps("getGuildPermissions")},get ChannelStore(){return u.getByProps("getChannels","getDMFromUserId")},get SelectedChannelStore(){return u.getByProps("getLastSelectedChannelId")},get ChannelActions(){return u.getByProps("selectChannel")},get PrivateChannelActions(){return u.getByProps("openPrivateChannel")},get ChannelSelector(){return u.getByProps("selectGuild","selectChannel")},get UserInfoStore(){return u.getByProps("getToken")},get UserSettingsStore(){return u.getByProps("guildPositions")},get AccountManager(){return u.getByProps("register","login")},get UserSettingsUpdater(){return u.getByProps("updateRemoteSettings")},get OnlineWatcher(){return u.getByProps("isOnline")},get CurrentUserIdle(){return u.getByProps("getIdleTime")},get RelationshipStore(){return u.getByProps("isBlocked","getFriendIDs")},get RelationshipManager(){return u.getByProps("addRelationship")},get MentionStore(){return u.getByProps("getMentions")},get UserStore(){return u.getByProps("getCurrentUser")},get UserStatusStore(){return u.getByProps("getStatus","getState")},get UserTypingStore(){return u.getByProps("isTyping")},get UserActivityStore(){return u.getByProps("getActivity")},get UserNameResolver(){return u.getByProps("getName")},get UserNoteStore(){return u.getByProps("getNote")},get UserNoteActions(){return u.getByProps("updateNote")},get EmojiInfo(){return u.getByProps("isEmojiDisabled")},get EmojiUtils(){return u.getByProps("getGuildEmoji")},get EmojiStore(){return u.getByProps("getByCategory","EMOJI_NAME_RE")},get InviteStore(){return u.getByProps("getInvites")},get InviteResolver(){return u.getByProps("findInvite")},get InviteActions(){return u.getByProps("acceptInvite")},get DiscordConstants(){return u.getByProps("Permissions","ActivityTypes","StatusTypes")},get DiscordPermissions(){return u.getByProps("Permissions","ActivityTypes","StatusTypes").Permissions},get PermissionUtils(){return u.getByProps("getHighestRole")},get ColorConverter(){return u.getByProps("hex2int")},get ColorShader(){return u.getByProps("darken")},get TinyColor(){return u.getByPrototypes("toRgb")},get ClassResolver(){return u.getByProps("getClass")},get ButtonData(){return u.getByProps("ButtonSizes")},get IconNames(){return u.getByProps("IconNames")},get NavigationUtils(){return u.getByProps("transitionTo","replaceWith","getHistory")},get MessageStore(){return u.getByProps("getMessages")},get MessageActions(){return u.getByProps("jumpToMessage","_sendMessage")},get MessageQueue(){return u.getByProps("enqueue")},get MessageParser(){return u.getByProps("createMessage","parse","unparse")},get hljs(){return u.getByProps("highlight","highlightBlock")},get SimpleMarkdown(){return u.getByProps("parseBlock","parseInline","defaultOutput")},get ExperimentStore(){return u.getByProps("getExperimentOverrides")},get ExperimentsManager(){return u.getByProps("isDeveloper")},get CurrentExperiment(){return u.getByProps("getExperimentId")},get ImageResolver(){return u.getByProps("getUserAvatarURL","getGuildIconURL")},get ImageUtils(){return u.getByProps("getSizedImageSrc")},get AvatarDefaults(){return u.getByProps("getUserAvatarURL","DEFAULT_AVATARS")},get WindowInfo(){return u.getByProps("isFocused","windowSize")},get TagInfo(){return u.getByProps("VALID_TAG_NAMES")},get DOMInfo(){return u.getByProps("canUseDOM")},get LocaleManager(){return u.getByProps("setLocale")},get Moment(){return u.getByProps("parseZone")},get LocationManager(){return u.getByProps("createLocation")},get Timestamps(){return u.getByProps("fromTimestamp")},get TimeFormatter(){return u.getByProps("dateFormat")},get Strings(){return u.getByProps("Messages").Messages},get StringFormats(){return u.getByProps("a","z")},get StringUtils(){return u.getByProps("toASCII")},get URLParser(){return u.getByProps("Url","parse")},get ExtraURLs(){return u.getByProps("getArticleURL")},get DNDActions(){return u.getByProps("beginDrag")},get DNDSources(){return u.getByProps("addTarget")},get DNDObjects(){return u.getByProps("DragSource")},get MediaDeviceInfo(){return u.getByProps("Codecs","SUPPORTED_BROWSERS")},get MediaInfo(){return u.getByProps("getOutputVolume")},get MediaEngineInfo(){return u.getByProps("MediaEngineFeatures")},get VoiceInfo(){return u.getByProps("EchoCancellation")},get VideoStream(){return u.getByProps("getVideoStream")},get SoundModule(){return u.getByProps("playSound")},get ElectronModule(){return u.getByProps("setBadge")},get Dispatcher(){return u.getByProps("dirtyDispatch")},get PathUtils(){return u.getByProps("hasBasename")},get NotificationModule(){return u.getByProps("showNotification")},get RouterModule(){return u.getByProps("Router")},get APIModule(){return u.getByProps("getAPIBaseURL")},get AnalyticEvents(){return u.getByProps("AnalyticEventConfigs")},get KeyGenerator(){return u.getByRegex(/"binary"/)},get Buffers(){return u.getByProps("Buffer","kMaxLength")},get DeviceStore(){return u.getByProps("getDevices")},get SoftwareInfo(){return u.getByProps("os")},get CurrentContext(){return u.getByProps("setTagsContext")},get GuildClasses(){const e=u.getByProps("wrapper","unreadMentionsBar"),t=u.getByProps("guildsError","selected"),s=u.getByProps("blobContainer");return Object.assign({},e,t,s)}});const m=s(5);var g=new class extends m{constructor(){super(),this.setMaxListeners(20)}dispatch(e,...t){this.emit(e,...t)}};const f=s(1),b=s(2),y=DiscordNative.globals.releaseChannel;var v=new class{constructor(){this.data={misc:{}},this.pluginData={},this.cacheData={}}initialize(){f.existsSync(this.baseFolder)||f.mkdirSync(this.baseFolder),f.existsSync(this.dataFolder)||f.mkdirSync(this.dataFolder),f.existsSync(this.localeFolder)||f.mkdirSync(this.localeFolder),f.existsSync(this.emoteFolder)||f.mkdirSync(this.emoteFolder),f.existsSync(this.cacheFile)||f.writeFileSync(this.cacheFile,JSON.stringify({})),f.existsSync(this.customCSS)||f.writeFileSync(this.customCSS,"");const e=f.readdirSync(this.dataFolder).filter(e=>!f.statSync(b.resolve(this.dataFolder,e)).isDirectory()&&e.endsWith(".json"));for(const t of e)this.data[t.split(".")[0]]=require(b.resolve(this.dataFolder,t));this.cacheData=c.testJSON(f.readFileSync(this.cacheFile).toString())||{}}get customCSS(){return this._customCSS||(this._customCSS=b.resolve(this.dataFolder,"custom.css"))}get baseFolder(){return this._baseFolder||(this._baseFolder=b.resolve(i.dataPath,"data"))}get dataFolder(){return this._dataFolder||(this._dataFolder=b.resolve(this.baseFolder,`${y}`))}get localeFolder(){return this._localeFolder||(this._localeFolder=b.resolve(this.baseFolder,"locales"))}get emoteFolder(){return this._emoteFolder||(this._emoteFolder=b.resolve(this.baseFolder,"emotes"))}get cacheFile(){return this._cacheFile||(this._cacheFile=b.resolve(this.baseFolder,".cache"))}getPluginFile(e){return b.resolve(i.dataPath,"plugins",e+".config.json")}_getFile(e){return"settings"==e||"plugins"==e||"themes"==e?b.resolve(this.dataFolder,`${e}.json`):b.resolve(this.dataFolder,"misc.json")}getBDData(e){return this.data.misc[e]||""}setBDData(e,t){this.data.misc[e]=t,f.writeFileSync(b.resolve(this.dataFolder,"misc.json"),JSON.stringify(this.data.misc,null,4))}getLocale(e){const t=b.resolve(this.localeFolder,`${e}.json`);return f.existsSync(t)?c.testJSON(f.readFileSync(t).toString()):null}saveLocale(e,t){f.writeFileSync(b.resolve(this.localeFolder,`${e}.json`),JSON.stringify(t,null,4))}getCacheHash(e,t){return this.cacheData[e]&&f.existsSync(b.resolve(this.baseFolder,e,`${t}.json`))&&this.cacheData[e][t]||""}setCacheHash(e,t,s){this.cacheData[e]||(this.cacheData[e]={}),this.cacheData[e][t]=s,f.writeFileSync(this.cacheFile,JSON.stringify(this.cacheData))}invalidateCache(e,t){this.cacheData[e]&&(delete this.cacheData[e][t],f.writeFileSync(this.cacheFile,JSON.stringify(this.cacheData)))}emotesExist(e){return f.existsSync(b.resolve(this.emoteFolder,`${e}.json`))}getEmoteData(e){const t=b.resolve(this.emoteFolder,`${e}.json`);return f.existsSync(t)?c.testJSON(f.readFileSync(t).toString()):null}saveEmoteData(e,t){f.writeFileSync(b.resolve(this.emoteFolder,`${e}.json`),JSON.stringify(t))}getData(e){return this.data[e]||""}setData(e,t){this.data[e]=t,f.writeFileSync(b.resolve(this.dataFolder,`${e}.json`),JSON.stringify(t,null,4))}loadCustomCSS(){return f.readFileSync(this.customCSS).toString()}saveCustomCSS(e){return f.writeFileSync(this.customCSS,e)}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:f.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(f.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,s){void 0!==s&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=s,f.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4)))}deletePluginData(e,t){void 0===this.pluginData[e]&&(this.pluginData[e]={}),delete this.pluginData[e][t],f.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};const w=s(3),{Dispatcher:C,DiscordConstants:S,UserSettingsStore:E}=p;var P=new class{get discordLocale(){return E.locale.split("-")[0]}get defaultLocale(){return"en"}constructor(){this.locale="",this.strings={}}async initialize(){await this.setLocale(this.discordLocale),C.subscribe(S.ActionTypes.USER_SETTINGS_UPDATE,({settings:e})=>{const t=e.locale;t&&t!=this.locale&&this.setLocale(t.split("-")[0])})}async setLocale(e){let t;if(e!=this.defaultLocale){if(!(t=await this.getLocaleStrings(e)))return this.setLocale(this.defaultLocale)}else t=a;this.locale=e,c.extend(this.strings,t),g.emit("strings-updated")}async getLocaleStrings(e){const t=v.getCacheHash("locales",e);if(!t)return await this.downloadLocale(e);const s=await this.downloadLocale(e,t);return s||v.getLocale(e)}downloadLocale(e,t=""){return new Promise(s=>{const n={url:c.repoUrl(`data/locales/${e}.json`),timeout:2e3,json:!0};t&&(n.headers={"If-None-Match":t}),w.get(n,(t,n,i)=>{if(t||200!==n.statusCode)return s(null);v.saveLocale(e,i),v.setCacheHash("locales",e,n.headers.etag),s(i)})})}};class x{static get bdHead(){return this.getElement("bd-head")}static get bdBody(){return this.getElement("bd-body")}static get bdScripts(){return this.getElement("bd-scripts")}static get bdStyles(){return this.getElement("bd-styles")}static get bdThemes(){return this.getElement("bd-themes")}static get bdCustomCSS(){return this.getElement("#customcss")}static initialize(){this.createElement("bd-head",{target:document.head}),this.createElement("bd-body",{target:document.body}),this.createElement("bd-scripts",{target:this.bdHead}),this.createElement("bd-styles",{target:this.bdHead}),this.createElement("bd-themes",{target:this.bdHead}),this.createElement("style",{id:"customcss",target:this.bdHead})}static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"-")}static getElement(e,t=document){return e instanceof Node?e:t.querySelector(e)}static createElement(e,t={}){const{className:s,id:n,target:i}=t,o=document.createElement(e);return s&&(o.className=s),n&&(o.id=n),i&&this.getElement(i).append(o),o}static removeStyle(e){e=this.escapeID(e);const t=this.getElement(`#${e}`,this.bdStyles);t&&t.remove()}static injectStyle(e,t){e=this.escapeID(e);const s=this.getElement(`#${e}`,this.bdStyles)||this.createElement("style",{id:e});s.textContent=t,this.bdStyles.append(s)}static removeTheme(e){e=this.escapeID(e);const t=this.getElement(`#${e}`,this.bdThemes);t&&t.remove()}static injectTheme(e,t){e=this.escapeID(e);const s=this.getElement(`#${e}`,this.bdThemes)||this.createElement("style",{id:e});s.textContent=t,this.bdThemes.append(s)}static updateCustomCSS(e){this.bdCustomCSS.textContent=e}static removeScript(e){e=this.escapeID(e);const t=this.getElement(`#${e}`,this.bdScripts);t&&t.remove()}static injectScript(e,t){return e=this.escapeID(e),new Promise(s=>{const n=this.getElement(`#${e}`,this.bdScripts)||this.createElement("script",{id:e});n.src=t,n.onload=s,this.bdScripts.append(n)})}}class k extends String{format(e){return c.formatString(this,e)}}var M=new Proxy(P.strings,{get:function(e,t){return e.hasOwnProperty(t)?new Proxy(e[t],{get:function(e,t){return"string"==typeof e[t]?new k(e[t]):e[t]}}):new Proxy({},{get:function(){return`String group "${t}" not found.`}})}}),A=new class{constructor(){this.state={},this.collections=[],this.panels=[],this.updateStrings=this.updateStrings.bind(this)}initialize(){this.registerCollection("settings","Settings",r),g.on("strings-updated",this.updateStrings)}registerCollection(e,t,s,n=null){if(this.collections.find(t=>t.id==e))return d.error("Settings","Already have a collection with id "+e);this.collections.push({type:"collection",id:e,name:t,settings:s,button:n}),this.setupCollection(e),this.loadCollection(e),this.updateStrings()}removeCollection(e){const t=this.collections.findIndex(t=>t.id==e);if(!t<0)return d.error("Settings","No collection with id "+e);this.collections.splice(t,1)}registerPanel(e,t,s){if(this.panels.find(t=>t.id==e))return d.error("Settings","Already have a panel with id "+e);const{element:n,onClick:i,order:o=1}=s,r={id:e,order:o,label:t,section:e};i&&(r.clickListener=i),n&&(r.element=n instanceof p.React.Component?()=>p.React.createElement(n,{}):"function"==typeof n?n:()=>n),this.panels.push(r)}removePanel(e){const t=this.panels.findIndex(t=>t.id==e);if(!t<0)return d.error("Settings","No collection with id "+e);this.panels.splice(t,1)}getPath(e,t="",s=""){return{collection:3==e.length?e[0]:t,category:3==e.length?e[1]:2==e.length?e[0]:s,setting:e[e.length-1]}}setupCollection(e){const t=this.collections.find(t=>t.id==e);if(!t)return;const s=t.settings;this.state[t.id]||(this.state[t.id]={});for(let e=0;e{const e=this.state[o.collection][o.category][o.setting];return s.enableWith?!e:e}})}}}}saveSettings(){for(const e in this.state)this.saveCollection(e)}loadSettings(){for(const e in this.state)this.loadCollection(e)}saveCollection(e){v.setData(e,this.state[e])}loadCollection(e){const t=v.getData(e);if(!t)return this.saveCollection(e);for(const s in this.state[e]){t[s]||Object.assign(t,{[s]:this.state[e][s]});for(const n in this.state[e][s]){if(null==t[s][n])continue;const i=this.getSetting(e,s,n);if("switch"==i.type&&(this.state[e][s][n]=t[s][n]),"dropdown"==i.type){i.options.some(e=>e.value==t[s][n])&&(this.state[e][s][n]=t[s][n])}}}this.saveCollection(e)}onSettingChange(e,t,s,n){this.state[e][t][s]=n,g.dispatch("setting-updated",e,t,s,n),this.saveCollection(e)}getSetting(e,t,s){return 2==arguments.length?this.collections[0].find(e=>e.id==arguments[0]).settings.find(e=>e.id==arguments[1]):this.collections.find(t=>t.id==e).settings.find(e=>e.id==t).settings.find(e=>e.id==s)}get(e,t,s){return 2==arguments.length&&(s=t,t=e,e="settings"),!(!this.state[e]||!this.state[e][t])&&this.state[e][t][s]}set(e,t,s,n){return 3==arguments.length&&(n=s,s=t,t=e,e="settings"),this.onSettingChange(e,t,s,n)}on(e,t,s,n){const i=(i,o,r,a)=>{i===e&&o===t&&r===s&&n(a)};return g.on("setting-updated",i),()=>{g.off("setting-updated",i)}}updateStrings(){for(let e=0;e"before"===e.type))try{t.callback(this,arguments)}catch(s){d.err("Patcher",`Could not fire before callback of ${e.functionName} for ${t.caller}`,s)}const s=e.children.filter(e=>"instead"===e.type);if(s.length)for(const n of s)try{const s=n.callback(this,arguments,e.originalFunction.bind(this));void 0!==s&&(t=s)}catch(t){d.err("Patcher",`Could not fire instead callback of ${e.functionName} for ${n.caller}`,t)}else t=e.originalFunction.apply(this,arguments);for(const s of e.children.filter(e=>"after"===e.type))try{const n=s.callback(this,arguments,t);void 0!==n&&(t=n)}catch(t){d.err("Patcher",`Could not fire after callback of ${e.functionName} for ${s.caller}`,t)}return t}}static rePatch(e){e.proxyFunction=e.module[e.functionName]=this.makeOverride(e)}static makePatch(e,t,s){const n={name:s,module:e,functionName:t,originalFunction:e[t],proxyFunction:null,revert:()=>{n.module[n.functionName]=n.originalFunction,n.proxyFunction=null,n.children=[]},counter:0,children:[]};return n.proxyFunction=e[t]=this.makeOverride(n),this.patches.push(n),n}static before(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"before"}))}static after(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"after"}))}static instead(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"instead"}))}static pushChildPatch(e,t,s,n,i={}){const{type:o="after",forcePatch:r=!0}=i,a=this.resolveModule(t);if(!a)return null;if(!a[s]&&r&&(a[s]=function(){}),!(a[s]instanceof Function))return null;"string"==typeof t&&(i.displayName=t);const l=`${i.displayName||a.displayName||a.name||a.constructor.displayName||a.constructor.name}.${s}`,d=this.patches.find(e=>e.module==a&&e.functionName==s)||this.makePatch(a,s,l);d.proxyFunction||this.rePatch(d);const c={caller:e,type:o,id:d.counter,callback:n,unpatch:()=>{if(d.children.splice(d.children.findIndex(e=>e.id===c.id&&e.type===o),1),d.children.length<=0){const e=this.patches.findIndex(e=>e.module==a&&e.functionName==s);this.patches[e].revert(),this.patches.splice(e,1)}}};return d.children.push(c),d.counter++,c.unpatch}}const T=p.React,B={},L=new Set,j=new Set;var z=new class{get named(){return B}get unknown(){return L}get listeners(){return j}constructor(){F.after("ReactComponents",T,"createElement",(e,t,s)=>{this.walkRenderTree(s)}),F.instead("ReactComponents",T.Component.prototype,"componentWillMount",e=>{this.addComponent(e.constructor)}),F.instead("ReactComponents",T.Component.prototype,"UNSAFE_componentWillMount",e=>{this.addComponent(e.constructor)}),F.instead("ReactComponents",T.PureComponent.prototype,"componentWillMount",e=>{this.addComponent(e.constructor)}),F.instead("ReactComponents",T.PureComponent.prototype,"UNSAFE_componentWillMount",e=>{this.addComponent(e.constructor)})}initialize(){this.walkReactTree(document.querySelector("#app-mount")._reactRootContainer._internalRoot.current)}get(e,t){return new Promise(s=>{if(B[e])return s(B[e]);if(j.add({name:e,filter:t,resolve:s}),t)for(const s of L)t(s)&&(s.displayName=e,L.delete(s),this.addNamedComponent(s))})}addNamedComponent(e){const t=e.displayName;if(!B[t]){B[t]=e;for(const s of j)s.name===t&&(s.resolve(e),j.delete(s))}}addUnknownComponent(e){if(!L.has(e)){for(const t of j)t.filter&&t.filter(e)&&(e.displayName=t.name,this.addNamedComponent(e));e.displayName||L.add(e)}}addComponent(e){return e.displayName?this.addNamedComponent(e):this.addUnknownComponent(e)}walkRenderTree(e){if(e){if("function"==typeof e.type&&this.addComponent(e.type),Array.isArray(e))for(const t of e)this.walkRenderTree(t);e.props&&e.props.children&&this.walkRenderTree(e.props.children)}}walkReactTree(e){e&&("function"==typeof e.type&&this.addComponent(e.type),e.child&&this.walkReactTree(e.child),e.sibling&&this.walkReactTree(e.sibling))}};const O=p.React,R=(p.ReactDOM,u.getByProps("sidebar","hasNotice").sidebar.split(" ")[0]),I=u.getByProps("membersWrap").membersWrap.split(" ")[0];class _{static get shouldShowToasts(){return A.get("settings","general","showToasts")}static async success(e,t={}){return this.show(e,Object.assign(t,{type:"success"}))}static async info(e,t={}){return this.show(e,Object.assign(t,{type:"info"}))}static async warning(e,t={}){return this.show(e,Object.assign(t,{type:"warning"}))}static async error(e,t={}){return this.show(e,Object.assign(t,{type:"error"}))}static async default(e,t={}){return this.show(e,Object.assign(t,{type:""}))}static show(e,t={}){const{type:s="",icon:n=!0,timeout:i=3e3,forceShow:o=!1}=t;if(!this.shouldShowToasts&&!o)return;this.ensureContainer();const r=document.createElement("div");r.classList.add("bd-toast"),s&&r.classList.add("toast-"+s),s&&n&&r.classList.add("icon"),r.innerText=e,document.querySelector(".bd-toasts").appendChild(r),setTimeout(()=>{r.classList.add("closing"),setTimeout(()=>{r.remove(),document.querySelectorAll(".bd-toasts .bd-toast").length||document.querySelector(".bd-toasts").remove()},300)},i)}static ensureContainer(){if(document.querySelector(".bd-toasts"))return;const e=document.querySelector(`.${R} + div`),t=e.querySelector(`.${I}`),s=e?e.querySelector("form"):null,n=e?e.getBoundingClientRect().left:310,i=t?t.getBoundingClientRect().left:0,o=i?i-e.getBoundingClientRect().left:e.offsetWidth,r=s?s.offsetHeight:80,a=document.createElement("div");a.classList.add("bd-toasts"),a.style.setProperty("left",n+"px"),a.style.setProperty("width",o+"px"),a.style.setProperty("bottom",r+"px"),document.querySelector("#app-mount").appendChild(a)}}class q extends O.Component{constructor(e){super(e),this.onClick=this.onClick.bind(this),this.state={checked:this.props.checked||!1}}render(){return O.createElement("div",{className:"checkbox-item"},O.createElement("div",{className:"checkbox-label label-JWQiNe da-label"},this.props.text),O.createElement("div",{className:"checkbox-wrapper checkbox-3kaeSU da-checkbox checkbox-3EVISJ da-checkbox",onClick:this.onClick},O.createElement("div",{className:"checkbox-inner checkboxInner-3yjcPe da-checkboxInner"},O.createElement("input",{className:"checkbox checkboxElement-1qV33p da-checkboxElement",checked:this.state.checked,type:"checkbox"}),O.createElement("span",null)),O.createElement("span",null)))}onClick(){this.props.onChange(!this.state.checked),this.setState({checked:!this.state.checked})}}function H(){return(H=Object.assign||function(e){for(var t=1;t{for(const s of e){if(!(s.addedNodes.length&&s.addedNodes[0]instanceof Element))continue;const e=s.addedNodes[0];e.parentElement===document.body&&e.querySelector("#ace_settingsmenu")&&(e.id="ace_settingsmenu_container",t.disconnect())}});t.observe(document.body,{childList:!0})};const t=this.props.theme==V.defaultProps.theme?this.props.theme.split("-")[1]:this.props.theme;this.editor.setTheme(`ace/theme/${t}`),this.editor.session.setMode(`ace/mode/${this.props.language}`),this.editor.setShowPrintMargin(!1),this.editor.setFontSize(this.props.fontSize),this.editor.on("change",this.onChange)}componentWillUnmount(){this.editor.destroy()}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}onChange(){this.props.onChange&&this.props.onChange(this.value)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}buildControl(e){return"checkbox"==e.type?this.makeCheckbox(e):this.makeButton(e)}makeCheckbox(e){return O.createElement(q,{text:e.label,onChange:e.onChange,checked:e.checked})}makeButton(e){return O.createElement(U,{color:"black",position:"top",text:e.tooltip},t=>O.createElement("button",H({},t,{className:"btn btn-primary",onClick:t=>{e.onClick(t,this.value)}}),e.label))}render(){this.editor&&this.editor.resize&&this.editor.resize();const e=this.props.controls.filter(e=>"right"!=e.side).map(this.buildControl.bind(this)),t=this.props.controls.filter(e=>"right"==e.side).map(this.buildControl.bind(this));return O.createElement("div",{id:"bd-editor-panel",className:this.props.theme},O.createElement("div",{id:"bd-editor-controls"},O.createElement("div",{className:"controls-section controls-left"},e),O.createElement("div",{className:"controls-section controls-right"},t)),O.createElement("div",{className:"editor-wrapper"},O.createElement("div",{id:this.props.id,className:"editor "+this.props.theme},this.props.value)))}}class J extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm2 16H5V5h11.17L19 7.83V19zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zM6 6h9v4H6z"}))}}class Z extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{viewBox:"0 0 24 24",fill:"#FFFFFF",style:{width:e,height:e},onClick:this.props.onClick},O.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),O.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}}class Y extends O.Component{render(){const e=this.props.size||"20px";return O.createElement("svg",{viewBox:"0 0 20 20",style:{width:e,height:e}},O.createElement("path",{fill:"none",d:"M0 0h20v20H0V0z"}),O.createElement("path",{d:"M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}))}}class K extends O.Component{constructor(e){super(e),this.hasUnsavedChanges=!1,this.onChange=this.onChange.bind(this),this.save=this.save.bind(this),this.openNative=this.openNative.bind(this),this.update=this.update.bind(this),this.controls=[{label:O.createElement(J,{size:"18px"}),tooltip:M.CustomCSS.save,onClick:this.save},{label:O.createElement(Z,{size:"18px"}),tooltip:M.CustomCSS.openNative,onClick:this.openNative},{label:O.createElement(Y,{size:"18px"}),tooltip:M.CustomCSS.settings,onClick:"showSettings"}]}update(){this.forceUpdate()}updateEditor(e){this.editor&&(this.editor.value=e)}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}setEditorRef(e){this.editor=e,this.props.editorRef&&void 0!==this.props.editorRef.current?this.props.editorRef.current=e:this.props.editorRef&&(this.props.editorRef=e)}render(){return O.createElement(V,{ref:this.setEditorRef.bind(this),language:this.props.language,id:this.props.id||"bd-addon-editor",controls:this.controls,value:this.props.content,onChange:this.onChange})}onChange(){this.hasUnsavedChanges=!0}save(e,t){this.hasUnsavedChanges=!1,this.props.save&&this.props.save(t)}openNative(){this.props.openNative&&this.props.openNative()}}class X{static get width(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)}static get height(){return Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}class Q extends O.Component{render(){return O.createElement("svg",{viewBox:"0 0 12 12",style:{width:"18px",height:"18px"}},O.createElement("g",{className:"background",fill:"none",fillRule:"evenodd"},O.createElement("path",{d:"M0 0h12v12H0"}),O.createElement("path",{className:"fill",fill:"#dcddde",d:"M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6"})))}}class ee extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e},onClick:this.props.onClick},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))}}class te{static get shouldShowAddonErrors(){return A.get("settings","addons","addonErrors")}static get ModalStack(){return u.getByProps("push","update","pop","popWithKey")}static get AlertModal(){return u.getByPrototypes("handleCancel","handleSubmit","handleMinorConfirm")}static get TextElement(){return u.getByProps("Sizes","Weights")}static get ConfirmationModal(){return u.getModule(e=>e.defaultProps&&e.key&&"confirm-modal"==e.key())}static default(e,t){const s=u.getByProps("backdrop")||{backdrop:"backdrop-1wrmKb"},n=u.getModule(e=>e.modal&&e.inner&&!e.sizeMedium)||{modal:"modal-36zFtW",inner:"inner-2VEzy9"},i=u.getByProps("sizeMedium")||{modal:"backdrop-1wrmKb",sizeMedium:"sizeMedium-ctncE5",content:"content-2KoCOZ",header:"header-2nhbou",footer:"footer-30ewN8",close:"close-hhyjWJ",inner:"inner-2Z5QZX"},o=c.parseHTML(`
\n
\n
\n
\n
\n
${e}
\n
\n
\n
\n
\n ${t}\n
\n
\n
\n \n
\n
\n
`);o.querySelector(".footer button").addEventListener("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.querySelector(".bd-backdrop").addEventListener("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),document.querySelector("#app-mount").append(o)}static alert(e,t){if(this.ModalStack&&this.AlertModal)return this.default(e,t);this.ModalStack.push(function(s){return O.createElement(this.AlertModal,Object.assign({title:e,body:t},s))})}static showConfirmationModal(e,t,s={}){const n=this.TextElement,i=this.ConfirmationModal,o=this.ModalStack;if(!this.ModalStack||!this.ConfirmationModal||!this.TextElement)return this.alert(e,t);const{onConfirm:r,onCancel:a,confirmText:l,cancelText:d,danger:c=!1}=s;"string"==typeof t?t=n.default({color:n.Colors.PRIMARY,children:[t]}):Array.isArray(t)&&(t=n.default({color:n.Colors.PRIMARY,children:t})),t=[t];const h=()=>{};o.push(function(s){return O.createElement(i,Object.assign({header:e,children:t,red:c,confirmText:l||M.Modals.okay,cancelText:d||M.Modals.cancel,onConfirm:r||h,onCancel:a||h},s))})}static showAddonErrors({plugins:e=[],themes:t=[]}){if(!e||!t||!this.shouldShowAddonErrors)return;if(!e.length&&!t.length)return;const s=u.getByProps("backdrop")||{backdrop:"backdrop-1wrmKb"},n=u.getModule(e=>e.modal&&e.inner&&!e.sizeMedium)||{modal:"modal-36zFtW",inner:"inner-2VEzy9"},i=u.getByProps("sizeMedium")||{modal:"modal-3v8ziU",sizeMedium:"sizeMedium-ctncE5",content:"content-2KoCOZ",header:"header-2nhbou",footer:"footer-30ewN8",close:"close-hhyjWJ",inner:"inner-2Z5QZX"},o=$(`
\n
\n
\n
\n
${M.Modals.addonErrors}
\n
\n
\n
\n
${M.Panels.plugins}
\n
${M.Panels.themes}
\n
\n
\n
\n
${M.Modals.name}
\n
${M.Modals.message}
\n
${M.Modals.error}
\n
\n
\n
\n\n
\n
\n
\n \n
\n
\n
`),r=function(e){const t=$('
');for(const s of e){const e=$(`
\n
${s.name?s.name:s.file}
\n
${s.message}
\n \n
`);t.append(e),s.error&&e.find("a").on("click",e=>{e.preventDefault(),d.stacktrace("AddonError",`Error details for ${s.name?s.name:s.file}.`,s.error)})}return t},a=[r(e),r(t)];o.find(".tab-bar-item").on("click",e=>{e.preventDefault(),o.find(".tab-bar-item").removeClass("selected"),$(e.target).addClass("selected"),o.find(".scroller").empty().append(a[$(e.target).index()])}),o.find(".footer button").on("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.find(".bd-backdrop").on("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.appendTo("#app-mount"),e.length?o.find(".tab-bar-item")[0].click():o.find(".tab-bar-item")[1].click()}}class se extends O.Component{constructor(e){super(e),this.state={modalOpen:!1},this.offX=0,this.offY=0,this.titlebar=O.createRef(),this.window=O.createRef(),this.close=this.close.bind(this),this.maximize=this.maximize.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragStart=this.onDragStart.bind(this),this.onDragStop=this.onDragStop.bind(this),this.onResizeStart=this.onResizeStart.bind(this)}componentDidMount(){this.window.current.addEventListener("mousedown",this.onResizeStart,!1),this.titlebar.current.addEventListener("mousedown",this.onDragStart,!1),document.addEventListener("mouseup",this.onDragStop,!1)}onResizeStart(){this.currentWidth=this.window.current.style.width,this.currentHeight=this.window.current.style.height}onDragStop(){if(document.removeEventListener("mousemove",this.onDrag,!0),this.props.onResize){const e=this.window.current.style.width,t=this.window.current.style.height;e==this.currentWidth&&t==this.currentHeight||this.props.onResize(),this.currentWidth=e,this.currentHeight=t}}onDragStart(e){const t=this.window.current;this.offY=e.clientY-parseInt(t.offsetTop),this.offX=e.clientX-parseInt(t.offsetLeft),document.addEventListener("mousemove",this.onDrag,!0)}onDrag(e){const t=this.window.current;t.style.top=e.clientY-this.offY+"px",t.style.left=e.clientX-this.offX+"px"}componentWillUnmount(){this.titlebar.current.removeEventListener("mousedown",this.onDragStart,!1),document.removeEventListener("mouseup",this.onDragStop,!1)}render(){const e=this.props.center?X.height/2-this.props.height/2:this.props.top,t=this.props.center?X.width/2-this.props.width/2:this.props.left,s=`floating-window${` ${this.props.className}`||""}${this.props.resizable?" resizable":""}${this.state.modalOpen?" modal-open":""}`,n={height:this.props.height,width:this.props.width,left:t||0,top:e||0};return O.createElement("div",{id:this.props.id,className:s,ref:this.window,style:n},O.createElement("div",{className:"floating-window-titlebar",ref:this.titlebar},O.createElement("span",{className:"title"},this.props.title),O.createElement("div",{className:"floating-window-buttons"},O.createElement("div",{className:"button maximize-button",onClick:this.maximize},O.createElement(ee,{size:"18px"})),O.createElement("div",{className:"button close-button",onClick:this.close},O.createElement(Q,null)))),O.createElement("div",{className:"floating-window-content"},this.props.children))}async close(){let e=!0;("function"==typeof this.props.confirmClose?this.props.confirmClose():this.props.confirmClose)&&(this.setState({modalOpen:!0}),e=await this.confirmClose(),this.setState({modalOpen:!1})),this.props.close&&e&&this.props.close()}maximize(){this.window.current.style.width="100%",this.window.current.style.height="100%",this.window.current.style.top="20px",this.window.current.style.left="0px",this.props.onResize&&this.props.onResize()}confirmClose(){return new Promise(e=>{te.showConfirmationModal(M.Modals.confirmAction,this.props.confirmationText,{danger:!0,confirmText:M.Modals.close,onConfirm:()=>{e(!0)},onCancel:()=>{e(!1)}})})}}function ne(){return(ne=Object.assign||function(e){for(var t=1;tO.createElement(se,ne({},e,{close:this.close.bind(this,e.id)}),e.children))}open(e){this.setState({windows:[...this.state.windows,e]})}close(e){this.setState({windows:this.state.windows.filter(t=>(t.id==e&&t.onClose&&t.onClose(),t.id!=e))})}static get id(){return"floating-windows"}static get root(){if(this._root)return this._root;const e=document.createElement("div");return e.id=this.id,document.body.append(e),this._root=e}},{ref:ie}),re=c.findInReactTree(c.getReactInstance(document.querySelector(".app-19_DXt")),e=>e&&e.type&&e.type.displayName&&"App"==e.type.displayName);F.after("FloatingContainer",re.type.prototype,"render",(e,t,s)=>{c.findInRenderTree(s,e=>e&&e[6]&&e[6].type&&"LayerContainer"==e[6].type.displayName,{walkable:["children","props"]}).push(oe)}),re.stateNode.forceUpdate();var ae=ie.current;const le=p.React,de=s(2),ce=s(1),he=s(4).Module;he.globalPaths.push(de.resolve(s(0).remote.app.getAppPath(),"node_modules"));const ue=/[^\S\r\n]*?\r?\n[^\S\r\n]*?\*[^\S\r\n]?/,pe=/^\\@/,me=function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e};class ge{get name(){return""}get moduleExtension(){return""}get extension(){return""}get addonFolder(){return""}get language(){return""}get prefix(){return"addon"}get collection(){return"settings"}get category(){return"addons"}get id(){return"autoReload"}emit(e,...t){return g.emit(`${this.prefix}-${e}`,...t)}constructor(){this.timeCache={},this.addonList=[],this.state={}}initialize(){return this.originalRequire=he._extensions[this.moduleExtension],he._extensions[this.moduleExtension]=this.getAddonRequire(),A.on(this.collection,this.category,this.id,e=>{e?this.watchAddons():this.unwatchAddons()}),this.loadAllAddons()}initializeAddon(){}getFileModification(e,t){return t}startAddon(){}stopAddon(){}loadState(){const e=v.getData(`${this.prefix}s`);e&&Object.assign(this.state,e)}saveState(){v.setData(`${this.prefix}s`,this.state)}watchAddons(){if(this.watcher)return d.error(this.name,`Already watching ${this.prefix} addons.`);d.log(this.name,`Starting to watch ${this.prefix} addons.`),this.watcher=ce.watch(this.addonFolder,{persistent:!1},async(e,t)=>{if(!e||!t||!t.endsWith(this.extension))return;await new Promise(e=>setTimeout(e,50));try{ce.statSync(de.resolve(this.addonFolder,t))}catch(e){if("ENOENT"!==e.code)return;delete this.timeCache[t],this.unloadAddon(t,!0)}if(!ce.statSync(de.resolve(this.addonFolder,t)).isFile())return;const s=ce.statSync(de.resolve(this.addonFolder,t));s&&s.mtime&&s.mtime.getTime()&&"number"==typeof s.mtime.getTime()&&this.timeCache[t]!=s.mtime.getTime()&&(this.timeCache[t]=s.mtime.getTime(),"rename"==e&&this.loadAddon(t,!0),"change"==e&&this.reloadAddon(t,!0))})}unwatchAddons(){if(!this.watcher)return d.error(this.name,`Was not watching ${this.prefix} addons.`);this.watcher.close(),delete this.watcher,d.log(this.name,`No longer watching ${this.prefix} addons.`)}extractMeta(e){const t=e.split("\n")[0];if(t.includes("//META"))return this.parseOldMeta(e);if(t.includes("/**"))return this.parseNewMeta(e);throw new N("META was not found.")}parseOldMeta(e){const t=e.split("\n")[0],s=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//")),n=c.testJSON(s);if(!n)throw new N("META could not be parsed.");if(!n.name)throw new N("META missing name data.");return n}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],s={};let n="",i="";for(const e of t.split(ue))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){s[n]=i;const t=e.indexOf(" ");n=e.substr(1,t-1),i=e.substr(t+1)}else i+=" "+e.replace("\\n","\n").replace(pe,"@");return s[n]=i.trim(),delete s[""],s}getAddonRequire(){const e=this,t=this.originalRequire;return function(s,n){const i=de.resolve(e.addonFolder,de.basename(n));if(!ce.existsSync(i)||n!==ce.realpathSync(i))return Reflect.apply(t,this,arguments);let o=ce.readFileSync(n,"utf8");o=me(o);const r=ce.statSync(n),a=e.extractMeta(o);a.id=a.name,a.filename=de.basename(n),a.added=r.atimeMs,a.modified=r.mtimeMs,a.size=r.size,o=e.getFileModification(s,o,a),s._compile(o,n)}}loadAddon(e,t=!1){if(void 0===e)return;try{require(de.resolve(this.addonFolder,e))}catch(n){return new D(e,e,"Could not be compiled.",{message:n.message,stack:n.stack})}const s=require(de.resolve(this.addonFolder,e));if(this.addonList.find(e=>e.id==s.id))return new D(s.name,e,`There is already a plugin with name ${s.name}`);const n=this.initializeAddon(s);return n||(this.addonList.push(s),t&&_.success(`${s.name} v${s.version} was loaded.`),this.emit("loaded",s.id),this.state[s.id]?this.startAddon(s):this.state[s.id]=!1)}unloadAddon(e,t=!0,s=!1){const n="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return!!n&&(this.state[n.id]&&(s?this.stopAddon(n):this.disableAddon(n)),delete require.cache[require.resolve(de.resolve(this.addonFolder,n.filename))],this.addonList.splice(this.addonList.indexOf(n),1),this.emit("unloaded",n.id),t&&_.success(`${n.name} was unloaded.`),!0)}reloadAddon(e,t=!0){const s="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e,n=this.unloadAddon(s,t,!0);return n?this.loadAddon(s.filename,t):n}isLoaded(e){return!!this.addonList.find(t=>t.id==e||t.filename==e)}isEnabled(e){const t=this.addonList.find(t=>t.id==e||t.filename==e);return!!t&&this.state[t.id]}enableAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(this.state[t.id]||(this.state[t.id]=!0,this.startAddon(t),this.saveState()))}disableAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&this.state[t.id]&&(this.state[t.id]=!1,this.stopAddon(t),this.saveState())}toggleAddon(e){this.state[e]?this.disableAddon(e):this.enableAddon(e)}loadNewAddons(){const e=ce.readdirSync(this.addonFolder),t=this.addonList.filter(t=>!e.includes(t.filename)).map(e=>e.id);return{added:e.filter(e=>!this.addonList.find(t=>t.filename==e)&&e.endsWith(this.extension)&&ce.statSync(de.resolve(this.addonFolder,e)).isFile()),removed:t}}updateList(){const e=this.loadNewAddons();for(const t of e.added)this.loadAddon(t);for(const t of e.removed)this.unloadAddon(t)}loadAllAddons(){this.loadState();const e=[],t=ce.readdirSync(this.addonFolder);for(const s of t){if(!ce.statSync(de.resolve(this.addonFolder,s)).isFile()||!s.endsWith(this.extension))continue;const t=this.loadAddon(s,!1);t instanceof D&&e.push(t)}return this.saveState(),A.get(this.collection,this.category,this.id)&&this.watchAddons(),e}deleteAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return ce.unlinkSync(de.resolve(this.addonFolder,t.filename))}saveAddon(e,t){const s="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return ce.writeFileSync(de.resolve(this.addonFolder,s.filename),t)}editAddon(e,t){const n="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e,i=de.resolve(this.addonFolder,n.filename);return void 0===t&&(t="system"==A.get("settings","addons","editAction")),t?s(0).shell.openItem(`${i}`):this.openDetached(n)}openDetached(e){const t=de.resolve(this.addonFolder,e.filename),s=ce.readFileSync(t).toString(),n=le.createRef(),i=le.createElement(K,{id:"bd-floating-editor-"+e.name,ref:n,content:s,save:this.saveAddon.bind(this,e),openNative:this.editAddon.bind(this,e,!0),language:this.language});ae.open({onClose:()=>{this.isDetached=!1},onResize:()=>{n&&n.current&&n.current.resize&&n.current.resize()},title:e.name,id:s.id,className:"floating-addon-window",height:470,width:410,center:!0,resizable:!0,children:i,confirmClose:()=>!(!n||!n.current)&&n.current.hasUnsavedChanges,confirmationText:M.Addons.confirmationText.format({name:e.name})})}}const fe="bd-settings-title h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi defaultColor-1_ajX0 defaultMarginh2-2LTaUL marginBottom20-32qID7",be="bd-settings-title bd-settings-group-title h5-18_1nd title-3sZWYQ size12-3R0845 height16-2Lv3qA weightSemiBold-NJexzi da-h5 da-title da-size12 da-height16 da-weightSemiBold marginBottom4-2qk4Hy da-marginBottom4 marginTop8-1DLZ1n da-marginTop8";class ye extends O.Component{constructor(e){super(e)}render(){const e=this.props.isGroup?be:fe,t=this.props.className?`${e} ${this.props.className}`:e;return O.createElement("h2",{className:t,onClick:()=>{this.props.onClick&&this.props.onClick()}},this.props.text,this.props.button&&O.createElement("button",{className:"bd-button bd-button-title",onClick:this.props.button.onClick},this.props.button.title),this.props.otherChildren)}}class ve extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{className:this.props.className||"",onClick:this.props.onClick,fill:"#dcddde",viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),O.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}class we extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e},onClick:this.props.onClick},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),O.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}class Ce extends O.Component{constructor(e){super(e),this.state={checked:this.props.checked},this.onChange=this.onChange.bind(this)}onChange(){this.props.disabled||(this.props.onChange(!this.state.checked),this.setState({checked:!this.state.checked}))}render(){const e=this.props.disabled?" bd-switch-disabled":"",t=this.state.checked?" bd-switch-checked":"";return O.createElement("div",{className:"bd-switch"+e+t},O.createElement("input",{type:"checkbox",id:this.props.id,className:"bd-checkbox",disabled:this.props.disabled,checked:this.state.checked,onChange:this.onChange}))}}function Se(){return(Se=Object.assign||function(e){for(var t=1;t{const s=e.scrollTop,n=s+e.clientHeight,i=t.offsetTop,o=i+t.clientHeight;return in})(t[0],e[0])&&t.animate({scrollTop:e.offset().top-t.offset().top+t.scrollTop()-30},300)}getString(e){return"string"==typeof e?e:e.toString()}onChange(){this.props.onChange&&this.props.onChange(this.props.addon.id),this.props.enabled=!this.props.enabled}showSettings(){this.props.hasSettings&&this.setState({settingsOpen:!0})}closeSettings(){this.panelRef.current.innerHTML="",this.setState({settingsOpen:!1})}buildTitle(e,t,s){const n=M.Addons.title.split(/({{[A-Za-z]+}})/),i=n.findIndex(e=>"{{name}}"==e);i&&(n[i]=O.createElement("span",{className:"bd-name"},e));const o=n.findIndex(e=>"{{version}}"==e);i&&(n[o]=O.createElement("span",{className:"bd-version"},t));const r=n.findIndex(e=>"{{author}}"==e);return i&&(n[r]=O.createElement("span",{className:"bd-author"},s)),n.flat()}get settingsComponent(){const e=this.props.addon,t=this.getString(e.name);try{this.settingsPanel=this.props.getSettingsPanel()}catch(e){d.stacktrace("Addon Settings","Unable to get settings panel for "+t+".",e)}const s={id:`${t}-settings`,className:"addon-settings",ref:this.panelRef};return"string"==typeof settingsPanel&&(s.dangerouslySetInnerHTML=this.settingsPanel),O.createElement("div",{className:"bd-addon-card settings-open bd-switch-item"},O.createElement("div",{className:"bd-close",onClick:this.closeSettings},O.createElement(Q,null)),O.createElement("div",s,this.settingsPanel instanceof O.Component?this.settingsPanel:null))}buildLink(e){const t=this.props.addon[e];return t?O.createElement("a",{className:"bd-link bd-link-website",href:t,target:"_blank",rel:"noopener noreferrer"},M.Addons[e]):null}get footer(){const e=["website","source"];if(!e.some(e=>this.props.addon[e])&&!this.props.hasSettings)return null;const t=e.map(this.buildLink.bind(this)).filter(e=>e);return O.createElement("div",{className:"bd-footer"},O.createElement("span",{className:"bd-links"},t.map((e,s)=>sO.createElement("div",Se({},e,{className:"bd-addon-button",onClick:s}),t))}render(){if(this.state.settingsOpen)return this.settingsComponent;const e=this.props.addon,t=this.getString(e.name),s=this.getString(e.author),n=this.getString(e.description),i=this.getString(e.version);return O.createElement("div",{id:`${e.id}-card`,className:"bd-addon-card settings-closed"},O.createElement("div",{className:"bd-addon-header"},O.createElement("span",{className:"bd-title"},this.buildTitle(t,i,s)),O.createElement("div",{className:"bd-controls"},this.props.editAddon&&this.makeButton(M.Addons.editAddon,O.createElement(Z,null),this.props.editAddon),this.props.deleteAddon&&this.makeButton(M.Addons.deleteAddon,O.createElement(we,null),this.props.deleteAddon),this.props.showReloadIcon&&this.makeButton(M.Addons.reload,O.createElement(ve,{className:"bd-reload bd-reload-card"}),this.reload),O.createElement(Ce,{checked:this.props.enabled,onChange:this.onChange}))),O.createElement("div",{className:"bd-description-wrap scroller-wrap fade"},O.createElement("div",{className:"bd-description scroller"},n)),this.footer)}}class xe extends O.Component{render(){const e=this.props.size||"16px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))}}class ke extends O.Component{constructor(e){super(e),this.state={open:!1,value:this.props.value||this.props.options[0].value},this.dropdown=O.createRef(),this.onChange=this.onChange.bind(this),this.showMenu=this.showMenu.bind(this),this.hideMenu=this.hideMenu.bind(this)}showMenu(e){e.preventDefault(),this.setState({open:!0},()=>{document.addEventListener("click",this.hideMenu)})}hideMenu(){this.setState({open:!1},()=>{document.removeEventListener("click",this.hideMenu)})}onChange(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)}get selected(){return this.props.options.find(e=>e.value==this.state.value)}get options(){const e=this.selected;return O.createElement("div",{className:"bd-select-options"},this.props.options.map(t=>O.createElement("div",{className:`bd-select-option${e.value==t.value?" selected":""}`,onClick:this.onChange.bind(this,t.value)},t.label)))}render(){const e="transparent"==this.props.style?" bd-select-transparent":"",t=this.state.open?" menu-open":"";return O.createElement("div",{className:`bd-select${e}${t}`,onClick:this.showMenu,ref:this.dropdown},O.createElement("div",{className:"bd-select-value"},this.selected.label),O.createElement(xe,{className:"bd-select-arrow"}),this.state.open&&this.options)}}class Me extends O.Component{render(){const e=this.props.size||"16px";return O.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),O.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))}}class Ae extends O.Component{render(){return O.createElement("div",{className:"bd-search-wrapper"},O.createElement("input",{onChange:this.props.onChange,onKeyDown:this.props.onKeyDown,type:"text",className:"bd-search",placeholder:this.props.placeholder,maxLength:"50"}),O.createElement(Me,null))}}class De extends O.Component{constructor(e){super(e),this.state={sort:"name",ascending:!0,query:""},this.sort=this.sort.bind(this),this.reverse=this.reverse.bind(this),this.search=this.search.bind(this),this.update=this.update.bind(this)}componentDidMount(){g.on(`${this.props.prefix}-loaded`,this.update),g.on(`${this.props.prefix}-unloaded`,this.update)}componentWillUnmount(){g.off(`${this.props.prefix}-loaded`,this.update),g.off(`${this.props.prefix}-unloaded`,this.update)}update(){this.forceUpdate()}reload(){this.props.refreshList&&this.props.refreshList(),this.forceUpdate()}reverse(e){this.setState({ascending:e})}sort(e){this.setState({sort:e})}search(e){this.setState({query:e.target.value.toLocaleLowerCase()})}get sortOptions(){return[{label:M.Addons.name,value:"name"},{label:M.Addons.author,value:"author"},{label:M.Addons.version,value:"version"},{label:M.Addons.added,value:"added"},{label:M.Addons.modified,value:"modified"}]}get directions(){return[{label:M.Sorting.ascending,value:!0},{label:M.Sorting.descending,value:!1}]}render(){const{title:e,folder:t,addonList:n,addonState:i,onChange:o,reload:r}=this.props,a=!A.get("settings","addons","autoReload"),l=t?{title:M.Addons.openFolder.format({type:e}),onClick:()=>{s(0).shell.openItem(t)}}:null,d=n.sort((e,t)=>{const s=e[this.state.sort],n=t[this.state.sort];return"string"==typeof s?s.toLocaleLowerCase().localeCompare(n.toLocaleLowerCase()):s>n?1:n>s?-1:0});return this.state.ascending||d.reverse(),[O.createElement(ye,{key:"title",text:e,button:l,otherChildren:a&&O.createElement(ve,{className:"bd-reload",onClick:this.reload.bind(this)})}),O.createElement("div",{className:"bd-controls bd-addon-controls"},O.createElement(Ae,{onChange:this.search,placeholder:`${M.Addons.search.format({type:this.props.title})}...`}),O.createElement("div",{className:"bd-addon-dropdowns"},O.createElement("div",{className:"bd-select-wrapper"},O.createElement("label",{className:"bd-label"},M.Sorting.sortBy,":"),O.createElement(ke,{options:this.sortOptions,onChange:this.sort,style:"transparent"})),O.createElement("div",{className:"bd-select-wrapper"},O.createElement("label",{className:"bd-label"},M.Sorting.order,":"),O.createElement(ke,{options:this.directions,onChange:this.reverse,style:"transparent"})))),O.createElement("div",{key:"addonList",className:"bd-addon-list"},d.map(e=>{if(this.state.query){let t=e.name.toLocaleLowerCase().includes(this.state.query);if(!(t=(t=t||e.author.toLocaleLowerCase().includes(this.state.query))||e.description.toLocaleLowerCase().includes(this.state.query)))return null}const t=e.type&&"function"==typeof e.plugin.getSettingsPanel,s=t&&e.plugin.getSettingsPanel.bind(e.plugin);return O.createElement(Pe,{editAddon:this.editAddon.bind(this,e.id),deleteAddon:this.deleteAddon.bind(this,e.id),showReloadIcon:a,key:e.id,enabled:i[e.id],addon:e,onChange:o,reload:r,hasSettings:t,getSettingsPanel:s})}))]}editAddon(e){this.props.editAddon&&this.props.editAddon(e)}async deleteAddon(e){const t=this.props.addonList.find(t=>t.id==e);await this.confirmDelete(t)&&this.props.deleteAddon&&this.props.deleteAddon(t)}confirmDelete(e){return new Promise(t=>{te.showConfirmationModal(M.Modals.confirmAction,M.Addons.confirmDelete.format({name:e.name}),{danger:!0,confirmText:M.Addons.deleteAddon,onConfirm:()=>{t(!0)},onCancel:()=>{t(!1)}})})}}class Ne extends O.Component{render(){return O.createElement("div",{className:"bd-divider divider-3573oO marginTop8-1DLZ1n marginBottom40-2vIwTv"})}}class Fe extends O.Component{render(){return O.createElement("div",{className:"bd-setting-item"},O.createElement("div",{className:"bd-setting-header"},O.createElement("label",{htmlFor:this.props.id,className:"bd-setting-title"},this.props.name),this.props.children),O.createElement("div",{className:"bd-setting-note"},this.props.note),O.createElement("div",{className:"bd-setting-divider"}))}}const Te="bd-settings-group";class Be extends O.Component{constructor(e){if(super(e),this.props.button&&this.props.collapsible){const e=this.props.button.onClick;this.props.button.onClick=t=>{t.stopPropagation(),e(...arguments)}}this.props.hasOwnProperty("shown")||(this.props.shown=!0),this.container=O.createRef(),this.state={collapsed:this.props.collapsible&&!this.props.shown},this.onChange=this.onChange.bind(this),this.toggleCollapse=this.toggleCollapse.bind(this)}toggleCollapse(){const e=this.container.current,t=this.state.collapsed?300:1;e.style.setProperty("height",e.scrollHeight+"px"),e.classList.add("animating"),this.setState({collapsed:!this.state.collapsed},()=>setTimeout(()=>{e.style.setProperty("height",""),e.classList.remove("animating")},t))}onChange(e,t){this.props.onChange&&(this.props.id?this.props.onChange(this.props.id,e,t):this.props.onChange(e,t),this.forceUpdate())}render(){const{settings:e}=this.props,t=this.props.collapsible?`collapsible ${this.state.collapsed?"collapsed":"expanded"}`:"",s=`${Te} ${t}`;return O.createElement("div",{className:s},O.createElement(ye,{text:this.props.name,collapsible:this.props.collapsible,onClick:this.toggleCollapse,button:this.props.button,isGroup:!0}),O.createElement("div",{className:"bd-settings-container",ref:this.container},e.filter(e=>!e.hidden).map(e=>{let t=null;return"dropdown"==e.type&&(t=O.createElement(ke,{disabled:e.disabled,id:e.id,options:e.options,value:e.value,onChange:this.onChange.bind(this,e.id)})),"switch"==e.type&&(t=O.createElement(Ce,{disabled:e.disabled,id:e.id,checked:e.value,onChange:this.onChange.bind(this,e.id)})),t?O.createElement(Fe,{id:e.id,key:e.id,name:e.name,note:e.note},t):null})),this.props.showDivider&&O.createElement(Ne,null))}}class Le extends O.Component{buildTitle(e,t,s){const n=M.Addons.title.split(/({{[A-Za-z]+}})/),i=n.findIndex(e=>"{{name}}"==e);i&&(n[i]=e);const o=n.findIndex(e=>"{{version}}"==e);i&&(n[o]=t);const r=n.findIndex(e=>"{{author}}"==e);return i&&(n[r]=s),n.flat()}render(){return O.createElement("div",{id:"bbd-version"},this.buildTitle("BBD",i.bbdVersion,O.createElement("a",{href:"https://github.com/rauenzi",target:"_blank",rel:"noopener noreferrer"},"Zerebos")))}}var je=new class{constructor(){this.patchSections(),g.on("strings-updated",this.forceUpdate)}onChange(e){return(t,s,n)=>{const i=A.collections.length+A.panels.length;e(t,s,n),i!=A.collections.length+A.panels.length&&setTimeout(this.forceUpdate.bind(this),50)}}buildSettingsPanel(e,t,s,n,i=null){return t.forEach(e=>{e.settings.forEach(t=>t.value=s[e.id][t.id])}),this.getSettingsPanel(e,t,this.onChange(n),i)}getSettingsPanel(e,t,s,n=null){return[O.createElement(ye,{text:e,button:n}),t.map(e=>O.createElement(Be,Object.assign({},e,{onChange:s})))]}getAddonPanel(e,t,s,n={}){return O.createElement(De,Object.assign({},{title:e,addonList:t,addonState:s},n))}async patchSections(){F.after("SettingsManager",u.getByDisplayName("FluxContainer(GuildSettings)").prototype,"render",e=>{e._reactInternalFiber.return.return.return.return.return.return.memoizedProps.id="guild-settings"});const e=await z.get("UserSettings",e=>e.prototype&&e.prototype.generateSections);F.after("SettingsManager",e.prototype,"render",e=>{e._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id="user-settings"}),F.after("SettingsManager",e.prototype,"generateSections",(e,t,s)=>{let n=s.findIndex(e=>"linux"==e.section.toLowerCase())+1;const i=e=>{s.splice(n,0,e),n++};i({section:"DIVIDER"}),i({section:"HEADER",label:"BandagedBD"});for(const e of A.collections)e.disabled||i({section:e.name,label:e.name,element:()=>this.buildSettingsPanel(e.name,e.settings,A.state[e.id],A.onSettingChange.bind(A,e.id),e.button?e.button:null)});for(const t of A.panels.sort((e,t)=>e.order>t.order))t.clickListener&&(t.onClick=n=>t.clickListener(e,n,s)),i(t);i({section:"CUSTOM",element:Le})}),this.forceUpdate()}forceUpdate(){const e=u.getByProps("standardSidebarView").standardSidebarView.split(" ")[0],t=document.querySelector(`.${e}`);if(!t)return;const s=c.findInReactTree(c.getReactInstance(t),e=>e&&e.generateSections,{walkable:["return","stateNode"]});s&&s.forceUpdate()}};const $e=s(2),ze=s(0).remote;var Oe=new class extends ge{get name(){return"PluginManager"}get moduleExtension(){return".js"}get extension(){return".plugin.js"}get addonFolder(){return $e.resolve(i.dataPath,"plugins")}get prefix(){return"plugin"}get language(){return"javascript"}constructor(){super(),this.onSwitch=this.onSwitch.bind(this),this.observer=new MutationObserver(e=>{for(let t=0,s=e.length;tje.getAddonPanel(M.Panels.plugins,this.addonList,this.state,{folder:this.addonFolder,onChange:this.togglePlugin.bind(this),reload:this.reloadPlugin.bind(this),refreshList:this.updatePluginList.bind(this),saveAddon:this.saveAddon.bind(this),editAddon:this.editAddon.bind(this),deleteAddon:this.deleteAddon.bind(this),prefix:this.prefix})}),e}updatePluginList(){return this.updateList()}loadAllPlugins(){return this.loadAllAddons()}enablePlugin(e){return this.enableAddon(e)}disablePlugin(e){return this.disableAddon(e)}togglePlugin(e){return this.toggleAddon(e)}unloadPlugin(e){return this.unloadAddon(e)}loadPlugin(e){const t=this.loadAddon(e);t&&te.showAddonErrors({themes:[t]})}reloadPlugin(e){const t=this.reloadAddon(e);return t&&te.showAddonErrors({plugins:[t]}),"string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e}initializeAddon(e){if(!e.type)return new D(e.name,e.filename,"Plugin had no exports",{message:"Plugin had no exports or no name property.",stack:""});try{const t=new e.type;e.plugin=t,e.name=t.getName()||e.name,e.author=t.getAuthor()||e.author||"No author",e.description=t.getDescription()||e.description||"No description",e.version=t.getVersion()||e.version||"No version";try{"function"==typeof e.plugin.load&&e.plugin.load()}catch(t){return this.state[e.id]=!1,new D(e.name,e.filename,"load() could not be fired.",{message:t.message,stack:t.stack})}}catch(t){return new D(e.name,e.filename,"Could not be constructed.",{message:t.message,stack:t.stack})}}getFileModification(e,t,s){return e._compile(t,e.filename),c.isEmpty(e.exports)?t+=`\nmodule.exports = ${JSON.stringify(s)};\nmodule.exports.type = ${s.exports||s.name};`:(s.type=e.exports,e.exports=s,"")}startAddon(e){return this.startPlugin(e)}stopAddon(e){return this.stopPlugin(e)}startPlugin(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;if(!t)return;const s=t.plugin;try{s.start(),this.emit("started",t.id),_.show(`${t.name} v${t.version} has started.`)}catch(e){return this.state[t.id]=!1,_.error(`${t.name} v${t.version} could not be started.`),d.stacktrace(this.name,t.name+" could not be started.",e),new D(t.name,t.filename,"start() could not be fired.",{message:e.message,stack:e.stack})}}stopPlugin(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;if(!t)return;const s=t.plugin;try{s.stop(),this.emit("stopped",t.id),_.show(`${t.name} v${t.version} has stopped.`)}catch(e){return this.state[t.id]=!1,_.error(`${t.name} v${t.version} could not be stopped.`),d.stacktrace(this.name,t.name+" could not be stopped.",e),new D(t.name,t.filename,"stop() could not be fired.",{message:e.message,stack:e.stack})}}setupFunctions(){ze.getCurrentWebContents().on("did-navigate-in-page",this.onSwitch.bind(this)),this.observer.observe(document,{childList:!0,subtree:!0})}onSwitch(){this.emit("page-switch");for(let e=0;eje.getAddonPanel(M.Panels.themes,this.addonList,this.state,{folder:this.addonFolder,onChange:this.toggleTheme.bind(this),reload:this.reloadTheme.bind(this),refreshList:this.updateThemeList.bind(this),saveAddon:this.saveAddon.bind(this),editAddon:this.editAddon.bind(this),deleteAddon:this.deleteAddon.bind(this),prefix:this.prefix})}),e}updateThemeList(){return this.updateList()}loadAllThemes(){return this.loadAllAddons()}enableTheme(e){return this.enableAddon(e)}disableTheme(e){return this.disableAddon(e)}toggleTheme(e){return this.toggleAddon(e)}unloadTheme(e){return this.unloadAddon(e)}loadTheme(e){const t=this.loadAddon(e);t&&te.showAddonErrors({themes:[t]})}reloadTheme(e){const t=this.reloadAddon(e);t&&te.showAddonErrors({themes:[t]})}getFileModification(e,t,s){return s.css=t,`module.exports = ${JSON.stringify(s)};`}startAddon(e){return this.addTheme(e)}stopAddon(e){return this.removeTheme(e)}addTheme(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(x.injectTheme(t.id,t.css),_.show(`${t.name} v${t.version} has been applied.`))}removeTheme(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(x.removeTheme(t.id),_.show(`${t.name} v${t.version} has been removed.`))}};class _e{get name(){return"Unnamed Builtin"}get collection(){return"settings"}get category(){return"general"}get id(){return"None"}async initialize(){A.get(this.collection,this.category,this.id)&&await this.enable(),g.on("setting-updated",(e,t,s,n)=>{e==this.collection&&t===this.category&&s===this.id&&(n?this.enable():this.disable())})}registerSetting(e,t,s,n,i){return 4==arguments.length?(e=this.collection,t=arguments[0],s=arguments[1],n=arguments[2],i=arguments[3]):3==arguments.length&&(e=this.collection,t=this.category,s=arguments[0],n=arguments[1],i=arguments[2]),A.on(e,t,s,e=>{e?n():i()})}get(e,t,s){return 2==arguments.length?(e=this.collection,t=arguments[0],s=arguments[1]):1==arguments.length&&(e=this.collection,t=this.category,s=arguments[0]),A.get(e,t,s)}async enable(){this.log("Enabled"),await this.enabled()}async disable(){this.log("Disabled"),await this.disabled()}async enabled(){}async disabled(){}log(...e){d.log(this.name,...e)}warn(...e){d.warn(this.name,...e)}error(...e){d.err(this.name,...e)}stacktrace(e,t){d.stacktrace(this.name,e,t)}after(e,t,s){return F.after(this.name,e,t,s)}unpatchAll(){return F.unpatchAll(this.name)}}const qe=u.getByDisplayName("TooltipDeprecated");class He extends O.Component{constructor(e){super(e),this.state={shouldAnimate:!this.animateOnHover,isFavorite:this.props.isFavorite},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onClick=this.onClick.bind(this),this.toggleFavorite=this.toggleFavorite.bind(this)}get animateOnHover(){return A.get("emotes","general","animateOnHover")}get label(){return this.props.modifier?`${this.props.name}:${this.props.modifier}`:this.props.name}get modifierClass(){return this.props.modifier?` emote${this.props.modifier}`:""}onMouseEnter(){!this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!0})}onMouseLeave(){this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!1})}onClick(e){this.props.onClick&&this.props.onClick(e)}toggleFavorite(e){e.preventDefault(),e.stopPropagation(),this.state.isFavorite?g.emit("emotes-favorite-removed",this.label):g.emit("emotes-favorite-added",this.label,this.props.url),this.setState({isFavorite:!this.state.isFavorite})}render(){return O.createElement(qe,{color:"black",position:"top",text:this.label,delay:750},O.createElement("div",{className:"emotewrapper"+(this.props.jumboable?" jumboable":""),onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onClick:this.onClick},O.createElement("img",{draggable:!1,className:"emote"+this.modifierClass+(this.props.jumboable?" jumboable":"")+(this.state.shouldAnimate?"":" stop-animation"),dataModifier:this.props.modifier,alt:this.label,src:this.props.url}),O.createElement("input",{className:"fav"+(this.state.isFavorite?" active":""),title:M.Emotes.favoriteAction,type:"button",onClick:this.toggleFavorite})))}}const Ue=s(3),We={TwitchGlobal:new k("https://static-cdn.jtvnw.net/emoticons/v1/{{id}}/1.0"),TwitchSubscriber:new k("https://static-cdn.jtvnw.net/emoticons/v1/{{id}}/1.0"),FrankerFaceZ:new k("https://cdn.frankerfacez.com/emoticon/{{id}}/1"),BTTV:new k("https://cdn.betterttv.net/emote/{{id}}/1x")},Ge={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{}},Ve=[],Je=["twitch","subscriber","bttv","ffz"],Ze=["flip","spin","pulse","spin2","spin3","1spin","2spin","3spin","tr","bl","br","shake","shake2","shake3","flap"];var Ye=new class extends _e{get name(){return"Emotes"}get collection(){return"settings"}get category(){return"general"}get id(){return"emotes"}get categories(){return Object.keys(Ge).filter(e=>this.isCategoryEnabled(e))}get shouldDownload(){return A.get("emotes",this.category,"download")}isCategoryEnabled(e){return super.get("emotes","categories",e.toLowerCase())}get(e){return super.get("emotes","general",e)}get MessageContentComponent(){return u.getModule(e=>e.defaultProps&&e.defaultProps.hasOwnProperty("disableButtons"))}get Emotes(){return Ge}get TwitchGlobal(){return Ge.TwitchGlobal}get TwitchSubscriber(){return Ge.TwitchSubscriber}get BTTV(){return Ge.BTTV}get FrankerFaceZ(){return Ge.FrankerFaceZ}get blacklist(){return Ve}get favorites(){return this.favoriteEmotes}getUrl(e,t){return We[e].format({id:Ge[e][t]})}getCategory(e){return Ge[e]}getRemoteFile(e){return c.repoUrl(`data/emotes/${e.toLowerCase()}.json`)}initialize(){super.initialize(),window.emoteModule=this;const e=v.getBDData("favoriteEmotes");this.favoriteEmotes=e||{},this.addFavorite=this.addFavorite.bind(this),this.removeFavorite=this.removeFavorite.bind(this),this.onCategoryToggle=this.onCategoryToggle.bind(this),this.resetEmotes=this.resetEmotes.bind(this)}async enabled(){for(A.registerCollection("emotes","Emotes",o,{title:M.Emotes.clearEmotes,onClick:this.resetEmotes}),await this.getBlacklist(),await this.loadEmoteData();!this.MessageContentComponent;)await new Promise(e=>setTimeout(e,100));this.patchMessageContent(),g.on("emotes-favorite-added",this.addFavorite),g.on("emotes-favorite-removed",this.removeFavorite),g.on("setting-updated",this.onCategoryToggle)}disabled(){g.off("setting-updated",this.onCategoryToggle),g.off("emotes-favorite-added",this.addFavorite),g.off("emotes-favorite-removed",this.removeFavorite),A.removeCollection("emotes"),this.emptyEmotes(),this.cancelEmoteRender&&(this.cancelEmoteRender(),delete this.cancelEmoteRender)}onCategoryToggle(e,t,s,n){if("emotes"==e&&"categories"==t)return n?this.loadEmoteData(s):this.unloadEmoteData(s)}addFavorite(e,t){this.favoriteEmotes.hasOwnProperty(e)||(this.favoriteEmotes[e]=t),this.saveFavorites()}removeFavorite(e){this.favoriteEmotes.hasOwnProperty(e)&&(delete this.favoriteEmotes[e],this.saveFavorites())}isFavorite(e){return this.favoriteEmotes.hasOwnProperty(e)}saveFavorites(){v.setBDData("favoriteEmotes",this.favoriteEmotes)}emptyEmotes(){for(const e in Ge)Object.assign(Ge,{[e]:{}})}patchMessageContent(){this.cancelEmoteRender||(this.cancelEmoteRender=this.after(this.MessageContentComponent.prototype,"render",(e,t,s)=>{this.after(s.props,"children",(e,t,s)=>{if(0==this.categories.length)return;const n=s.props.children[1];if(!n.props.children)return;const i=n.props.children[1];if(i&&i.length){for(let e=0;e"string"==typeof e&&""==e.replace(/\s*/,"")||(!(!e.type||"BDEmote"!=e.type.name)||!!(e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName))))for(const e of i)"object"==typeof e&&("BDEmote"==e.type.name?e.props.jumboable=!0:e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName&&(e.props.children.props.jumboable=!0))}})}))}async getBlacklist(){const e=v.emotesExist("Blacklist"),t=await this.isCacheValid("Blacklist"),s=t||!t&&e&&!this.shouldDownload?v.getEmoteData("Blacklist"):await this.downloadEmotes("Blacklist");Ve.push(...s)}isCacheValid(e){return new Promise(t=>{const s=v.getCacheHash("emotes",e);if(!s)return t(!1);Ue.head({url:this.getRemoteFile(e),headers:{"If-None-Match":s}},(e,s)=>{t(304==s.statusCode)})})}async loadEmoteData(e){e||(e=this.categories),Array.isArray(e)||(e=[e]);const t=Object.keys(Ge);e=e.map(e=>t.find(t=>t.toLowerCase()==e.toLowerCase())),_.show(M.Emotes.loading,{type:"info"}),this.emotesLoaded=!1;for(const t of e){const e=v.emotesExist(t),s=await this.isCacheValid(t);let n=null;if(s||!s&&e&&!this.shouldDownload){this.log(`Loading ${t} emotes from local cache.`);const e=v.getEmoteData(t);Object.keys(e).length>0&&(n=e)}n||(n=await this.downloadEmotes(t)),Object.assign(Ge[t],n),await new Promise(e=>setTimeout(e,1e3))}this.emotesLoaded=!0,g.dispatch("emotes-loaded"),_.show(M.Emotes.loaded,{type:"success"})}unloadEmoteData(e){e||(e=this.categories),Array.isArray(e)||(e=[e]);const t=Object.keys(Ge);e=e.map(e=>t.find(t=>t.toLowerCase()==e.toLowerCase()));for(const t of e)delete Ge[t],Ge[t]={}}downloadEmotes(e){const t=this.getRemoteFile(e);this.log(`Downloading ${e} from ${t}`);const s={url:t,timeout:1e4,json:!0};return new Promise(t=>{Ue.get(s,(s,n,i)=>{if(s||200!=n.statusCode)return this.stacktrace(`Could not download ${e} emotes.`,s),t({});for(const e in i)(e.length<4||Ve.includes(e)||!i[e])&&delete i[e];v.saveEmoteData(e,i),v.setCacheHash("emotes",e,n.headers.etag),t(i),this.log(`Downloaded ${e}`)})})}resetEmotes(){const e=Object.keys(Ge);this.unloadEmoteData(e);for(const t of e)v.invalidateCache("emotes",t);this.loadEmoteData()}};class Ke extends O.Component{render(){const e=this.props.size||"24px";return O.createElement("svg",{viewBox:"0 0 24 24",style:{width:e,height:e}},O.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),O.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}))}}class Xe extends O.Component{constructor(e){super(e),this.hasUnsavedChanges=!1,this.onChange=this.onChange.bind(this),this.toggleLiveUpdate=this.toggleLiveUpdate.bind(this),this.updateCss=this.updateCss.bind(this),this.saveCss=this.saveCss.bind(this),this.openDetached=this.props.openDetached?this.openDetached.bind(this):null,this.openNative=this.openNative.bind(this),this.updateEditor=this.updateEditor.bind(this),this.controls=[{label:O.createElement(ve,{size:"18px"}),tooltip:M.CustomCSS.update,onClick:this.updateCss},{label:O.createElement(J,{size:"18px"}),tooltip:M.CustomCSS.save,onClick:this.saveCss},{label:O.createElement(Z,{size:"18px"}),tooltip:M.CustomCSS.openNative,onClick:this.openNative},{label:O.createElement(Y,{size:"18px"}),tooltip:M.CustomCSS.settings,onClick:"showSettings"},{label:M.Collections.settings.customcss.liveUpdate.name,type:"checkbox",onChange:this.toggleLiveUpdate,checked:A.get("settings","customcss","liveUpdate"),side:"right"}],this.openDetached&&this.controls.push({label:O.createElement(Ke,{size:"18px"}),tooltip:M.CustomCSS.openDetached,onClick:this.openDetached,side:"right"})}componentDidMount(){g.on("customcss-updated",this.updateEditor)}componentWillUnmount(){g.off("customcss-updated",this.updateEditor)}updateEditor(e){this.editor&&(this.editor.value=e)}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}setEditorRef(e){this.editor=e,this.props.editorRef&&void 0!==this.props.editorRef.current?this.props.editorRef.current=e:this.props.editorRef&&(this.props.editorRef=e)}onChange(){this.hasUnsavedChanges=!0,this.props.onChange&&this.props.onChange(...arguments)}render(){return O.createElement(V,{ref:this.setEditorRef.bind(this),readOnly:this.props.readOnly,id:this.props.id||"bd-customcss-editor",onChange:this.onChange,controls:this.controls,value:this.props.css})}toggleLiveUpdate(e){A.set("settings","customcss","liveUpdate",e)}updateCss(e,t){this.props.update&&this.props.update(t)}saveCss(e,t){this.hasUnsavedChanges=!1,this.props.save&&this.props.save(t)}openDetached(e,t){this.props.openDetached&&this.props.openDetached(t)}openNative(){this.props.openNative&&this.props.openNative()}}const Qe=s(1),et=s(0),tt=u.getByProps("updateAccount"),st=u.getByProps("dirtyDispatch"),nt=u.getByProps("ActionTypes").ActionTypes;var it=new class extends _e{get name(){return"Custom CSS"}get category(){return"customcss"}get id(){return"customcss"}get startDetached(){return"detached"==A.get(this.collection,this.category,"openAction")}get nativeOpen(){return"system"==A.get(this.collection,this.category,"openAction")}constructor(){super(),this.savedCss="",this.insertedCss="",this.isDetached=!1}async enabled(){window.ace||x.injectScript("ace-script","https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js").then(()=>{window.require.original&&(window.require=window.require.original)}),A.registerPanel(this.id,M.Panels.customcss,{order:2,element:()=>[O.createElement(ye,{text:M.CustomCSS.editorTitle}),O.createElement(Xe,{css:this.savedCss,save:this.saveCSS.bind(this),update:this.insertCSS.bind(this),openNative:this.openNative.bind(this),openDetached:this.openDetached.bind(this),onChange:this.onChange.bind(this)})],onClick:e=>{if(this.isDetached)return;if(this.nativeOpen)return this.openNative();if(this.startDetached)return this.openDetached();const t=c.findInRenderTree(e._reactInternalFiber,e=>e&&e.onSetSection,{walkable:["child","memoizedProps","props","children"]});t&&t.onSetSection&&t.onSetSection(this.id)}}),this.loadCSS(),this.insertCSS(this.savedCss),this.watchContent()}disabled(){A.removePanel(this.id),this.unwatchContent()}watchContent(){if(this.watcher)return this.error("Already watching content.");const e={};this.log("Starting to watch content."),this.watcher=Qe.watch(v.customCSS,{persistent:!1},async(t,s)=>{if(!t||!s)return;await new Promise(e=>setTimeout(e,50));try{Qe.statSync(v.customCSS)}catch(t){if("ENOENT"!==t.code)return;delete e[s],this.saveCSS("")}const n=Qe.statSync(v.customCSS);if(n&&n.mtime&&n.mtime.getTime()&&"number"==typeof n.mtime.getTime()&&e[s]!=n.mtime.getTime()&&(e[s]=n.mtime.getTime(),"change"==t)){const e=v.loadCustomCSS();if(e==this.savedCss)return;this.savedCss=e,this.insertCSS(this.savedCss),g.emit("customcss-updated",this.savedCss)}})}unwatchContent(){if(!this.watcher)return this.error("Was not watching content.");this.watcher.close(),delete this.watcher,this.log("No longer watching content.")}onChange(e){A.get("settings","customcss","liveUpdate")&&(this.insertCSS(e),this.saveCSS(e))}loadCSS(){this.savedCss=v.loadCustomCSS()}insertCSS(e){void 0===e?e=this.insertedCss:this.insertedCss=e,x.updateCustomCSS(e)}saveCSS(e){void 0!==e&&(this.savedCss=e),v.saveCustomCSS(this.savedCss)}openNative(){et.shell.openExternal(`file://${v.customCSS}`)}openDetached(e){const t=O.createRef(),s=O.createElement(Xe,{id:"bd-floating-editor",ref:t,css:e,save:this.saveCSS.bind(this),update:this.insertCSS.bind(this),openNative:this.openNative.bind(this),onChange:this.onChange.bind(this)});ae.open({onClose:()=>{this.isDetached=!1},onResize:()=>{t&&t.current&&t.current.resize&&t.current.resize()},title:M.CustomCSS.editorTitle,id:"floating-editor-window",height:470,width:410,center:!0,resizable:!0,children:s,confirmClose:()=>!(!t||!t.current)&&t.current.hasUnsavedChanges,confirmationText:M.CustomCSS.confirmationText}),this.isDetached=!0,tt.close(),st.dirtyDispatch({type:nt.LAYER_POP})}},ot=new class extends _e{get name(){return"VoiceMode"}get category(){return"appearance"}get id(){return"voiceMode"}enabled(){document.querySelector(".chat-3bRxxu").style.setProperty("visibility","hidden"),document.querySelector(".chat-3bRxxu").style.setProperty("min-width","0px"),document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow","100000")}disabled(){document.querySelector(".chat-3bRxxu").style.setProperty("visibility",""),document.querySelector(".chat-3bRxxu").style.setProperty("min-width",""),document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow","")}};const rt=new RegExp("^(?!da-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$");var at=new class extends _e{get id(){return"classNormalizer"}get category(){return"general"}get name(){return"ClassNormalizer"}enabled(){this.hasPatched||(this.patchClassModules(u.getModules(this.moduleFilter.bind(this))),this.normalizeElement(document.querySelector("#app-mount")),this.hasPatched=!0,this.patchDOMMethods())}disabled(){this.hasPatched&&(this.unpatchClassModules(u.getModules(this.moduleFilter.bind(this))),this.revertElement(document.querySelector("#app-mount")),this.hasPatched=!1)}patchClassModules(e){for(const t of e)this.patchClassModule("da",t)}unpatchClassModules(e){for(const t of e)this.unpatchClassModule("da",t)}shouldIgnore(e){return!isNaN(e)||(!!(e.endsWith("px")||e.endsWith("ch")||e.endsWith("em")||e.endsWith("ms"))||(!!e.startsWith("layerContainer-")||(!(!e.startsWith("#")||7!=e.length&&4!=e.length)||!(!e.includes("calc(")&&!e.includes("rgba")))))}moduleFilter(e){if("object"!=typeof e||Array.isArray(e))return!1;if(e.__esModule)return!1;if(!Object.keys(e).length)return!1;for(const t in e){const s=e[t];if("string"!=typeof s)return!1;if(!this.shouldIgnore(s)){if(1===s.split("-").length)return!1;if(!rt.test(s.split(" ")[0]))return!1}}return!0}patchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;const i=n.split(" ");for(const n of i){const i=n.match(rt)[1];if(!i)continue;const o=i.split("-").map((e,t)=>t?e[0].toUpperCase()+e.slice(1):e).join("");t[s]+=` ${e}-${o}`}}}unpatchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;let i="";const o=n.split(" ");for(const t of o)t.startsWith(`${e}-`)||(i+=` ${t}`);t[s]=i.trim()}}normalizeElement(e){if(!(e instanceof Element))return;const t=e.classList;for(let s=0,n=t.length;st?e[0].toUpperCase()+e.slice(1):e).join("");e.classList.add(`da-${n}`)}for(const t of e.children)this.normalizeElement(t)}revertElement(e){if(!(e instanceof Element))return;e.children&&e.children.length&&this.revertElement(e.children[0]),e.nextElementSibling&&this.revertElement(e.nextElementSibling);const t=e.classList,s=[];for(let e=0;ee.call(this,t))}}},lt=new class extends _e{get name(){return"DeveloperMode"}get category(){return"developer"}get id(){return"developerMode"}get selectorModeID(){return"copySelector"}get selectorMode(){return this.get(this.selectorModeID)}constructor(){super(),this.enableSelectors=this.enableSelectors.bind(this),this.disableSelectors=this.disableSelectors.bind(this)}enabled(){$(window).on("keydown.bdDevmode",e=>{119!==e.which&&118!=e.which||this.log("Debugger Activated")}),this.selectorMode&&this.enableSelectors(),this.selectorCancel=this.registerSetting(this.selectorModeID,this.enableSelectors,this.disableSelectors)}disabled(){$(window).off("keydown.bdDevmode"),this.selectorMode&&this.disableSelectors(),this.selectorCancel&&this.selectorCancel()}enableSelectors(){$(document).on("contextmenu.bdDevmode",e=>{this.lastSelector=this.getSelector(e.toElement);setImmediate(()=>{let t=$(".contextMenu-HLZMGh");t.length<=0&&((t=$('
')).addClass($(".app, .app-2rEoOp").hasClass("theme-dark")?"theme-dark":"theme-light"),t.appendTo(".app, .app-2rEoOp"),t.css("top",e.clientY),t.css("left",e.clientX),$(document).on("click.bdDevModeCtx",()=>{t.remove(),$(document).off(".bdDevModeCtx")}),$(document).on("contextmenu.bdDevModeCtx",()=>{t.remove(),$(document).off(".bdDevModeCtx")}),$(document).on("keyup.bdDevModeCtx",e=>{27===e.keyCode&&(t.remove(),$(document).off(".bdDevModeCtx"))}));const s=$("
",{class:"itemGroup-1tL0uz"}),n=$("
",{class:"item-1Yvehc",click:()=>{p.ElectronModule.copy(this.lastSelector),t.hide()}}).append($("",{text:M.Collections.settings.developer.copySelector.name}));s.append(n),t.append(s),t.hasClass("undefined")&&t.css("top","-="+s.outerHeight())}),e.stopPropagation()})}disableSelectors(){$(document).off("contextmenu.bdDevmode"),$(document).off("contextmenu.bdDevModeCtx")}getRules(e,t=e.ownerDocument.styleSheets){return[...t].filter(e=>!e.href||!e.href.includes("BetterDiscordApp")).map(e=>[...e.cssRules||[]]).flat().filter(t=>t&&t.selectorText&&e.matches(t.selectorText)&&t.style.length&&t.selectorText.split(", ").length<8&&!t.selectorText.split(", ").includes("*"))}getSelector(e){if(e.id)return`#${e.id}`;const t=this.getRules(e),s=t[t.length-1];return s?s.selectorText:e.classList.length?`.${Array.from(e.classList).join(".")}`:`.${Array.from(e.parentElement.classList).join(".")}`}};class dt extends O.Component{constructor(e){super(e),this.props.server.iconUrl||(this.props.server.iconUrl=this.props.defaultAvatar()),this.state={imageError:!1,joined:this.props.joined},this.join=this.join.bind(this),this.handleError=this.handleError.bind(this)}render(){const{server:e}=this.props,t="string"==typeof this.state.joined?`${M.PublicServers.joining}...`:this.state.joined?M.PublicServers.joined:M.PublicServers.join,s=`bd-button${1==this.state.joined?" bd-button-success":""}`;return O.createElement("div",{className:`bd-server-card${e.pinned?" bd-server-card-pinned":""}`},O.createElement("img",{className:"bd-server-image",src:e.iconUrl,onError:this.handleError}),",",O.createElement("div",{className:"bd-server-content"},O.createElement("div",{className:"bd-server-header"},O.createElement("h5",{className:"bd-server-name"},e.name),O.createElement("h5",{className:"bd-server-member-count"},e.members," Members")),O.createElement("div",{className:"bd-scroller-wrap bd-server-description-container"},O.createElement("div",{className:"bd-scroller bd-server-description"},e.description)),O.createElement("div",{className:"bd-server-footer"},O.createElement("div",{className:"bd-server-tags"},e.categories.join(", ")),O.createElement("button",{type:"button",className:s,onClick:this.join},t))))}handleError(){this.props.server.iconUrl=this.props.defaultAvatar(),this.setState({imageError:!0})}async join(){if(this.state.joined)return;this.setState({joined:"joining"});const e=await this.props.join(this.props.server.identifier,this.props.server.nativejoin);this.setState({joined:e})}}const ct=u.getByProps("getSortedGuilds"),ht=u.getByProps("getUserAvatarURL","DEFAULT_AVATARS"),ut=u.getByProps("acceptInvite"),pt=s(0).remote.BrowserWindow;class mt{static get endPoint(){return"https://search.discordservers.com"}static get joinEndPoint(){return"https://j.discordservers.com"}static get connectEndPoint(){return"https://auth.discordservers.com/info"}static getDefaultAvatar(){return ht.DEFAULT_AVATARS[Math.floor(5*Math.random())]}static hasJoined(e){return ct.getFlattenedGuildIds().includes(e)}static search({term:e="",category:t="",from:s=0}={}){return new Promise(n=>{const i=[];t&&i.push(`category=${t.replace(/ /g,"%20")}`),e&&i.push(`term=${e.replace(/ /g,"%20")}`),s&&i.push(`from=${s}`);const o=`?${i.join("&")}`;$.ajax({method:"GET",url:`${this.endPoint}${o}`,success:e=>{const t=e.size+e.from;n({servers:e.results,size:e.size,from:e.from,total:e.total,next:t>=e.total?null:t})},error:()=>n(null)})})}static join(e,t=!1){return new Promise(s=>{if(t)return ut.acceptInvite(e),s(!0);$.ajax({method:"GET",url:`${this.joinEndPoint}/${e}`,headers:{Accept:"application/json;","Content-Type":"application/json;","x-discord-token":this._accessToken},crossDomain:!0,xhrFields:{withCredentials:!0},success:()=>s(!0),error:()=>s(!1)})})}static checkConnection(){return new Promise(e=>{try{$.ajax({method:"GET",url:this.connectEndPoint,headers:{Accept:"application/json;","Content-Type":"application/json;"},crossDomain:!0,xhrFields:{withCredentials:!0},success:t=>{this._accessToken=t.access_token,e(t)},error:()=>e(!1)})}catch(t){e(!1)}})}static connect(){return new Promise(e=>{const t=new pt(this.windowOptions),s=`https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=${this.connectEndPoint}`;t.webContents.on("did-navigate",(s,n)=>{n==this.connectEndPoint&&(t.close(),e())}),t.loadURL(s)})}static get windowOptions(){return{width:380,height:450,backgroundColor:"#282b30",show:!0,resizable:!0,maximizable:!1,minimizable:!1,alwaysOnTop:!0,frame:!1,center:!0,webPreferences:{nodeIntegration:!1}}}}const gt=u.getByDisplayName("SettingsView");class ft extends O.Component{get categoryButtons(){return["All","FPS Games","MMO Games","Strategy Games","MOBA Games","RPG Games","Tabletop Games","Sandbox Games","Simulation Games","Music","Community","Language","Programming","Other"]}constructor(e){super(e),this.state={category:"All",query:"",loading:!0,user:null,results:{servers:[],size:0,from:0,total:0,next:null}},this.changeCategory=this.changeCategory.bind(this),this.searchKeyDown=this.searchKeyDown.bind(this),this.connect=this.connect.bind(this),this.loadNextPage=this.loadNextPage.bind(this)}componentDidMount(){this.checkConnection()}async checkConnection(){const e=await mt.checkConnection();if(!e)return this.setState({loading:!0,user:null});this.setState({user:e}),this.search()}async connect(){await mt.connect(),this.checkConnection()}searchKeyDown(e){this.state.loading||13!==e.which||this.search(e.target.value)}async search(e="",t=0){this.setState({query:e,loading:!0});const s=await mt.search({term:e,category:"All"==this.state.category?"":this.state.category,from:t});if(!s)return this.setState({results:{servers:[],size:0,from:0,total:0,next:null}});this.setState({loading:!1,results:s})}async changeCategory(e){this.state.loading||(await new Promise(t=>this.setState({category:e},t)),this.search())}loadNextPage(){this.state.loading||this.search(this.state.query,this.state.results.next)}async join(e,t=!1){return await mt.join(e,t)}get searchBox(){return O.createElement(Ae,{onKeyDown:this.searchKeyDown,placeholder:`${M.PublicServers.search}...`})}get title(){if(!this.state.user)return M.PublicServers.notConnected;if(this.state.loading)return`${M.PublicServers.loading}...`;const e=this.state.results.from+1,t=this.state.results.total,s=this.state.results.next?this.state.results.next:t;let n=M.PublicServers.results.format({start:e,end:s,total:t,category:this.state.category});return this.state.query&&(n+=" "+M.PublicServers.query.format({query:this.state.query})),n}get content(){const e=this.state.user?null:{title:M.PublicServers.connect,onClick:this.connect},t="All"!=this.state.category&&this.state.user?null:this.bdServer,s=this.state.results.servers.map(e=>O.createElement(dt,{key:e.identifier,server:e,joined:mt.hasJoined(e.identifier),defaultAvatar:mt.getDefaultAvatar}));return[O.createElement(ye,{text:this.title,button:e}),t,s,this.state.results.next?this.nextButton:null,this.state.results.servers.length>0&&O.createElement(ye,{text:this.title})]}get nextButton(){return O.createElement("button",{type:"button",className:"bd-button bd-button-next",onClick:this.loadNextPage},this.state.loading?M.PublicServers.loading:M.PublicServers.loadMore)}get connection(){const{user:e}=this.state;return e?O.createElement("div",{id:"bd-connection"},O.createElement("div",{className:"bd-footnote"},M.PublicServers.connection.format(e)),O.createElement("button",{type:"button",className:"bd-button bd-button-reconnect",onClick:this.connect},M.PublicServers.reconnect)):O.createElement("div",{id:"bd-connection"})}get bdServer(){const e={name:"BetterDiscord",online:"7500+",members:"20000+",categories:["community","programming","support"],description:"Official BetterDiscord server for plugins, themes, support, etc",identifier:"86004744966914048",iconUrl:"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp",nativejoin:!0,invite_code:"0Tmfo5ZbORCRqbAd",pinned:!0};return O.createElement(dt,{server:e,pinned:!0,joined:mt.hasJoined(e.identifier),defaultAvatar:mt.getDefaultAvatar})}render(){const e=this.categoryButtons.map(e=>({section:e,label:e,element:()=>this.content}));return O.createElement(gt,{onClose:this.props.close,onSetSection:this.changeCategory,section:this.state.category,sections:[{section:"HEADER",label:M.PublicServers.search},{section:"CUSTOM",element:()=>this.searchBox},{section:"HEADER",label:M.PublicServers.categories},...e,{section:"DIVIDER"},{section:"HEADER",label:O.createElement("a",{href:"https://discordservers.com",target:"_blank"},"DiscordServers.com")},{section:"DIVIDER"},{section:"CUSTOM",element:()=>this.connection}],theme:"dark"})}}const bt=u.getByProps("pushLayer");var yt=new class extends _e{get name(){return"PublicServers"}get category(){return"general"}get id(){return"publicServers"}enabled(){const e=p.GuildClasses.wrapper.split(" ")[0];$(`.${e} .scroller-2FKFPG >:first-child`).after(this.button)}disabled(){$("#bd-pub-li").remove()}openPublicServers(){bt.pushLayer(()=>p.React.createElement(ft,{close:bt.popLayer}))}get button(){return $("
",{class:p.GuildClasses.listItem,id:"bd-pub-li"}).append($("
",{class:"wrapper-25eVIn "+p.GuildClasses.circleButtonMask,text:M.PublicServers.button,id:"bd-pub-button",click:()=>{this.openPublicServers()}}))}},vt=new class extends _e{get name(){return"DarkMode"}get category(){return"appearance"}get id(){return"darkMode"}enabled(){document.getElementById("app-mount").classList.add("bda-dark","bd-dark")}disabled(){document.getElementById("app-mount").classList.remove("bda-dark","bd-dark")}},wt=new class extends _e{get name(){return"MinimalMode"}get category(){return"appearance"}get id(){return"minimalMode"}get hideChannelsID(){return"hideChannels"}get hideChannels(){return this.get(this.hideChannelsID)}constructor(){super(),this.enableHideChannels=this.enableHideChannels.bind(this),this.disableHideChannels=this.disableHideChannels.bind(this)}enabled(){document.body.classList.add("bd-minimal"),this.hideChannels&&this.enableHideChannels(),this.hideChannelCancel=this.registerSetting(this.hideChannelsID,this.enableHideChannels,this.disableHideChannels)}disabled(){document.body.classList.remove("bd-minimal"),this.hideChannels&&this.disableHideChannels(),this.hideChannelCancel&&this.hideChannelCancel()}enableHideChannels(){document.body.classList.add("bd-minimal-chan")}disableHideChannels(){document.body.classList.remove("bd-minimal-chan")}},Ct=new class extends _e{get name(){return"24Hour"}get category(){return"general"}get id(){return"twentyFourHour"}enabled(){this.inject24Hour()}disabled(){this.unpatchAll()}inject24Hour(){const e=new RegExp("([0-9]{1,2}):([0-9]{1,2})\\s(AM|PM)"),t=(t,s,n)=>{const i=n.match(e);if(i&&4===i.length)return"AM"===i[3]?n.replace(i[0],`${"12"===i[1]?"00":i[1].padStart(2,"0")}:${i[2]}`):n.replace(i[0],`${"12"===i[1]?"12":parseInt(i[1])+12}:${i[2]}`)};this.after(p.TimeFormatter,"calendarFormat",t),this.after(p.TimeFormatter,"dateFormat",t)}};const St=u.getModule(e=>e.defaultProps&&e.defaultProps.hasOwnProperty("disableButtons"));var Et=new class extends _e{get name(){return"ColoredText"}get category(){return"appearance"}get id(){return"coloredText"}enabled(){this.injectColoredText()}disabled(){this.unpatchAll()}injectColoredText(){this.after(St.prototype,"render",(e,t,s)=>{this.after(s.props,"children",{silent:!0,after:({returnValue:t})=>{const s=t.props.children[1],n=e.props.message.colorString;s&&n&&(s.props.style={color:n})}})})}removeColoredText(){document.querySelectorAll(".markup-2BOw-j").forEach(e=>{e.style.setProperty("color","")})}},Pt=new class extends _e{get name(){return"VoiceDisconnect"}get category(){return"general"}get id(){return"voiceDisconnect"}constructor(){super(),this.beforeUnload=this.beforeUnload.bind(this)}enabled(){window.addEventListener("beforeunload",this.beforeUnload)}disabled(){window.removeEventListener("beforeunload",this.beforeUnload)}beforeUnload(){p.ChannelActions.selectVoiceChannel(null,null)}};const xt=(e,t,s={})=>{const{onContextMenu:n,onClick:i}=s,o=c.parseHTML(`
\n ${e}\n
`);return n&&o.addEventListener("contextmenu",n),o.addEventListener("click",i),o};var kt=new class extends _e{get name(){return"EmoteMenu"}get collection(){return"emotes"}get category(){return"general"}get id(){return"emoteMenu"}get hideEmojisID(){return"hideEmojiMenu"}get hideEmojis(){return this.get(this.hideEmojisID)}constructor(){super(),this.lastTab="bd-qem-emojis",this.qmeHeader=c.parseHTML('
\n \n \n
');for(const e of this.qmeHeader.getElementsByTagName("button"))e.addEventListener("click",this.switchMenu.bind(this));this.teContainer=c.parseHTML('
\n
\n
\n
\n\n
\n
\n
\n
'),this.teContainerInner=this.teContainer.querySelector(".emote-menu-inner"),this.faContainer=c.parseHTML('
\n
\n
\n
\n\n
\n
\n
\n
'),this.faContainerInner=this.faContainer.querySelector(".emote-menu-inner"),this.observer=new MutationObserver(e=>{for(const t of e)this.observe(t)}),this.enableHideEmojis=this.enableHideEmojis.bind(this),this.disableHideEmojis=this.disableHideEmojis.bind(this),this.updateTwitchEmotes=this.updateTwitchEmotes.bind(this)}async enabled(){this.log("Starting to observe"),this.observer.observe(document.getElementById("app-mount"),{childList:!0,subtree:!0}),this.hideEmojiCancel=this.registerSetting(this.hideEmojisID,this.enableHideEmojis,this.disableHideEmojis),this.hideEmojis&&this.enableHideEmojis(),Ye.emotesLoaded&&this.updateTwitchEmotes(),this.updateFavorites(),g.on("emotes-loaded",this.updateTwitchEmotes)}disabled(){g.off("emotes-loaded",this.updateTwitchEmotes),this.observer.disconnect(),this.disableHideEmojis(),this.hideEmojiCancel&&this.hideEmojiCancel()}enableHideEmojis(){const e=document.querySelector(".emojiPicker-3m1S-j");e&&e.classList.add("bd-qme-hidden")}disableHideEmojis(){const e=document.querySelector(".emojiPicker-3m1S-j");e&&e.classList.remove("bd-qme-hidden")}insertEmote(e){const t=c.getTextArea();c.insertText(t[0]," "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)}favContext(e){e.stopPropagation();const t=e.target.closest(".emote-container").children[0],s=$('
Remove
');s.css({top:e.pageY-$("#bd-qem-favourite-container").offset().top,left:e.pageX-$("#bd-qem-favourite-container").offset().left}),$(t).parent().append(s),s.on("click",e=>{e.preventDefault(),e.stopPropagation(),$(t).remove(),Ye.removeFavorite($(t).attr("title")),this.updateFavorites(),$(document).off("mousedown.emotemenu")}),$(document).on("mousedown.emotemenu",function(e){"removemenu"!=e.target.id&&($("#removemenu").remove(),$(document).off("mousedown.emotemenu"))})}switchMenu(e){let t="string"==typeof e?e:e.target.id;"bd-qem-emojis"==t&&this.hideEmojis&&(t="bd-qem-favourite");const s=$("#bd-qem-twitch"),n=$("#bd-qem-favourite"),i=$("#bd-qem-emojis");switch(s.removeClass("active"),n.removeClass("active"),i.removeClass("active"),$(".emojiPicker-3m1S-j").hide(),$("#bd-qem-favourite-container").hide(),$("#bd-qem-twitch-container").hide(),t){case"bd-qem-twitch":s.addClass("active"),$("#bd-qem-twitch-container").show();break;case"bd-qem-favourite":n.addClass("active"),$("#bd-qem-favourite-container").show();break;case"bd-qem-emojis":i.addClass("active"),$(".emojiPicker-3m1S-j").show(),$(".emojiPicker-3m1S-j input").focus()}t&&(this.lastTab=t)}observe(e){if(!(e.addedNodes.length&&e.addedNodes[0]instanceof Element))return;const t=e.addedNodes[0];if(!t.classList.contains("popout-3sVMXz")||t.classList.contains("popoutLeft-30WmrD")||!t.getElementsByClassName("emojiPicker-3m1S-j").length)return;const s=$(t);this.hideEmojis?s.addClass("bd-qme-hidden"):s.removeClass("bd-qme-hidden"),s.prepend(this.qmeHeader),s.append(this.teContainer),s.append(this.faContainer),this.switchMenu(this.lastTab)}updateTwitchEmotes(){for(;this.teContainerInner.firstChild;)this.teContainerInner.firstChild.remove();for(const e in Ye.getCategory("TwitchGlobal")){if(!Ye.getCategory("TwitchGlobal").hasOwnProperty(e))continue;const t=Ye.getUrl("TwitchGlobal",e),s=xt(e,t,{onClick:this.insertEmote.bind(this,e)});this.teContainerInner.append(s)}}updateFavorites(){for(;this.faContainerInner.firstChild;)this.faContainerInner.firstChild.remove();for(const e in Ye.favorites){const t=Ye.favorites[e],s=xt(e,t,{onClick:this.insertEmote.bind(this,e),onContextMenu:this.favContext.bind(this)});this.faContainerInner.append(s)}Ye.saveFavorites()}},Mt=new class extends _e{get name(){return"EmoteAutocapitalize"}get collection(){return"emotes"}get category(){return"general"}get id(){return"autoCaps"}enabled(){$("body").off(".bdac"),$("body").on("keyup.bdac change.bdac paste.bdac",$(".channelTextArea-1LDbYG textarea:first"),()=>{const e=$(".channelTextArea-1LDbYG textarea:first").val();if(null==e)return;const t=e.split(" ").pop();if(t.length>3){if("danSgame"==t)return;const s=this.capitalize(t.toLowerCase());null!=s&&c.insertText(c.getTextArea()[0],e.replace(t,s))}})}disabled(){$("body").off(".bdac")}capitalize(e){const t=Ye.getCategory("TwitchGlobal");for(const s in t)if(t.hasOwnProperty(s)&&e==(s+"").toLowerCase())return s}};const At=s(1),Dt=s(2);var Nt=new class extends _e{get name(){return"WindowPrefs"}get category(){return"window"}get id(){return"transparency"}get WindowConfigFile(){if(this._windowConfigFile)return this._windowConfigFile;const e=s(0).remote.app,t=e.getAppPath(),n=e.getPath("userData"),i=Dt.resolve(n,e.getVersion(),"modules","discord_desktop_core","injector","config.json"),o=Dt.resolve(t,"..","app","config.json"),r=At.existsSync(o)?o:At.existsSync(i)?i:null;return this._windowConfigFile=r||null}enabled(){this.setWindowPreference("transparent",!0),this.setWindowPreference("backgroundColor",null)}disabled(){this.setWindowPreference("transparent",!1),this.setWindowPreference("backgroundColor","#2f3136")}getAllWindowPreferences(){return this.WindowConfigFile?require(this.WindowConfigFile):{}}getWindowPreference(e){if(this.WindowConfigFile)return this.getAllWindowPreferences()[e]}setWindowPreference(e,t){if(!this.WindowConfigFile)return;const n=this.getAllWindowPreferences();n[e]=t,delete s.c[this.WindowConfigFile],At.writeFileSync(this.WindowConfigFile,JSON.stringify(n,null,4))}};class Ft extends O.Component{render(){return O.createElement("svg",{className:"bd-logo "+this.props.className,height:"100%",width:this.props.size||"16px",viewBox:"0 0 2000 2000",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}},O.createElement("metadata",null),O.createElement("defs",null,O.createElement("filter",{id:"shadow1"},O.createElement("feDropShadow",{dx:"20",dy:"0",stdDeviation:"20",floodColor:"rgba(0,0,0,0.35)"})),O.createElement("filter",{id:"shadow2"},O.createElement("feDropShadow",{dx:"15",dy:"0",stdDeviation:"20",floodColor:"rgba(255,255,255,0.15)"})),O.createElement("filter",{id:"shadow3"},O.createElement("feDropShadow",{dx:"10",dy:"0",stdDeviation:"20",floodColor:"rgba(0,0,0,0.35)"}))),O.createElement("g",null,O.createElement("path",{style:{filter:"url(#shadow3)"},fill:"#171717",opacity:"1",d:"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z"}),O.createElement("path",{style:{filter:"url(#shadow2)"},fill:"#3E82E5",opacity:"1",d:"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z"}),O.createElement("path",{style:{filter:"url(#shadow1)"},fill:"#FFFFFF",opacity:"1",d:"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z"})))}}var Tt=new class{initialize(){c.suppressErrors(this.patchSocial.bind(this),"BD Social Patch")(),c.suppressErrors(this.patchGuildPills.bind(this),"BD Guild Pills Patch")(),c.suppressErrors(this.patchGuildListItems.bind(this),"BD Guild List Items Patch")(),c.suppressErrors(this.patchGuildSeparator.bind(this),"BD Guild Separator Patch")()}patchSocial(){if(this.socialPatch)return;const e=u.getByDisplayName("TabBar"),t=u.getByDisplayName("Anchor");e&&t&&(this.socialPatch=F.after("ThemeHelper",e.prototype,"render",(e,s,n)=>{const i=n.props.children;if(!i||!i.length)return;if("Separator"!==i[i.length-2].type.displayName)return;if(!i[i.length-1].type.toString().includes("socialLinks"))return;const o=i[i.length-1].type;i[i.length-1].type=function(){const e=o(...arguments);return e.props.children.push(p.React.createElement(t,{className:"bd-social-link",href:"https://github.com/rauenzi/BetterDiscordApp",rel:"author",title:"BandagedBD",target:"_blank"},p.React.createElement(Ft,{size:"16px",className:"bd-social-logo"}))),e}}))}patchGuildListItems(){if(this.guildListItemsPatch)return;const e=p.GuildClasses.listItem.split(" ")[0],t=p.GuildClasses.blobContainer.split(" ")[0],s=c.getReactInstance(document.querySelector(`.${e} .${t}`).parentElement).return.type;s&&(this.guildListItemsPatch=F.after("ThemeHelper",s.prototype,"render",(e,t,s)=>{const n=e.props;return s.props.className+=" bd-guild",n.unread&&(s.props.className+=" bd-unread"),n.selected&&(s.props.className+=" bd-selected"),n.audio&&(s.props.className+=" bd-audio"),n.video&&(s.props.className+=" bd-video"),n.badge&&(s.props.className+=" bd-badge"),n.animatable&&(s.props.className+=" bd-animatable"),s}))}patchGuildPills(){if(this.guildPillPatch)return;const e=u.getModule(e=>e.default&&!e.default.displayName&&e.default.toString&&e.default.toString().includes("translate3d"));e&&(this.guildPillPatch=F.after("ThemeHelper",e,"default",(e,t,s)=>{const n=t[0];return n.unread&&(s.props.className+=" bd-unread"),n.selected&&(s.props.className+=" bd-selected"),n.hovered&&(s.props.className+=" bd-hovered"),s}))}patchGuildSeparator(){if(this.guildSeparatorPatch)return;const e=u.getByDisplayName("Guilds"),t=u.getByProps("renderListItem");if(!t||!e)return;const s=function(){const e=t.Separator(...arguments);return e.props.className+=" bd-guild-separator",e};this.guildSeparatorPatch=F.after("ThemeHelper",e.prototype,"render",(e,t,n)=>{const i=c.findInReactTree(n,e=>e.type&&!e.type.displayName&&"function"==typeof e.type&&c.isEmpty(e.props));i&&(i.type=s)})}};const Bt=p.GuildClasses;function Lt(){}Lt.prototype.setConfig=function(e){Object.assign(i,e)},Lt.prototype.init=async function(){if(i.version
Please download the latest version from GitHub");v.initialize(),await P.initialize(),d.log("Startup","Initializing Settings"),A.initialize(),x.initialize(),await this.waitForGuilds(),z.initialize(),Tt.initialize();for(const e in n)n[e].initialize();d.log("Startup","Loading Plugins");const e=Oe.initialize();d.log("Startup","Loading Themes");const t=Ie.initialize();d.log("Startup","Removing Loading Icon"),document.getElementsByClassName("bd-loaderv2")[0].remove(),d.log("Startup","Collecting Startup Errors"),te.showAddonErrors({plugins:e,themes:t})},Lt.prototype.waitForGuilds=function(){return new Promise(e=>{const t=function(){"complete"!=document.readyState&&setTimeout(t,100);const s=Bt.wrapper.split(" ")[0],n=Bt.listItem.split(" ")[0],o=Bt.blobContainer.split(" ")[0];if(document.querySelectorAll(`.${s} .${n} .${o}`).length>0)return e(i.deferLoaded=!0);setTimeout(t,100)};t()})};var jt=new Lt;const $t={get React(){return p.React},get ReactDOM(){return p.ReactDOM},get WindowConfigFile(){if(this._windowConfigFile)return this._windowConfigFile;const e=s(0).remote.app,t=s(2),n=e.getAppPath(),i=e.getPath("userData"),o=t.resolve(i,e.getVersion(),"modules","discord_desktop_core","injector","config.json"),r=t.resolve(n,"..","app","config.json"),a=s(1),l=a.existsSync(r)?r:a.existsSync(o)?o:null;return this._windowConfigFile=l||null},getAllWindowPreferences:function(){return this.WindowConfigFile?require(this.WindowConfigFile):{}},getWindowPreference:function(e){if(this.WindowConfigFile)return this.getAllWindowPreferences()[e]},setWindowPreference:function(e,t){if(!this.WindowConfigFile)return;const n=s(1),i=this.getAllWindowPreferences();i[e]=t,delete s.c[this.WindowConfigFile],n.writeFileSync(this.WindowConfigFile,JSON.stringify(i,null,4))},injectCSS:function(e,t){x.injectStyle(e,t)},clearCSS:function(e){x.removeStyle(e)},linkJS:function(e,t){return x.injectScript(e,t)},unlinkJS:function(e){x.removeScript(e)},alert:function(e,t){te.alert(e,t)},showConfirmationModal:function(e,t,s={}){return te.showConfirmationModal(e,t,s)},showToast:function(e,t={}){_.show(e,t)},findModule:function(e){return u.getModule(e)},findAllModules:function(e){return u.getModule(e,!1)},findModuleByProps:function(...e){return u.getByProps(...e)},findModuleByPrototypes:function(...e){return u.getByPrototypes(...e)},findModuleByDisplayName:function(e){return u.getByDisplayName(e)},getInternalInstance:function(e){if(e instanceof window.jQuery||e instanceof Element)return e instanceof jQuery&&(e=e[0]),c.getReactInstance(e)},loadData:function(e,t){return v.getPluginData(e,t)}};$t.getData=$t.loadData,$t.saveData=function(e,t,s){return v.setPluginData(e,t,s)},$t.setData=$t.saveData,$t.deleteData=function(e,t){return v.deletePluginData(e,t)},$t.monkeyPatch=function(e,t,s){const{before:n,after:i,instead:o,once:r=!1,silent:a=!1,force:l=!1}=s,d=s.displayName||e.displayName||e.name||e.constructor.displayName||e.constructor.name;if(a||console.log("patch",t,"of",d),!e[t]){if(!l)return console.error(t,"does not exist for",d);e[t]=function(){}}const h=e[t],u=()=>{a||console.log("unpatch",t,"of",d),e[t]=h};return e[t]=function(){const s={thisObject:this,methodArguments:arguments,cancelPatch:u,originalMethod:h,callOriginalMethod:()=>s.returnValue=s.originalMethod.apply(s.thisObject,s.methodArguments)};if(o){const n=c.suppressErrors(o,"`instead` callback of "+e[t].displayName)(s);void 0!==n&&(s.returnValue=n)}else n&&c.suppressErrors(n,"`before` callback of "+e[t].displayName)(s),s.callOriginalMethod(),i&&c.suppressErrors(i,"`after` callback of "+e[t].displayName)(s);return r&&u(),s.returnValue},e[t].__monkeyPatched=!0,e[t].__originalMethod||(e[t].__originalMethod=h),e[t].displayName="patched "+(e[t].displayName||t),u},$t.onRemoved=function(e,t){return c.onRemoved(e,t)},$t.suppressErrors=function(e,t){return c.suppressErrors(e,t)},$t.testJSON=function(e){return c.testJSON(e)},$t.getPlugin=function(e){return Oe.addonList.find(t=>t.name==e)},$t.isPluginEnabled=function(e){const t=this.getPlugin(e);return!!t&&Oe.isEnabled(t.id)},$t.isThemeEnabled=function(e){const t=Ie.addonList.find(t=>t.name==e);return!!t&&Ie.isEnabled(t.id)},$t.getBDData=function(e){return v.getBDData(e)},$t.setBDData=function(e,t){return v.setBDData(e,t)};var zt=$t;s.d(t,"default",function(){return Rt});const Ot=document.createElement("div");Ot.className="bd-loaderv2",Ot.title="BandagedBD is loading...",document.body.appendChild(Ot),window.BdApi=zt,window.pluginModule=Oe,window.themeModule=Ie,window.bdEmotes=Ye.Emotes,window.bemotes=Ye.blacklist,window.settingsModule=A,window.DataStore=v,window.DomManager=x,window.utils=c,window.Components=z,window.BDEvents=g,window.bdConfig=i,window.Strings=M;class Rt{constructor(e){jt.setConfig(e)}init(){jt.init()}}!function(){const e=s(4),t=e._load;e._load=function(e){return"betterdiscord"!==e&&!e.startsWith("betterdiscord/")||"api"!=e.substr("betterdiscord/".length)?t.apply(this,arguments):zt}}()}]).default; \ No newline at end of file +var Core=function(e){var t={};function s(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=6)}([function(e,t){e.exports=require("electron")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("request")},function(e,t){e.exports=require("module")},function(e,t){e.exports=require("events")},function(e,t,s){"use strict";s.r(t);var n={};s.r(n),s.d(n,"EmoteModule",(function(){return Ie})),s.d(n,"CustomCSS",(function(){return Je})),s.d(n,"VoiceMode",(function(){return Ze})),s.d(n,"ClassNormalizer",(function(){return Ye})),s.d(n,"DeveloperMode",(function(){return Qe})),s.d(n,"PublicServers",(function(){return lt})),s.d(n,"DarkMode",(function(){return dt})),s.d(n,"MinimalMode",(function(){return ct})),s.d(n,"TwentyFourHour",(function(){return ht})),s.d(n,"ColoredText",(function(){return pt})),s.d(n,"VoiceDisconnect",(function(){return mt})),s.d(n,"EmoteMenu",(function(){return ft})),s.d(n,"EmoteAutocaps",(function(){return bt})),s.d(n,"WindowPrefs",(function(){return wt}));var i={local:!1,localServer:"//localhost:8080",minified:!0,version:"0.3.0",branch:"master",repo:"rauenzi",minSupportedVersion:"0.3.0",bbdVersion:"1.0.0"},o=[{type:"category",id:"general",name:"General",collapsible:!0,settings:[{type:"switch",id:"download",value:!0},{type:"switch",id:"emoteMenu",value:!0},{type:"switch",id:"hideEmojiMenu",value:!1,enableWith:"emoteMenu"},{type:"switch",id:"autoCaps",value:!1},{type:"switch",id:"showNames",value:!0},{type:"switch",id:"modifiers",value:!0},{type:"switch",id:"animateOnHover",value:!1}]},{type:"category",id:"categories",name:"Categories",collapsible:!0,settings:[{type:"switch",id:"twitchglobal",value:!0},{type:"switch",id:"twitchsubscriber",value:!1},{type:"switch",id:"frankerfacez",value:!0},{type:"switch",id:"bttv",value:!0}]}],r=[{type:"category",id:"general",collapsible:!0,settings:[{type:"switch",id:"emotes",value:!0},{type:"switch",id:"publicServers",value:!0},{type:"switch",id:"voiceDisconnect",value:!1},{type:"switch",id:"twentyFourHour",value:!1},{type:"switch",id:"classNormalizer",value:!0},{type:"switch",id:"showToasts",value:!0}]},{type:"category",id:"appearance",collapsible:!0,settings:[{type:"switch",id:"voiceMode",value:!1},{type:"switch",id:"minimalMode",value:!1},{type:"switch",id:"hideChannels",value:!1,enableWith:"minimalMode"},{type:"switch",id:"darkMode",value:!0},{type:"switch",id:"coloredText",value:!1}]},{type:"category",id:"addons",collapsible:!0,shown:!1,settings:[{type:"switch",id:"addonErrors",value:!0},{type:"switch",id:"autoScroll",value:!0},{type:"switch",id:"autoReload",value:!0},{type:"dropdown",id:"editAction",value:"detached",options:[{value:"detached"},{value:"system"}]}]},{type:"category",id:"customcss",collapsible:!0,shown:!1,settings:[{type:"switch",id:"customcss",value:!0},{type:"switch",id:"liveUpdate",value:!1},{type:"dropdown",id:"openAction",value:"settings",options:[{value:"settings"},{value:"detached"},{value:"system"}]}]},{type:"category",id:"developer",collapsible:!0,shown:!1,settings:[{type:"switch",id:"developerMode",value:!1},{type:"switch",id:"copySelector",value:!1,enableWith:"developerMode"}]},{type:"category",id:"window",collapsible:!0,shown:!1,settings:[{type:"switch",id:"transparency",value:!1},{type:"switch",id:"frame",value:!1,hidden:!0}]}],a={Panels:{plugins:"Plugins",themes:"Themes",customcss:"Custom CSS"},Collections:{settings:{name:"Settings",general:{name:"General",emotes:{name:"Emote System",note:"Enables BD's emote system"},publicServers:{name:"Public Servers",note:"Display public servers button"},voiceDisconnect:{name:"Voice Disconnect",note:"Disconnect from voice server when closing Discord"},twentyFourHour:{name:"24-Hour Timestamps",note:"Hides channels when in minimal mode"},classNormalizer:{name:"Normalize Classes",note:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)"},showToasts:{name:"Show Toasts",note:"Shows a small notification for important information"}},appearance:{name:"Appearance",voiceMode:{name:"Voice Mode",note:"Hides everything that isn't voice chat"},minimalMode:{name:"Minimal Mode",note:"Hide elements and reduce the size of elements"},hideChannels:{name:"Hide Channels",note:"Hides channels when in minimal mode"},darkMode:{name:"Dark Mode",note:"Make certain elements dark by default"},coloredText:{name:"Colored Text",note:"Make text colour the same as role color"}},addons:{name:"Addon Manager",addonErrors:{name:"Show Addon Errors",note:"Shows a modal with plugin/theme errors"},autoScroll:{name:"Scroll To Settings",note:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)"},autoReload:{name:"Automatic Loading",note:"Automatically loads, reloads, and unloads plugins and themes"},editAction:{name:"Edit Action",note:"Where plugins & themes appear when editing",options:{detached:"Detached Window",system:"System Editor"}}},customcss:{name:"Custom CSS",customcss:{name:"Custom CSS",note:"Enables the Custom CSS tab"},liveUpdate:{name:"Live Update",note:"Updates the css as you type"},startDetached:{name:"Start Detached",note:"Clicking the Custom CSS tab opens the editor in a separate window"},nativeOpen:{name:"Open in Native Editor",note:"Clicking the Custom CSS tab opens your custom css in your native editor"},openAction:{name:"Editor Location",note:"Where Custom CSS should open by default",options:{settings:"Settings Menu",detached:"Detached Window",system:"System Editor"}}},developer:{name:"Developer Settings",developerMode:{name:"Developer Mode",note:"Allows activating debugger when pressing F8"},copySelector:{name:"Copy Selector",note:'Adds a "Copy Selector" option to context menus when developer mode is active'}},window:{name:"Window Preferences",transparency:{name:"Enable Transparency",note:"Enables the main window to be see-through (requires restart)"},frame:{name:"Window Frame",note:"Adds the native os window frame to the main window"}}},emotes:{name:"Emotes",general:{name:"General",download:{name:"Download Emotes",note:"Download emotes whenever they are out of date"},emoteMenu:{name:"Emote Menu",note:"Show Twitch/Favourite emotes in emote menu"},hideEmojiMenu:{name:"Hide Emoji Menu",note:"Hides Discord's emoji menu when using emote menu"},autoCaps:{name:"Emote Autocapitalization",note:"Autocapitalize emote commands"},showNames:{name:"Show Names",note:"Show emote names on hover"},modifiers:{name:"Show Emote Modifiers",note:"Enable emote mods (flip, spin, pulse, spin2, spin3, 1spin, 2spin, 3spin, tr, bl, br, shake, shake2, shake3, flap)"},animateOnHover:{name:"Animate On Hover",note:"Only animate the emote modifiers on hover"}},categories:{name:"Categories",twitchglobal:{name:"Twitch Globals",note:"Show Twitch global emotes"},twitchsubscriber:{name:"Twitch Subscribers",note:"Show Twitch subscriber emotes"},frankerfacez:{name:"FrankerFaceZ",note:"Show emotes from FFZ"},bttv:{name:"BetterTTV",note:"Show emotes from BTTV"}}}},Addons:{title:"{{name}} v{{version}} by {{author}}",openFolder:"Open {{type}} Folder",reload:"Reload",addonSettings:"Settings",website:"Website",source:"Source",server:"Support Server",donate:"Donate",name:"Name",author:"Author",version:"Version",added:"Date Added",modified:"Date Modified",search:"Search {{type}}",editAddon:"Edit",deleteAddon:"Delete",confirmDelete:"Are you sure you want to delete {{name}}?",confirmationText:"You have unsaved changes to {{name}}. Closing this window will lose all those changes."},Emotes:{loading:"Loading emotes in the background do not reload.",loaded:"All emotes successfully loaded.",clearEmotes:"Clear Emote Data",favoriteAction:"Favorite!"},CustomCSS:{confirmationText:"You have unsaved changes to your Custom CSS. Closing this window will lose all those changes.",update:"Update",save:"Save",openNative:"Open in System Editor",openDetached:"Detach Window",settings:"Editor Settings",editorTitle:"Custom CSS Editor"},PublicServers:{button:"public",join:"Join",joining:"Joining",joined:"Joined",loading:"Loading",loadMore:"Load More",notConnected:"Not connected to DiscordServers.com!",search:"Search",connect:"Connect",reconnect:"Reconnect",categories:"Categories",connection:"Connected as: {{username}}#{{discriminator}}",results:"Showing {{start}}-{{end}} of {{total}} results in {{category}}",query:"for {{query}}"},Modals:{confirmAction:"Are You Sure?",okay:"Okay",cancel:"Cancel",close:"Close",name:"Name",message:"Message",error:"Error",addonErrors:"Addon Errors"},Sorting:{sortBy:"Sort By",order:"Order",ascending:"Ascending",descending:"Descending"}};const l={err:"error",error:"error",dbg:"debug",debug:"debug",log:"log",warn:"warn",info:"info"};class d{static stacktrace(e,t,s){console.error(`%c[${e}]%c ${t}\n\n%c`,"color: #3a71c1; font-weight: 700;","color: red; font-weight: 700;","color: red;",s)}static err(e,...t){d._log(e,t,"error")}static warn(e,...t){d._log(e,t,"warn")}static info(e,...t){d._log(e,t,"info")}static debug(e,...t){d._log(e,t,"debug")}static log(e,...t){d._log(e,t)}static _log(e,t,s="log"){s=d.parseType(s),Array.isArray(t)||(t=[t]),console[s](`%c[BandagedBD]%c [${e}]%c`,"color: #3E82E5; font-weight: 700;","color: #3a71c1;","",...t)}static parseType(e){return l.hasOwnProperty(e)?l[e]:"log"}}class c{static repoUrl(e){return`https://cdn.staticaly.com/gh/${i.repo}/BetterDiscordApp/${i.hash}/${e}`}static parseHTML(e,t=!1){const s=document.createElement("template");s.innerHTML=e;const n=s.content.cloneNode(!0);return t?n:n.childNodes.length>1?n.childNodes:n.childNodes[0]}static getTextArea(){return $(".channelTextArea-1LDbYG textarea")}static insertText(e,t){e.focus(),e.selectionStart=0,e.selectionEnd=e.value.length,document.execCommand("insertText",!1,t)}static escape(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}static testJSON(e){try{return JSON.parse(e)}catch(e){return!1}}static suppressErrors(e,t){return(...s)=>{try{return e(...s)}catch(e){d.stacktrace("SuppressedError","Error occurred in "+t,e)}}}static onRemoved(e,t){const s=new MutationObserver(n=>{for(let i=0;i-1,l=r.some(t=>t.contains(e));(a||l)&&(s.disconnect(),t())}});s.observe(document.body,{subtree:!0,childList:!0})}static isEmpty(e){if(null==e||null==e||""==e)return!0;if("object"!=typeof e)return!1;if(Array.isArray(e))return 0==e.length;for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}static memoizeObject(e){const t=new Proxy(e,{get:function(e,t){if(e.hasOwnProperty(t)){if(Object.getOwnPropertyDescriptor(e,t).get){const s=e[t];delete e[t],e[t]=s}return e[t]}},set:function(e,t,s){return e.hasOwnProperty(t)?d.error("MemoizedObject","Trying to overwrite existing property"):(e[t]=s,e[t])}});return Object.defineProperty(t,"hasOwnProperty",{value:function(e){return void 0!==this[e]}}),t}static extend(e,...t){for(let s=0;se.startsWith("__reactInternalInstance"))]||null}static getOwnerInstance(e,{include:t,exclude:s=["Popout","Tooltip","Scroller","BackgroundFlash"],filter:n=(e=>e)}={}){if(void 0===e)return;const i=void 0===t,o=i?s:t;function r(e){const t=function(e){const t=e.type;return t&&(t.displayName||t.name)||null}(e);return null!==t&&!!(o.includes(t)^i)}let a=this.getReactInstance(e);for(a=a&&a.return;null!==a;a=a.return){if(null===a)continue;const e=a.stateNode;if(null!==a&&!(e instanceof HTMLElement)&&r(a)&&n(e))return e}return null}}class h{static byProperties(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&e.every(e=>void 0!==n[e])}}static byPrototypeFields(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&(!!n.prototype&&e.every(e=>void 0!==n.prototype[e]))}}static byCode(e,t=(e=>e)){return s=>{const n=t(s);return!!n&&-1!==n.toString([]).search(e)}}static byString(...e){return t=>{const s=t.toString([]);for(const t of e)if(!s.includes(t))return!1;return!0}}static byDisplayName(e){return t=>t&&t.displayName===e}static combine(...e){return t=>e.every(e=>e(t))}}class u{static find(e,t=!0){return this.getModule(e,t)}static findAll(e){return this.getModule(e,!1)}static findByUniqueProperties(e,t=!0){return t?this.getByProps(...e):this.getAllByProps(...e)}static findByDisplayName(e){return this.getByDisplayName(e)}static getModule(e,t=!0){const s=this.getAllModules(),n=[];for(const i in s){if(!s.hasOwnProperty(i))continue;const o=s[i],{exports:r}=o;let a=null;if(r&&(r.__esModule&&r.default&&e(r.default)&&(a=r.default),e(r)&&(a=r),a)){if(t)return a;n.push(a)}}return t||0==n.length?void 0:n}static getModules(e){return this.getModule(e,!1)}static getByDisplayName(e){return this.getModule(h.byDisplayName(e),!0)}static getByRegex(e,t=!0){return this.getModule(h.byCode(e),t)}static getByPrototypes(...e){return this.getModule(h.byPrototypeFields(e),!0)}static getAllByPrototypes(...e){return this.getModule(h.byPrototypeFields(e),!1)}static getByProps(...e){return this.getModule(h.byProperties(e),!0)}static getAllByProps(...e){return this.getModule(h.byProperties(e),!1)}static getByString(...e){return this.getModule(h.byString(...e),!0)}static getAllByString(...e){return this.getModule(h.byString(...e),!1)}static get require(){if(this._require)return this._require;const e="bbd-webpackmodules",t="function"==typeof window.webpackJsonp?window.webpackJsonp([],{[e]:(e,t,s)=>t.default=s},[e]).default:window.webpackJsonp.push([[],{[e]:(e,t,s)=>e.exports=s},[[e]]]);return delete t.m[e],delete t.c[e],this._require=t}static getAllModules(){return this.require.c}}var p=c.memoizeObject({get React(){return u.getByProps("createElement","cloneElement")},get ReactDOM(){return u.getByProps("render","findDOMNode")},get Flux(){return u.getByProps("connectStores")},get Events(){return u.getByPrototypes("setMaxListeners","emit")},get GuildStore(){return u.getByProps("getGuild")},get SortedGuildStore(){return u.getByProps("getSortedGuilds")},get SelectedGuildStore(){return u.getByProps("getLastSelectedGuildId")},get GuildSync(){return u.getByProps("getSyncedGuilds")},get GuildInfo(){return u.getByProps("getAcronym")},get GuildChannelsStore(){return u.getByProps("getChannels","getDefaultChannel")},get GuildMemberStore(){return u.getByProps("getMember")},get MemberCountStore(){return u.getByProps("getMemberCounts")},get GuildEmojiStore(){return u.getByProps("getEmojis")},get GuildActions(){return u.getByProps("markGuildAsRead")},get GuildPermissions(){return u.getByProps("getGuildPermissions")},get ChannelStore(){return u.getByProps("getChannels","getDMFromUserId")},get SelectedChannelStore(){return u.getByProps("getLastSelectedChannelId")},get ChannelActions(){return u.getByProps("selectChannel")},get PrivateChannelActions(){return u.getByProps("openPrivateChannel")},get ChannelSelector(){return u.getByProps("selectGuild","selectChannel")},get UserInfoStore(){return u.getByProps("getToken")},get UserSettingsStore(){return u.getByProps("guildPositions")},get AccountManager(){return u.getByProps("register","login")},get UserSettingsUpdater(){return u.getByProps("updateRemoteSettings")},get OnlineWatcher(){return u.getByProps("isOnline")},get CurrentUserIdle(){return u.getByProps("getIdleTime")},get RelationshipStore(){return u.getByProps("isBlocked","getFriendIDs")},get RelationshipManager(){return u.getByProps("addRelationship")},get MentionStore(){return u.getByProps("getMentions")},get UserStore(){return u.getByProps("getCurrentUser")},get UserStatusStore(){return u.getByProps("getStatus","getState")},get UserTypingStore(){return u.getByProps("isTyping")},get UserActivityStore(){return u.getByProps("getActivity")},get UserNameResolver(){return u.getByProps("getName")},get UserNoteStore(){return u.getByProps("getNote")},get UserNoteActions(){return u.getByProps("updateNote")},get EmojiInfo(){return u.getByProps("isEmojiDisabled")},get EmojiUtils(){return u.getByProps("getGuildEmoji")},get EmojiStore(){return u.getByProps("getByCategory","EMOJI_NAME_RE")},get InviteStore(){return u.getByProps("getInvites")},get InviteResolver(){return u.getByProps("findInvite")},get InviteActions(){return u.getByProps("acceptInvite")},get DiscordConstants(){return u.getByProps("Permissions","ActivityTypes","StatusTypes")},get DiscordPermissions(){return u.getByProps("Permissions","ActivityTypes","StatusTypes").Permissions},get PermissionUtils(){return u.getByProps("getHighestRole")},get ColorConverter(){return u.getByProps("hex2int")},get ColorShader(){return u.getByProps("darken")},get TinyColor(){return u.getByPrototypes("toRgb")},get ClassResolver(){return u.getByProps("getClass")},get ButtonData(){return u.getByProps("ButtonSizes")},get IconNames(){return u.getByProps("IconNames")},get NavigationUtils(){return u.getByProps("transitionTo","replaceWith","getHistory")},get MessageStore(){return u.getByProps("getMessages")},get MessageActions(){return u.getByProps("jumpToMessage","_sendMessage")},get MessageQueue(){return u.getByProps("enqueue")},get MessageParser(){return u.getByProps("createMessage","parse","unparse")},get hljs(){return u.getByProps("highlight","highlightBlock")},get SimpleMarkdown(){return u.getByProps("parseBlock","parseInline","defaultOutput")},get ExperimentStore(){return u.getByProps("getExperimentOverrides")},get ExperimentsManager(){return u.getByProps("isDeveloper")},get CurrentExperiment(){return u.getByProps("getExperimentId")},get ImageResolver(){return u.getByProps("getUserAvatarURL","getGuildIconURL")},get ImageUtils(){return u.getByProps("getSizedImageSrc")},get AvatarDefaults(){return u.getByProps("getUserAvatarURL","DEFAULT_AVATARS")},get WindowInfo(){return u.getByProps("isFocused","windowSize")},get TagInfo(){return u.getByProps("VALID_TAG_NAMES")},get DOMInfo(){return u.getByProps("canUseDOM")},get LocaleManager(){return u.getByProps("setLocale")},get Moment(){return u.getByProps("parseZone")},get LocationManager(){return u.getByProps("createLocation")},get Timestamps(){return u.getByProps("fromTimestamp")},get TimeFormatter(){return u.getByProps("dateFormat")},get Strings(){return u.getByProps("Messages").Messages},get StringFormats(){return u.getByProps("a","z")},get StringUtils(){return u.getByProps("toASCII")},get URLParser(){return u.getByProps("Url","parse")},get ExtraURLs(){return u.getByProps("getArticleURL")},get DNDActions(){return u.getByProps("beginDrag")},get DNDSources(){return u.getByProps("addTarget")},get DNDObjects(){return u.getByProps("DragSource")},get MediaDeviceInfo(){return u.getByProps("Codecs","SUPPORTED_BROWSERS")},get MediaInfo(){return u.getByProps("getOutputVolume")},get MediaEngineInfo(){return u.getByProps("MediaEngineFeatures")},get VoiceInfo(){return u.getByProps("EchoCancellation")},get VideoStream(){return u.getByProps("getVideoStream")},get SoundModule(){return u.getByProps("playSound")},get ElectronModule(){return u.getByProps("setBadge")},get Dispatcher(){return u.getByProps("dirtyDispatch")},get PathUtils(){return u.getByProps("hasBasename")},get NotificationModule(){return u.getByProps("showNotification")},get RouterModule(){return u.getByProps("Router")},get APIModule(){return u.getByProps("getAPIBaseURL")},get AnalyticEvents(){return u.getByProps("AnalyticEventConfigs")},get KeyGenerator(){return u.getByRegex(/"binary"/)},get Buffers(){return u.getByProps("Buffer","kMaxLength")},get DeviceStore(){return u.getByProps("getDevices")},get SoftwareInfo(){return u.getByProps("os")},get CurrentContext(){return u.getByProps("setTagsContext")},get GuildClasses(){const e=u.getByProps("wrapper","unreadMentionsBar"),t=u.getByProps("guildsError","selected"),s=u.getByProps("blobContainer");return Object.assign({},e,t,s)}});const m=s(5);var g=new class extends m{constructor(){super(),this.setMaxListeners(20)}dispatch(e,...t){this.emit(e,...t)}};const f=s(1),b=s(2),y=DiscordNative.globals.releaseChannel;var v=new class{constructor(){this.data={misc:{}},this.pluginData={},this.cacheData={}}initialize(){f.existsSync(this.baseFolder)||f.mkdirSync(this.baseFolder),f.existsSync(this.dataFolder)||f.mkdirSync(this.dataFolder),f.existsSync(this.localeFolder)||f.mkdirSync(this.localeFolder),f.existsSync(this.emoteFolder)||f.mkdirSync(this.emoteFolder),f.existsSync(this.cacheFile)||f.writeFileSync(this.cacheFile,JSON.stringify({})),f.existsSync(this.customCSS)||f.writeFileSync(this.customCSS,"");const e=f.readdirSync(this.dataFolder).filter(e=>!f.statSync(b.resolve(this.dataFolder,e)).isDirectory()&&e.endsWith(".json"));for(const t of e)this.data[t.split(".")[0]]=require(b.resolve(this.dataFolder,t));this.cacheData=c.testJSON(f.readFileSync(this.cacheFile).toString())||{}}get customCSS(){return this._customCSS||(this._customCSS=b.resolve(this.dataFolder,"custom.css"))}get baseFolder(){return this._baseFolder||(this._baseFolder=b.resolve(i.dataPath,"data"))}get dataFolder(){return this._dataFolder||(this._dataFolder=b.resolve(this.baseFolder,`${y}`))}get localeFolder(){return this._localeFolder||(this._localeFolder=b.resolve(this.baseFolder,"locales"))}get emoteFolder(){return this._emoteFolder||(this._emoteFolder=b.resolve(this.baseFolder,"emotes"))}get cacheFile(){return this._cacheFile||(this._cacheFile=b.resolve(this.baseFolder,".cache"))}getPluginFile(e){return b.resolve(i.dataPath,"plugins",e+".config.json")}_getFile(e){return"settings"==e||"plugins"==e||"themes"==e?b.resolve(this.dataFolder,`${e}.json`):b.resolve(this.dataFolder,"misc.json")}getBDData(e){return this.data.misc[e]||""}setBDData(e,t){this.data.misc[e]=t,f.writeFileSync(b.resolve(this.dataFolder,"misc.json"),JSON.stringify(this.data.misc,null,4))}getLocale(e){const t=b.resolve(this.localeFolder,`${e}.json`);return f.existsSync(t)?c.testJSON(f.readFileSync(t).toString()):null}saveLocale(e,t){f.writeFileSync(b.resolve(this.localeFolder,`${e}.json`),JSON.stringify(t,null,4))}getCacheHash(e,t){return this.cacheData[e]&&f.existsSync(b.resolve(this.baseFolder,e,`${t}.json`))&&this.cacheData[e][t]||""}setCacheHash(e,t,s){this.cacheData[e]||(this.cacheData[e]={}),this.cacheData[e][t]=s,f.writeFileSync(this.cacheFile,JSON.stringify(this.cacheData))}invalidateCache(e,t){this.cacheData[e]&&(delete this.cacheData[e][t],f.writeFileSync(this.cacheFile,JSON.stringify(this.cacheData)))}emotesExist(e){return f.existsSync(b.resolve(this.emoteFolder,`${e}.json`))}getEmoteData(e){const t=b.resolve(this.emoteFolder,`${e}.json`);return f.existsSync(t)?c.testJSON(f.readFileSync(t).toString()):null}saveEmoteData(e,t){f.writeFileSync(b.resolve(this.emoteFolder,`${e}.json`),JSON.stringify(t))}getData(e){return this.data[e]||""}setData(e,t){this.data[e]=t,f.writeFileSync(b.resolve(this.dataFolder,`${e}.json`),JSON.stringify(t,null,4))}loadCustomCSS(){return f.readFileSync(this.customCSS).toString()}saveCustomCSS(e){return f.writeFileSync(this.customCSS,e)}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:f.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(f.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,s){void 0!==s&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=s,f.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4)))}deletePluginData(e,t){void 0===this.pluginData[e]&&(this.pluginData[e]={}),delete this.pluginData[e][t],f.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};const w=s(3),{Dispatcher:C,DiscordConstants:S,UserSettingsStore:E}=p;var P=new class{get discordLocale(){return E.locale.split("-")[0]}get defaultLocale(){return"en"}constructor(){this.locale="",this.strings={}}async initialize(){await this.setLocale(this.discordLocale),C.subscribe(S.ActionTypes.USER_SETTINGS_UPDATE,({settings:e})=>{const t=e.locale;t&&t!=this.locale&&this.setLocale(t.split("-")[0])})}async setLocale(e){let t;if(e!=this.defaultLocale){if(t=await this.getLocaleStrings(e),!t)return this.setLocale(this.defaultLocale)}else t=a;this.locale=e,c.extend(this.strings,t),g.emit("strings-updated")}async getLocaleStrings(e){const t=v.getCacheHash("locales",e);if(!t)return await this.downloadLocale(e);const s=await this.downloadLocale(e,t);return s||v.getLocale(e)}downloadLocale(e,t=""){return new Promise(s=>{const n={url:c.repoUrl(`data/locales/${e}.json`),timeout:2e3,json:!0};t&&(n.headers={"If-None-Match":t}),w.get(n,(t,n,i)=>{if(t||200!==n.statusCode)return s(null);v.saveLocale(e,i),v.setCacheHash("locales",e,n.headers.etag),s(i)})})}};class x{static get bdHead(){return this.getElement("bd-head")}static get bdBody(){return this.getElement("bd-body")}static get bdScripts(){return this.getElement("bd-scripts")}static get bdStyles(){return this.getElement("bd-styles")}static get bdThemes(){return this.getElement("bd-themes")}static get bdCustomCSS(){return this.getElement("#customcss")}static initialize(){this.createElement("bd-head",{target:document.head}),this.createElement("bd-body",{target:document.body}),this.createElement("bd-scripts",{target:this.bdHead}),this.createElement("bd-styles",{target:this.bdHead}),this.createElement("bd-themes",{target:this.bdHead}),this.createElement("style",{id:"customcss",target:this.bdHead})}static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"-")}static getElement(e,t=document){return e instanceof Node?e:t.querySelector(e)}static createElement(e,t={}){const{className:s,id:n,target:i}=t,o=document.createElement(e);return s&&(o.className=s),n&&(o.id=n),i&&this.getElement(i).append(o),o}static removeStyle(e){e=this.escapeID(e);const t=this.getElement(`#${e}`,this.bdStyles);t&&t.remove()}static injectStyle(e,t){e=this.escapeID(e);const s=this.getElement(`#${e}`,this.bdStyles)||this.createElement("style",{id:e});s.textContent=t,this.bdStyles.append(s)}static removeTheme(e){e=this.escapeID(e);const t=this.getElement(`#${e}`,this.bdThemes);t&&t.remove()}static injectTheme(e,t){e=this.escapeID(e);const s=this.getElement(`#${e}`,this.bdThemes)||this.createElement("style",{id:e});s.textContent=t,this.bdThemes.append(s)}static updateCustomCSS(e){this.bdCustomCSS.textContent=e}static removeScript(e){e=this.escapeID(e);const t=this.getElement(`#${e}`,this.bdScripts);t&&t.remove()}static injectScript(e,t){return e=this.escapeID(e),new Promise(s=>{const n=this.getElement(`#${e}`,this.bdScripts)||this.createElement("script",{id:e});n.src=t,n.onload=s,this.bdScripts.append(n)})}}class k extends String{format(e){return c.formatString(this,e)}}var M=new Proxy(P.strings,{get:function(e,t){return e.hasOwnProperty(t)?new Proxy(e[t],{get:function(e,t){return"string"==typeof e[t]?new k(e[t]):e[t]}}):new Proxy({},{get:function(){return`String group "${t}" not found.`}})}}),A=new class{constructor(){this.state={},this.collections=[],this.panels=[],this.updateStrings=this.updateStrings.bind(this)}initialize(){this.registerCollection("settings","Settings",r),g.on("strings-updated",this.updateStrings)}registerCollection(e,t,s,n=null){if(this.collections.find(t=>t.id==e))return d.error("Settings","Already have a collection with id "+e);this.collections.push({type:"collection",id:e,name:t,settings:s,button:n}),this.setupCollection(e),this.loadCollection(e),this.updateStrings()}removeCollection(e){const t=this.collections.findIndex(t=>t.id==e);if(!t<0)return d.error("Settings","No collection with id "+e);this.collections.splice(t,1)}registerPanel(e,t,s){if(this.panels.find(t=>t.id==e))return d.error("Settings","Already have a panel with id "+e);const{element:n,onClick:i,order:o=1}=s,r={id:e,order:o,label:t,section:e};i&&(r.clickListener=i),n&&(r.element=n instanceof p.React.Component?()=>p.React.createElement(n,{}):"function"==typeof n?n:()=>n),this.panels.push(r)}removePanel(e){const t=this.panels.findIndex(t=>t.id==e);if(!t<0)return d.error("Settings","No collection with id "+e);this.panels.splice(t,1)}getPath(e,t="",s=""){return{collection:3==e.length?e[0]:t,category:3==e.length?e[1]:2==e.length?e[0]:s,setting:e[e.length-1]}}setupCollection(e){const t=this.collections.find(t=>t.id==e);if(!t)return;const s=t.settings;this.state[t.id]||(this.state[t.id]={});for(let e=0;e{const e=this.state[o.collection][o.category][o.setting];return s.enableWith?!e:e}})}}}}saveSettings(){for(const e in this.state)this.saveCollection(e)}loadSettings(){for(const e in this.state)this.loadCollection(e)}saveCollection(e){v.setData(e,this.state[e])}loadCollection(e){const t=v.getData(e);if(!t)return this.saveCollection(e);for(const s in this.state[e]){t[s]||Object.assign(t,{[s]:this.state[e][s]});for(const n in this.state[e][s]){if(null==t[s][n])continue;const i=this.getSetting(e,s,n);if("switch"==i.type&&(this.state[e][s][n]=t[s][n]),"dropdown"==i.type){i.options.some(e=>e.value==t[s][n])&&(this.state[e][s][n]=t[s][n])}}}this.saveCollection(e)}onSettingChange(e,t,s,n){this.state[e][t][s]=n,g.dispatch("setting-updated",e,t,s,n),this.saveCollection(e)}getSetting(e,t,s){return 2==arguments.length?this.collections[0].find(e=>e.id==arguments[0]).settings.find(e=>e.id==arguments[1]):this.collections.find(t=>t.id==e).settings.find(e=>e.id==t).settings.find(e=>e.id==s)}get(e,t,s){return 2==arguments.length&&(s=t,t=e,e="settings"),!(!this.state[e]||!this.state[e][t])&&this.state[e][t][s]}set(e,t,s,n){return 3==arguments.length&&(n=s,s=t,t=e,e="settings"),this.onSettingChange(e,t,s,n)}on(e,t,s,n){const i=(i,o,r,a)=>{i===e&&o===t&&r===s&&n(a)};return g.on("setting-updated",i),()=>{g.off("setting-updated",i)}}updateStrings(){for(let e=0;e"before"===e.type))try{t.callback(this,arguments)}catch(s){d.err("Patcher",`Could not fire before callback of ${e.functionName} for ${t.caller}`,s)}const s=e.children.filter(e=>"instead"===e.type);if(s.length)for(const n of s)try{const s=n.callback(this,arguments,e.originalFunction.bind(this));void 0!==s&&(t=s)}catch(t){d.err("Patcher",`Could not fire instead callback of ${e.functionName} for ${n.caller}`,t)}else t=e.originalFunction.apply(this,arguments);for(const s of e.children.filter(e=>"after"===e.type))try{const e=s.callback(this,arguments,t);void 0!==e&&(t=e)}catch(t){d.err("Patcher",`Could not fire after callback of ${e.functionName} for ${s.caller}`,t)}return t}}static rePatch(e){e.proxyFunction=e.module[e.functionName]=this.makeOverride(e)}static makePatch(e,t,s){const n={name:s,module:e,functionName:t,originalFunction:e[t],proxyFunction:null,revert:()=>{n.module[n.functionName]=n.originalFunction,n.proxyFunction=null,n.children=[]},counter:0,children:[]};return n.proxyFunction=e[t]=this.makeOverride(n),this.patches.push(n),n}static before(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"before"}))}static after(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"after"}))}static instead(e,t,s,n,i={}){return this.pushChildPatch(e,t,s,n,Object.assign(i,{type:"instead"}))}static pushChildPatch(e,t,s,n,i={}){const{type:o="after",forcePatch:r=!0}=i,a=this.resolveModule(t);if(!a)return null;if(!a[s]&&r&&(a[s]=function(){}),!(a[s]instanceof Function))return null;"string"==typeof t&&(i.displayName=t);const l=`${i.displayName||a.displayName||a.name||a.constructor.displayName||a.constructor.name}.${s}`,d=this.patches.find(e=>e.module==a&&e.functionName==s)||this.makePatch(a,s,l);d.proxyFunction||this.rePatch(d);const c={caller:e,type:o,id:d.counter,callback:n,unpatch:()=>{if(d.children.splice(d.children.findIndex(e=>e.id===c.id&&e.type===o),1),d.children.length<=0){const e=this.patches.findIndex(e=>e.module==a&&e.functionName==s);this.patches[e].revert(),this.patches.splice(e,1)}}};return d.children.push(c),d.counter++,c.unpatch}}const F=p.React,T={},L=new Set,j=new Set;var O=new class{get named(){return T}get unknown(){return L}get listeners(){return j}constructor(){B.after("ReactComponents",F,"createElement",(e,t,s)=>{this.walkRenderTree(s)}),B.instead("ReactComponents",F.Component.prototype,"componentWillMount",e=>{this.addComponent(e.constructor)}),B.instead("ReactComponents",F.Component.prototype,"UNSAFE_componentWillMount",e=>{this.addComponent(e.constructor)}),B.instead("ReactComponents",F.PureComponent.prototype,"componentWillMount",e=>{this.addComponent(e.constructor)}),B.instead("ReactComponents",F.PureComponent.prototype,"UNSAFE_componentWillMount",e=>{this.addComponent(e.constructor)})}initialize(){this.walkReactTree(document.querySelector("#app-mount")._reactRootContainer._internalRoot.current)}get(e,t){return new Promise(s=>{if(T[e])return s(T[e]);if(j.add({name:e,filter:t,resolve:s}),t)for(const s of L)t(s)&&(s.displayName=e,L.delete(s),this.addNamedComponent(s))})}addNamedComponent(e){const t=e.displayName;if(!T[t]){T[t]=e;for(const s of j)s.name===t&&(s.resolve(e),j.delete(s))}}addUnknownComponent(e){if(!L.has(e)){for(const t of j)t.filter&&t.filter(e)&&(e.displayName=t.name,this.addNamedComponent(e));e.displayName||L.add(e)}}addComponent(e){return e.displayName?this.addNamedComponent(e):this.addUnknownComponent(e)}walkRenderTree(e){if(e){if("function"==typeof e.type&&this.addComponent(e.type),Array.isArray(e))for(const t of e)this.walkRenderTree(t);e.props&&e.props.children&&this.walkRenderTree(e.props.children)}}walkReactTree(e){e&&("function"==typeof e.type&&this.addComponent(e.type),e.child&&this.walkReactTree(e.child),e.sibling&&this.walkReactTree(e.sibling))}};const z=p.React,R=(p.ReactDOM,u.getByProps("sidebar","hasNotice").sidebar.split(" ")[0]),I=u.getByProps("membersWrap").membersWrap.split(" ")[0];class _{static get shouldShowToasts(){return A.get("settings","general","showToasts")}static async success(e,t={}){return this.show(e,Object.assign(t,{type:"success"}))}static async info(e,t={}){return this.show(e,Object.assign(t,{type:"info"}))}static async warning(e,t={}){return this.show(e,Object.assign(t,{type:"warning"}))}static async error(e,t={}){return this.show(e,Object.assign(t,{type:"error"}))}static async default(e,t={}){return this.show(e,Object.assign(t,{type:""}))}static show(e,t={}){const{type:s="",icon:n=!0,timeout:i=3e3,forceShow:o=!1}=t;if(!this.shouldShowToasts&&!o)return;this.ensureContainer();const r=document.createElement("div");r.classList.add("bd-toast"),s&&r.classList.add("toast-"+s),s&&n&&r.classList.add("icon"),r.innerText=e,document.querySelector(".bd-toasts").appendChild(r),setTimeout(()=>{r.classList.add("closing"),setTimeout(()=>{r.remove(),document.querySelectorAll(".bd-toasts .bd-toast").length||document.querySelector(".bd-toasts").remove()},300)},i)}static ensureContainer(){if(document.querySelector(".bd-toasts"))return;const e=document.querySelector(`.${R} + div`),t=e.querySelector(`.${I}`),s=e?e.querySelector("form"):null,n=e?e.getBoundingClientRect().left:310,i=t?t.getBoundingClientRect().left:0,o=i?i-e.getBoundingClientRect().left:e.offsetWidth,r=s?s.offsetHeight:80,a=document.createElement("div");a.classList.add("bd-toasts"),a.style.setProperty("left",n+"px"),a.style.setProperty("width",o+"px"),a.style.setProperty("bottom",r+"px"),document.querySelector("#app-mount").appendChild(a)}}class q extends z.Component{constructor(e){super(e),this.onClick=this.onClick.bind(this),this.state={checked:this.props.checked||!1}}render(){return z.createElement("div",{className:"checkbox-item"},z.createElement("div",{className:"checkbox-label label-JWQiNe da-label"},this.props.text),z.createElement("div",{className:"checkbox-wrapper checkbox-3kaeSU da-checkbox checkbox-3EVISJ da-checkbox",onClick:this.onClick},z.createElement("div",{className:"checkbox-inner checkboxInner-3yjcPe da-checkboxInner"},z.createElement("input",{className:"checkbox checkboxElement-1qV33p da-checkboxElement",checked:this.state.checked,type:"checkbox"}),z.createElement("span",null)),z.createElement("span",null)))}onClick(){this.props.onChange(!this.state.checked),this.setState({checked:!this.state.checked})}}function H(){return(H=Object.assign||function(e){for(var t=1;t{for(const s of e){if(!(s.addedNodes.length&&s.addedNodes[0]instanceof Element))continue;const e=s.addedNodes[0];e.parentElement===document.body&&e.querySelector("#ace_settingsmenu")&&(e.id="ace_settingsmenu_container",t.disconnect())}});t.observe(document.body,{childList:!0})};const t=this.props.theme==V.defaultProps.theme?this.props.theme.split("-")[1]:this.props.theme;this.editor.setTheme(`ace/theme/${t}`),this.editor.session.setMode(`ace/mode/${this.props.language}`),this.editor.setShowPrintMargin(!1),this.editor.setFontSize(this.props.fontSize),this.editor.on("change",this.onChange)}componentWillUnmount(){this.editor.destroy()}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}onChange(){this.props.onChange&&this.props.onChange(this.value)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}buildControl(e){return"checkbox"==e.type?this.makeCheckbox(e):this.makeButton(e)}makeCheckbox(e){return z.createElement(q,{text:e.label,onChange:e.onChange,checked:e.checked})}makeButton(e){return z.createElement(U,{color:"black",position:"top",text:e.tooltip},t=>z.createElement("button",H({},t,{className:"btn btn-primary",onClick:t=>{e.onClick(t,this.value)}}),e.label))}render(){this.editor&&this.editor.resize&&this.editor.resize();const e=this.props.controls.filter(e=>"right"!=e.side).map(this.buildControl.bind(this)),t=this.props.controls.filter(e=>"right"==e.side).map(this.buildControl.bind(this));return z.createElement("div",{id:"bd-editor-panel",className:this.props.theme},z.createElement("div",{id:"bd-editor-controls"},z.createElement("div",{className:"controls-section controls-left"},e),z.createElement("div",{className:"controls-section controls-right"},t)),z.createElement("div",{className:"editor-wrapper"},z.createElement("div",{id:this.props.id,className:"editor "+this.props.theme},this.props.value)))}}class J extends z.Component{render(){const e=this.props.size||"24px";return z.createElement("svg",{viewBox:"0 0 24 24",style:{width:e,height:e}},z.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),z.createElement("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm2 16H5V5h11.17L19 7.83V19zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zM6 6h9v4H6z"}))}}class Z extends z.Component{render(){const e=this.props.size||"24px";return z.createElement("svg",{viewBox:"0 0 24 24",fill:"#FFFFFF",style:{width:e,height:e},onClick:this.props.onClick},z.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),z.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}}class K extends z.Component{render(){const e=this.props.size||"20px";return z.createElement("svg",{viewBox:"0 0 20 20",style:{width:e,height:e}},z.createElement("path",{fill:"none",d:"M0 0h20v20H0V0z"}),z.createElement("path",{d:"M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}))}}class Y extends z.Component{constructor(e){super(e),this.hasUnsavedChanges=!1,this.onChange=this.onChange.bind(this),this.save=this.save.bind(this),this.openNative=this.openNative.bind(this),this.update=this.update.bind(this),this.controls=[{label:z.createElement(J,{size:"18px"}),tooltip:M.CustomCSS.save,onClick:this.save},{label:z.createElement(Z,{size:"18px"}),tooltip:M.CustomCSS.openNative,onClick:this.openNative},{label:z.createElement(K,{size:"18px"}),tooltip:M.CustomCSS.settings,onClick:"showSettings"}]}update(){this.forceUpdate()}updateEditor(e){this.editor&&(this.editor.value=e)}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}setEditorRef(e){this.editor=e,this.props.editorRef&&void 0!==this.props.editorRef.current?this.props.editorRef.current=e:this.props.editorRef&&(this.props.editorRef=e)}render(){return z.createElement(V,{ref:this.setEditorRef.bind(this),language:this.props.language,id:this.props.id||"bd-addon-editor",controls:this.controls,value:this.props.content,onChange:this.onChange})}onChange(){this.hasUnsavedChanges=!0}save(e,t){this.hasUnsavedChanges=!1,this.props.save&&this.props.save(t)}openNative(){this.props.openNative&&this.props.openNative()}}class Q extends z.Component{render(){return z.createElement("svg",{viewBox:"0 0 12 12",style:{width:"18px",height:"18px"}},z.createElement("g",{className:"background",fill:"none",fillRule:"evenodd"},z.createElement("path",{d:"M0 0h12v12H0"}),z.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"})))}}z.Component;class X{static get shouldShowAddonErrors(){return A.get("settings","addons","addonErrors")}static get ModalStack(){return u.getByProps("push","update","pop","popWithKey")}static get AlertModal(){return u.getByPrototypes("handleCancel","handleSubmit","handleMinorConfirm")}static get TextElement(){return u.getByProps("Sizes","Weights")}static get ConfirmationModal(){return u.getModule(e=>e.defaultProps&&e.key&&"confirm-modal"==e.key())}static default(e,t){const s=u.getByProps("backdrop")||{backdrop:"backdrop-1wrmKb"},n=u.getModule(e=>e.modal&&e.inner&&!e.sizeMedium)||{modal:"modal-36zFtW",inner:"inner-2VEzy9"},i=u.getByProps("sizeMedium")||{modal:"backdrop-1wrmKb",sizeMedium:"sizeMedium-ctncE5",content:"content-2KoCOZ",header:"header-2nhbou",footer:"footer-30ewN8",close:"close-hhyjWJ",inner:"inner-2Z5QZX"},o=c.parseHTML(`
\n
\n
\n
\n
\n
${e}
\n
\n
\n
\n
\n ${t}\n
\n
\n
\n \n
\n
\n
`);o.querySelector(".footer button").addEventListener("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.querySelector(".bd-backdrop").addEventListener("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),document.querySelector("#app-mount").append(o)}static alert(e,t){if(this.ModalStack&&this.AlertModal)return this.default(e,t);this.ModalStack.push((function(s){return z.createElement(this.AlertModal,Object.assign({title:e,body:t},s))}))}static showConfirmationModal(e,t,s={}){const n=this.TextElement,i=this.ConfirmationModal,o=this.ModalStack;if(!this.ModalStack||!this.ConfirmationModal||!this.TextElement)return this.alert(e,t);const{onConfirm:r,onCancel:a,confirmText:l,cancelText:d,danger:c=!1}=s;"string"==typeof t?t=n.default({color:n.Colors.PRIMARY,children:[t]}):Array.isArray(t)&&(t=n.default({color:n.Colors.PRIMARY,children:t})),t=[t];const h=()=>{};o.push((function(s){return z.createElement(i,Object.assign({header:e,children:t,red:c,confirmText:l||M.Modals.okay,cancelText:d||M.Modals.cancel,onConfirm:r||h,onCancel:a||h},s))}))}static showAddonErrors({plugins:e=[],themes:t=[]}){if(!e||!t||!this.shouldShowAddonErrors)return;if(!e.length&&!t.length)return;const s=u.getByProps("backdrop")||{backdrop:"backdrop-1wrmKb"},n=u.getModule(e=>e.modal&&e.inner&&!e.sizeMedium)||{modal:"modal-36zFtW",inner:"inner-2VEzy9"},i=u.getByProps("sizeMedium")||{modal:"modal-3v8ziU",sizeMedium:"sizeMedium-ctncE5",content:"content-2KoCOZ",header:"header-2nhbou",footer:"footer-30ewN8",close:"close-hhyjWJ",inner:"inner-2Z5QZX"},o=$(`
\n
\n
\n
\n
${M.Modals.addonErrors}
\n
\n
\n
\n
${M.Panels.plugins}
\n
${M.Panels.themes}
\n
\n
\n
\n
${M.Modals.name}
\n
${M.Modals.message}
\n
${M.Modals.error}
\n
\n
\n
\n\n
\n
\n
\n \n
\n
\n
`),r=function(e){const t=$('
');for(const s of e){const e=$(`
\n
${s.name?s.name:s.file}
\n
${s.message}
\n \n
`);t.append(e),s.error&&e.find("a").on("click",e=>{e.preventDefault(),d.stacktrace("AddonError",`Error details for ${s.name?s.name:s.file}.`,s.error)})}return t},a=[r(e),r(t)];o.find(".tab-bar-item").on("click",e=>{e.preventDefault(),o.find(".tab-bar-item").removeClass("selected"),$(e.target).addClass("selected"),o.find(".scroller").empty().append(a[$(e.target).index()])}),o.find(".footer button").on("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.find(".bd-backdrop").on("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.appendTo("#app-mount"),e.length?o.find(".tab-bar-item")[0].click():o.find(".tab-bar-item")[1].click()}showChangelogModal(e={}){const t=u.getByProps("push","update","pop","popWithKey"),s=u.getByProps("fixed","improved"),n=u.getByProps("Sizes","Weights"),o=u.getByProps("Child"),r=u.getByProps("Tags","default"),a=u.getModule(e=>e.defaultProps&&0==e.defaultProps.selectable),l=u.getByProps("defaultRules","parse");if(!(a&&t&&s&&n&&o&&r&&l))return;const{image:d="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:c="",changes:h=[],title:p="BandagedBD",subtitle:m=`v${i.bbdVersion}`,footer:g}=e,f=z.createElement,b=[f("img",{src:d})];c&&b.push(f("p",null,l.parse(c)));for(let e=0;ef("li",null,l.parse(e))));b.push(o)}const y=function(){return f(o.Child,{grow:1,shrink:1},f(r.default,{tag:r.Tags.H4},p),f(n,{size:n.Sizes.SMALL,color:n.Colors.PRIMARY,className:s.date},m))},v=()=>{const e=u.getModule(e=>"Anchor"==e.displayName),s=u.getByProps("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},i=e=>{e.preventDefault(),e.stopPropagation(),t.pop()},r=e?f(e,{onClick:i},"Join our Discord Server."):f("a",{className:`${s.anchor} ${s.anchorUnderlineOnHover}`,onClick:i},"Join our Discord Server."),a=f(n,{size:n.Sizes.SMALL,color:n.Colors.PRIMARY},"Need support? ",r);return f(o.Child,{grow:1,shrink:1},g||a)};t.push((function(e){return f(a,Object.assign({className:s.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:y,renderFooter:v,children:b},e))}))}}z.Component;z.Component;var ee=z.createRef().current;const te=p.React,se=s(2),ne=s(1),ie=s(4).Module;ie.globalPaths.push(se.resolve(s(0).remote.app.getAppPath(),"node_modules"));const oe=/[^\S\r\n]*?\r?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,re=/^\\@/,ae=function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e};class le{get name(){return""}get moduleExtension(){return""}get extension(){return""}get addonFolder(){return""}get language(){return""}get prefix(){return"addon"}get collection(){return"settings"}get category(){return"addons"}get id(){return"autoReload"}emit(e,...t){return g.emit(`${this.prefix}-${e}`,...t)}constructor(){this.timeCache={},this.addonList=[],this.state={}}initialize(){return this.originalRequire=ie._extensions[this.moduleExtension],ie._extensions[this.moduleExtension]=this.getAddonRequire(),A.on(this.collection,this.category,this.id,e=>{e?this.watchAddons():this.unwatchAddons()}),this.loadAllAddons()}initializeAddon(){}getFileModification(e,t){return t}startAddon(){}stopAddon(){}loadState(){const e=v.getData(`${this.prefix}s`);e&&Object.assign(this.state,e)}saveState(){v.setData(`${this.prefix}s`,this.state)}watchAddons(){if(this.watcher)return d.error(this.name,`Already watching ${this.prefix} addons.`);d.log(this.name,`Starting to watch ${this.prefix} addons.`),this.watcher=ne.watch(this.addonFolder,{persistent:!1},async(e,t)=>{if(!e||!t||!t.endsWith(this.extension))return;await new Promise(e=>setTimeout(e,50));try{ne.statSync(se.resolve(this.addonFolder,t))}catch(e){if("ENOENT"!==e.code)return;delete this.timeCache[t],this.unloadAddon(t,!0)}if(!ne.statSync(se.resolve(this.addonFolder,t)).isFile())return;const s=ne.statSync(se.resolve(this.addonFolder,t));s&&s.mtime&&s.mtime.getTime()&&"number"==typeof s.mtime.getTime()&&this.timeCache[t]!=s.mtime.getTime()&&(this.timeCache[t]=s.mtime.getTime(),"rename"==e&&this.loadAddon(t,!0),"change"==e&&this.reloadAddon(t,!0))})}unwatchAddons(){if(!this.watcher)return d.error(this.name,`Was not watching ${this.prefix} addons.`);this.watcher.close(),delete this.watcher,d.log(this.name,`No longer watching ${this.prefix} addons.`)}extractMeta(e){const t=e.split("\n")[0];if(t.includes("//META"))return this.parseOldMeta(e);if(t.includes("/**"))return this.parseNewMeta(e);throw new N("META was not found.")}parseOldMeta(e){const t=e.split("\n")[0],s=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//")),n=c.testJSON(s);if(!n)throw new N("META could not be parsed.");if(!n.name)throw new N("META missing name data.");return n.format="json",n}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],s={};let n="",i="";for(const e of t.split(oe))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){s[n]=i;const t=e.indexOf(" ");n=e.substr(1,t-1),i=e.substr(t+1)}else i+=" "+e.replace("\\n","\n").replace(re,"@");return s[n]=i.trim(),delete s[""],s.format="jsdoc",s}getAddonRequire(){const e=this,t=this.originalRequire;return function(s,n){const i=se.resolve(e.addonFolder,se.basename(n));if(!ne.existsSync(i)||n!==ne.realpathSync(i))return Reflect.apply(t,this,arguments);let o=ne.readFileSync(n,"utf8");o=ae(o);const r=ne.statSync(n),a=e.extractMeta(o);a.id=a.name,a.filename=se.basename(n),a.added=r.atimeMs,a.modified=r.mtimeMs,a.size=r.size,o=e.getFileModification(s,o,a),s._compile(o,n)}}loadAddon(e,t=!1){if(void 0===e)return;try{require(se.resolve(this.addonFolder,e))}catch(n){return new D(e,e,"Could not be compiled.",{message:n.message,stack:n.stack})}const s=require(se.resolve(this.addonFolder,e));if(this.addonList.find(e=>e.id==s.id))return new D(s.name,e,`There is already a plugin with name ${s.name}`);const n=this.initializeAddon(s);return n||(this.addonList.push(s),t&&_.success(`${s.name} v${s.version} was loaded.`),this.emit("loaded",s.id),this.state[s.id]?this.startAddon(s):this.state[s.id]=!1)}unloadAddon(e,t=!0,s=!1){const n="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return!!n&&(this.state[n.id]&&(s?this.stopAddon(n):this.disableAddon(n)),delete require.cache[require.resolve(se.resolve(this.addonFolder,n.filename))],this.addonList.splice(this.addonList.indexOf(n),1),this.emit("unloaded",n.id),t&&_.success(`${n.name} was unloaded.`),!0)}reloadAddon(e,t=!0){const s="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e,n=this.unloadAddon(s,t,!0);return n?this.loadAddon(s.filename,t):n}isLoaded(e){return!!this.addonList.find(t=>t.id==e||t.filename==e)}isEnabled(e){const t=this.addonList.find(t=>t.id==e||t.filename==e);return!!t&&this.state[t.id]}enableAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(this.state[t.id]||(this.state[t.id]=!0,this.startAddon(t),this.saveState()))}disableAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&this.state[t.id]&&(this.state[t.id]=!1,this.stopAddon(t),this.saveState())}toggleAddon(e){this.state[e]?this.disableAddon(e):this.enableAddon(e)}loadNewAddons(){const e=ne.readdirSync(this.addonFolder),t=this.addonList.filter(t=>!e.includes(t.filename)).map(e=>e.id);return{added:e.filter(e=>!this.addonList.find(t=>t.filename==e)&&e.endsWith(this.extension)&&ne.statSync(se.resolve(this.addonFolder,e)).isFile()),removed:t}}updateList(){const e=this.loadNewAddons();for(const t of e.added)this.loadAddon(t);for(const t of e.removed)this.unloadAddon(t)}loadAllAddons(){this.loadState();const e=[],t=ne.readdirSync(this.addonFolder);for(const s of t){if(!ne.statSync(se.resolve(this.addonFolder,s)).isFile()||!s.endsWith(this.extension))continue;const t=this.loadAddon(s,!1);t instanceof D&&e.push(t)}return this.saveState(),A.get(this.collection,this.category,this.id)&&this.watchAddons(),e}deleteAddon(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return ne.unlinkSync(se.resolve(this.addonFolder,t.filename))}saveAddon(e,t){const s="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e;return ne.writeFileSync(se.resolve(this.addonFolder,s.filename),t)}editAddon(e,t){const n="string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e,i=se.resolve(this.addonFolder,n.filename);return void 0===t&&(t="system"==A.get("settings","addons","editAction")),t?s(0).shell.openItem(`${i}`):this.openDetached(n)}openDetached(e){const t=se.resolve(this.addonFolder,e.filename),s=ne.readFileSync(t).toString(),n=te.createRef(),i=te.createElement(Y,{id:"bd-floating-editor-"+e.name,ref:n,content:s,save:this.saveAddon.bind(this,e),openNative:this.editAddon.bind(this,e,!0),language:this.language});ee.open({onClose:()=>{this.isDetached=!1},onResize:()=>{n&&n.current&&n.current.resize&&n.current.resize()},title:e.name,id:s.id,className:"floating-addon-window",height:470,width:410,center:!0,resizable:!0,children:i,confirmClose:()=>!(!n||!n.current)&&n.current.hasUnsavedChanges,confirmationText:M.Addons.confirmationText.format({name:e.name})})}}class de extends z.Component{constructor(e){super(e)}render(){const e=this.props.isGroup?"bd-settings-title bd-settings-group-title h5-18_1nd title-3sZWYQ size12-3R0845 height16-2Lv3qA weightSemiBold-NJexzi da-h5 da-title da-size12 da-height16 da-weightSemiBold marginBottom4-2qk4Hy da-marginBottom4 marginTop8-1DLZ1n da-marginTop8":"bd-settings-title h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi defaultColor-1_ajX0 defaultMarginh2-2LTaUL marginBottom20-32qID7",t=this.props.className?`${e} ${this.props.className}`:e;return z.createElement("h2",{className:t,onClick:()=>{this.props.onClick&&this.props.onClick()}},this.props.text,this.props.button&&z.createElement("button",{className:"bd-button bd-button-title",onClick:this.props.button.onClick},this.props.button.title),this.props.otherChildren)}}class ce extends z.Component{render(){const e=this.props.size||"24px";return z.createElement("svg",{className:this.props.className||"",onClick:this.props.onClick,fill:"#dcddde",viewBox:"0 0 24 24",style:{width:e,height:e}},z.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"}),z.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}class he extends z.Component{render(){const e=this.props.size||"24px";return z.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e},onClick:this.props.onClick},z.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),z.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),z.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}class ue extends z.Component{constructor(e){super(e),this.state={checked:this.props.checked},this.onChange=this.onChange.bind(this)}onChange(){this.props.disabled||(this.props.onChange(!this.state.checked),this.setState({checked:!this.state.checked}))}render(){const e=this.props.disabled?" bd-switch-disabled":"",t=this.state.checked?" bd-switch-checked":"";return z.createElement("div",{className:"bd-switch"+e+t},z.createElement("input",{type:"checkbox",id:this.props.id,className:"bd-checkbox",disabled:this.props.disabled,checked:this.state.checked,onChange:this.onChange}))}}function pe(){return(pe=Object.assign||function(e){for(var t=1;t{const s=e.scrollTop,n=s+e.clientHeight,i=t.offsetTop,o=i+t.clientHeight;return in})(t[0],e[0])&&t.animate({scrollTop:e.offset().top-t.offset().top+t.scrollTop()-30},300)}getString(e){return"string"==typeof e?e:e.toString()}onChange(){this.props.onChange&&this.props.onChange(this.props.addon.id),this.props.enabled=!this.props.enabled}showSettings(){this.props.hasSettings&&this.setState({settingsOpen:!0})}closeSettings(){this.panelRef.current.innerHTML="",this.setState({settingsOpen:!1})}buildTitle(e,t,s){const n=M.Addons.title.split(/({{[A-Za-z]+}})/),i=n.findIndex(e=>"{{name}}"==e);i&&(n[i]=z.createElement("span",{className:"bd-name"},e));const o=n.findIndex(e=>"{{version}}"==e);i&&(n[o]=z.createElement("span",{className:"bd-version"},t));const r=n.findIndex(e=>"{{author}}"==e);return i&&(n[r]=z.createElement("span",{className:"bd-author"},s)),n.flat()}get settingsComponent(){const e=this.props.addon,t=this.getString(e.name);try{this.settingsPanel=this.props.getSettingsPanel()}catch(e){d.stacktrace("Addon Settings","Unable to get settings panel for "+t+".",e)}const s={id:`${t}-settings`,className:"addon-settings",ref:this.panelRef};return"string"==typeof settingsPanel&&(s.dangerouslySetInnerHTML=this.settingsPanel),z.createElement("div",{className:"bd-addon-card settings-open bd-switch-item"},z.createElement("div",{className:"bd-close",onClick:this.closeSettings},z.createElement(Q,null)),z.createElement("div",s,this.settingsPanel instanceof z.Component?this.settingsPanel:null))}buildLink(e){const t=this.props.addon[e];return t?z.createElement("a",{className:"bd-link bd-link-website",href:t,target:"_blank",rel:"noopener noreferrer"},M.Addons[e]):null}get footer(){const e=["website","source","invite","donate","patreon"];if(!e.some(e=>this.props.addon[e])&&!this.props.hasSettings)return null;const t=e.map(this.buildLink.bind(this)).filter(e=>e);return z.createElement("div",{className:"bd-footer"},z.createElement("span",{className:"bd-links"},t.map((e,s)=>sz.createElement("div",pe({},e,{className:"bd-addon-button",onClick:s}),t))}render(){if(this.state.settingsOpen)return this.settingsComponent;const e=this.props.addon,t=this.getString(e.name),s=this.getString(e.author),n=this.getString(e.description),i=this.getString(e.version);return z.createElement("div",{id:`${e.id}-card`,className:"bd-addon-card settings-closed"},z.createElement("div",{className:"bd-addon-header"},z.createElement("span",{className:"bd-title"},this.buildTitle(t,i,s)),z.createElement("div",{className:"bd-controls"},this.props.editAddon&&this.makeButton(M.Addons.editAddon,z.createElement(Z,null),this.props.editAddon),this.props.deleteAddon&&this.makeButton(M.Addons.deleteAddon,z.createElement(he,null),this.props.deleteAddon),this.props.showReloadIcon&&this.makeButton(M.Addons.reload,z.createElement(ce,{className:"bd-reload bd-reload-card"}),this.reload),z.createElement(ue,{checked:this.props.enabled,onChange:this.onChange}))),z.createElement("div",{className:"bd-description-wrap scroller-wrap fade"},z.createElement("div",{className:"bd-description scroller"},n)),this.footer)}}class fe extends z.Component{render(){const e=this.props.size||"16px";return z.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e}},z.createElement("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))}}class be extends z.Component{constructor(e){super(e),this.state={open:!1,value:this.props.value||this.props.options[0].value},this.dropdown=z.createRef(),this.onChange=this.onChange.bind(this),this.showMenu=this.showMenu.bind(this),this.hideMenu=this.hideMenu.bind(this)}showMenu(e){e.preventDefault(),this.setState({open:!0},()=>{document.addEventListener("click",this.hideMenu)})}hideMenu(){this.setState({open:!1},()=>{document.removeEventListener("click",this.hideMenu)})}onChange(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)}get selected(){return this.props.options.find(e=>e.value==this.state.value)}get options(){const e=this.selected;return z.createElement("div",{className:"bd-select-options"},this.props.options.map(t=>z.createElement("div",{className:`bd-select-option${e.value==t.value?" selected":""}`,onClick:this.onChange.bind(this,t.value)},t.label)))}render(){const e="transparent"==this.props.style?" bd-select-transparent":"",t=this.state.open?" menu-open":"";return z.createElement("div",{className:`bd-select${e}${t}`,onClick:this.showMenu,ref:this.dropdown},z.createElement("div",{className:"bd-select-value"},this.selected.label),z.createElement(fe,{className:"bd-select-arrow"}),this.state.open&&this.options)}}class ye extends z.Component{render(){const e=this.props.size||"16px";return z.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e}},z.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),z.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))}}class ve extends z.Component{render(){return z.createElement("div",{className:"bd-search-wrapper"},z.createElement("input",{onChange:this.props.onChange,onKeyDown:this.props.onKeyDown,type:"text",className:"bd-search",placeholder:this.props.placeholder,maxLength:"50"}),z.createElement(ye,null))}}class we extends z.Component{constructor(e){super(e),this.state={sort:"name",ascending:!0,query:""},this.sort=this.sort.bind(this),this.reverse=this.reverse.bind(this),this.search=this.search.bind(this),this.update=this.update.bind(this)}componentDidMount(){g.on(`${this.props.prefix}-loaded`,this.update),g.on(`${this.props.prefix}-unloaded`,this.update)}componentWillUnmount(){g.off(`${this.props.prefix}-loaded`,this.update),g.off(`${this.props.prefix}-unloaded`,this.update)}update(){this.forceUpdate()}reload(){this.props.refreshList&&this.props.refreshList(),this.forceUpdate()}reverse(e){this.setState({ascending:e})}sort(e){this.setState({sort:e})}search(e){this.setState({query:e.target.value.toLocaleLowerCase()})}get sortOptions(){return[{label:M.Addons.name,value:"name"},{label:M.Addons.author,value:"author"},{label:M.Addons.version,value:"version"},{label:M.Addons.added,value:"added"},{label:M.Addons.modified,value:"modified"}]}get directions(){return[{label:M.Sorting.ascending,value:!0},{label:M.Sorting.descending,value:!1}]}render(){const{title:e,folder:t,addonList:n,addonState:i,onChange:o,reload:r}=this.props,a=!A.get("settings","addons","autoReload"),l=t?{title:M.Addons.openFolder.format({type:e}),onClick:()=>{s(0).shell.openItem(t)}}:null,d=n.sort((e,t)=>{const s=e[this.state.sort],n=t[this.state.sort];return"string"==typeof s?s.toLocaleLowerCase().localeCompare(n.toLocaleLowerCase()):s>n?1:n>s?-1:0});return this.state.ascending||d.reverse(),[z.createElement(de,{key:"title",text:e,button:l,otherChildren:a&&z.createElement(ce,{className:"bd-reload",onClick:this.reload.bind(this)})}),z.createElement("div",{className:"bd-controls bd-addon-controls"},z.createElement(ve,{onChange:this.search,placeholder:`${M.Addons.search.format({type:this.props.title})}...`}),z.createElement("div",{className:"bd-addon-dropdowns"},z.createElement("div",{className:"bd-select-wrapper"},z.createElement("label",{className:"bd-label"},M.Sorting.sortBy,":"),z.createElement(be,{options:this.sortOptions,onChange:this.sort,style:"transparent"})),z.createElement("div",{className:"bd-select-wrapper"},z.createElement("label",{className:"bd-label"},M.Sorting.order,":"),z.createElement(be,{options:this.directions,onChange:this.reverse,style:"transparent"})))),z.createElement("div",{key:"addonList",className:"bd-addon-list"},d.map(e=>{if(this.state.query){let t=e.name.toLocaleLowerCase().includes(this.state.query);if(t=t||e.author.toLocaleLowerCase().includes(this.state.query),t=t||e.description.toLocaleLowerCase().includes(this.state.query),!t)return null}const t=e.type&&"function"==typeof e.plugin.getSettingsPanel,s=t&&e.plugin.getSettingsPanel.bind(e.plugin);return z.createElement(ge,{editAddon:this.editAddon.bind(this,e.id),deleteAddon:this.deleteAddon.bind(this,e.id),showReloadIcon:a,key:e.id,enabled:i[e.id],addon:e,onChange:o,reload:r,hasSettings:t,getSettingsPanel:s})}))]}editAddon(e){this.props.editAddon&&this.props.editAddon(e)}async deleteAddon(e){const t=this.props.addonList.find(t=>t.id==e);await this.confirmDelete(t)&&this.props.deleteAddon&&this.props.deleteAddon(t)}confirmDelete(e){return new Promise(t=>{X.showConfirmationModal(M.Modals.confirmAction,M.Addons.confirmDelete.format({name:e.name}),{danger:!0,confirmText:M.Addons.deleteAddon,onConfirm:()=>{t(!0)},onCancel:()=>{t(!1)}})})}}class Ce extends z.Component{render(){return z.createElement("div",{className:"bd-divider divider-3573oO marginTop8-1DLZ1n marginBottom40-2vIwTv"})}}class Se extends z.Component{render(){return z.createElement("div",{className:"bd-setting-item"},z.createElement("div",{className:"bd-setting-header"},z.createElement("label",{htmlFor:this.props.id,className:"bd-setting-title"},this.props.name),this.props.children),z.createElement("div",{className:"bd-setting-note"},this.props.note),z.createElement("div",{className:"bd-setting-divider"}))}}class Ee extends z.Component{constructor(e){if(super(e),this.props.button&&this.props.collapsible){const e=this.props.button.onClick;this.props.button.onClick=t=>{t.stopPropagation(),e(...arguments)}}this.props.hasOwnProperty("shown")||(this.props.shown=!0),this.container=z.createRef(),this.state={collapsed:this.props.collapsible&&!this.props.shown},this.onChange=this.onChange.bind(this),this.toggleCollapse=this.toggleCollapse.bind(this)}toggleCollapse(){const e=this.container.current,t=this.state.collapsed?300:1;e.style.setProperty("height",e.scrollHeight+"px"),e.classList.add("animating"),this.setState({collapsed:!this.state.collapsed},()=>setTimeout(()=>{e.style.setProperty("height",""),e.classList.remove("animating")},t))}onChange(e,t){this.props.onChange&&(this.props.id?this.props.onChange(this.props.id,e,t):this.props.onChange(e,t),this.forceUpdate())}render(){const{settings:e}=this.props,t=`bd-settings-group ${this.props.collapsible?`collapsible ${this.state.collapsed?"collapsed":"expanded"}`:""}`;return z.createElement("div",{className:t},z.createElement(de,{text:this.props.name,collapsible:this.props.collapsible,onClick:this.toggleCollapse,button:this.props.button,isGroup:!0}),z.createElement("div",{className:"bd-settings-container",ref:this.container},e.filter(e=>!e.hidden).map(e=>{let t=null;return"dropdown"==e.type&&(t=z.createElement(be,{disabled:e.disabled,id:e.id,options:e.options,value:e.value,onChange:this.onChange.bind(this,e.id)})),"switch"==e.type&&(t=z.createElement(ue,{disabled:e.disabled,id:e.id,checked:e.value,onChange:this.onChange.bind(this,e.id)})),t?z.createElement(Se,{id:e.id,key:e.id,name:e.name,note:e.note},t):null})),this.props.showDivider&&z.createElement(Ce,null))}}class Pe extends z.Component{buildTitle(e,t,s){const n=M.Addons.title.split(/({{[A-Za-z]+}})/),i=n.findIndex(e=>"{{name}}"==e);i&&(n[i]=e);const o=n.findIndex(e=>"{{version}}"==e);i&&(n[o]=t);const r=n.findIndex(e=>"{{author}}"==e);return i&&(n[r]=s),n.flat()}render(){return z.createElement("div",{id:"bbd-version"},this.buildTitle("BBD",i.bbdVersion,z.createElement("a",{href:"https://github.com/rauenzi",target:"_blank",rel:"noopener noreferrer"},"Zerebos")))}}var xe=new class{constructor(){this.patchSections(),g.on("strings-updated",this.forceUpdate)}onChange(e){return(t,s,n)=>{const i=A.collections.length+A.panels.length;e(t,s,n),i!=A.collections.length+A.panels.length&&setTimeout(this.forceUpdate.bind(this),50)}}buildSettingsPanel(e,t,s,n,i=null){return t.forEach(e=>{e.settings.forEach(t=>t.value=s[e.id][t.id])}),this.getSettingsPanel(e,t,this.onChange(n),i)}getSettingsPanel(e,t,s,n=null){return[z.createElement(de,{text:e,button:n}),t.map(e=>z.createElement(Ee,Object.assign({},e,{onChange:s})))]}getAddonPanel(e,t,s,n={}){return z.createElement(we,Object.assign({},{title:e,addonList:t,addonState:s},n))}async patchSections(){O.get("FluxContainer(GuildSettings)",e=>"FluxContainer(GuildSettings)"==e.displayName).then(e=>console.log("COMPONENT",e));const e=await O.get("UserSettings",e=>e.prototype&&e.prototype.generateSections);B.after("SettingsManager",e.prototype,"render",e=>{e._reactInternalFiber.return.return.return.return.return.return.return.memoizedProps.id="user-settings"}),B.after("SettingsManager",e.prototype,"generateSections",(e,t,s)=>{let n=s.findIndex(e=>"linux"==e.section.toLowerCase())+1;const i=e=>{s.splice(n,0,e),n++};i({section:"DIVIDER"}),i({section:"HEADER",label:"BandagedBD"});for(const e of A.collections)e.disabled||i({section:e.name,label:e.name,element:()=>this.buildSettingsPanel(e.name,e.settings,A.state[e.id],A.onSettingChange.bind(A,e.id),e.button?e.button:null)});for(const t of A.panels.sort((e,t)=>e.order>t.order))t.clickListener&&(t.onClick=n=>t.clickListener(e,n,s)),i(t);i({section:"CUSTOM",element:Pe})}),this.forceUpdate()}forceUpdate(){const e=u.getByProps("standardSidebarView").standardSidebarView.split(" ")[0],t=document.querySelector(`.${e}`);if(!t)return;const s=c.findInReactTree(c.getReactInstance(t),e=>e&&e.generateSections,{walkable:["return","stateNode"]});s&&s.forceUpdate()}};const ke=s(2),Me=s(0).remote;var Ae=new class extends le{get name(){return"PluginManager"}get moduleExtension(){return".js"}get extension(){return".plugin.js"}get addonFolder(){return ke.resolve(i.dataPath,"plugins")}get prefix(){return"plugin"}get language(){return"javascript"}constructor(){super(),this.onSwitch=this.onSwitch.bind(this),this.observer=new MutationObserver(e=>{for(let t=0,s=e.length;txe.getAddonPanel(M.Panels.plugins,this.addonList,this.state,{folder:this.addonFolder,onChange:this.togglePlugin.bind(this),reload:this.reloadPlugin.bind(this),refreshList:this.updatePluginList.bind(this),saveAddon:this.saveAddon.bind(this),editAddon:this.editAddon.bind(this),deleteAddon:this.deleteAddon.bind(this),prefix:this.prefix})}),e}updatePluginList(){return this.updateList()}loadAllPlugins(){return this.loadAllAddons()}enablePlugin(e){return this.enableAddon(e)}disablePlugin(e){return this.disableAddon(e)}togglePlugin(e){return this.toggleAddon(e)}unloadPlugin(e){return this.unloadAddon(e)}loadPlugin(e){const t=this.loadAddon(e);t&&X.showAddonErrors({themes:[t]})}reloadPlugin(e){const t=this.reloadAddon(e);return t&&X.showAddonErrors({plugins:[t]}),"string"==typeof e?this.addonList.find(t=>t.id==e||t.filename==e):e}initializeAddon(e){if(!e.type)return new D(e.name,e.filename,"Plugin had no exports",{message:"Plugin had no exports or no name property.",stack:""});try{const t=new e.type;e.plugin=t,e.name=t.getName()||e.name,e.author=t.getAuthor()||e.author||"No author",e.description=t.getDescription()||e.description||"No description",e.version=t.getVersion()||e.version||"No version";try{"function"==typeof e.plugin.load&&e.plugin.load()}catch(t){return this.state[e.id]=!1,new D(e.name,e.filename,"load() could not be fired.",{message:t.message,stack:t.stack})}}catch(t){return new D(e.name,e.filename,"Could not be constructed.",{message:t.message,stack:t.stack})}}getFileModification(e,t,s){return e._compile(t,e.filename),c.isEmpty(e.exports)?t+=`\nmodule.exports = ${JSON.stringify(s)};\nmodule.exports.type = ${s.exports||s.name};`:(s.type=e.exports,e.exports=s,"")}startAddon(e){return this.startPlugin(e)}stopAddon(e){return this.stopPlugin(e)}startPlugin(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;if(!t)return;const s=t.plugin;try{s.start(),this.emit("started",t.id),_.show(`${t.name} v${t.version} has started.`)}catch(e){return this.state[t.id]=!1,_.error(`${t.name} v${t.version} could not be started.`),d.stacktrace(this.name,t.name+" could not be started.",e),new D(t.name,t.filename,"start() could not be fired.",{message:e.message,stack:e.stack})}}stopPlugin(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;if(!t)return;const s=t.plugin;try{s.stop(),this.emit("stopped",t.id),_.show(`${t.name} v${t.version} has stopped.`)}catch(e){return this.state[t.id]=!1,_.error(`${t.name} v${t.version} could not be stopped.`),d.stacktrace(this.name,t.name+" could not be stopped.",e),new D(t.name,t.filename,"stop() could not be fired.",{message:e.message,stack:e.stack})}}setupFunctions(){Me.getCurrentWebContents().on("did-navigate-in-page",this.onSwitch.bind(this)),this.observer.observe(document,{childList:!0,subtree:!0})}onSwitch(){this.emit("page-switch");for(let e=0;exe.getAddonPanel(M.Panels.themes,this.addonList,this.state,{folder:this.addonFolder,onChange:this.toggleTheme.bind(this),reload:this.reloadTheme.bind(this),refreshList:this.updateThemeList.bind(this),saveAddon:this.saveAddon.bind(this),editAddon:this.editAddon.bind(this),deleteAddon:this.deleteAddon.bind(this),prefix:this.prefix})}),e}updateThemeList(){return this.updateList()}loadAllThemes(){return this.loadAllAddons()}enableTheme(e){return this.enableAddon(e)}disableTheme(e){return this.disableAddon(e)}toggleTheme(e){return this.toggleAddon(e)}unloadTheme(e){return this.unloadAddon(e)}loadTheme(e){const t=this.loadAddon(e);t&&X.showAddonErrors({themes:[t]})}reloadTheme(e){const t=this.reloadAddon(e);t&&X.showAddonErrors({themes:[t]})}getFileModification(e,t,s){return s.css=t,`module.exports = ${JSON.stringify(s)};`}startAddon(e){return this.addTheme(e)}stopAddon(e){return this.removeTheme(e)}addTheme(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(x.injectTheme(t.id,t.css),_.show(`${t.name} v${t.version} has been applied.`))}removeTheme(e){const t="string"==typeof e?this.addonList.find(t=>t.id==e):e;t&&(x.removeTheme(t.id),_.show(`${t.name} v${t.version} has been removed.`))}};class Be{get name(){return"Unnamed Builtin"}get collection(){return"settings"}get category(){return"general"}get id(){return"None"}async initialize(){A.get(this.collection,this.category,this.id)&&await this.enable(),g.on("setting-updated",(e,t,s,n)=>{e==this.collection&&t===this.category&&s===this.id&&(n?this.enable():this.disable())})}registerSetting(e,t,s,n,i){return 4==arguments.length?(e=this.collection,t=arguments[0],s=arguments[1],n=arguments[2],i=arguments[3]):3==arguments.length&&(e=this.collection,t=this.category,s=arguments[0],n=arguments[1],i=arguments[2]),A.on(e,t,s,e=>{e?n():i()})}get(e,t,s){return 2==arguments.length?(e=this.collection,t=arguments[0],s=arguments[1]):1==arguments.length&&(e=this.collection,t=this.category,s=arguments[0]),A.get(e,t,s)}async enable(){this.log("Enabled"),await this.enabled()}async disable(){this.log("Disabled"),await this.disabled()}async enabled(){}async disabled(){}log(...e){d.log(this.name,...e)}warn(...e){d.warn(this.name,...e)}error(...e){d.err(this.name,...e)}stacktrace(e,t){d.stacktrace(this.name,e,t)}after(e,t,s){return B.after(this.name,e,t,s)}unpatchAll(){return B.unpatchAll(this.name)}}const Fe=u.getByDisplayName("Tooltip");class Te extends z.Component{constructor(e){super(e),this.state={shouldAnimate:!this.animateOnHover,isFavorite:this.props.isFavorite},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onClick=this.onClick.bind(this),this.toggleFavorite=this.toggleFavorite.bind(this)}get animateOnHover(){return A.get("emotes","general","animateOnHover")}get label(){return this.props.modifier?`${this.props.name}:${this.props.modifier}`:this.props.name}get modifierClass(){return this.props.modifier?` emote${this.props.modifier}`:""}onMouseEnter(){!this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!0})}onMouseLeave(){this.state.shouldAnimate&&this.animateOnHover&&this.setState({shouldAnimate:!1})}onClick(e){this.props.onClick&&this.props.onClick(e)}toggleFavorite(e){e.preventDefault(),e.stopPropagation(),this.state.isFavorite?g.emit("emotes-favorite-removed",this.label):g.emit("emotes-favorite-added",this.label,this.props.url),this.setState({isFavorite:!this.state.isFavorite})}render(){return z.createElement(Fe,{color:"black",position:"top",text:this.label,delay:750},e=>z.createElement("div",Object.assign({className:"emotewrapper"+(this.props.jumboable?" jumboable":""),onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onClick:this.onClick},e),z.createElement("img",{draggable:!1,className:"emote"+this.modifierClass+(this.props.jumboable?" jumboable":"")+(this.state.shouldAnimate?"":" stop-animation"),dataModifier:this.props.modifier,alt:this.label,src:this.props.url}),z.createElement("input",{className:"fav"+(this.state.isFavorite?" active":""),title:M.Emotes.favoriteAction,type:"button",onClick:this.toggleFavorite})))}}const Le=s(3),je={TwitchGlobal:new k("https://static-cdn.jtvnw.net/emoticons/v1/{{id}}/1.0"),TwitchSubscriber:new k("https://static-cdn.jtvnw.net/emoticons/v1/{{id}}/1.0"),FrankerFaceZ:new k("https://cdn.frankerfacez.com/emoticon/{{id}}/1"),BTTV:new k("https://cdn.betterttv.net/emote/{{id}}/1x")},$e={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{}},Oe=[],ze=["twitch","subscriber","bttv","ffz"],Re=["flip","spin","pulse","spin2","spin3","1spin","2spin","3spin","tr","bl","br","shake","shake2","shake3","flap"];var Ie=new class extends Be{get name(){return"Emotes"}get collection(){return"settings"}get category(){return"general"}get id(){return"emotes"}get categories(){return Object.keys($e).filter(e=>this.isCategoryEnabled(e))}get shouldDownload(){return A.get("emotes",this.category,"download")}isCategoryEnabled(e){return super.get("emotes","categories",e.toLowerCase())}get(e){return super.get("emotes","general",e)}get MessageContentComponent(){return u.getModule(e=>e.defaultProps&&e.defaultProps.hasOwnProperty("disableButtons"))}get Emotes(){return $e}get TwitchGlobal(){return $e.TwitchGlobal}get TwitchSubscriber(){return $e.TwitchSubscriber}get BTTV(){return $e.BTTV}get FrankerFaceZ(){return $e.FrankerFaceZ}get blacklist(){return Oe}get favorites(){return this.favoriteEmotes}getUrl(e,t){return je[e].format({id:$e[e][t]})}getCategory(e){return $e[e]}getRemoteFile(e){return c.repoUrl(`data/emotes/${e.toLowerCase()}.json`)}initialize(){super.initialize(),window.emoteModule=this;const e=v.getBDData("favoriteEmotes");this.favoriteEmotes=e||{},this.addFavorite=this.addFavorite.bind(this),this.removeFavorite=this.removeFavorite.bind(this),this.onCategoryToggle=this.onCategoryToggle.bind(this),this.resetEmotes=this.resetEmotes.bind(this)}async enabled(){A.registerCollection("emotes","Emotes",o,{title:M.Emotes.clearEmotes,onClick:this.resetEmotes}),await this.getBlacklist(),await this.loadEmoteData(),g.on("emotes-favorite-added",this.addFavorite),g.on("emotes-favorite-removed",this.removeFavorite),g.on("setting-updated",this.onCategoryToggle)}disabled(){console.log("DISABLED"),g.off("setting-updated",this.onCategoryToggle),g.off("emotes-favorite-added",this.addFavorite),g.off("emotes-favorite-removed",this.removeFavorite),A.removeCollection("emotes"),this.emptyEmotes(),this.cancelEmoteRender&&(this.cancelEmoteRender(),delete this.cancelEmoteRender)}onCategoryToggle(e,t,s,n){if("emotes"==e&&"categories"==t)return n?this.loadEmoteData(s):this.unloadEmoteData(s)}addFavorite(e,t){this.favoriteEmotes.hasOwnProperty(e)||(this.favoriteEmotes[e]=t),this.saveFavorites()}removeFavorite(e){this.favoriteEmotes.hasOwnProperty(e)&&(delete this.favoriteEmotes[e],this.saveFavorites())}isFavorite(e){return this.favoriteEmotes.hasOwnProperty(e)}saveFavorites(){v.setBDData("favoriteEmotes",this.favoriteEmotes)}emptyEmotes(){for(const e in $e)Object.assign($e,{[e]:{}})}patchMessageContent(){this.cancelEmoteRender||(this.cancelEmoteRender=this.after(this.MessageContentComponent.prototype,"render",(e,t,s)=>{this.after(s.props,"children",(e,t,s)=>{if(0==this.categories.length)return;const n=s.props.children[1];if(!n.props.children)return;const i=n.props.children[1];if(i&&i.length){for(let e=0;e"string"==typeof e&&""==e.replace(/\s*/,"")||(!(!e.type||"BDEmote"!=e.type.name)||!!(e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName))))for(const e of i)"object"==typeof e&&("BDEmote"==e.type.name?e.props.jumboable=!0:e.props&&e.props.children&&e.props.children.props&&e.props.children.props.emojiName&&(e.props.children.props.jumboable=!0))}})}))}async getBlacklist(){try{const e="Blacklist",t=v.emotesExist(e),s=await this.isCacheValid(e),n=s||!s&&t&&!this.shouldDownload?v.getEmoteData(e):await this.downloadEmotes(e);Oe.push(...n)}catch(e){}}isCacheValid(e){return new Promise(t=>{const s=v.getCacheHash("emotes",e);if(!s)return t(!1);Le.head({url:this.getRemoteFile(e),headers:{"If-None-Match":s}},(e,s)=>{t(304==s.statusCode)})})}async loadEmoteData(e){e||(e=this.categories),Array.isArray(e)||(e=[e]);const t=Object.keys($e);e=e.map(e=>t.find(t=>t.toLowerCase()==e.toLowerCase())),_.show(M.Emotes.loading,{type:"info"}),this.emotesLoaded=!1;for(const t of e){const e=v.emotesExist(t),s=await this.isCacheValid(t);let n=null;if(s||!s&&e&&!this.shouldDownload){this.log(`Loading ${t} emotes from local cache.`);const e=v.getEmoteData(t);Object.keys(e).length>0&&(n=e)}n||(n=await this.downloadEmotes(t)),Object.assign($e[t],n),await new Promise(e=>setTimeout(e,1e3))}this.emotesLoaded=!0,g.dispatch("emotes-loaded"),_.show(M.Emotes.loaded,{type:"success"})}unloadEmoteData(e){e||(e=this.categories),Array.isArray(e)||(e=[e]);const t=Object.keys($e);e=e.map(e=>t.find(t=>t.toLowerCase()==e.toLowerCase()));for(const t of e)delete $e[t],$e[t]={}}downloadEmotes(e){const t=this.getRemoteFile(e);this.log(`Downloading ${e} from ${t}`);const s={url:t,timeout:1e4,json:!0};return new Promise(t=>{Le.get(s,(s,n,i)=>{if(s||200!=n.statusCode)return this.stacktrace(`Could not download ${e} emotes.`,s),t({});for(const e in i)(e.length<4||Oe.includes(e)||!i[e])&&delete i[e];v.saveEmoteData(e,i),v.setCacheHash("emotes",e,n.headers.etag),t(i),this.log(`Downloaded ${e}`)})})}resetEmotes(){const e=Object.keys($e);this.unloadEmoteData(e);for(const t of e)v.invalidateCache("emotes",t);this.loadEmoteData()}};class _e extends z.Component{render(){const e=this.props.size||"24px";return z.createElement("svg",{viewBox:"0 0 24 24",style:{width:e,height:e}},z.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),z.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}))}}class qe extends z.Component{constructor(e){super(e),this.hasUnsavedChanges=!1,this.onChange=this.onChange.bind(this),this.toggleLiveUpdate=this.toggleLiveUpdate.bind(this),this.updateCss=this.updateCss.bind(this),this.saveCss=this.saveCss.bind(this),this.openDetached=this.props.openDetached?this.openDetached.bind(this):null,this.openNative=this.openNative.bind(this),this.updateEditor=this.updateEditor.bind(this),this.controls=[{label:z.createElement(ce,{size:"18px"}),tooltip:M.CustomCSS.update,onClick:this.updateCss},{label:z.createElement(J,{size:"18px"}),tooltip:M.CustomCSS.save,onClick:this.saveCss},{label:z.createElement(Z,{size:"18px"}),tooltip:M.CustomCSS.openNative,onClick:this.openNative},{label:z.createElement(K,{size:"18px"}),tooltip:M.CustomCSS.settings,onClick:"showSettings"},{label:M.Collections.settings.customcss.liveUpdate.name,type:"checkbox",onChange:this.toggleLiveUpdate,checked:A.get("settings","customcss","liveUpdate"),side:"right"}],this.openDetached&&this.controls.push({label:z.createElement(_e,{size:"18px"}),tooltip:M.CustomCSS.openDetached,onClick:this.openDetached,side:"right"})}componentDidMount(){g.on("customcss-updated",this.updateEditor)}componentWillUnmount(){g.off("customcss-updated",this.updateEditor)}updateEditor(e){this.editor&&(this.editor.value=e)}get value(){return this.editor.session.getValue()}set value(e){this.editor.setValue(e)}showSettings(){return this.editor.keyBinding.$defaultHandler.commands.showSettingsMenu.exec(this.editor)}resize(){return this.editor.resize()}setEditorRef(e){this.editor=e,this.props.editorRef&&void 0!==this.props.editorRef.current?this.props.editorRef.current=e:this.props.editorRef&&(this.props.editorRef=e)}onChange(){this.hasUnsavedChanges=!0,this.props.onChange&&this.props.onChange(...arguments)}render(){return z.createElement(V,{ref:this.setEditorRef.bind(this),readOnly:this.props.readOnly,id:this.props.id||"bd-customcss-editor",onChange:this.onChange,controls:this.controls,value:this.props.css})}toggleLiveUpdate(e){A.set("settings","customcss","liveUpdate",e)}updateCss(e,t){this.props.update&&this.props.update(t)}saveCss(e,t){this.hasUnsavedChanges=!1,this.props.save&&this.props.save(t)}openDetached(e,t){this.props.openDetached&&this.props.openDetached(t)}openNative(){this.props.openNative&&this.props.openNative()}}const He=s(1),Ue=s(0),We=u.getByProps("updateAccount"),Ge=u.getByProps("dirtyDispatch"),Ve=u.getByProps("ActionTypes").ActionTypes;var Je=new class extends Be{get name(){return"Custom CSS"}get category(){return"customcss"}get id(){return"customcss"}get startDetached(){return"detached"==A.get(this.collection,this.category,"openAction")}get nativeOpen(){return"system"==A.get(this.collection,this.category,"openAction")}constructor(){super(),this.savedCss="",this.insertedCss="",this.isDetached=!1}async enabled(){window.ace||x.injectScript("ace-script","https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js").then(()=>{window.require.original&&(window.require=window.require.original)}),A.registerPanel(this.id,M.Panels.customcss,{order:2,element:()=>[z.createElement(de,{text:M.CustomCSS.editorTitle}),z.createElement(qe,{css:this.savedCss,save:this.saveCSS.bind(this),update:this.insertCSS.bind(this),openNative:this.openNative.bind(this),openDetached:this.openDetached.bind(this),onChange:this.onChange.bind(this)})],onClick:e=>{if(this.isDetached)return;if(this.nativeOpen)return this.openNative();if(this.startDetached)return this.openDetached();const t=c.findInRenderTree(e._reactInternalFiber,e=>e&&e.onSetSection,{walkable:["child","memoizedProps","props","children"]});t&&t.onSetSection&&t.onSetSection(this.id)}}),this.loadCSS(),this.insertCSS(this.savedCss),this.watchContent()}disabled(){A.removePanel(this.id),this.unwatchContent()}watchContent(){if(this.watcher)return this.error("Already watching content.");const e={};this.log("Starting to watch content."),this.watcher=He.watch(v.customCSS,{persistent:!1},async(t,s)=>{if(!t||!s)return;await new Promise(e=>setTimeout(e,50));try{He.statSync(v.customCSS)}catch(t){if("ENOENT"!==t.code)return;delete e[s],this.saveCSS("")}const n=He.statSync(v.customCSS);if(n&&n.mtime&&n.mtime.getTime()&&"number"==typeof n.mtime.getTime()&&e[s]!=n.mtime.getTime()&&(e[s]=n.mtime.getTime(),"change"==t)){const e=v.loadCustomCSS();if(e==this.savedCss)return;this.savedCss=e,this.insertCSS(this.savedCss),g.emit("customcss-updated",this.savedCss)}})}unwatchContent(){if(!this.watcher)return this.error("Was not watching content.");this.watcher.close(),delete this.watcher,this.log("No longer watching content.")}onChange(e){A.get("settings","customcss","liveUpdate")&&(this.insertCSS(e),this.saveCSS(e))}loadCSS(){this.savedCss=v.loadCustomCSS()}insertCSS(e){void 0===e?e=this.insertedCss:this.insertedCss=e,x.updateCustomCSS(e)}saveCSS(e){void 0!==e&&(this.savedCss=e),v.saveCustomCSS(this.savedCss)}openNative(){Ue.shell.openExternal(`file://${v.customCSS}`)}openDetached(e){const t=z.createRef(),s=z.createElement(qe,{id:"bd-floating-editor",ref:t,css:e,save:this.saveCSS.bind(this),update:this.insertCSS.bind(this),openNative:this.openNative.bind(this),onChange:this.onChange.bind(this)});ee.open({onClose:()=>{this.isDetached=!1},onResize:()=>{t&&t.current&&t.current.resize&&t.current.resize()},title:M.CustomCSS.editorTitle,id:"floating-editor-window",height:470,width:410,center:!0,resizable:!0,children:s,confirmClose:()=>!(!t||!t.current)&&t.current.hasUnsavedChanges,confirmationText:M.CustomCSS.confirmationText}),this.isDetached=!0,We.close(),Ge.dirtyDispatch({type:Ve.LAYER_POP})}},Ze=new class extends Be{get name(){return"VoiceMode"}get category(){return"appearance"}get id(){return"voiceMode"}enabled(){document.querySelector(".chat-3bRxxu").style.setProperty("visibility","hidden"),document.querySelector(".chat-3bRxxu").style.setProperty("min-width","0px"),document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow","100000")}disabled(){document.querySelector(".chat-3bRxxu").style.setProperty("visibility",""),document.querySelector(".chat-3bRxxu").style.setProperty("min-width",""),document.querySelector(".channels-Ie2l6A").style.setProperty("flex-grow","")}};const Ke=new RegExp("^(?!da-)((?:[A-Za-z]|[0-9]|-)+)-(?:[A-Za-z]|[0-9]|-|_){6}$");var Ye=new class extends Be{get id(){return"classNormalizer"}get category(){return"general"}get name(){return"ClassNormalizer"}enabled(){this.hasPatched||(this.patchClassModules(u.getModules(this.moduleFilter.bind(this))),this.normalizeElement(document.querySelector("#app-mount")),this.hasPatched=!0,this.patchDOMMethods())}disabled(){this.hasPatched&&(this.unpatchClassModules(u.getModules(this.moduleFilter.bind(this))),this.revertElement(document.querySelector("#app-mount")),this.hasPatched=!1)}patchClassModules(e){for(const t of e)this.patchClassModule("da",t)}unpatchClassModules(e){for(const t of e)this.unpatchClassModule("da",t)}shouldIgnore(e){return!isNaN(e)||(!!(e.endsWith("px")||e.endsWith("ch")||e.endsWith("em")||e.endsWith("ms"))||(!!e.startsWith("layerContainer-")||(!(!e.startsWith("#")||7!=e.length&&4!=e.length)||!(!e.includes("calc(")&&!e.includes("rgba")))))}moduleFilter(e){if("object"!=typeof e||Array.isArray(e))return!1;if(e.__esModule)return!1;if(!Object.keys(e).length)return!1;for(const t in e){const s=e[t];if("string"!=typeof s)return!1;if(!this.shouldIgnore(s)){if(1===s.split("-").length)return!1;if(!Ke.test(s.split(" ")[0]))return!1}}return!0}patchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;const i=n.split(" ");for(const n of i){const i=n.match(Ke);if(!i||!i.length||i.length<2)continue;const o=i[1].split("-").map((e,t)=>t?e[0].toUpperCase()+e.slice(1):e).join("");t[s]+=` ${e}-${o}`}}}unpatchClassModule(e,t){for(const s in t){const n=t[s];if(this.shouldIgnore(n))continue;let i="";const o=n.split(" ");for(const t of o)t.startsWith(`${e}-`)||(i+=` ${t}`);t[s]=i.trim()}}normalizeElement(e){if(!(e instanceof Element))return;const t=e.classList;for(let s=0,n=t.length;st?e[0].toUpperCase()+e.slice(1):e).join("");e.classList.add(`da-${n}`)}for(const t of e.children)this.normalizeElement(t)}revertElement(e){if(!(e instanceof Element))return;e.children&&e.children.length&&this.revertElement(e.children[0]),e.nextElementSibling&&this.revertElement(e.nextElementSibling);const t=e.classList,s=[];for(let e=0;ee.call(this,t))}}},Qe=new class extends Be{get name(){return"DeveloperMode"}get category(){return"developer"}get id(){return"developerMode"}get selectorModeID(){return"copySelector"}get selectorMode(){return this.get(this.selectorModeID)}constructor(){super(),this.enableSelectors=this.enableSelectors.bind(this),this.disableSelectors=this.disableSelectors.bind(this)}enabled(){$(document).on("keydown.bdDevmode",e=>{119!==e.which&&118!=e.which||this.log("Debugger Activated")}),this.selectorMode&&this.enableSelectors(),this.selectorCancel=this.registerSetting(this.selectorModeID,this.enableSelectors,this.disableSelectors)}disabled(){$(document).off("keydown.bdDevmode"),this.selectorMode&&this.disableSelectors(),this.selectorCancel&&this.selectorCancel()}enableSelectors(){$(document).on("contextmenu.bdDevmode",e=>{this.lastSelector=this.getSelector(e.toElement);setImmediate(()=>{let t=$(".contextMenu-HLZMGh");t.length<=0&&(t=$('
'),t.addClass($(".app, .app-2rEoOp").hasClass("theme-dark")?"theme-dark":"theme-light"),t.appendTo(".app, .app-2rEoOp"),t.css("top",e.clientY),t.css("left",e.clientX),$(document).on("click.bdDevModeCtx",()=>{t.remove(),$(document).off(".bdDevModeCtx")}),$(document).on("contextmenu.bdDevModeCtx",()=>{t.remove(),$(document).off(".bdDevModeCtx")}),$(document).on("keyup.bdDevModeCtx",e=>{27===e.keyCode&&(t.remove(),$(document).off(".bdDevModeCtx"))}));const s=$("
",{class:"itemGroup-1tL0uz"}),n=$("
",{class:"item-1Yvehc",click:()=>{p.ElectronModule.copy(this.lastSelector),t.hide()}}).append($("",{text:M.Collections.settings.developer.copySelector.name}));s.append(n),t.append(s),t.hasClass("undefined")&&t.css("top","-="+s.outerHeight())}),e.stopPropagation()})}disableSelectors(){$(document).off("contextmenu.bdDevmode"),$(document).off("contextmenu.bdDevModeCtx")}getRules(e,t=e.ownerDocument.styleSheets){return[...t].filter(e=>!e.href||!e.href.includes("BetterDiscordApp")).map(e=>[...e.cssRules||[]]).flat().filter(t=>t&&t.selectorText&&e.matches(t.selectorText)&&t.style.length&&t.selectorText.split(", ").length<8&&!t.selectorText.split(", ").includes("*"))}getSelector(e){if(e.id)return`#${e.id}`;const t=this.getRules(e),s=t[t.length-1];return s?s.selectorText:e.classList.length?`.${Array.from(e.classList).join(".")}`:`.${Array.from(e.parentElement.classList).join(".")}`}};class Xe extends z.Component{constructor(e){super(e),this.props.server.iconUrl||(this.props.server.iconUrl=this.props.defaultAvatar()),this.state={imageError:!1,joined:this.props.joined},this.join=this.join.bind(this),this.handleError=this.handleError.bind(this)}render(){const{server:e}=this.props,t="string"==typeof this.state.joined?`${M.PublicServers.joining}...`:this.state.joined?M.PublicServers.joined:M.PublicServers.join,s=`bd-button${1==this.state.joined?" bd-button-success":""}`;return z.createElement("div",{className:`bd-server-card${e.pinned?" bd-server-card-pinned":""}`},z.createElement("img",{className:"bd-server-image",src:e.iconUrl,onError:this.handleError}),",",z.createElement("div",{className:"bd-server-content"},z.createElement("div",{className:"bd-server-header"},z.createElement("h5",{className:"bd-server-name"},e.name),z.createElement("h5",{className:"bd-server-member-count"},e.members," Members")),z.createElement("div",{className:"bd-scroller-wrap bd-server-description-container"},z.createElement("div",{className:"bd-scroller bd-server-description"},e.description)),z.createElement("div",{className:"bd-server-footer"},z.createElement("div",{className:"bd-server-tags"},e.categories.join(", ")),z.createElement("button",{type:"button",className:s,onClick:this.join},t))))}handleError(){this.props.server.iconUrl=this.props.defaultAvatar(),this.setState({imageError:!0})}async join(){if(this.state.joined)return;this.setState({joined:"joining"});const e=await this.props.join(this.props.server.identifier,this.props.server.nativejoin);this.setState({joined:e})}}const et=u.getByProps("getSortedGuilds"),tt=u.getByProps("getUserAvatarURL","DEFAULT_AVATARS"),st=u.getByProps("acceptInvite"),nt=s(0).remote.BrowserWindow;class it{static get endPoint(){return"https://search.discordservers.com"}static get joinEndPoint(){return"https://j.discordservers.com"}static get connectEndPoint(){return"https://auth.discordservers.com/info"}static getDefaultAvatar(){return tt.DEFAULT_AVATARS[Math.floor(5*Math.random())]}static hasJoined(e){return et.getFlattenedGuildIds().includes(e)}static search({term:e="",category:t="",from:s=0}={}){return new Promise(n=>{const i=[];t&&i.push(`category=${t.replace(/ /g,"%20")}`),e&&i.push(`term=${e.replace(/ /g,"%20")}`),s&&i.push(`from=${s}`);const o=`?${i.join("&")}`;$.ajax({method:"GET",url:`${this.endPoint}${o}`,success:e=>{const t=e.size+e.from;n({servers:e.results,size:e.size,from:e.from,total:e.total,next:t>=e.total?null:t})},error:()=>n(null)})})}static join(e,t=!1){return new Promise(s=>{if(t)return st.acceptInvite(e),s(!0);$.ajax({method:"GET",url:`${this.joinEndPoint}/${e}`,headers:{Accept:"application/json;","Content-Type":"application/json;","x-discord-token":this._accessToken},crossDomain:!0,xhrFields:{withCredentials:!0},success:()=>s(!0),error:()=>s(!1)})})}static checkConnection(){return new Promise(e=>{try{$.ajax({method:"GET",url:this.connectEndPoint,headers:{Accept:"application/json;","Content-Type":"application/json;"},crossDomain:!0,xhrFields:{withCredentials:!0},success:t=>{this._accessToken=t.access_token,e(t)},error:()=>e(!1)})}catch(t){e(!1)}})}static connect(){return new Promise(e=>{const t=new nt(this.windowOptions),s=`https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=${this.connectEndPoint}`;t.webContents.on("did-navigate",(s,n)=>{n==this.connectEndPoint&&(t.close(),e())}),t.loadURL(s)})}static get windowOptions(){return{width:380,height:450,backgroundColor:"#282b30",show:!0,resizable:!0,maximizable:!1,minimizable:!1,alwaysOnTop:!0,frame:!1,center:!0,webPreferences:{nodeIntegration:!1}}}}const ot=u.getByDisplayName("SettingsView");class rt extends z.Component{get categoryButtons(){return["All","FPS Games","MMO Games","Strategy Games","MOBA Games","RPG Games","Tabletop Games","Sandbox Games","Simulation Games","Music","Community","Language","Programming","Other"]}constructor(e){super(e),this.state={category:"All",query:"",loading:!0,user:null,results:{servers:[],size:0,from:0,total:0,next:null}},this.changeCategory=this.changeCategory.bind(this),this.searchKeyDown=this.searchKeyDown.bind(this),this.connect=this.connect.bind(this),this.loadNextPage=this.loadNextPage.bind(this)}componentDidMount(){this.checkConnection()}async checkConnection(){const e=await it.checkConnection();if(!e)return this.setState({loading:!0,user:null});this.setState({user:e}),this.search()}async connect(){await it.connect(),this.checkConnection()}searchKeyDown(e){this.state.loading||13!==e.which||this.search(e.target.value)}async search(e="",t=0){this.setState({query:e,loading:!0});const s=await it.search({term:e,category:"All"==this.state.category?"":this.state.category,from:t});if(!s)return this.setState({results:{servers:[],size:0,from:0,total:0,next:null}});this.setState({loading:!1,results:s})}async changeCategory(e){this.state.loading||(await new Promise(t=>this.setState({category:e},t)),this.search())}loadNextPage(){this.state.loading||this.search(this.state.query,this.state.results.next)}async join(e,t=!1){return await it.join(e,t)}get searchBox(){return z.createElement(ve,{onKeyDown:this.searchKeyDown,placeholder:`${M.PublicServers.search}...`})}get title(){if(!this.state.user)return M.PublicServers.notConnected;if(this.state.loading)return`${M.PublicServers.loading}...`;const e=this.state.results.from+1,t=this.state.results.total,s=this.state.results.next?this.state.results.next:t;let n=M.PublicServers.results.format({start:e,end:s,total:t,category:this.state.category});return this.state.query&&(n+=" "+M.PublicServers.query.format({query:this.state.query})),n}get content(){const e=this.state.user?null:{title:M.PublicServers.connect,onClick:this.connect},t="All"!=this.state.category&&this.state.user?null:this.bdServer,s=this.state.results.servers.map(e=>z.createElement(Xe,{key:e.identifier,server:e,joined:it.hasJoined(e.identifier),defaultAvatar:it.getDefaultAvatar}));return[z.createElement(de,{text:this.title,button:e}),t,s,this.state.results.next?this.nextButton:null,this.state.results.servers.length>0&&z.createElement(de,{text:this.title})]}get nextButton(){return z.createElement("button",{type:"button",className:"bd-button bd-button-next",onClick:this.loadNextPage},this.state.loading?M.PublicServers.loading:M.PublicServers.loadMore)}get connection(){const{user:e}=this.state;return e?z.createElement("div",{id:"bd-connection"},z.createElement("div",{className:"bd-footnote"},M.PublicServers.connection.format(e)),z.createElement("button",{type:"button",className:"bd-button bd-button-reconnect",onClick:this.connect},M.PublicServers.reconnect)):z.createElement("div",{id:"bd-connection"})}get bdServer(){const e={name:"BetterDiscord",online:"7500+",members:"20000+",categories:["community","programming","support"],description:"Official BetterDiscord server for plugins, themes, support, etc",identifier:"86004744966914048",iconUrl:"https://cdn.discordapp.com/icons/86004744966914048/292e7f6bfff2b71dfd13e508a859aedd.webp",nativejoin:!0,invite_code:"0Tmfo5ZbORCRqbAd",pinned:!0};return z.createElement(Xe,{server:e,pinned:!0,joined:it.hasJoined(e.identifier),defaultAvatar:it.getDefaultAvatar})}render(){const e=this.categoryButtons.map(e=>({section:e,label:e,element:()=>this.content}));return z.createElement(ot,{onClose:this.props.close,onSetSection:this.changeCategory,section:this.state.category,sections:[{section:"HEADER",label:M.PublicServers.search},{section:"CUSTOM",element:()=>this.searchBox},{section:"HEADER",label:M.PublicServers.categories},...e,{section:"DIVIDER"},{section:"HEADER",label:z.createElement("a",{href:"https://discordservers.com",target:"_blank"},"DiscordServers.com")},{section:"DIVIDER"},{section:"CUSTOM",element:()=>this.connection}],theme:"dark"})}}const at=u.getByProps("pushLayer");var lt=new class extends Be{get name(){return"PublicServers"}get category(){return"general"}get id(){return"publicServers"}enabled(){const e=p.GuildClasses.wrapper.split(" ")[0];$(`.${e} .scroller-2FKFPG >:first-child`).after(this.button)}disabled(){$("#bd-pub-li").remove()}openPublicServers(){at.pushLayer(()=>p.React.createElement(rt,{close:at.popLayer}))}get button(){return $("
",{class:p.GuildClasses.listItem,id:"bd-pub-li"}).append($("
",{class:"wrapper-25eVIn "+p.GuildClasses.circleButtonMask,text:M.PublicServers.button,id:"bd-pub-button",click:()=>{this.openPublicServers()}}))}},dt=new class extends Be{get name(){return"DarkMode"}get category(){return"appearance"}get id(){return"darkMode"}enabled(){document.getElementById("app-mount").classList.add("bda-dark","bd-dark")}disabled(){document.getElementById("app-mount").classList.remove("bda-dark","bd-dark")}},ct=new class extends Be{get name(){return"MinimalMode"}get category(){return"appearance"}get id(){return"minimalMode"}get hideChannelsID(){return"hideChannels"}get hideChannels(){return this.get(this.hideChannelsID)}constructor(){super(),this.enableHideChannels=this.enableHideChannels.bind(this),this.disableHideChannels=this.disableHideChannels.bind(this)}enabled(){document.body.classList.add("bd-minimal"),this.hideChannels&&this.enableHideChannels(),this.hideChannelCancel=this.registerSetting(this.hideChannelsID,this.enableHideChannels,this.disableHideChannels)}disabled(){document.body.classList.remove("bd-minimal"),this.hideChannels&&this.disableHideChannels(),this.hideChannelCancel&&this.hideChannelCancel()}enableHideChannels(){document.body.classList.add("bd-minimal-chan")}disableHideChannels(){document.body.classList.remove("bd-minimal-chan")}},ht=new class extends Be{get name(){return"24Hour"}get category(){return"general"}get id(){return"twentyFourHour"}enabled(){this.inject24Hour()}disabled(){this.unpatchAll()}inject24Hour(){const e=new RegExp("([0-9]{1,2}):([0-9]{1,2})\\s(AM|PM)"),t=(t,s,n)=>{const i=n.match(e);if(i&&4===i.length)return"AM"===i[3]?n.replace(i[0],`${"12"===i[1]?"00":i[1].padStart(2,"0")}:${i[2]}`):n.replace(i[0],`${"12"===i[1]?"12":parseInt(i[1])+12}:${i[2]}`)};this.after(p.TimeFormatter,"calendarFormat",t),this.after(p.TimeFormatter,"dateFormat",t)}};const ut=u.getModule(e=>e.default&&e.default.displayName&&"Message"==e.default.displayName);var pt=new class extends Be{get name(){return"ColoredText"}get category(){return"appearance"}get id(){return"coloredText"}enabled(){this.injectColoredText()}disabled(){this.unpatchAll()}injectColoredText(){this.after(ut.prototype,"render",(e,t,s)=>{this.after(s.props,"children",{silent:!0,after:({returnValue:t})=>{const s=t.props.children[1],n=e.props.message.colorString;s&&n&&(s.props.style={color:n})}})})}removeColoredText(){document.querySelectorAll(".markup-2BOw-j").forEach(e=>{e.style.setProperty("color","")})}},mt=new class extends Be{get name(){return"VoiceDisconnect"}get category(){return"general"}get id(){return"voiceDisconnect"}constructor(){super(),this.beforeUnload=this.beforeUnload.bind(this)}enabled(){window.addEventListener("beforeunload",this.beforeUnload)}disabled(){window.removeEventListener("beforeunload",this.beforeUnload)}beforeUnload(){p.ChannelActions.selectVoiceChannel(null,null)}};const gt=(e,t,s={})=>{const{onContextMenu:n,onClick:i}=s,o=c.parseHTML(`
\n ${e}\n
`);return n&&o.addEventListener("contextmenu",n),o.addEventListener("click",i),o};var ft=new class extends Be{get name(){return"EmoteMenu"}get collection(){return"emotes"}get category(){return"general"}get id(){return"emoteMenu"}get hideEmojisID(){return"hideEmojiMenu"}get hideEmojis(){return this.get(this.hideEmojisID)}constructor(){super(),this.lastTab="bd-qem-emojis",this.qmeHeader=c.parseHTML('
\n \n \n
');for(const e of this.qmeHeader.getElementsByTagName("button"))e.addEventListener("click",this.switchMenu.bind(this));this.teContainer=c.parseHTML('
\n
\n
\n
\n\n
\n
\n
\n
'),this.teContainerInner=this.teContainer.querySelector(".emote-menu-inner"),this.faContainer=c.parseHTML('
\n
\n
\n
\n\n
\n
\n
\n
'),this.faContainerInner=this.faContainer.querySelector(".emote-menu-inner"),this.observer=new MutationObserver(e=>{for(const t of e)this.observe(t)}),this.enableHideEmojis=this.enableHideEmojis.bind(this),this.disableHideEmojis=this.disableHideEmojis.bind(this),this.updateTwitchEmotes=this.updateTwitchEmotes.bind(this)}async enabled(){this.log("Starting to observe"),this.observer.observe(document.getElementById("app-mount"),{childList:!0,subtree:!0}),this.hideEmojiCancel=this.registerSetting(this.hideEmojisID,this.enableHideEmojis,this.disableHideEmojis),this.hideEmojis&&this.enableHideEmojis(),Ie.emotesLoaded&&this.updateTwitchEmotes(),this.updateFavorites(),g.on("emotes-loaded",this.updateTwitchEmotes)}disabled(){g.off("emotes-loaded",this.updateTwitchEmotes),this.observer.disconnect(),this.disableHideEmojis(),this.hideEmojiCancel&&this.hideEmojiCancel()}enableHideEmojis(){const e=document.querySelector(".emojiPicker-3m1S-j");e&&e.classList.add("bd-qme-hidden")}disableHideEmojis(){const e=document.querySelector(".emojiPicker-3m1S-j");e&&e.classList.remove("bd-qme-hidden")}insertEmote(e){const t=c.getTextArea();c.insertText(t[0]," "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)}favContext(e){e.stopPropagation();const t=e.target.closest(".emote-container").children[0],s=$('
Remove
');s.css({top:e.pageY-$("#bd-qem-favourite-container").offset().top,left:e.pageX-$("#bd-qem-favourite-container").offset().left}),$(t).parent().append(s),s.on("click",e=>{e.preventDefault(),e.stopPropagation(),$(t).remove(),Ie.removeFavorite($(t).attr("title")),this.updateFavorites(),$(document).off("mousedown.emotemenu")}),$(document).on("mousedown.emotemenu",(function(e){"removemenu"!=e.target.id&&($("#removemenu").remove(),$(document).off("mousedown.emotemenu"))}))}switchMenu(e){let t="string"==typeof e?e:e.target.id;"bd-qem-emojis"==t&&this.hideEmojis&&(t="bd-qem-favourite");const s=$("#bd-qem-twitch"),n=$("#bd-qem-favourite"),i=$("#bd-qem-emojis");switch(s.removeClass("active"),n.removeClass("active"),i.removeClass("active"),$(".emojiPicker-3m1S-j").hide(),$("#bd-qem-favourite-container").hide(),$("#bd-qem-twitch-container").hide(),t){case"bd-qem-twitch":s.addClass("active"),$("#bd-qem-twitch-container").show();break;case"bd-qem-favourite":n.addClass("active"),$("#bd-qem-favourite-container").show();break;case"bd-qem-emojis":i.addClass("active"),$(".emojiPicker-3m1S-j").show(),$(".emojiPicker-3m1S-j input").focus()}t&&(this.lastTab=t)}observe(e){if(!(e.addedNodes.length&&e.addedNodes[0]instanceof Element))return;const t=e.addedNodes[0];if(!t.classList.contains("layer-v9HyYc")||!t.getElementsByClassName("emojiPicker-3m1S-j").length||t.querySelector(".emojiPicker-3m1S-j").parentElement.classList.contains("animatorLeft-1EQxU0"))return;const s=$(t);this.hideEmojis?s.addClass("bd-qme-hidden"):s.removeClass("bd-qme-hidden"),s.prepend(this.qmeHeader),s.append(this.teContainer),s.append(this.faContainer),this.switchMenu(this.lastTab)}updateTwitchEmotes(){for(;this.teContainerInner.firstChild;)this.teContainerInner.firstChild.remove();for(const e in Ie.getCategory("TwitchGlobal")){if(!Ie.getCategory("TwitchGlobal").hasOwnProperty(e))continue;const t=Ie.getUrl("TwitchGlobal",e),s=gt(e,t,{onClick:this.insertEmote.bind(this,e)});this.teContainerInner.append(s)}}updateFavorites(){for(;this.faContainerInner.firstChild;)this.faContainerInner.firstChild.remove();for(const e in Ie.favorites){const t=Ie.favorites[e],s=gt(e,t,{onClick:this.insertEmote.bind(this,e),onContextMenu:this.favContext.bind(this)});this.faContainerInner.append(s)}Ie.saveFavorites()}},bt=new class extends Be{get name(){return"EmoteAutocapitalize"}get collection(){return"emotes"}get category(){return"general"}get id(){return"autoCaps"}enabled(){$("body").off(".bdac"),$("body").on("keyup.bdac change.bdac paste.bdac",$(".channelTextArea-1LDbYG textarea:first"),()=>{const e=$(".channelTextArea-1LDbYG textarea:first").val();if(null==e)return;const t=e.split(" ").pop();if(t.length>3){if("danSgame"==t)return;const s=this.capitalize(t.toLowerCase());null!=s&&c.insertText(c.getTextArea()[0],e.replace(t,s))}})}disabled(){$("body").off(".bdac")}capitalize(e){const t=Ie.getCategory("TwitchGlobal");for(const s in t)if(t.hasOwnProperty(s)&&e==(s+"").toLowerCase())return s}};const yt=s(1),vt=s(2);var wt=new class extends Be{get name(){return"WindowPrefs"}get category(){return"window"}get id(){return"transparency"}get WindowConfigFile(){if(this._windowConfigFile)return this._windowConfigFile;const e=s(0).remote.app,t=e.getAppPath(),n=e.getPath("userData"),i=vt.resolve(n,e.getVersion(),"modules","discord_desktop_core","injector","config.json"),o=vt.resolve(t,"..","app","config.json"),r=yt.existsSync(o)?o:yt.existsSync(i)?i:null;return this._windowConfigFile=r||null}enabled(){this.setWindowPreference("transparent",!0),this.setWindowPreference("backgroundColor",null)}disabled(){this.setWindowPreference("transparent",!1),this.setWindowPreference("backgroundColor","#2f3136")}getAllWindowPreferences(){return this.WindowConfigFile?require(this.WindowConfigFile):{}}getWindowPreference(e){if(this.WindowConfigFile)return this.getAllWindowPreferences()[e]}setWindowPreference(e,t){if(!this.WindowConfigFile)return;const n=this.getAllWindowPreferences();n[e]=t,delete s.c[this.WindowConfigFile],yt.writeFileSync(this.WindowConfigFile,JSON.stringify(n,null,4))}};class Ct extends z.Component{render(){return z.createElement("svg",{className:"bd-logo "+this.props.className,height:"100%",width:this.props.size||"16px",viewBox:"0 0 2000 2000",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}},z.createElement("metadata",null),z.createElement("defs",null,z.createElement("filter",{id:"shadow1"},z.createElement("feDropShadow",{dx:"20",dy:"0",stdDeviation:"20",floodColor:"rgba(0,0,0,0.35)"})),z.createElement("filter",{id:"shadow2"},z.createElement("feDropShadow",{dx:"15",dy:"0",stdDeviation:"20",floodColor:"rgba(255,255,255,0.15)"})),z.createElement("filter",{id:"shadow3"},z.createElement("feDropShadow",{dx:"10",dy:"0",stdDeviation:"20",floodColor:"rgba(0,0,0,0.35)"}))),z.createElement("g",null,z.createElement("path",{style:{filter:"url(#shadow3)"},fill:"#171717",opacity:"1",d:"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z"}),z.createElement("path",{style:{filter:"url(#shadow2)"},fill:"#3E82E5",opacity:"1",d:"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z"}),z.createElement("path",{style:{filter:"url(#shadow1)"},fill:"#FFFFFF",opacity:"1",d:"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z"})))}}var St=new class{initialize(){c.suppressErrors(this.patchSocial.bind(this),"BD Social Patch")(),c.suppressErrors(this.patchGuildPills.bind(this),"BD Guild Pills Patch")(),c.suppressErrors(this.patchGuildListItems.bind(this),"BD Guild List Items Patch")(),c.suppressErrors(this.patchGuildSeparator.bind(this),"BD Guild Separator Patch")()}patchSocial(){if(this.socialPatch)return;const e=u.getByDisplayName("TabBar"),t=u.getByDisplayName("Anchor");e&&t&&(this.socialPatch=B.after("ThemeHelper",e.prototype,"render",(e,s,n)=>{const i=n.props.children;if(!i||!i.length)return;if("Separator"!==i[i.length-2].type.displayName)return;if(!i[i.length-1].type.toString().includes("socialLinks"))return;const o=i[i.length-1].type;i[i.length-1].type=function(){const e=o(...arguments);return e.props.children.push(p.React.createElement(t,{className:"bd-social-link",href:"https://github.com/rauenzi/BetterDiscordApp",rel:"author",title:"BandagedBD",target:"_blank"},p.React.createElement(Ct,{size:"16px",className:"bd-social-logo"}))),e}}))}patchGuildListItems(){if(this.guildListItemsPatch)return;const e=p.GuildClasses.listItem.split(" ")[0],t=p.GuildClasses.blobContainer.split(" ")[0],s=c.getReactInstance(document.querySelector(`.${e} .${t}`).parentElement).return.type;s&&(this.guildListItemsPatch=B.after("ThemeHelper",s.prototype,"render",(e,t,s)=>{if(!s||!e)return;const n=e.props;return s.props.className+=" bd-guild",n.unread&&(s.props.className+=" bd-unread"),n.selected&&(s.props.className+=" bd-selected"),n.audio&&(s.props.className+=" bd-audio"),n.video&&(s.props.className+=" bd-video"),n.badge&&(s.props.className+=" bd-badge"),n.animatable&&(s.props.className+=" bd-animatable"),s}))}patchGuildPills(){if(this.guildPillPatch)return;const e=u.getModule(e=>e.default&&!e.default.displayName&&e.default.toString&&e.default.toString().includes("translate3d"));e&&(this.guildPillPatch=B.after("ThemeHelper",e,"default",(e,t,s)=>{const n=t[0];return n.unread&&(s.props.className+=" bd-unread"),n.selected&&(s.props.className+=" bd-selected"),n.hovered&&(s.props.className+=" bd-hovered"),s}))}patchGuildSeparator(){if(this.guildSeparatorPatch)return;const e=u.getByDisplayName("Guilds"),t=u.getByProps("renderListItem");if(!t||!e)return;const s=function(){const e=t.Separator(...arguments);return e.props.className+=" bd-guild-separator",e};this.guildSeparatorPatch=B.after("ThemeHelper",e.prototype,"render",(e,t,n)=>{const i=c.findInReactTree(n,e=>e.type&&!e.type.displayName&&"function"==typeof e.type&&c.isEmpty(e.props));i&&(i.type=s)})}};const Et=p.GuildClasses;function Pt(){}Pt.prototype.setConfig=function(e){Object.assign(i,e)},Pt.prototype.init=async function(){if(i.version
Please download the latest version from GitHub");if(window.ED)return void X.alert("Not Supported","BandagedBD does not work with EnhancedDiscord. Please uninstall one of them.");if(window.WebSocket&&window.WebSocket.name&&window.WebSocket.name.includes("Patched"))return void X.alert("Not Supported","BandagedBD does not work with Powercord. Please uninstall one of them.");v.initialize(),await P.initialize(),d.log("Startup","Initializing Settings"),A.initialize(),x.initialize(),await this.waitForGuilds(),O.initialize(),St.initialize();for(const e in n)n[e].initialize();d.log("Startup","Loading Plugins");const e=Ae.initialize();d.log("Startup","Loading Themes");const t=Ne.initialize();d.log("Startup","Removing Loading Icon"),document.getElementsByClassName("bd-loaderv2")[0].remove(),d.log("Startup","Collecting Startup Errors"),X.showAddonErrors({plugins:e,themes:t})},Pt.prototype.waitForGuilds=function(){let e=0;return new Promise(t=>{const s=function(){e++,"complete"!=document.readyState&&setTimeout(s,100);const n=Et.wrapper.split(" ")[0],o=Et.listItem.split(" ")[0],r=Et.blobContainer.split(" ")[0];return document.querySelectorAll(`.${n} .${o} .${r}`).length>0||e>=50?t(i.deferLoaded=!0):void setTimeout(s,100)};s()})};var xt=new Pt;const kt={get React(){return p.React},get ReactDOM(){return p.ReactDOM},get WindowConfigFile(){if(this._windowConfigFile)return this._windowConfigFile;const e=s(0).remote.app,t=s(2),n=e.getAppPath(),i=e.getPath("userData"),o=t.resolve(i,e.getVersion(),"modules","discord_desktop_core","injector","config.json"),r=t.resolve(n,"..","app","config.json"),a=s(1),l=a.existsSync(r)?r:a.existsSync(o)?o:null;return this._windowConfigFile=l||null},getAllWindowPreferences:function(){return this.WindowConfigFile?require(this.WindowConfigFile):{}},getWindowPreference:function(e){if(this.WindowConfigFile)return this.getAllWindowPreferences()[e]},setWindowPreference:function(e,t){if(!this.WindowConfigFile)return;const n=s(1),i=this.getAllWindowPreferences();i[e]=t,delete s.c[this.WindowConfigFile],n.writeFileSync(this.WindowConfigFile,JSON.stringify(i,null,4))},injectCSS:function(e,t){x.injectStyle(e,t)},clearCSS:function(e){x.removeStyle(e)},linkJS:function(e,t){return x.injectScript(e,t)},unlinkJS:function(e){x.removeScript(e)},alert:function(e,t){X.alert(e,t)},showConfirmationModal:function(e,t,s={}){return X.showConfirmationModal(e,t,s)},showToast:function(e,t={}){_.show(e,t)},findModule:function(e){return u.getModule(e)},findAllModules:function(e){return u.getModule(e,!1)},findModuleByProps:function(...e){return u.getByProps(...e)},findModuleByPrototypes:function(...e){return u.getByPrototypes(...e)},findModuleByDisplayName:function(e){return u.getByDisplayName(e)},getInternalInstance:function(e){if(e instanceof window.jQuery||e instanceof Element)return e instanceof jQuery&&(e=e[0]),c.getReactInstance(e)},loadData:function(e,t){return v.getPluginData(e,t)}};kt.getData=kt.loadData,kt.saveData=function(e,t,s){return v.setPluginData(e,t,s)},kt.setData=kt.saveData,kt.deleteData=function(e,t){return v.deletePluginData(e,t)},kt.monkeyPatch=function(e,t,s){const{before:n,after:i,instead:o,once:r=!1,silent:a=!1,force:l=!1}=s,d=s.displayName||e.displayName||e.name||e.constructor.displayName||e.constructor.name;if(a||console.log("patch",t,"of",d),!e[t]){if(!l)return console.error(t,"does not exist for",d);e[t]=function(){}}const h=e[t],u=()=>{a||console.log("unpatch",t,"of",d),e[t]=h};return e[t]=function(){const s={thisObject:this,methodArguments:arguments,cancelPatch:u,originalMethod:h,callOriginalMethod:()=>s.returnValue=s.originalMethod.apply(s.thisObject,s.methodArguments)};if(o){const n=c.suppressErrors(o,"`instead` callback of "+e[t].displayName)(s);void 0!==n&&(s.returnValue=n)}else n&&c.suppressErrors(n,"`before` callback of "+e[t].displayName)(s),s.callOriginalMethod(),i&&c.suppressErrors(i,"`after` callback of "+e[t].displayName)(s);return r&&u(),s.returnValue},e[t].__monkeyPatched=!0,e[t].__originalMethod||(e[t].__originalMethod=h),e[t].displayName="patched "+(e[t].displayName||t),u},kt.onRemoved=function(e,t){return c.onRemoved(e,t)},kt.suppressErrors=function(e,t){return c.suppressErrors(e,t)},kt.testJSON=function(e){return c.testJSON(e)},kt.getPlugin=function(e){return Ae.addonList.find(t=>t.name==e)},kt.isPluginEnabled=function(e){const t=this.getPlugin(e);return!!t&&Ae.isEnabled(t.id)},kt.isThemeEnabled=function(e){const t=Ne.addonList.find(t=>t.name==e);return!!t&&Ne.isEnabled(t.id)},kt.getBDData=function(e){return v.getBDData(e)},kt.setBDData=function(e,t){return v.setBDData(e,t)};var Mt=kt;s.d(t,"default",(function(){return Dt}));const At=document.createElement("div");At.className="bd-loaderv2",At.title="BandagedBD is loading...",document.body.appendChild(At),window.BdApi=Mt,window.pluginModule=Ae,window.themeModule=Ne,window.bdEmotes=Ie.Emotes,window.bemotes=Ie.blacklist,window.settingsModule=A,window.DataStore=v,window.DomManager=x,window.utils=c,window.Components=O,window.BDEvents=g,window.bdConfig=i,window.Strings=M;class Dt{constructor(e){xt.setConfig(e)}init(){xt.init()}}!function(){const e="betterdiscord/",t=s(4),n=t._load;t._load=function(t){if("betterdiscord"===t||t.startsWith(e)){if("api"==t.substr(e.length))return Mt}return n.apply(this,arguments)}}()}]).default; \ No newline at end of file diff --git a/src/ui/modals.js b/src/ui/modals.js index 65de8c14..989dffd8 100644 --- a/src/ui/modals.js +++ b/src/ui/modals.js @@ -204,7 +204,7 @@ export default class Modals { click.preventDefault(); click.stopPropagation(); ModalStack.pop(); - BDV2.joinBD2(); + // TODO: BDV2.joinBD2(); }; const supportLink = Anchor ? ce(Anchor, {onClick: joinSupportServer}, "Join our Discord Server.") : ce("a", {className: `${AnchorClasses.anchor} ${AnchorClasses.anchorUnderlineOnHover}`, onClick: joinSupportServer}, "Join our Discord Server."); const defaultFooter = ce(TextElement,{size: TextElement.Sizes.SMALL, color: TextElement.Colors.PRIMARY}, "Need support? ", supportLink); diff --git a/src/ui/settings/addoncard.jsx b/src/ui/settings/addoncard.jsx index 7701ce4e..c1e31def 100644 --- a/src/ui/settings/addoncard.jsx +++ b/src/ui/settings/addoncard.jsx @@ -97,13 +97,14 @@ export default class AddonCard extends React.Component { buildLink(which) { const url = this.props.addon[which]; if (which == "invite") { - const onClick = () => { - const tester = /\.gg\/(.*)$/; - let code = url; - if (tester.test(code)) code = code.match(tester)[1]; - BDV2.LayerStack.popLayer(); - BDV2.InviteActions.acceptInviteAndTransitionToInviteChannel(code); - }; + // TODO: + // const onClick = () => { + // const tester = /\.gg\/(.*)$/; + // let code = url; + // if (tester.test(code)) code = code.match(tester)[1]; + // BDV2.LayerStack.popLayer(); + // BDV2.InviteActions.acceptInviteAndTransitionToInviteChannel(code); + // }; } if (!url) return null; return {Strings.Addons[which]};