diff --git a/js/main.js b/js/main.js index 7d7768d3..cc29c7a2 100644 --- a/js/main.js +++ b/js/main.js @@ -287,7 +287,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0gl /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _webpackModules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _ui_publicservers_publicServers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/publicservers/publicServers */ \"./src/ui/publicservers/publicServers.js\");\n/* harmony import */ var _ui_publicservers_layer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/publicservers/layer */ \"./src/ui/publicservers/layer.js\");\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class V2_PublicServers {\n constructor() {\n this._appendButton = this._appendButton.bind(this);\n }\n\n get component() {\n return _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_ui_publicservers_layer__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n rootId: \"pubslayerroot\",\n id: \"pubslayer\"\n }, _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_ui_publicservers_publicServers__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n rootId: \"pubslayerroot\"\n }));\n }\n\n get root() {\n const _root = document.getElementById(\"pubslayerroot\");\n\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.root;\n }\n\n return _root;\n }\n\n injectRoot() {\n const layers = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\".layers, .layers-3iHuyZ\");\n if (!layers) return false;\n layers.append(_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(\"
\"));\n return true;\n }\n\n render() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layers\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactDom.render(this.component, root);\n }\n\n get button() {\n const btn = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`
`);\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-1\"]) btn.style.display = \"none\";\n const label = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`
public
`);\n label.addEventListener(\"click\", () => {\n this.render();\n });\n btn.append(label);\n return btn;\n }\n\n _appendButton() {\n if (_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-pub-li\")) return;\n const wrapper = _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].guildClasses.wrapper.split(\" \")[0];\n const guilds = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(`.${wrapper} .scroller-2FKFPG >:first-child`);\n _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].after(guilds, this.button);\n }\n\n addButton() {\n if (this.guildPatch) return;\n const GuildList = _webpackModules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].find(m => m.default && m.default.displayName == \"NavigableGuilds\");\n if (!GuildList) _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn(\"PublicServer\", \"Can't find GuildList component\");\n this.guildPatch = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].monkeyPatch(GuildList, \"default\", {\n after: this._appendButton\n });\n\n this._appendButton();\n }\n\n removeButton() {\n this.guildPatch();\n delete this.guildPatch;\n _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-pub-li\").remove();\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9wdWJsaWNTZXJ2ZXJzLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQ29yZS8uL3NyYy9tb2R1bGVzL3B1YmxpY1NlcnZlcnMuanM/ZTBlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzZXR0aW5nc0Nvb2tpZSB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IEJEVjIgZnJvbSBcIi4vdjJcIjtcbmltcG9ydCB3ZWJwYWNrTW9kdWxlcyBmcm9tIFwiLi93ZWJwYWNrTW9kdWxlc1wiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuL2RvbXRvb2xzXCI7XG5pbXBvcnQgVjJDX1B1YmxpY1NlcnZlcnMgZnJvbSBcIi4uL3VpL3B1YmxpY3NlcnZlcnMvcHVibGljU2VydmVyc1wiO1xuaW1wb3J0IExheWVyIGZyb20gXCIuLi91aS9wdWJsaWNzZXJ2ZXJzL2xheWVyXCI7XG5leHBvcnQgZGVmYXVsdCBuZXcgY2xhc3MgVjJfUHVibGljU2VydmVycyB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMuX2FwcGVuZEJ1dHRvbiA9IHRoaXMuX2FwcGVuZEJ1dHRvbi5iaW5kKHRoaXMpO1xuICB9XG5cbiAgZ2V0IGNvbXBvbmVudCgpIHtcbiAgICByZXR1cm4gQkRWMi5yZWFjdC5jcmVhdGVFbGVtZW50KExheWVyLCB7XG4gICAgICByb290SWQ6IFwicHVic2xheWVycm9vd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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/publicServers.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _webpackModules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _domtools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _ui_publicservers_publicServers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/publicservers/publicServers */ \"./src/ui/publicservers/publicServers.js\");\n/* harmony import */ var _ui_publicservers_layer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/publicservers/layer */ \"./src/ui/publicservers/layer.js\");\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class V2_PublicServers {\n constructor() {\n this._appendButton = this._appendButton.bind(this);\n }\n\n get component() {\n return _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_ui_publicservers_layer__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n rootId: \"pubslayerroot\",\n id: \"pubslayer\"\n }, _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_ui_publicservers_publicServers__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n rootId: \"pubslayerroot\"\n }));\n }\n\n get root() {\n const _root = document.getElementById(\"pubslayerroot\");\n\n if (!_root) {\n if (!this.injectRoot()) return null;\n return this.root;\n }\n\n return _root;\n }\n\n injectRoot() {\n const layers = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\".layers, .layers-3iHuyZ\");\n if (!layers) return false;\n layers.append(_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(\"
\"));\n return true;\n }\n\n render() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layers\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactDom.render(this.component, root);\n }\n\n get button() {\n const btn = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`
`);\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-1\"]) btn.style.display = \"none\";\n const label = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createElement(`
public
`);\n label.addEventListener(\"click\", () => {\n this.render();\n });\n btn.append(label);\n return btn;\n }\n\n _appendButton() {\n if (_domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-pub-li\")) return;\n const wrapper = _v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].guildClasses.wrapper.split(\" \")[0];\n const guilds = _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(`.${wrapper} .scroller-2FKFPG >:first-child`);\n _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].after(guilds, this.button);\n }\n\n addButton() {\n if (this.guildPatch) return;\n const GuildList = _webpackModules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].find(m => m.default && m.default.displayName == \"NavigableGuilds\");\n const GuildListOld = _webpackModules__WEBPACK_IMPORTED_MODULE_2__[\"default\"].findByDisplayName(\"Guilds\");\n if (!GuildList && !GuildListOld) _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].warn(\"PublicServer\", \"Can't find GuildList component\");\n this.guildPatch = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].monkeyPatch(GuildList ? GuildList : GuildListOld.prototype, GuildList ? \"default\" : \"render\", {\n after: this._appendButton\n });\n\n this._appendButton();\n }\n\n removeButton() {\n this.guildPatch();\n delete this.guildPatch;\n _domtools__WEBPACK_IMPORTED_MODULE_4__[\"default\"].query(\"#bd-pub-li\").remove();\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9wdWJsaWNTZXJ2ZXJzLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQ29yZS8uL3NyYy9tb2R1bGVzL3B1YmxpY1NlcnZlcnMuanM/ZTBlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzZXR0aW5nc0Nvb2tpZSB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IEJEVjIgZnJvbSBcIi4vdjJcIjtcbmltcG9ydCB3ZWJwYWNrTW9kdWxlcyBmcm9tIFwiLi93ZWJwYWNrTW9kdWxlc1wiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuL3V0aWxzXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuL2RvbXRvb2xzXCI7XG5pbXBvcnQgVjJDX1B1YmxpY1NlcnZlcnMgZnJvbSBcIi4uL3VpL3B1YmxpY3NlcnZlcnMvcHVibGljU2VydmVyc1wiO1xuaW1wb3J0IExheWVyIGZyb20gXCIuLi91aS9wdWJsaWNzZXJ2ZXJzL2xheWVyXCI7XG5leHBvcnQgZGVmYXVsdCBuZXcgY2xhc3MgVjJfUHVibGljU2VydmVycyB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMuX2FwcGVuZEJ1dHRvbiA9IHRoaXMuX2FwcGVuZEJ1dHRvbi5iaW5kKHRoaXMpO1xuICB9XG5cbiAgZ2V0IGNvbXBvbmVudC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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/publicServers.js\n"); /***/ }), @@ -407,7 +407,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nconst req = webpackJsonp.push /***/ (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 V2C_PluginCard; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _modules_domtools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _xSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./xSvg */ \"./src/ui/xSvg.js\");\n/* harmony import */ var _reloadIcon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _icons_edit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icons/edit */ \"./src/ui/icons/edit.jsx\");\n/* harmony import */ var _icons_delete__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icons/delete */ \"./src/ui/icons/delete.jsx\");\n/* harmony import */ var _components_switch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/switch */ \"./src/ui/components/switch.jsx\");\n/* harmony import */ var _tooltipWrap__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n\n\n\n\n\n\n\n\n\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].React;\nconst anchorClasses = _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].anchorClasses;\nclass V2C_PluginCard extends _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n this.showSettings = this.showSettings.bind(this);\n this.setInitialState();\n this.hasSettings = this.props.addon.plugin && typeof this.props.addon.plugin.getSettingsPanel === \"function\";\n this.settingsPanel = \"\";\n this.edit = this.edit.bind(this);\n this.delete = this.delete.bind(this);\n this.reload = this.reload.bind(this);\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.enabled,\n settings: false,\n reloads: 0\n };\n }\n\n showSettings() {\n if (!this.hasSettings) return;\n this.setState({\n settings: true\n });\n }\n\n closeSettings() {\n this.panelRef.current.innerHTML = \"\";\n this.setState({\n settingsOpen: false\n });\n }\n\n componentDidUpdate() {\n if (!this.state.settings) return;\n\n if (typeof this.settingsPanel === \"object\") {\n this.refs.settingspanel.appendChild(this.settingsPanel);\n }\n\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-3\"]) return;\n setImmediate(() => {\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 thisNode = this.refs.cardNode;\n const container = thisNode.closest(\".scroller\");\n if (!isHidden(container, thisNode)) return;\n const thisNodeOffset = _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].offset(thisNode);\n const containerOffset = _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].offset(container);\n const original = container.scrollTop;\n const endPoint = thisNodeOffset.top - containerOffset.top + container.scrollTop - 30;\n _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].animate({\n duration: 300,\n update: function (progress) {\n if (endPoint > original) container.scrollTop = original + progress * (endPoint - original);else container.scrollTop = original - progress * (original - endPoint);\n }\n });\n });\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n get settingsComponent() {\n const name = this.getString(this.props.addon.name);\n\n try {\n this.settingsPanel = this.props.addon.plugin.getSettingsPanel();\n } catch (err) {\n _modules_utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].err(\"Plugins\", \"Unable to get settings panel for \" + this.props.addon.name + \".\", err);\n }\n\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card bd-addon-card settings-open ui-switch-item\",\n ref: \"cardNode\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n style: {\n \"float\": \"right\",\n \"cursor\": \"pointer\"\n },\n onClick: () => {\n this.refs.settingspanel.innerHTML = \"\";\n this.setState({\n settings: false\n });\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_xSvg__WEBPACK_IMPORTED_MODULE_4__[\"default\"], null)), typeof this.settingsPanel === \"object\" && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n id: `plugin-settings-${name}`,\n className: \"plugin-settings\",\n ref: \"settingspanel\"\n }), typeof this.settingsPanel !== \"object\" && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n id: `plugin-settings-${name}`,\n className: \"plugin-settings\",\n ref: \"settingspanel\",\n dangerouslySetInnerHTML: {\n __html: this.settingsPanel\n }\n }));\n }\n\n buildTitle(name, version, author) {\n const title = \"{{name}} v{{version}} by {{author}}\".split(/({{[A-Za-z]+}})/);\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\n if (nameIndex) title[nameIndex] = React.createElement(\"span\", {\n className: \"name bda-name\"\n }, name);\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\n if (nameIndex) title[versionIndex] = React.createElement(\"span\", {\n className: \"version bda-version\"\n }, version);\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\n\n if (nameIndex) {\n const props = {\n className: \"author bda-author\"\n };\n\n if (author.link || author.id) {\n props.className += ` ${anchorClasses.anchor} ${anchorClasses.anchorUnderlineOnHover}`;\n props.target = \"_blank\";\n if (author.link) props.href = author.link;\n if (author.id) props.onClick = () => {\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LayerStack.popLayer();\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].openDM(author.id);\n };\n }\n\n title[authorIndex] = React.createElement(author.link || author.id ? \"a\" : \"span\", props, author.name);\n }\n\n return title.flat();\n }\n\n makeLink(title, url) {\n const props = {\n className: \"bda-link bda-link-website\",\n target: \"_blank\"\n };\n if (typeof url == \"string\") props.href = url;\n if (typeof url == \"function\") props.onClick = event => {\n event.preventDefault();\n event.stopPropagation();\n url();\n };\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"a\", props, title);\n }\n\n makeButton(title, children, action) {\n return React.createElement(_tooltipWrap__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: title\n }, React.createElement(\"div\", {\n className: \"bd-addon-button\",\n onClick: action\n }, children));\n }\n\n get links() {\n const links = [];\n const addon = this.props.addon;\n if (addon.website) links.push(this.makeLink(\"Website\", addon.website));\n if (addon.source) links.push(this.makeLink(\"Source\", addon.source));\n\n if (addon.invite) {\n links.push(this.makeLink(\"Support Server\", () => {\n const tester = /\\.gg\\/(.*)$/;\n let code = addon.invite;\n if (tester.test(code)) code = code.match(tester)[1];\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LayerStack.popLayer();\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].InviteActions.acceptInviteAndTransitionToInviteChannel(code);\n }));\n }\n\n if (addon.donate) links.push(this.makeLink(\"Donate\", addon.donate));\n if (addon.patreon) links.push(this.makeLink(\"Patreon\", addon.patreon));\n return links;\n }\n\n get footer() {\n const links = this.links;\n return (links.length || this.hasSettings) && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card-footer bda-footer\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"span\", {\n className: \"bd-addon-links bda-links\"\n }, ...links.map((element, index) => index < links.length - 1 ? [element, \" | \"] : element).flat()), this.hasSettings && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"button\", {\n onClick: this.showSettings,\n className: \"bd-button bda-settings-button\",\n disabled: !this.state.checked\n }, \"Settings\"));\n }\n\n onChange() {\n this.props.toggle && this.props.toggle(this.props.addon.plugin ? this.props.addon.plugin.getName() || this.props.addon.name : this.props.addon.name);\n this.setState({\n checked: !this.state.checked\n });\n }\n\n edit() {\n this.props.edit(this.props.addon.name);\n }\n\n delete() {\n this.props.remove(this.props.addon.name);\n }\n\n reload() {\n this.props.reload(this.props.addon.name);\n }\n\n render() {\n if (this.state.settings) return this.settingsComponent;\n const name = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() || this.props.addon.name : this.props.addon.name);\n const author = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);\n const description = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);\n const version = this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);\n const {\n authorId,\n authorLink\n } = this.props.addon;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card bd-addon-card settings-closed ui-switch-item\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-addon-header bda-header\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card-title bda-header-title\"\n }, this.buildTitle(name, version, {\n name: author,\n id: authorId,\n link: authorLink\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-addon-controls bda-controls\"\n }, this.props.edit && this.makeButton(\"Edit\", React.createElement(_icons_edit__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n className: \"bd-icon\"\n }), this.edit), this.props.remove && this.makeButton(\"Delete\", React.createElement(_icons_delete__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n className: \"bd-icon\"\n }), this.delete), this.props.reload && this.makeButton(\"Reload\", React.createElement(_reloadIcon__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n className: \"bd-icon\"\n }), this.reload), React.createElement(_components_switch__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n onChange: this.onChange,\n checked: this.state.checked\n }))), _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-scroller-wrap bda-description-wrap scroller-wrap fade\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-scroller bd-addon-description bda-description scroller\"\n }, description)), this.footer);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingUR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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/ui/addoncard.jsx\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return V2C_PluginCard; });\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _modules_domtools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/domtools */ \"./src/modules/domtools.js\");\n/* harmony import */ var _xSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./xSvg */ \"./src/ui/xSvg.js\");\n/* harmony import */ var _reloadIcon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _icons_edit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icons/edit */ \"./src/ui/icons/edit.jsx\");\n/* harmony import */ var _icons_delete__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icons/delete */ \"./src/ui/icons/delete.jsx\");\n/* harmony import */ var _components_switch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/switch */ \"./src/ui/components/switch.jsx\");\n/* harmony import */ var _tooltipWrap__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n\n\n\n\n\n\n\n\n\n\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].React;\nconst anchorClasses = _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].anchorClasses;\nclass V2C_PluginCard extends _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n this.showSettings = this.showSettings.bind(this);\n this.setInitialState();\n this.hasSettings = this.props.addon.plugin && typeof this.props.addon.plugin.getSettingsPanel === \"function\";\n this.settingsPanel = \"\";\n this.edit = this.edit.bind(this);\n this.delete = this.delete.bind(this);\n this.reload = this.reload.bind(this);\n }\n\n setInitialState() {\n this.state = {\n checked: this.props.enabled,\n settings: false,\n reloads: 0\n };\n }\n\n showSettings() {\n if (!this.hasSettings) return;\n this.setState({\n settings: true\n });\n }\n\n closeSettings() {\n this.panelRef.current.innerHTML = \"\";\n this.setState({\n settingsOpen: false\n });\n }\n\n componentDidUpdate() {\n if (!this.state.settings) return;\n\n if (typeof this.settingsPanel === \"object\") {\n this.refs.settingspanel.appendChild(this.settingsPanel);\n }\n\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-3\"]) return;\n setImmediate(() => {\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 thisNode = this.refs.cardNode;\n const container = thisNode.closest(\".scroller\");\n if (!isHidden(container, thisNode)) return;\n const thisNodeOffset = _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].offset(thisNode);\n const containerOffset = _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].offset(container);\n const original = container.scrollTop;\n const endPoint = thisNodeOffset.top - containerOffset.top + container.scrollTop - 30;\n _modules_domtools__WEBPACK_IMPORTED_MODULE_3__[\"default\"].animate({\n duration: 300,\n update: function (progress) {\n if (endPoint > original) container.scrollTop = original + progress * (endPoint - original);else container.scrollTop = original - progress * (original - endPoint);\n }\n });\n });\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n get settingsComponent() {\n try {\n this.settingsPanel = this.props.addon.plugin.getSettingsPanel();\n } catch (err) {\n _modules_utils__WEBPACK_IMPORTED_MODULE_2__[\"default\"].err(\"Plugins\", \"Unable to get settings panel for \" + this.name + \".\", err);\n }\n\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card bd-addon-card settings-open ui-switch-item\",\n ref: \"cardNode\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n style: {\n \"float\": \"right\",\n \"cursor\": \"pointer\"\n },\n onClick: () => {\n this.refs.settingspanel.innerHTML = \"\";\n this.setState({\n settings: false\n });\n }\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(_xSvg__WEBPACK_IMPORTED_MODULE_4__[\"default\"], null)), typeof this.settingsPanel === \"object\" && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n id: `plugin-settings-${this.name}`,\n className: \"plugin-settings\",\n ref: \"settingspanel\"\n }), typeof this.settingsPanel !== \"object\" && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n id: `plugin-settings-${this.name}`,\n className: \"plugin-settings\",\n ref: \"settingspanel\",\n dangerouslySetInnerHTML: {\n __html: this.settingsPanel\n }\n }));\n }\n\n buildTitle(name, version, author) {\n const title = \"{{name}} v{{version}} by {{author}}\".split(/({{[A-Za-z]+}})/);\n const nameIndex = title.findIndex(s => s == \"{{name}}\");\n if (nameIndex) title[nameIndex] = React.createElement(\"span\", {\n className: \"name bda-name\"\n }, name);\n const versionIndex = title.findIndex(s => s == \"{{version}}\");\n if (nameIndex) title[versionIndex] = React.createElement(\"span\", {\n className: \"version bda-version\"\n }, version);\n const authorIndex = title.findIndex(s => s == \"{{author}}\");\n\n if (nameIndex) {\n const props = {\n className: \"author bda-author\"\n };\n\n if (author.link || author.id) {\n props.className += ` ${anchorClasses.anchor} ${anchorClasses.anchorUnderlineOnHover}`;\n props.target = \"_blank\";\n if (author.link) props.href = author.link;\n if (author.id) props.onClick = () => {\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LayerStack.popLayer();\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].openDM(author.id);\n };\n }\n\n title[authorIndex] = React.createElement(author.link || author.id ? \"a\" : \"span\", props, author.name);\n }\n\n return title.flat();\n }\n\n makeLink(title, url) {\n const props = {\n className: \"bda-link bda-link-website\",\n target: \"_blank\"\n };\n if (typeof url == \"string\") props.href = url;\n if (typeof url == \"function\") props.onClick = event => {\n event.preventDefault();\n event.stopPropagation();\n url();\n };\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"a\", props, title);\n }\n\n makeButton(title, children, action) {\n return React.createElement(_tooltipWrap__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: title\n }, React.createElement(\"div\", {\n className: \"bd-addon-button\",\n onClick: action\n }, children));\n }\n\n get links() {\n const links = [];\n const addon = this.props.addon;\n if (addon.website) links.push(this.makeLink(\"Website\", addon.website));\n if (addon.source) links.push(this.makeLink(\"Source\", addon.source));\n\n if (addon.invite) {\n links.push(this.makeLink(\"Support Server\", () => {\n const tester = /\\.gg\\/(.*)$/;\n let code = addon.invite;\n if (tester.test(code)) code = code.match(tester)[1];\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LayerStack.popLayer();\n _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].InviteActions.acceptInviteAndTransitionToInviteChannel(code);\n }));\n }\n\n if (addon.donate) links.push(this.makeLink(\"Donate\", addon.donate));\n if (addon.patreon) links.push(this.makeLink(\"Patreon\", addon.patreon));\n return links;\n }\n\n get footer() {\n const links = this.links;\n return (links.length || this.hasSettings) && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card-footer bda-footer\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"span\", {\n className: \"bd-addon-links bda-links\"\n }, ...links.map((element, index) => index < links.length - 1 ? [element, \" | \"] : element).flat()), this.hasSettings && _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"button\", {\n onClick: this.showSettings,\n className: \"bd-button bda-settings-button\",\n disabled: !this.state.checked\n }, \"Settings\"));\n }\n\n onChange() {\n this.props.toggle && this.props.toggle(this.name);\n this.setState({\n checked: !this.state.checked\n });\n }\n\n edit() {\n this.props.edit(this.name);\n }\n\n delete() {\n this.props.remove(this.name);\n }\n\n reload() {\n this.props.reload(this.name);\n }\n\n get name() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getName() : this.props.addon.name);\n }\n\n get author() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getAuthor() : this.props.addon.author);\n }\n\n get description() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getDescription() : this.props.addon.description);\n }\n\n get version() {\n return this.getString(this.props.addon.plugin ? this.props.addon.plugin.getVersion() : this.props.addon.version);\n }\n\n render() {\n if (this.state.settings) return this.settingsComponent;\n const {\n authorId,\n authorLink\n } = this.props.addon;\n return _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card bd-addon-card settings-closed ui-switch-item\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-addon-header bda-header\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-card-title bda-header-title\"\n }, this.buildTitle(this.name, this.version, {\n name: this.author,\n id: authorId,\n link: authorLink\n })), _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-addon-controls bda-controls\"\n }, this.props.edit && this.makeButton(\"Edit\", React.createElement(_icons_edit__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n className: \"bd-icon\"\n }), this.edit), this.props.remove && this.makeButton(\"Delete\", React.createElement(_icons_delete__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n className: \"bd-icon\"\n }), this.delete), this.props.reload && this.makeButton(\"Reload\", React.createElement(_reloadIcon__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n className: \"bd-icon\"\n }), this.reload), React.createElement(_components_switch__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n onChange: this.onChange,\n checked: this.state.checked\n }))), _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-scroller-wrap bda-description-wrap scroller-wrap fade\"\n }, _modules_v2__WEBPACK_IMPORTED_MODULE_1__[\"default\"].react.createElement(\"div\", {\n className: \"bd-scroller bd-addon-description bda-description scroller\"\n }, this.description)), this.footer);\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYWRkb25jYXJkLmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0NvcmUvLi9zcmMvdWkvYWRkb25jYXJkLmpzeD9lYTY4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNldHRpbmdzQ29va2llIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgQkRWMiBmcm9tIFwiLi4vbW9kdWxlcy92MlwiO1xuaW1wb3J0IFV0aWxzIGZyb20gXCIuLi9tb2R1bGVzL3V0aWxzXCI7XG5pbXBvcnQgRE9NIGZyb20gXCIuLi9tb2R1bGVzL2RvbXRvb2xzXCI7XG5pbXBvcnQgWFN2ZyBmcm9tIFwiLi94U3ZnXCI7XG5pbXBvcnQgUmVsb2FkSWNv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Vyc2lvbkluZGV4ID0gdGl0bGUuZmluZEluZGV4KHMgPT4gcyA9PSBcInt7dmVyc2lvbn19XCIpO1xuICAgIGlmIChuYW1lSW5kZXgpIHRpdGxlW3ZlcnNpb25JbmRleF0gPSBSZWFjdC5jcmVhdGVFbGVtZW50KFwic3BhblwiLCB7XG4gICAgICBjbGFzc05hbWU6IFwidmVyc2lvbiBiZGEtdmVyc2lvblwiXG4gICAgfSwgdmVyc2lvbik7XG4gICAgY29uc3QgYXV0aG9ySW5kZXggPSB0aXRsZS5maW5kSW5kZXgocyA9PiBzID09IFwie3thdXRob3J9fVwiKTtcblxuICAgIGlmIChuYW1lSW5kZXgpIHtcbiAgICAgIGNvbnN0IHByb3BzID0ge1xuICAgICAgICBjbGFzc05hbWU6IFwiYXV0aG9yIGJkYS1hdXRob3JcIlxuICAgICAgfTtcblxuICAgICAgaWYgKGF1dGhvci5saW5rIHx8IGF1dGhvci5pZCkge1xuICAgICAgICBwcm9wcy5jbGFzc05hbWUgKz0gYCAke2FuY2hvckNsYXNzZXMuYW5jaG9yfSAke2FuY2hvckNsYXNzZXMuYW5jaG9yVW5kZXJsaW5lT25Ib3Zlcn1gO1xuICAgICAgICBwcm9wcy50YXJnZXQgPSBcIl9ibGFua1wiO1xuICAgICAgICBpZiAoYXV0aG9yLmxpbmspIHByb3BzLmhyZWYgPSBhdXRob3IubGluaztcbiAgICAgICAgaWYgKGF1dGhvci5pZCkgcHJvcHMub25DbGljayA9ICgpID0+IHtcbiAgICAgICAgICBCRFYyLkxheWVyU3RhY2sucG9wTGF5ZXIoKTtcbiAgICAgICAgICBCRFYyLm9wZW5ETShhdXRob3IuaWQpO1xuICAgICAgICB9O1xuICAgICAgfVxuXG4gICAgICB0aXRsZVthdXRob3JJbmRleF0gPSBSZWFjdC5jcmVhdGVFbGVtZW50KGF1dGhvci5saW5rIHx8IGF1dGhvci5pZCA/IFwiYVwiIDogXCJzcGFuXCIsIHByb3BzLCBhdXRob3IubmFtZSk7XG4gICA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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/ui/addoncard.jsx\n"); /***/ }), @@ -419,7 +419,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 CardList; });\n/* harmony import */ var _errorBoundary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errorBoundary */ \"./src/ui/errorBoundary.js\");\n/* harmony import */ var _contentColumn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentColumn */ \"./src/ui/contentColumn.js\");\n/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tools */ \"./src/ui/tools.js\");\n/* harmony import */ var _reloadIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _addoncard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./addoncard */ \"./src/ui/addoncard.jsx\");\n/* harmony import */ var _scroller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scroller */ \"./src/ui/scroller.js\");\n/* harmony import */ var _components_dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/dropdown */ \"./src/ui/components/dropdown.jsx\");\n/* harmony import */ var _components_search__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/search */ \"./src/ui/components/search.jsx\");\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modules/contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modules/pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../modules/themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _modules_webpackModules__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../modules/webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _modules_bdApi__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../modules/bdApi */ \"./src/modules/bdApi.js\");\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\n\n\n\n\n\n\n\n\n\nconst Tooltip = _modules_webpackModules__WEBPACK_IMPORTED_MODULE_13__[\"default\"].findByDisplayName(\"Tooltip\");\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_10__[\"default\"].react;\nclass CardList extends _modules_v2__WEBPACK_IMPORTED_MODULE_10__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.state = {\n sort: \"name\",\n ascending: true,\n query: \"\"\n };\n this.isPlugins = this.props.type == \"plugins\";\n this.cookie = this.isPlugins ? _0globals__WEBPACK_IMPORTED_MODULE_8__[\"pluginCookie\"] : _0globals__WEBPACK_IMPORTED_MODULE_8__[\"themeCookie\"];\n this.manager = this.isPlugins ? _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__[\"default\"] : _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\n this.sort = this.sort.bind(this);\n this.reverse = this.reverse.bind(this);\n this.search = this.search.bind(this);\n }\n\n openFolder() {\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(this.isPlugins ? _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__[\"default\"].pluginsFolder : _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__[\"default\"].themesFolder);\n }\n\n edit(name) {\n console.log(name);\n this.manager.edit(name);\n }\n\n async delete(name) {\n const shouldDelete = await this.confirmDelete(name);\n if (!shouldDelete) return;\n this.manager.delete(name);\n }\n\n confirmDelete(name) {\n return new Promise(resolve => {\n _modules_bdApi__WEBPACK_IMPORTED_MODULE_14__[\"default\"].showConfirmationModal(\"Are You Sure?\", `Are you sure you want to delete ${name}?`, {\n danger: true,\n confirmText: \"Delete\",\n onConfirm: () => {\n resolve(true);\n },\n onCancel: () => {\n resolve(false);\n }\n });\n });\n }\n\n get sortOptions() {\n return [{\n label: \"Name\",\n value: \"name\"\n }, {\n label: \"Author\",\n value: \"author\"\n }, {\n label: \"Version\",\n value: \"version\"\n }, {\n label: \"Recently Added\",\n value: \"added\"\n }, {\n label: \"Last Modified\",\n value: \"modified\"\n }, {\n label: \"File Size\",\n value: \"size\"\n }];\n }\n\n get directions() {\n return [{\n label: \"Ascending\",\n value: true\n }, {\n label: \"Descending\",\n value: false\n }];\n }\n\n reverse(value) {\n this.setState({\n ascending: value\n });\n }\n\n sort(value) {\n this.setState({\n sort: value\n });\n }\n\n search(event) {\n this.setState({\n query: event.target.value.toLocaleLowerCase()\n });\n }\n\n getProps(addon) {\n return {\n key: addon.name,\n enabled: this.cookie[addon.name],\n toggle: this.manager.toggle.bind(this.manager),\n //edit: this.edit.bind(this),\n remove: this.delete.bind(this),\n addon: addon\n };\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n getAddons() {\n const sortedAddons = this.props.list.sort((a, b) => {\n const cap = this.state.sort.charAt(0).toUpperCase() + this.state.sort.slice(1);\n const first = a.plugin ? this.getString(a.plugin[`get${cap}`]()) : a[this.state.sort];\n const second = b.plugin ? this.getString(b.plugin[`get${cap}`]()) : b[this.state.sort];\n if (typeof first == \"string\") return first.toLocaleLowerCase().localeCompare(second.toLocaleLowerCase());\n if (first > second) return 1;\n if (second > first) return -1;\n return 0;\n });\n if (!this.state.ascending) sortedAddons.reverse();\n const rendered = [];\n\n for (let a = 0; a < sortedAddons.length; a++) {\n const addon = sortedAddons[a];\n\n if (this.state.query) {\n let matches = null;\n const name = this.getString(addon.plugin ? addon.plugin.getName() || addon.name : addon.name);\n const author = this.getString(addon.plugin ? addon.plugin.getAuthor() : addon.author);\n const description = this.getString(addon.plugin ? addon.plugin.getDescription() : addon.description);\n const version = this.getString(addon.plugin ? addon.plugin.getVersion() : addon.version);\n if (name) matches = name.toLocaleLowerCase().includes(this.state.query);\n if (author) matches = matches || author.toLocaleLowerCase().includes(this.state.query);\n if (description) matches = matches || description.toLocaleLowerCase().includes(this.state.query);\n if (version) matches = matches || version.toLocaleLowerCase().includes(this.state.query);\n if (!matches) continue;\n }\n\n const props = this.getProps(addon);\n rendered.push(React.createElement(_errorBoundary__WEBPACK_IMPORTED_MODULE_0__[\"default\"], null, React.createElement(_addoncard__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _extends({}, props, {\n reload: !_0globals__WEBPACK_IMPORTED_MODULE_8__[\"settingsCookie\"][\"fork-ps-5\"] && this.manager.reload.bind(this.manager)\n }))));\n }\n\n return rendered;\n }\n\n render() {\n const refreshIcon = React.createElement(Tooltip, {\n color: \"black\",\n position: \"top\",\n text: \"Reload List\"\n }, props => React.createElement(_reloadIcon__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _extends({}, props, {\n className: \"bd-icon bd-reload bd-reload-header\",\n size: \"18px\",\n onClick: async () => {\n if (this.isPlugins) _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__[\"default\"].updatePluginList();else _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__[\"default\"].updateThemeList();\n this.forceUpdate();\n }\n })));\n const addonCards = this.getAddons();\n return React.createElement(_scroller__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, React.createElement(_contentColumn__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n title: `${this.props.type.toUpperCase()}—${addonCards.length}`\n }, React.createElement(\"button\", {\n key: \"folder-button\",\n className: \"bd-button bd-pfbtn\",\n onClick: this.openFolder.bind(this)\n }, \"Open \", this.isPlugins ? \"Plugin\" : \"Theme\", \" Folder\"), !_0globals__WEBPACK_IMPORTED_MODULE_8__[\"settingsCookie\"][\"fork-ps-5\"] && refreshIcon, React.createElement(\"div\", {\n className: \"bd-controls bd-addon-controls\"\n }, React.createElement(_components_search__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n onChange: this.search,\n placeholder: `Search ${this.props.type}...`\n }), React.createElement(\"div\", {\n className: \"bd-addon-dropdowns\"\n }, React.createElement(\"div\", {\n className: \"bd-select-wrapper\"\n }, React.createElement(\"label\", {\n className: \"bd-label\"\n }, \"Sort by:\"), React.createElement(_components_dropdown__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n options: this.sortOptions,\n onChange: this.sort,\n style: \"transparent\"\n })), React.createElement(\"div\", {\n className: \"bd-select-wrapper\"\n }, React.createElement(\"label\", {\n className: \"bd-label\"\n }, \"Order:\"), React.createElement(_components_dropdown__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n options: this.directions,\n onChange: this.reverse,\n style: \"transparent\"\n })))), React.createElement(\"div\", {\n className: \"bda-slist bd-addon-list\"\n }, addonCards)), React.createElement(_tools__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYWRkb25saXN0LmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0NvcmUvLi9zcmMvdWkvYWRkb25saXN0LmpzeD80OGQxIl0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIF9leHRlbmRzKCkgeyBfZXh0ZW5kcyA9IE9iamVjdC5hc3NpZ24gfHwgZnVuY3Rpb24gKHRhcmdldCkgeyBmb3IgKHZhciBpID0gMTsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKykgeyB2YXIgc291cmNlID0gYXJndW1lbnRzW2ldOyBmb3IgKHZhciBrZXkgaW4gc291cmNlKSB7IGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoc291cmNlLCBrZXkpKSB7IHRhcmdldFtrZXldID0gc291cmNlW2tleV07IH0gfSB9IHJldHVybiB0YXJnZXQ7IH07IHJldHVybiBfZXh0ZW5kcy5hcHBseSh0aGlzLCBhcmd1bWVudHMpOyB9XG5cbmltcG9ydCBFcnJvckJvdW5kYXJ5IGZyb20gXCIuL2Vycm9yQm91bmRhcnlcIjtcbmltcG9ydCBDb250ZW50Q29sdW1uIGZyb20gXCIuL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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/addonlist.jsx\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CardList; });\n/* harmony import */ var _errorBoundary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errorBoundary */ \"./src/ui/errorBoundary.js\");\n/* harmony import */ var _contentColumn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentColumn */ \"./src/ui/contentColumn.js\");\n/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tools */ \"./src/ui/tools.js\");\n/* harmony import */ var _reloadIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _addoncard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./addoncard */ \"./src/ui/addoncard.jsx\");\n/* harmony import */ var _scroller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scroller */ \"./src/ui/scroller.js\");\n/* harmony import */ var _components_dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/dropdown */ \"./src/ui/components/dropdown.jsx\");\n/* harmony import */ var _components_search__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/search */ \"./src/ui/components/search.jsx\");\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modules/contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _modules_v2__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modules/v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modules/pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../modules/themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _modules_webpackModules__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../modules/webpackModules */ \"./src/modules/webpackModules.js\");\n/* harmony import */ var _modules_bdApi__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../modules/bdApi */ \"./src/modules/bdApi.js\");\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\n\n\n\n\n\n\n\n\n\nconst Tooltip = _modules_webpackModules__WEBPACK_IMPORTED_MODULE_13__[\"default\"].findByDisplayName(\"Tooltip\");\nconst React = _modules_v2__WEBPACK_IMPORTED_MODULE_10__[\"default\"].react;\nclass CardList extends _modules_v2__WEBPACK_IMPORTED_MODULE_10__[\"default\"].reactComponent {\n constructor(props) {\n super(props);\n this.state = {\n sort: \"name\",\n ascending: true,\n query: \"\"\n };\n this.isPlugins = this.props.type == \"plugins\";\n this.cookie = this.isPlugins ? _0globals__WEBPACK_IMPORTED_MODULE_8__[\"pluginCookie\"] : _0globals__WEBPACK_IMPORTED_MODULE_8__[\"themeCookie\"];\n this.manager = this.isPlugins ? _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__[\"default\"] : _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\n this.sort = this.sort.bind(this);\n this.reverse = this.reverse.bind(this);\n this.search = this.search.bind(this);\n }\n\n openFolder() {\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(this.isPlugins ? _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__[\"default\"].pluginsFolder : _modules_contentManager__WEBPACK_IMPORTED_MODULE_9__[\"default\"].themesFolder);\n }\n\n edit(name) {\n console.log(name);\n this.manager.edit(name);\n }\n\n async delete(name) {\n const shouldDelete = await this.confirmDelete(name);\n if (!shouldDelete) return;\n this.manager.delete(name);\n }\n\n confirmDelete(name) {\n return new Promise(resolve => {\n _modules_bdApi__WEBPACK_IMPORTED_MODULE_14__[\"default\"].showConfirmationModal(\"Are You Sure?\", `Are you sure you want to delete ${name}?`, {\n danger: true,\n confirmText: \"Delete\",\n onConfirm: () => {\n resolve(true);\n },\n onCancel: () => {\n resolve(false);\n }\n });\n });\n }\n\n get sortOptions() {\n return [{\n label: \"Name\",\n value: \"name\"\n }, {\n label: \"Author\",\n value: \"author\"\n }, {\n label: \"Version\",\n value: \"version\"\n }, {\n label: \"Recently Added\",\n value: \"added\"\n }, {\n label: \"Last Modified\",\n value: \"modified\"\n }, {\n label: \"File Size\",\n value: \"size\"\n }];\n }\n\n get directions() {\n return [{\n label: \"Ascending\",\n value: true\n }, {\n label: \"Descending\",\n value: false\n }];\n }\n\n reverse(value) {\n this.setState({\n ascending: value\n });\n }\n\n sort(value) {\n this.setState({\n sort: value\n });\n }\n\n search(event) {\n this.setState({\n query: event.target.value.toLocaleLowerCase()\n });\n }\n\n getProps(addon) {\n return {\n key: this.getName(addon),\n enabled: this.cookie[this.getName(addon)],\n toggle: this.manager.toggle.bind(this.manager),\n //edit: this.edit.bind(this),\n remove: this.delete.bind(this),\n addon: addon\n };\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n getAddons() {\n const sortedAddons = this.props.list.sort((a, b) => {\n const cap = this.state.sort.charAt(0).toUpperCase() + this.state.sort.slice(1);\n const first = a.plugin ? this.getString(a.plugin[`get${cap}`]()) : a[this.state.sort];\n const second = b.plugin ? this.getString(b.plugin[`get${cap}`]()) : b[this.state.sort];\n if (typeof first == \"string\") return first.toLocaleLowerCase().localeCompare(second.toLocaleLowerCase());\n if (first > second) return 1;\n if (second > first) return -1;\n return 0;\n });\n if (!this.state.ascending) sortedAddons.reverse();\n const rendered = [];\n\n for (let a = 0; a < sortedAddons.length; a++) {\n const addon = sortedAddons[a];\n\n if (this.state.query) {\n let matches = null;\n const name = this.getName(addon);\n const author = this.getAuthor(addon);\n const description = this.getDescription(addon);\n const version = this.getVersion(addon);\n if (name) matches = name.toLocaleLowerCase().includes(this.state.query);\n if (author) matches = matches || author.toLocaleLowerCase().includes(this.state.query);\n if (description) matches = matches || description.toLocaleLowerCase().includes(this.state.query);\n if (version) matches = matches || version.toLocaleLowerCase().includes(this.state.query);\n if (!matches) continue;\n }\n\n const props = this.getProps(addon);\n rendered.push(React.createElement(_errorBoundary__WEBPACK_IMPORTED_MODULE_0__[\"default\"], null, React.createElement(_addoncard__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _extends({}, props, {\n reload: !_0globals__WEBPACK_IMPORTED_MODULE_8__[\"settingsCookie\"][\"fork-ps-5\"] && this.manager.reload.bind(this.manager)\n }))));\n }\n\n return rendered;\n }\n\n getName(addon) {\n return this.getString(addon.plugin ? addon.plugin.getName() : addon.name);\n }\n\n getAuthor(addon) {\n return this.getString(addon.plugin ? addon.plugin.getAuthor() : addon.author);\n }\n\n getDescription(addon) {\n return this.getString(addon.plugin ? addon.plugin.getDescription() : addon.description);\n }\n\n getVersion(addon) {\n return this.getString(addon.plugin ? addon.plugin.getVersion() : addon.version);\n }\n\n render() {\n const refreshIcon = React.createElement(Tooltip, {\n color: \"black\",\n position: \"top\",\n text: \"Reload List\"\n }, props => React.createElement(_reloadIcon__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _extends({}, props, {\n className: \"bd-icon bd-reload bd-reload-header\",\n size: \"18px\",\n onClick: async () => {\n if (this.isPlugins) _modules_pluginModule__WEBPACK_IMPORTED_MODULE_11__[\"default\"].updatePluginList();else _modules_themeModule__WEBPACK_IMPORTED_MODULE_12__[\"default\"].updateThemeList();\n this.forceUpdate();\n }\n })));\n const addonCards = this.getAddons();\n return React.createElement(_scroller__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true\n }, React.createElement(_contentColumn__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n title: `${this.props.type.toUpperCase()}—${addonCards.length}`\n }, React.createElement(\"button\", {\n key: \"folder-button\",\n className: \"bd-button bd-pfbtn\",\n onClick: this.openFolder.bind(this)\n }, \"Open \", this.isPlugins ? \"Plugin\" : \"Theme\", \" Folder\"), !_0globals__WEBPACK_IMPORTED_MODULE_8__[\"settingsCookie\"][\"fork-ps-5\"] && refreshIcon, React.createElement(\"div\", {\n className: \"bd-controls bd-addon-controls\"\n }, React.createElement(_components_search__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n onChange: this.search,\n placeholder: `Search ${this.props.type}...`\n }), React.createElement(\"div\", {\n className: \"bd-addon-dropdowns\"\n }, React.createElement(\"div\", {\n className: \"bd-select-wrapper\"\n }, React.createElement(\"label\", {\n className: \"bd-label\"\n }, \"Sort by:\"), React.createElement(_components_dropdown__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n options: this.sortOptions,\n onChange: this.sort,\n style: \"transparent\"\n })), React.createElement(\"div\", {\n className: \"bd-select-wrapper\"\n }, React.createElement(\"label\", {\n className: \"bd-label\"\n }, \"Order:\"), React.createElement(_components_dropdown__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n options: this.directions,\n onChange: this.reverse,\n style: \"transparent\"\n })))), React.createElement(\"div\", {\n className: \"bda-slist bd-addon-list\"\n }, addonCards)), React.createElement(_tools__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n key: \"tools\"\n }));\n }\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdWkvYWRkb25saXN0LmpzeC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0NvcmUvLi9zcmMvdWkvYWRkb25saXN0LmpzeD80OGQxIl0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIF9leHRlbmRzKCkgeyBfZXh0ZW5kcyA9IE9iamVjdC5hc3NpZ24gfHwgZnVuY3Rpb24gKHRhcmdldCkgeyBmb3IgKHZhciBpID0gMTsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKykgeyB2YXIgc291cmNlID0gYXJndW1lbnRzW2ldOyBmb3IgKHZhciBrZXkgaW4gc291cmNlKSB7IGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoc291cmNlLCBrZXkpKSB7IHRhcmdldFtrZXldID0gc291cmNlW2tleV07IH0gfSB9IHJldHVybiB0YXJnZXQ7IH07IHJldHVybiBfZXh0ZW5kcy5hcHBseSh0aGlzLCBhcmd1bWVudHMpOyB9XG5cbmltcG9ydCB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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/ui/addonlist.jsx\n"); /***/ }), diff --git a/js/main.min.js b/js/main.min.js index 229d9b3f..984c8add 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -1 +1 @@ -var Core=function(e){var t={};function n(s){if(t[s])return t[s].exports;var o=t[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(s,o,function(t){return e[t]}.bind(null,o));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("electron")},function(e,t){e.exports=require("request")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("module")},function(e,t,n){"use strict";n.r(t);var s={};n.r(s),n.d(s,"minimumDiscordVersion",(function(){return o})),n.d(s,"currentDiscordVersion",(function(){return r})),n.d(s,"minSupportedVersion",(function(){return i})),n.d(s,"bbdVersion",(function(){return a})),n.d(s,"bbdChangelog",(function(){return l})),n.d(s,"settings",(function(){return c})),n.d(s,"defaultCookie",(function(){return d})),n.d(s,"settingsCookie",(function(){return u})),n.d(s,"bdpluginErrors",(function(){return h})),n.d(s,"bdthemeErrors",(function(){return p})),n.d(s,"bdConfig",(function(){return m})),n.d(s,"bemotes",(function(){return g})),n.d(s,"emotesFfz",(function(){return f})),n.d(s,"emotesBTTV",(function(){return b})),n.d(s,"emotesBTTV2",(function(){return v})),n.d(s,"emotesTwitch",(function(){return y})),n.d(s,"subEmotesTwitch",(function(){return C})),n.d(s,"bdEmotes",(function(){return E})),n.d(s,"bdEmoteSettingIDs",(function(){return w})),n.d(s,"bdthemes",(function(){return k})),n.d(s,"bdplugins",(function(){return S})),n.d(s,"pluginCookie",(function(){return x})),n.d(s,"themeCookie",(function(){return D}));const o="0.0.306",r=window.DiscordNative&&window.DiscordNative.remoteApp&&window.DiscordNative.remoteApp.getVersion&&window.DiscordNative.remoteApp.getVersion()||"0.0.306",i="0.3.0",a="0.3.2",l={description:"More big things.",changes:[{title:"What's New?",items:["**jQuery** is no longer used internally in BBD. This should speed things up and hopefully close some memory leaks.","**VoiceMode** was redone to act more like it used to."]},{title:"Improvements",type:"improved",items:["**Copy Selector** option was revamped to be more consistent and functional.","**Emote Menu** has gone through some serious changes to be more efficient and less buggy.","Some speed improvements when entering the plugins and themes tabs."]}]},c={"Custom css live update":{id:"bda-css-0",info:"",implemented:!0,hidden:!0,cat:"core"},"Custom css auto udpate":{id:"bda-css-1",info:"",implemented:!0,hidden:!0,cat:"core"},"BetterDiscord Blue":{id:"bda-gs-b",info:"Replace Discord blue with BD Blue",implemented:!1,hidden:!1,cat:"core"},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Dark Mode":{id:"bda-gs-5",info:"Make certain elements dark by default(wip)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Disconnect":{id:"bda-dc-0",info:"Disconnect from voice server when closing Discord",implemented:!0,hidden:!1,cat:"core",category:"modules"},"24 Hour Timestamps":{id:"bda-gs-6",info:"Replace 12hr timestamps with proper ones",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Colored Text":{id:"bda-gs-7",info:"Make text color the same as role color",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Normalize Classes":{id:"fork-ps-4",info:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Content Error Modal":{id:"fork-ps-1",info:"Shows a modal with plugin/theme errors",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Show Toasts":{id:"fork-ps-2",info:"Shows a small notification for important information",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Scroll To Settings":{id:"fork-ps-3",info:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Automatic Loading":{id:"fork-ps-5",info:"Automatically loads, reloads, and unloads plugins and themes",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Developer Mode":{id:"bda-gs-8",info:"Developer Mode",implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"Copy Selector":{id:"fork-dm-1",info:'Adds a "Copy Selector" option to context menus when developer mode is active',implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"React DevTools":{id:"reactDevTools",info:"Adds react developer tools to the devtools. Must be installed in Google Chrome on your pc.",implemented:!0,hidden:!0,cat:"core",category:"developer settings"},"Enable Transparency":{id:"fork-wp-1",info:"Enables the main window to be see-through (requires restart)",implemented:!0,hidden:!1,cat:"core",category:"window preferences"},"Window Frame":{id:"fork-wp-2",info:"Adds the native os window frame to the main window",implemented:!1,hidden:!0,cat:"core",category:"window preferences"},"Download Emotes":{id:"fork-es-3",info:"Download emotes when the cache is expired",implemented:!0,hidden:!1,cat:"emote"},"Twitch Emotes":{id:"bda-es-7",info:"Show Twitch emotes",implemented:!0,hidden:!1,cat:"emote"},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0,hidden:!1,cat:"emote"},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0,hidden:!1,cat:"emote"},"Emote Menu":{id:"bda-es-0",info:"Show Twitch/Favourite emotes in emote menu",implemented:!0,hidden:!1,cat:"emote"},"Emoji Menu":{id:"bda-es-9",info:"Show Discord emoji menu",implemented:!0,hidden:!1,cat:"emote"},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!1,hidden:!1,cat:"emote"},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0,hidden:!1,cat:"emote"},"Show emote modifiers":{id:"bda-es-8",info:"Enable emote mods (flip, spin, pulse, spin2, spin3, 1spin, 2spin, 3spin, tr, bl, br, shake, shake2, shake3, flap)",implemented:!0,hidden:!1,cat:"emote"},"Animate On Hover":{id:"fork-es-2",info:"Only animate the emote modifiers on hover",implemented:!0,hidden:!1,cat:"emote"}},d={"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!1,"bda-gs-5":!0,"bda-gs-6":!1,"bda-gs-7":!1,"bda-gs-8":!1,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-4":!1,"bda-es-6":!0,"bda-es-7":!0,"bda-gs-b":!1,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0,"fork-dm-1":!1,"fork-ps-1":!0,"fork-ps-2":!0,"fork-ps-3":!0,"fork-ps-4":!0,"fork-ps-5":!0,"fork-es-2":!1,"fork-es-3":!0,"fork-wp-1":!1,"fork-wp-2":!1,"fork-beta":!0,reactDevTools:!1},u={},h=[],p=[],m={},g=[],f={},b={},v={},y={},C={},E={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{},BTTV2:{}},w={TwitchGlobal:"bda-es-7",TwitchSubscriber:"bda-es-7",BTTV:"bda-es-2",FrankerFaceZ:"bda-es-1",BTTV2:"bda-es-2"},k={},S={},x={},D={},N=webpackJsonp.push([[],{__extra_id__:(e,t,n)=>e.exports=n},[["__extra_id__"]]]);delete N.m.__extra_id__,delete N.c.__extra_id__;const T=e=>{for(const t in N.c)if(N.c.hasOwnProperty(t)){const n=N.c[t].exports;if(n&&n.__esModule&&n.default&&e(n.default))return n.default;if(n&&e(n))return n}return null};var P=T,L=e=>{const t=[];for(const n in N.c)if(N.c.hasOwnProperty(n)){const s=N.c[n].exports;s&&s.__esModule&&s.default&&e(s.default)?t.push(s.default):s&&e(s)&&t.push(s)}return t},M=(...e)=>T(t=>e.every(e=>void 0!==t[e])),B=e=>T(t=>t.displayName===e),F=new class{constructor(){this.editorDetached=!1,this.WebpackModules=(()=>{const e=webpackJsonp.push([[],{__extra_id__:(e,t,n)=>e.exports=n},[["__extra_id__"]]]);delete e.m.__extra_id__,delete e.c.__extra_id__;const t=e=>e.remove&&e.set&&e.clear&&e.get&&!e.sort?null:e.getToken||e.getEmail||e.showToken?new Proxy(e,{get:function(e,t){return"getToken"==t?()=>"mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa":"getEmail"==t?()=>"puppet11112@gmail.com":"showToken"==t?()=>!0:e[t]}}):e,n=n=>{for(const s in e.c)if(e.c.hasOwnProperty(s)){const o=e.c[s].exports;if(o&&o.__esModule&&o.default&&n(o.default))return t(o.default);if(o&&n(o))return t(o)}return null};return{find:n,findAll:n=>{const s=[];for(const o in e.c)if(e.c.hasOwnProperty(o)){const r=e.c[o].exports;r&&r.__esModule&&r.default&&n(r.default)?s.push(t(r.default)):r&&n(r)&&s.push(t(r))}return s},findByUniqueProperties:e=>n(t=>e.every(e=>void 0!==t[e])),findByPrototypes:e=>n(t=>t.prototype&&e.every(e=>void 0!==t.prototype[e])),findByDisplayName:e=>n(t=>t.displayName===e)}})(),this.internal={react:this.WebpackModules.findByUniqueProperties(["Component","PureComponent","Children","createElement","cloneElement"]),reactDom:this.WebpackModules.findByUniqueProperties(["findDOMNode"])},this.getInternalInstance=e=>e[Object.keys(e).find(e=>e.startsWith("__reactInternalInstance"))]}initialize(){}joinBD1(){this.InviteActions.acceptInviteAndTransitionToInviteChannel("0Tmfo5ZbORCRqbAd")}leaveBD1(){this.GuildActions.leaveGuild("86004744966914048")}joinBD2(){this.InviteActions.acceptInviteAndTransitionToInviteChannel("2HScm8j")}leaveBD2(){this.GuildActions.leaveGuild("280806472928198656")}get react(){return this.internal.react}get React(){return this.internal.react}get reactDom(){return this.internal.reactDom}get ReactDom(){return this.internal.reactDom}get reactComponent(){return this.internal.react.Component}get ReactComponent(){return this.internal.react.Component}get anchorClasses(){return this.WebpackModules.findByUniqueProperties(["anchorUnderlineOnHover"])||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"}}get slateEditorClasses(){return this.WebpackModules.findByUniqueProperties(["slateTextArea"])}get messageClasses(){return this.WebpackModules.findByUniqueProperties(["message","containerCozy"])}get guildClasses(){const e=this.WebpackModules.findByUniqueProperties(["wrapper","unreadMentionsBar"]),t=this.WebpackModules.findByUniqueProperties(["guildsError","selected"]),n=this.WebpackModules.findByUniqueProperties(["blobContainer"]);return Object.assign({},e,t,n)}get MessageContentComponent(){return this.WebpackModules.find(e=>e.defaultProps&&e.defaultProps.hasOwnProperty("disableButtons"))}get MessageComponent(){return this.WebpackModules.find(e=>e.default&&e.default.displayName&&"Message"==e.default.displayName)}get TimeFormatter(){return this.WebpackModules.findByUniqueProperties(["dateFormat"])}get TooltipWrapper(){return this.WebpackModules.findByDisplayName("Tooltip")}get NativeModule(){return this.WebpackModules.findByUniqueProperties(["setBadge"])}get InviteActions(){return this.WebpackModules.findByUniqueProperties(["acceptInvite"])}get GuildActions(){return this.WebpackModules.findByUniqueProperties(["leaveGuild"])}get Tooltips(){return this.WebpackModules.find(e=>e.hide&&e.show&&!e.search&&!e.submit&&!e.search&&!e.activateRagingDemon&&!e.dismiss)}get KeyGenerator(){return this.WebpackModules.find(e=>e.toString&&/"binary"/.test(e.toString()))}get LayerStack(){return this.WebpackModules.findByUniqueProperties(["popLayer"])}get UserStore(){return this.WebpackModules.findByUniqueProperties(["getCurrentUser"])}get ChannelStore(){return this.WebpackModules.findByUniqueProperties(["getChannel"])}get ChannelActions(){return this.WebpackModules.findByUniqueProperties(["openPrivateChannel"])}get PrivateChannelActions(){return this.WebpackModules.findByUniqueProperties(["selectPrivateChannel"])}openDM(e){const t=this.UserStore.getCurrentUser().id;if(t==e)return;const n=this.ChannelStore.getDMFromUserId(e);if(n)return this.PrivateChannelActions.selectPrivateChannel(n);this.ChannelActions.openPrivateChannel(t,e)}parseSettings(e){return Object.keys(c).reduce((t,n)=>{const s=c[n];return s.cat===e&&s.implemented&&!s.hidden&&(s.text=n,t.push(s)),t},[])}};class A{static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"-")}static addStyle(e,t){document.head.append(A.createElement(``))}static removeStyle(e){const t=document.getElementById(e);t&&t.remove()}static addScript(e,t){return new Promise(n=>{const s=document.createElement("script");s.id=e,s.src=t,s.type="text/javascript",s.onload=n,document.head.append(s)})}static removeScript(e){e=this.escapeID(e);const t=document.getElementById(e);t&&t.remove()}static animate({timing:e=(e=>e),update:t,duration:n}){const s=performance.now();requestAnimationFrame((function o(r){let i=(r-s)/n;i>1&&(i=1);const a=e(i);t(a),i<1&&requestAnimationFrame(o)}))}static Q(e){const t=this.parseHTML(e);return(t instanceof NodeList?Array.from(t).some(e=>1===e.nodeType):1===t.nodeType)?t:this.query(e)}static query(e,t){return t||(t=document),t.querySelector(e)}static queryAll(e,t){return t||(t=document),t.querySelectorAll(e)}static parseHTML(e,t=!1){const n=document.createElement("template");n.innerHTML=e;const s=n.content.cloneNode(!0);return t?s:s.childNodes.length>1?s.childNodes:s.childNodes[0]}static createElement(e,t=!1){return this.parseHTML(e,t)}static escapeHTML(e){const t=document.createTextNode(""),n=document.createElement("span");return n.append(t),t.nodeValue=e,n.innerHTML}static addClass(e,...t){t=t.flat().filter(e=>e);for(let e=0;ee),e.classList.add(...t),e}static removeClass(e,...t){for(let e=0;ee),e.classList.remove(...t),e}static toggleClass(e,t,n){return t=t.toString().split(" ").filter(e=>e),void 0!==n?t.forEach(t=>e.classList.toggle(t,n)):t.forEach(t=>e.classList.toggle(t)),e}static hasClass(e,t){return t.toString().split(" ").filter(e=>e).every(t=>e.classList.contains(t))}static replaceClass(e,t,n){return e.classList.replace(t,n),e}static appendTo(e,t){return"string"==typeof t&&(t=this.query(t)),t?(t.append(e),e):null}static prependTo(e,t){return"string"==typeof t&&(t=this.query(t)),t?(t.prepend(e),e):null}static insertAfter(e,t){return t.parentNode.insertBefore(e,t.nextSibling),e}static after(e,t){return e.parentNode.insertBefore(t,e.nextSibling),e}static next(e,t=""){return t?e.querySelector("+ "+t):e.nextElementSibling}static nextAll(e){return e.querySelectorAll("~ *")}static nextUntil(e,t){const n=[];for(;e.nextElementSibling&&!e.nextElementSibling.matches(t);)n.push(e=e.nextElementSibling);return n}static previous(e,t=""){const n=e.previousElementSibling;return t?n&&n.matches(t)?n:null:n}static previousAll(e){const t=[];for(;e.previousElementSibling;)t.push(e=e.previousElementSibling);return t}static previousUntil(e,t){const n=[];for(;e.previousElementSibling&&!e.previousElementSibling.matches(t);)n.push(e=e.previousElementSibling);return n}static indexInParent(e){const t=e.parentNode.childNodes;let n=0;for(let s=0;s "+t)}static findChildren(e,t){return e.querySelectorAll(":scope > "+t)}static parents(e,t=""){const n=[];if(t)for(;e.parentElement&&e.parentElement.closest(t);)n.push(e=e.parentElement.closest(t));else for(;e.parentElement;)n.push(e=e.parentElement);return n}static parentsUntil(e,t){const n=[];for(;e.parentElement&&!e.parentElement.matches(t);)n.push(e=e.parentElement);return n}static siblings(e,t="*"){return Array.from(e.parentElement.children).filter(n=>n!=e&&n.matches(t))}static css(e,t,n){return void 0===n?global.getComputedStyle(e)[t]:(e.style[t]=n,e)}static width(e,t){return void 0===t?parseInt(getComputedStyle(e).width):(e.style.width=t,e)}static height(e,t){return void 0===t?parseInt(getComputedStyle(e).height):(e.style.height=t,e)}static text(e,t){return void 0===t?e.textContent:e.textContent=t}static innerWidth(e){return e.clientWidth}static innerHeight(e){return e.clientHeight}static outerWidth(e){return e.offsetWidth}static outerHeight(e){return e.offsetHeight}static offset(e){return e.getBoundingClientRect()}static get listeners(){return this._listeners||(this._listeners={})}static on(e,t,n,s){const[o,r]=t.split("."),i=n&&s;s||(s=n);const a=i?function(e){e.target.matches(n)&&s(e)}:s;e.addEventListener(o,a);const l=()=>{e.removeEventListener(o,a)};if(r){this.listeners[r]||(this.listeners[r]=[]);const t=()=>{l(),this.listeners[r].splice(this.listeners[r].findIndex(t=>t.event==o&&t.element==e),1)};return this.listeners[r].push({event:o,element:e,cancel:t}),t}return l}static once(e,t,n,s){const[o,r]=t.split("."),i=n&&s;s||(s=n);const a=i?function(t){t.target.matches(n)&&(s(t),e.removeEventListener(o,a))}:function(t){s(t),e.removeEventListener(o,a)};e.addEventListener(o,a);const l=()=>{e.removeEventListener(o,a)};if(r){this.listeners[r]||(this.listeners[r]=[]);const t=()=>{l(),this.listeners[r].splice(this.listeners[r].findIndex(t=>t.event==o&&t.element==e),1)};return this.listeners[r].push({event:o,element:e,cancel:t}),t}return l}static __offAll(e,t){const[n,s]=e.split(".");let o=e=>e.event==n,r=e=>e;t&&(o=e=>e.event==n&&e.element==t,r=e=>e.element==t);const i=this.listeners[s]||[],a=n?i.filter(o):i.filter(r);for(let e=0;e{this.observer.unsubscribe(s),t()};return this.observer.subscribe(s,t=>{const s=Array.from(n?t.addedNodes:t.removedNodes),o=s.indexOf(e)>-1,r=s.some(t=>t.contains(e));return o||r}),e}static onMount(e,t){return this.onMountChange(e,t)}static onUnmount(e,t){return this.onMountChange(e,t,!1)}static onAdded(e,t){return this.onMount(e,t)}static onRemoved(e,t){return this.onUnmount(e,t,!1)}static wrap(e){const t=this.parseHTML('
');for(let n=0;n{try{return e(...n)}catch(e){this.err("SuppressedError","Error occurred in "+t,e)}}}static monkeyPatch(e,t,n){const{before:s,after:o,instead:r,once:i=!1,silent:a=!1,force:l=!1}=n,c=n.displayName||e.displayName||e[t].displayName||e.name||e.constructor.displayName||e.constructor.name;if(a||console.log("patch",t,"of",c),!e[t]){if(!l)return console.error(t,"does not exist for",c);e[t]=function(){}}const d=e[t],u=()=>{a||console.log("unpatch",t,"of",c),e[t]=d};return e[t]=function(){const n={thisObject:this,methodArguments:arguments,cancelPatch:u,originalMethod:d,callOriginalMethod:()=>n.returnValue=n.originalMethod.apply(n.thisObject,n.methodArguments)};if(r){const s=j.suppressErrors(r,"`instead` callback of "+e[t].displayName)(n);void 0!==s&&(n.returnValue=s)}else s&&j.suppressErrors(s,"`before` callback of "+e[t].displayName)(n),n.callOriginalMethod(),o&&j.suppressErrors(o,"`after` callback of "+e[t].displayName)(n);return i&&u(),n.returnValue},Object.assign(e[t],d),e[t].__monkeyPatched=!0,e[t].displayName=c,e[t].__originalMethod||(e[t].__originalMethod=d,e[t].toString=function(){return d.toString()}),u}static onRemoved(e,t){const n=new MutationObserver(s=>{for(let o=0;o-1,l=i.some(t=>t.contains(e));(a||l)&&(n.disconnect(),t())}});n.observe(document.body,{subtree:!0,childList:!0})}static getNestedProp(e,t){return t.split(/\s?\.\s?/).reduce((function(e,t){return e&&e[t]}),e)}static showToast(e,t={}){if(!document.querySelector(".bd-toasts")){const e=document.querySelector(".sidebar-2K8pFh + div")||null,t=e?e.querySelector(".membersWrap-2h-GB4"):null,n=e?e.querySelector("form"):null,s=e?e.getBoundingClientRect().left:310,o=t?t.getBoundingClientRect().left:0,r=o?o-e.getBoundingClientRect().left:j.screenWidth-s-240,i=n?n.offsetHeight:80,a=document.createElement("div");a.classList.add("bd-toasts"),a.style.setProperty("left",s+"px"),a.style.setProperty("width",r+"px"),a.style.setProperty("bottom",i+"px"),document.querySelector("#app-mount").appendChild(a)}const{type:n="",icon:s=!0,timeout:o=3e3}=t,r=document.createElement("div");r.classList.add("bd-toast"),n&&r.classList.add("toast-"+n),n&&s&&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)},o)}static alert(e,t){const n=A.createElement(`
\n
\n \n
`);n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n)}static showContentErrors({plugins:e=[],themes:t=[]}){if(!e||!t)return;if(!e.length&&!t.length)return;const n=A.createElement('
\n
\n \n
');function s(e){const t=A.createElement('
');for(const n of e){const e=A.createElement(`
\n
${n.name?n.name:n.file}
\n
${n.message}
\n \n
`);t.append(e),n.error&&e.querySelectorAll("a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),j.err("ContentManager",`Error details for ${n.name?n.name:n.file}.`,n.error)}))}return t}const o=[s(e),s(t)];n.querySelectorAll(".tab-bar-item").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();const t=n.querySelector(".tab-bar-item.selected");t&&A.removeClass(t,"selected"),A.addClass(e.target,"selected");const s=n.querySelector(".scroller");s.innerHTML="",s.append(o[A.index(e.target)])})),n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").on("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n),e.length?n.querySelector(".tab-bar-item").click():n.querySelectorAll(".tab-bar-item")[1].click()}static showChangelogModal(e={}){const t=M("push","update","pop","popWithKey"),n=M("fixed","improved"),s=M("Sizes","Weights"),o=M("Child"),r=M("Tags","default"),i=P(e=>e.defaultProps&&0==e.defaultProps.selectable),l=M("defaultRules","parse");if(!(i&&t&&n&&s&&o&&r&&l))return;const{image:c="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:d="",changes:u=[],title:h="BandagedBD",subtitle:p=`v${a}`,footer:m}=e,g=F.React.createElement,f=[g("img",{src:c})];d&&f.push(g("p",null,l.parse(d)));for(let e=0;eg("li",null,l.parse(e))));f.push(r)}const b=function(){return g(o.Child,{grow:1,shrink:1},g(r.default,{tag:r.Tags.H4},h),g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY,className:n.date},p))},v=()=>{const e=P(e=>"Anchor"==e.displayName),n=M("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},r=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),F.joinBD2()},i=e?g(e,{onClick:r},"Join our Discord Server."):g("a",{className:`${n.anchor} ${n.anchorUnderlineOnHover}`,onClick:r},"Join our Discord Server."),a=g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY},"Need support? ",i);return g(o.Child,{grow:1,shrink:1},m||a)};t.push((function(e){return g(i,Object.assign({className:n.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:b,renderFooter:v,children:f},e))}))}}j.showToast=j.suppressErrors(j.showToast,"Could not show toast.");const O=n(4);var $=new class extends O{dispatch(e,...t){this.emit(e,...t)}off(e,t){this.removeListener(e,t)}};function I(){}I.prototype.loadPlugins=function(){this.loadPluginData(),h.splice(0,0,...Y.loadPlugins());const e=Object.keys(S);for(let t=0;tt.filename==e).plugin;try{n.load&&"function"==typeof n.load&&n.load()}catch(e){u["fork-ps-1"]&&j.showContentErrors({plugins:[e]})}j.log("ContentManager",`${n.getName()} v${n.getVersion()} was loaded.`),u["fork-ps-2"]&&j.showToast(`${n.getName()} v${n.getVersion()} was loaded.`,{type:"success"}),$.dispatch("plugin-loaded",n.getName())},I.prototype.unloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const n=t.plugin.getName();x[n]&&this.disablePlugin(n,!0);const s=Y.unloadContent(S[n].filename,"plugin");if(delete S[n],s)return u["fork-ps-1"]&&j.showContentErrors({plugins:[s]}),u["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),u["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),$.dispatch("plugin-unloaded",n)},I.prototype.delete=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;this.unloadPlugin(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},I.prototype.reloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return this.loadPlugin(e);const n=t.plugin.getName(),s=x[n];s&&this.stopPlugin(n,!0);const o=Y.reloadContent(S[n].filename,"plugin");if(o)return u["fork-ps-1"]&&j.showContentErrors({plugins:[o]}),u["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,o);S[n].plugin.load&&"function"==typeof S[n].plugin.load&&S[n].plugin.load(),s&&this.startPlugin(n,!0),j.log("ContentManager",`${n} v${S[n].plugin.getVersion()} was reloaded.`),u["fork-ps-2"]&&j.showToast(`${n} v${S[n].plugin.getVersion()} was reloaded.`,{type:"success"}),$.dispatch("plugin-reloaded",n)},I.prototype.reload=function(e){return this.reloadPlugin(e)},I.prototype.edit=function(e){console.log("Edit "+e);const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const s=n(1).resolve(Y.pluginsFolder,t.filename);console.log("Edit "+s),n(2).shell.openItem(`${s}`)},I.prototype.updatePluginList=function(){const e=Y.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},I.prototype.loadPluginData=function(){const e=ee.getSettingGroup("plugins");e&&Object.assign(x,e)},I.prototype.savePluginData=function(){ee.setSettingGroup("plugins",x)},I.prototype.newMessage=function(){const e=Object.keys(S);for(let t=0;tt.filename==e);j.log("ContentManager",`${n.name} v${n.version} was loaded.`),u["fork-ps-2"]&&j.showToast(`${n.name} v${n.version} was loaded.`,{type:"success"}),$.dispatch("theme-loaded",n.name)},q.prototype.unloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const n=t.name;D[n]&&this.disableTheme(n,!0);const s=Y.unloadContent(k[n].filename,"theme");if(delete k[n],s)return u["fork-ps-1"]&&j.showContentErrors({themes:[s]}),u["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),u["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),$.dispatch("theme-unloaded",n)},q.prototype.delete=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;this.unloadTheme(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},q.prototype.reloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return this.loadTheme(e);const n=t.name,s=Y.reloadContent(k[n].filename,"theme");if(D[n]&&(this.disableTheme(n,!0),this.enableTheme(n,!0)),s)return u["fork-ps-1"]&&j.showContentErrors({themes:[s]}),u["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,s);j.log("ContentManager",`${n} v${k[n].version} was reloaded.`),u["fork-ps-2"]&&j.showToast(`${n} v${k[n].version} was reloaded.`,{type:"success"}),$.dispatch("theme-reloaded",n)},q.prototype.reload=function(e){return this.reloadTheme(e)},q.prototype.edit=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const s=n(1).resolve(Y.themesFolder,t.filename);n(2).shell.openItem(`${s}`)},q.prototype.updateThemeList=function(){const e=Y.loadNewContent("theme");for(const t of e.added)this.loadTheme(t);for(const t of e.removed)this.unloadTheme(t)},q.prototype.loadThemeData=function(){const e=ee.getSettingGroup("themes");e&&Object.assign(D,e)},q.prototype.saveThemeData=function(){ee.setSettingGroup("themes",D)};var _=new q;const W=n(1),H=n(0),G=n(5).Module;G.globalPaths.push(W.resolve(n(2).remote.app.getAppPath(),"node_modules"));class z extends Error{constructor(e){super(e),this.name="MetaError"}}const V=G._extensions[".js"],U=G._extensions[".css"]?G._extensions[".css"]:()=>null,J=/[^\S\r\n]*?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,Q=/^\\@/;var Y=new class{constructor(){this.timeCache={},this.watchers={},G._extensions[".js"]=this.getContentRequire("plugin"),G._extensions[".css"]=this.getContentRequire("theme")}get pluginsFolder(){return this._pluginsFolder||(this._pluginsFolder=H.realpathSync(W.resolve(m.dataPath+"plugins/")))}get themesFolder(){return this._themesFolder||(this._themesFolder=H.realpathSync(W.resolve(m.dataPath+"themes/")))}watchContent(e){if(this.watchers[e])return;const t="plugin"===e,n=t?this.pluginsFolder:this.themesFolder,s=t?".plugin.js":".theme.css";this.watchers[e]=H.watch(n,{persistent:!1},async(e,o)=>{if(!e||!o||!o.endsWith(s))return;await new Promise(e=>setTimeout(e,50));try{H.statSync(W.resolve(n,o))}catch(e){if("ENOENT"!==e.code)return;return delete this.timeCache[o],t?R.unloadPlugin(o):_.unloadTheme(o)}if(!H.statSync(W.resolve(n,o)).isFile())return;const r=H.statSync(W.resolve(n,o));r&&r.mtime&&r.mtime.getTime()&&"number"==typeof r.mtime.getTime()&&this.timeCache[o]!=r.mtime.getTime()&&(this.timeCache[o]=r.mtime.getTime(),"rename"==e&&(t?R.loadPlugin(o):_.loadTheme(o)),"change"==e&&(t?R.reloadPlugin(o):_.reloadTheme(o)))})}unwatchContent(e){this.watchers[e]&&(this.watchers[e].close(),delete this.watchers[e])}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 z("META was not found.")}parseOldMeta(e){const t=e.split("\n")[0],n=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//"));if(t.indexOf("META")<0)throw new z("META was not found.");const s=j.testJSON(n);if(!s)throw new z("META could not be parsed.");if(!s.name)throw new z("META missing name data.");return s.format="json",s}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],n={};let s="",o="";for(const e of t.split(J))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){n[s]=o;const t=e.indexOf(" ");s=e.substr(1,t-1),o=e.substr(t+1)}else o+=" "+e.replace("\\n","\n").replace(Q,"@");return n[s]=o.trim(),delete n[""],n.format="jsdoc",n}getContentRequire(e){const t="plugin"===e,n=this,s=t?V:U;return function(e,o){const r=t?n.pluginsFolder:n.themesFolder,i=W.resolve(r,W.basename(o));if(!H.existsSync(i)||o!==H.realpathSync(i))return Reflect.apply(s,this,arguments);let a=H.readFileSync(o,"utf8");a=j.stripBOM(a);const l=H.statSync(o),c=n.extractMeta(a);if(c.filename=W.basename(o),c.added=l.atimeMs,c.modified=l.mtimeMs,c.size=l.size,t||(c.css=a,"json"==c.format&&(c.css=c.css.split("\n").slice(1).join("\n")),a=`module.exports = ${JSON.stringify(c)};`),t){e._compile(a,e.filename),!j.isEmpty(e.exports)?(c.type=e.exports,e.exports=c,a=""):a+=`\nmodule.exports = ${JSON.stringify(c)};\nmodule.exports.type = ${c.exports||c.name};`}e._compile(a,o)}}makePlaceholderPlugin(e){return{plugin:{start:()=>{},getName:()=>e.name||e.filename,getAuthor:()=>"???",getDescription:()=>e.message?e.message:"This plugin was unable to be loaded. Check the author's page for updates.",getVersion:()=>"???"},name:e.name||e.filename,filename:e.filename,source:e.source?e.source:"",website:e.website?e.website:""}}loadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t,s=n?this.pluginsFolder:this.themesFolder;try{require(W.resolve(s,e))}catch(t){return{name:e,file:e,message:"Could not be compiled.",error:{message:t.message,stack:t.stack}}}const o=require(W.resolve(s,e));if(o.id=j.escapeID(o.name),n){if(!o.type)return;try{o.plugin=new o.type,delete S[o.plugin.getName()],S[o.plugin.getName()]=o}catch(t){return{name:e,file:e,message:"Could not be constructed.",error:{message:t.message,stack:t.stack}}}}else delete k[o.name],k[o.name]=o}unloadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{delete require.cache[require.resolve(W.resolve(n,e))]}catch(t){return{name:e,file:e,message:"Could not be unloaded.",error:{message:t.message,stack:t.stack}}}}isLoaded(e,t){const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{require.cache[require.resolve(W.resolve(n,e))]}catch(e){return!1}return!0}reloadContent(e,t){const n=this.unloadContent(e,t);return n||this.loadContent(e,t)}loadNewContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=H.readdirSync(s),r=Object.values(t?S:k),i=r.filter(e=>!o.includes(e.filename)).map(e=>t?e.plugin.getName():e.name);return{added:o.filter(e=>!r.find(t=>t.filename==e)&&e.endsWith(n)&&H.statSync(W.resolve(s,e)).isFile()),removed:i}}loadAllContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=[],r=H.readdirSync(s);for(const t of r){if(!H.statSync(W.resolve(s,t)).isFile()||!t.endsWith(n))continue;const r=this.loadContent(t,e);r&&o.push(r)}return o}loadPlugins(){return this.loadAllContent("plugin")}loadThemes(){return this.loadAllContent("theme")}};const Z=n(0),K=n(1),X=DiscordNative.globals.releaseChannel;var ee=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={}}initialize(){try{Z.existsSync(this.BDFile)||Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4));const e=require(this.BDFile);if(e.hasOwnProperty("settings")&&(this.data=e),!Z.existsSync(this.settingsFile))return;let t=require(this.settingsFile);Z.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[X]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}catch(e){console.error(e),j.alert("Corrupt Storage","The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.")}}get BDFile(){return this._BDFile||(this._BDFile=K.resolve(m.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=K.resolve(m.dataPath,"bdsettings.json"))}getPluginFile(e){return K.resolve(Y.pluginsFolder,e+".config.json")}getSettingGroup(e){return this.data.settings[X][e]||null}setSettingGroup(e,t){this.data.settings[X][e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:Z.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(Z.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,n){void 0!==n&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=n,Z.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],Z.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};function te(){this.switchHandler=this.switchHandler.bind(this),this.favContext=this.favContext.bind(this)}const ne=function(e){const t=e.target.getAttribute("title"),n=document.querySelector(`.${F.slateEditorClasses.slateTextArea.split(" ")[0]}`);if(n){const e=F.getInternalInstance(n),s=j.getNestedProp(e,"memoizedProps.children.props.editor.insertText");s&&s(` ${t} `)}else{const e=j.getTextArea();j.insertText(e," "==e.value.slice(-1)?e.value+t:e.value+" "+t)}},se=function(e,t,{click:n=ne,contextmenu:s}={}){const o=A.createElement(`
${e}
`);return n&&o.addEventListener("click",n),s&&o.addEventListener("contextmenu",s),o};te.prototype.init=function(){this.initialized=!0,this.favoriteEmotes={};const e=ee.getBDData("bdfavemotes");""!==e&&null!==e&&(this.favoriteEmotes=JSON.parse(atob(e))),this.qmeHeader=A.createElement('
'),this.twitchButton=A.createElement(''),this.favoriteButton=A.createElement(''),this.emojiButton=A.createElement('\n
\n
\n
\n
`);n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n)}static showContentErrors({plugins:e=[],themes:t=[]}){if(!e||!t)return;if(!e.length&&!t.length)return;const n=A.createElement('
\n
\n \n
');function s(e){const t=A.createElement('
');for(const n of e){const e=A.createElement(`
\n
${n.name?n.name:n.file}
\n
${n.message}
\n \n
`);t.append(e),n.error&&e.querySelectorAll("a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),j.err("ContentManager",`Error details for ${n.name?n.name:n.file}.`,n.error)}))}return t}const o=[s(e),s(t)];n.querySelectorAll(".tab-bar-item").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();const t=n.querySelector(".tab-bar-item.selected");t&&A.removeClass(t,"selected"),A.addClass(e.target,"selected");const s=n.querySelector(".scroller");s.innerHTML="",s.append(o[A.index(e.target)])})),n.querySelector(".footer button").addEventListener("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),n.querySelector(".bd-backdrop").on("click",()=>{A.addClass(n,"closing"),setTimeout(()=>{n.remove()},300)}),A.query("#app-mount").append(n),e.length?n.querySelector(".tab-bar-item").click():n.querySelectorAll(".tab-bar-item")[1].click()}static showChangelogModal(e={}){const t=M("push","update","pop","popWithKey"),n=M("fixed","improved"),s=M("Sizes","Weights"),o=M("Child"),r=M("Tags","default"),i=P(e=>e.defaultProps&&0==e.defaultProps.selectable),l=M("defaultRules","parse");if(!(i&&t&&n&&s&&o&&r&&l))return;const{image:c="https://repository-images.githubusercontent.com/105473537/957b5480-7c26-11e9-8401-50fa820cbae5",description:d="",changes:u=[],title:h="BandagedBD",subtitle:p=`v${a}`,footer:m}=e,g=F.React.createElement,f=[g("img",{src:c})];d&&f.push(g("p",null,l.parse(d)));for(let e=0;eg("li",null,l.parse(e))));f.push(r)}const b=function(){return g(o.Child,{grow:1,shrink:1},g(r.default,{tag:r.Tags.H4},h),g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY,className:n.date},p))},v=()=>{const e=P(e=>"Anchor"==e.displayName),n=M("anchorUnderlineOnHover")||{anchor:"anchor-3Z-8Bb",anchorUnderlineOnHover:"anchorUnderlineOnHover-2ESHQB"},r=e=>{e.preventDefault(),e.stopPropagation(),t.pop(),F.joinBD2()},i=e?g(e,{onClick:r},"Join our Discord Server."):g("a",{className:`${n.anchor} ${n.anchorUnderlineOnHover}`,onClick:r},"Join our Discord Server."),a=g(s,{size:s.Sizes.SMALL,color:s.Colors.PRIMARY},"Need support? ",i);return g(o.Child,{grow:1,shrink:1},m||a)};t.push((function(e){return g(i,Object.assign({className:n.container,selectable:!0,onScroll:e=>e,onClose:e=>e,renderHeader:b,renderFooter:v,children:f},e))}))}}j.showToast=j.suppressErrors(j.showToast,"Could not show toast.");const O=n(4);var $=new class extends O{dispatch(e,...t){this.emit(e,...t)}off(e,t){this.removeListener(e,t)}};function I(){}I.prototype.loadPlugins=function(){this.loadPluginData(),h.splice(0,0,...Y.loadPlugins());const e=Object.keys(S);for(let t=0;tt.filename==e).plugin;try{n.load&&"function"==typeof n.load&&n.load()}catch(e){u["fork-ps-1"]&&j.showContentErrors({plugins:[e]})}j.log("ContentManager",`${n.getName()} v${n.getVersion()} was loaded.`),u["fork-ps-2"]&&j.showToast(`${n.getName()} v${n.getVersion()} was loaded.`,{type:"success"}),$.dispatch("plugin-loaded",n.getName())},I.prototype.unloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const n=t.plugin.getName();x[n]&&this.disablePlugin(n,!0);const s=Y.unloadContent(S[n].filename,"plugin");if(delete S[n],s)return u["fork-ps-1"]&&j.showContentErrors({plugins:[s]}),u["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),u["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),$.dispatch("plugin-unloaded",n)},I.prototype.delete=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;this.unloadPlugin(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},I.prototype.reloadPlugin=function(e){const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return this.loadPlugin(e);const n=t.plugin.getName(),s=x[n];s&&this.stopPlugin(n,!0);const o=Y.reloadContent(S[n].filename,"plugin");if(o)return u["fork-ps-1"]&&j.showContentErrors({plugins:[o]}),u["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,o);S[n].plugin.load&&"function"==typeof S[n].plugin.load&&S[n].plugin.load(),s&&this.startPlugin(n,!0),j.log("ContentManager",`${n} v${S[n].plugin.getVersion()} was reloaded.`),u["fork-ps-2"]&&j.showToast(`${n} v${S[n].plugin.getVersion()} was reloaded.`,{type:"success"}),$.dispatch("plugin-reloaded",n)},I.prototype.reload=function(e){return this.reloadPlugin(e)},I.prototype.edit=function(e){console.log("Edit "+e);const t=Object.values(S).find(t=>t.filename==e)||S[e];if(!t)return;const s=n(1).resolve(Y.pluginsFolder,t.filename);console.log("Edit "+s),n(2).shell.openItem(`${s}`)},I.prototype.updatePluginList=function(){const e=Y.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},I.prototype.loadPluginData=function(){const e=ee.getSettingGroup("plugins");e&&Object.assign(x,e)},I.prototype.savePluginData=function(){ee.setSettingGroup("plugins",x)},I.prototype.newMessage=function(){const e=Object.keys(S);for(let t=0;tt.filename==e);j.log("ContentManager",`${n.name} v${n.version} was loaded.`),u["fork-ps-2"]&&j.showToast(`${n.name} v${n.version} was loaded.`,{type:"success"}),$.dispatch("theme-loaded",n.name)},q.prototype.unloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const n=t.name;D[n]&&this.disableTheme(n,!0);const s=Y.unloadContent(k[n].filename,"theme");if(delete k[n],s)return u["fork-ps-1"]&&j.showContentErrors({themes:[s]}),u["fork-ps-2"]&&j.showToast(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),j.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);j.log("ContentManager",`${n} was unloaded.`),u["fork-ps-2"]&&j.showToast(`${n} was unloaded.`,{type:"success"}),$.dispatch("theme-unloaded",n)},q.prototype.delete=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;this.unloadTheme(t.filename);const s=n(1).resolve(Y.pluginsFolder,t.filename);n(0).unlinkSync(s)},q.prototype.reloadTheme=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return this.loadTheme(e);const n=t.name,s=Y.reloadContent(k[n].filename,"theme");if(D[n]&&(this.disableTheme(n,!0),this.enableTheme(n,!0)),s)return u["fork-ps-1"]&&j.showContentErrors({themes:[s]}),u["fork-ps-2"]&&j.showToast(`${n} could not be reloaded.`,{type:"error"}),j.err("ContentManager",`${n} could not be reloaded.`,s);j.log("ContentManager",`${n} v${k[n].version} was reloaded.`),u["fork-ps-2"]&&j.showToast(`${n} v${k[n].version} was reloaded.`,{type:"success"}),$.dispatch("theme-reloaded",n)},q.prototype.reload=function(e){return this.reloadTheme(e)},q.prototype.edit=function(e){const t=Object.values(k).find(t=>t.filename==e)||k[e];if(!t)return;const s=n(1).resolve(Y.themesFolder,t.filename);n(2).shell.openItem(`${s}`)},q.prototype.updateThemeList=function(){const e=Y.loadNewContent("theme");for(const t of e.added)this.loadTheme(t);for(const t of e.removed)this.unloadTheme(t)},q.prototype.loadThemeData=function(){const e=ee.getSettingGroup("themes");e&&Object.assign(D,e)},q.prototype.saveThemeData=function(){ee.setSettingGroup("themes",D)};var _=new q;const W=n(1),H=n(0),G=n(5).Module;G.globalPaths.push(W.resolve(n(2).remote.app.getAppPath(),"node_modules"));class z extends Error{constructor(e){super(e),this.name="MetaError"}}const V=G._extensions[".js"],U=G._extensions[".css"]?G._extensions[".css"]:()=>null,J=/[^\S\r\n]*?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,Q=/^\\@/;var Y=new class{constructor(){this.timeCache={},this.watchers={},G._extensions[".js"]=this.getContentRequire("plugin"),G._extensions[".css"]=this.getContentRequire("theme")}get pluginsFolder(){return this._pluginsFolder||(this._pluginsFolder=H.realpathSync(W.resolve(m.dataPath+"plugins/")))}get themesFolder(){return this._themesFolder||(this._themesFolder=H.realpathSync(W.resolve(m.dataPath+"themes/")))}watchContent(e){if(this.watchers[e])return;const t="plugin"===e,n=t?this.pluginsFolder:this.themesFolder,s=t?".plugin.js":".theme.css";this.watchers[e]=H.watch(n,{persistent:!1},async(e,o)=>{if(!e||!o||!o.endsWith(s))return;await new Promise(e=>setTimeout(e,50));try{H.statSync(W.resolve(n,o))}catch(e){if("ENOENT"!==e.code)return;return delete this.timeCache[o],t?R.unloadPlugin(o):_.unloadTheme(o)}if(!H.statSync(W.resolve(n,o)).isFile())return;const r=H.statSync(W.resolve(n,o));r&&r.mtime&&r.mtime.getTime()&&"number"==typeof r.mtime.getTime()&&this.timeCache[o]!=r.mtime.getTime()&&(this.timeCache[o]=r.mtime.getTime(),"rename"==e&&(t?R.loadPlugin(o):_.loadTheme(o)),"change"==e&&(t?R.reloadPlugin(o):_.reloadTheme(o)))})}unwatchContent(e){this.watchers[e]&&(this.watchers[e].close(),delete this.watchers[e])}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 z("META was not found.")}parseOldMeta(e){const t=e.split("\n")[0],n=t.substring(t.lastIndexOf("//META")+6,t.lastIndexOf("*//"));if(t.indexOf("META")<0)throw new z("META was not found.");const s=j.testJSON(n);if(!s)throw new z("META could not be parsed.");if(!s.name)throw new z("META missing name data.");return s.format="json",s}parseNewMeta(e){const t=e.split("/**",2)[1].split("*/",1)[0],n={};let s="",o="";for(const e of t.split(J))if(0!==e.length)if("@"===e.charAt(0)&&" "!==e.charAt(1)){n[s]=o;const t=e.indexOf(" ");s=e.substr(1,t-1),o=e.substr(t+1)}else o+=" "+e.replace("\\n","\n").replace(Q,"@");return n[s]=o.trim(),delete n[""],n.format="jsdoc",n}getContentRequire(e){const t="plugin"===e,n=this,s=t?V:U;return function(e,o){const r=t?n.pluginsFolder:n.themesFolder,i=W.resolve(r,W.basename(o));if(!H.existsSync(i)||o!==H.realpathSync(i))return Reflect.apply(s,this,arguments);let a=H.readFileSync(o,"utf8");a=j.stripBOM(a);const l=H.statSync(o),c=n.extractMeta(a);if(c.filename=W.basename(o),c.added=l.atimeMs,c.modified=l.mtimeMs,c.size=l.size,t||(c.css=a,"json"==c.format&&(c.css=c.css.split("\n").slice(1).join("\n")),a=`module.exports = ${JSON.stringify(c)};`),t){e._compile(a,e.filename),!j.isEmpty(e.exports)?(c.type=e.exports,e.exports=c,a=""):a+=`\nmodule.exports = ${JSON.stringify(c)};\nmodule.exports.type = ${c.exports||c.name};`}e._compile(a,o)}}makePlaceholderPlugin(e){return{plugin:{start:()=>{},getName:()=>e.name||e.filename,getAuthor:()=>"???",getDescription:()=>e.message?e.message:"This plugin was unable to be loaded. Check the author's page for updates.",getVersion:()=>"???"},name:e.name||e.filename,filename:e.filename,source:e.source?e.source:"",website:e.website?e.website:""}}loadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t,s=n?this.pluginsFolder:this.themesFolder;try{require(W.resolve(s,e))}catch(t){return{name:e,file:e,message:"Could not be compiled.",error:{message:t.message,stack:t.stack}}}const o=require(W.resolve(s,e));if(o.id=j.escapeID(o.name),n){if(!o.type)return;try{o.plugin=new o.type,delete S[o.plugin.getName()],S[o.plugin.getName()]=o}catch(t){return{name:e,file:e,message:"Could not be constructed.",error:{message:t.message,stack:t.stack}}}}else delete k[o.name],k[o.name]=o}unloadContent(e,t){if(void 0===e||void 0===t)return;const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{delete require.cache[require.resolve(W.resolve(n,e))]}catch(t){return{name:e,file:e,message:"Could not be unloaded.",error:{message:t.message,stack:t.stack}}}}isLoaded(e,t){const n="plugin"===t?this.pluginsFolder:this.themesFolder;try{require.cache[require.resolve(W.resolve(n,e))]}catch(e){return!1}return!0}reloadContent(e,t){const n=this.unloadContent(e,t);return n||this.loadContent(e,t)}loadNewContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=H.readdirSync(s),r=Object.values(t?S:k),i=r.filter(e=>!o.includes(e.filename)).map(e=>t?e.plugin.getName():e.name);return{added:o.filter(e=>!r.find(t=>t.filename==e)&&e.endsWith(n)&&H.statSync(W.resolve(s,e)).isFile()),removed:i}}loadAllContent(e){const t="plugin"===e,n=t?".plugin.js":".theme.css",s=t?this.pluginsFolder:this.themesFolder,o=[],r=H.readdirSync(s);for(const t of r){if(!H.statSync(W.resolve(s,t)).isFile()||!t.endsWith(n))continue;const r=this.loadContent(t,e);r&&o.push(r)}return o}loadPlugins(){return this.loadAllContent("plugin")}loadThemes(){return this.loadAllContent("theme")}};const Z=n(0),K=n(1),X=DiscordNative.globals.releaseChannel;var ee=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={}}initialize(){try{Z.existsSync(this.BDFile)||Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4));const e=require(this.BDFile);if(e.hasOwnProperty("settings")&&(this.data=e),!Z.existsSync(this.settingsFile))return;let t=require(this.settingsFile);Z.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[X]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}catch(e){console.error(e),j.alert("Corrupt Storage","The bd storage has somehow become corrupt. You may either try to salvage the file or delete it then reload.")}}get BDFile(){return this._BDFile||(this._BDFile=K.resolve(m.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=K.resolve(m.dataPath,"bdsettings.json"))}getPluginFile(e){return K.resolve(Y.pluginsFolder,e+".config.json")}getSettingGroup(e){return this.data.settings[X][e]||null}setSettingGroup(e,t){this.data.settings[X][e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,Z.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:Z.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(Z.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,n){void 0!==n&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=n,Z.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],Z.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};function te(){this.switchHandler=this.switchHandler.bind(this),this.favContext=this.favContext.bind(this)}const ne=function(e){const t=e.target.getAttribute("title"),n=document.querySelector(`.${F.slateEditorClasses.slateTextArea.split(" ")[0]}`);if(n){const e=F.getInternalInstance(n),s=j.getNestedProp(e,"memoizedProps.children.props.editor.insertText");s&&s(` ${t} `)}else{const e=j.getTextArea();j.insertText(e," "==e.value.slice(-1)?e.value+t:e.value+" "+t)}},se=function(e,t,{click:n=ne,contextmenu:s}={}){const o=A.createElement(`
${e}
`);return n&&o.addEventListener("click",n),s&&o.addEventListener("contextmenu",s),o};te.prototype.init=function(){this.initialized=!0,this.favoriteEmotes={};const e=ee.getBDData("bdfavemotes");""!==e&&null!==e&&(this.favoriteEmotes=JSON.parse(atob(e))),this.qmeHeader=A.createElement('
'),this.twitchButton=A.createElement(''),this.favoriteButton=A.createElement(''),this.emojiButton=A.createElement('