Lightcord/LightcordApi/js/main.js

3068 lines
344 KiB
JavaScript
Raw Normal View History

2020-06-10 16:16:33 +02:00
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
/******/ })
/************************************************************************/
/******/ ({
2020-06-16 15:51:21 +02:00
/***/ "./src/alias/react-dom.ts":
/*!********************************!*\
!*** ./src/alias/react-dom.ts ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
// bait typescript into thinking this is not reactDOM so no circular dependency.
window.ReactDOM = (window["Reac" + "tDOM"] || // If in Lightcord
(() => {
try {
2020-07-28 13:56:57 +02:00
return window.BdApi.ReactDOM;
}
catch (e) {
return null;
}
})() ||
(() => {
try {
const webpack = __webpack_require__(/*! powercord/webpack */ "powercord/webpack");
return webpack.ReactDOM;
}
catch (e) {
return null;
}
})() ||
(() => {
try {
2020-07-28 13:56:57 +02:00
return window.EDApi.ReactDOM;
}
catch (e) {
return null;
}
})());
module.exports = window.ReactDOM;
2020-08-04 13:17:51 +02:00
/***/ }),
/***/ "./src/alias/react.ts":
/*!****************************!*\
!*** ./src/alias/react.ts ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
window.React = (window.React || // If in Lightcord
(() => {
try {
return window.BdApi.React;
}
catch (e) {
return null;
}
})() ||
(() => {
try {
const webpack = __webpack_require__(/*! powercord/webpack */ "powercord/webpack");
return webpack.React;
}
catch (e) {
return null;
}
})() ||
(() => {
try {
return window.EDApi.React;
}
catch (e) {
return null;
}
})());
module.exports = window.React;
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/components.ts":
/*!**************************************!*\
!*** ./src/components/components.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const Button_1 = __webpack_require__(/*! ./inputs/Button */ "./src/components/inputs/Button.tsx");
const Switch_1 = __webpack_require__(/*! ./inputs/Switch */ "./src/components/inputs/Switch.tsx");
const RadioGroup_1 = __webpack_require__(/*! ./inputs/RadioGroup */ "./src/components/inputs/RadioGroup.tsx");
const TextArea_1 = __webpack_require__(/*! ./inputs/TextArea */ "./src/components/inputs/TextArea.tsx");
const TextInput_1 = __webpack_require__(/*! ./inputs/TextInput */ "./src/components/inputs/TextInput.tsx");
const Dropdown_1 = __webpack_require__(/*! ./inputs/Dropdown */ "./src/components/inputs/Dropdown.tsx");
const Title_1 = __webpack_require__(/*! ./general/Title */ "./src/components/general/Title.tsx");
const SettingsTitle_1 = __webpack_require__(/*! ./general/SettingsTitle */ "./src/components/general/SettingsTitle.tsx");
const Tabs_1 = __webpack_require__(/*! ./general/Tabs */ "./src/components/general/Tabs.tsx");
const SettingSubTitle_1 = __webpack_require__(/*! ./general/SettingSubTitle */ "./src/components/general/SettingSubTitle.tsx");
const CodeBlock_1 = __webpack_require__(/*! ./general/CodeBlock */ "./src/components/general/CodeBlock.tsx");
const cloneNullProto_1 = __webpack_require__(/*! ../modules/cloneNullProto */ "./src/modules/cloneNullProto.ts");
const Tooltip_1 = __webpack_require__(/*! ./general/Tooltip */ "./src/components/general/Tooltip.ts");
2020-07-11 21:29:08 +02:00
const ColorPicker_1 = __webpack_require__(/*! ./inputs/ColorPicker */ "./src/components/inputs/ColorPicker.tsx");
const AlertBox_1 = __webpack_require__(/*! ./general/AlertBox */ "./src/components/general/AlertBox.tsx");
2020-08-04 13:17:51 +02:00
const ErrorCatcher_1 = __webpack_require__(/*! ./general/ErrorCatcher */ "./src/components/general/ErrorCatcher.tsx");
const Flex_1 = __webpack_require__(/*! ./general/Flex */ "./src/components/general/Flex.tsx");
const Text_1 = __webpack_require__(/*! ./general/Text */ "./src/components/general/Text.ts");
const RadioGroupProxied = ErrorCatcher_1.createProxyErrorCatcherClass(RadioGroup_1.default);
2020-07-10 01:44:40 +02:00
exports.default = cloneNullProto_1.default({
inputs: cloneNullProto_1.default({
Button: ErrorCatcher_1.createProxyErrorCatcherClass(Button_1.default),
Switch: ErrorCatcher_1.createProxyErrorCatcherClass(Switch_1.default),
Choices: RadioGroupProxied,
RadioGroup: RadioGroupProxied,
TextArea: ErrorCatcher_1.createProxyErrorCatcherClass(TextArea_1.default),
TextInput: ErrorCatcher_1.createProxyErrorCatcherClass(TextInput_1.default),
Dropdown: ErrorCatcher_1.createProxyErrorCatcherClass(Dropdown_1.default),
2020-08-04 13:17:51 +02:00
ColorPicker: ErrorCatcher_1.createProxyErrorCatcherClass(ColorPicker_1.default),
2020-07-10 01:44:40 +02:00
}),
general: cloneNullProto_1.default({
Title: ErrorCatcher_1.createProxyErrorCatcherClass(Title_1.default),
SettingsTitle: ErrorCatcher_1.createProxyErrorCatcherClass(SettingsTitle_1.default),
SettingSubTitle: ErrorCatcher_1.createProxyErrorCatcherClass(SettingSubTitle_1.default),
Tabs: ErrorCatcher_1.createProxyErrorCatcherClass(Tabs_1.default),
CodeBlock: ErrorCatcher_1.createProxyErrorCatcherClass(CodeBlock_1.default),
Tooltip: ErrorCatcher_1.createProxyErrorCatcherClass(Tooltip_1.default),
2020-08-04 13:17:51 +02:00
AlertBox: ErrorCatcher_1.createProxyErrorCatcherClass(AlertBox_1.default),
Flex: ErrorCatcher_1.createProxyErrorCatcherClass(Flex_1.default),
FlexChild: ErrorCatcher_1.createProxyErrorCatcherClass(Flex_1.FlexChild),
ErrorCatcher: ErrorCatcher_1.default,
Text: Text_1.default
2020-07-10 01:44:40 +02:00
})
});
2020-06-16 15:51:21 +02:00
2020-07-11 21:29:08 +02:00
/***/ }),
/***/ "./src/components/general/AlertBox.tsx":
/*!*********************************************!*\
!*** ./src/components/general/AlertBox.tsx ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let AlertBoxModules;
class AlertBox extends React.Component {
get modules() {
return AlertBoxModules || (AlertBoxModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Markdown" && e.default.defaultProps.parser).default
]);
}
render() {
const [Markdown] = this.modules;
let wrap;
let children;
if (typeof this.props.children === "string") {
wrap = Markdown.prototype.render.call({
props: Object.assign({
className: "",
children: this.props.children
}, Markdown.defaultProps)
});
children = wrap.props.children;
}
else {
wrap = Markdown.prototype.render.call({
props: Object.assign({
className: "",
children: ""
}, Markdown.defaultProps)
});
children = this.props.children;
}
wrap.props.children = React.createElement("div", { className: "lc-alert-box lc-alert-box-" + this.props.type },
React.createElement("blockquote", { className: "lc-blockquote" }, children));
2020-07-11 21:29:08 +02:00
return wrap;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "***Discord's*** **Markdown** _is_ [supported](https://google.com) or you can just insert your own react childs."
}
], [
{
type: "info"
2020-07-11 21:29:08 +02:00
},
{
type: "success"
2020-07-11 21:29:08 +02:00
},
{
type: "warn"
2020-07-11 21:29:08 +02:00
},
{
type: "error"
2020-07-11 21:29:08 +02:00
}
]);
return AllPreviews;
})();
}
}
exports.default = AlertBox;
AlertBox.defaultProps = {
type: "info",
children: null
};
AlertBox.help = {
info: "You can insert markdown (as string) or normal react childs",
warn: "All string will be interpreted as markdown. If you want raw string, pass an array with the string inside."
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
/***/ }),
/***/ "./src/components/general/CodeBlock.tsx":
/*!**********************************************!*\
!*** ./src/components/general/CodeBlock.tsx ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let CodeBlockModules;
class CodeBlock extends React.Component {
get modules() {
return CodeBlockModules || (CodeBlockModules = [
WebpackLoader_1.default.find(e => e.markup),
WebpackLoader_1.default.find(e => e.messageContent),
WebpackLoader_1.default.find(e => e.scrollbarGhostHairline),
WebpackLoader_1.default.find(e => e.highlight),
WebpackLoader_1.default.find(e => e.marginBottom8)
]);
}
render() {
let [messageModule1, messageModule2, scrollbarModule1, hightlightJS, marginModule1] = this.modules;
const code = this.props.language === "plaintext" ? React.createElement("code", { className: `${scrollbarModule1.scrollbarGhostHairline} hljs` }, this.props.content) : React.createElement("code", { className: `${scrollbarModule1.scrollbarGhostHairline} hljs`, dangerouslySetInnerHTML: { __html: hightlightJS.highlight(this.props.language, this.props.content).value } });
return (React.createElement("div", { className: `${messageModule1.markup} ${messageModule2.messageContent}` },
React.createElement("pre", null, code),
React.createElement("div", { className: marginModule1.marginBottom8 })));
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
content: "console.log(\"Exemple code\")"
}
]);
AllPreviews.push([
{
language: "js"
},
{
language: "plaintext"
},
...CodeBlock.prototype.modules[3].listLanguages().filter(e => e !== "js").map(e => ({ language: e }))
]);
return AllPreviews;
})();
}
}
exports.default = CodeBlock;
CodeBlock.defaultProps = {
language: "plaintext",
content: ""
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
2020-08-04 13:17:51 +02:00
/***/ }),
/***/ "./src/components/general/ErrorCatcher.tsx":
/*!*************************************************!*\
!*** ./src/components/general/ErrorCatcher.tsx ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProxyErrorCatcherClass = void 0;
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const DiscordTools_1 = __webpack_require__(/*! ../../modules/DiscordTools */ "./src/modules/DiscordTools.ts");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const uuid_1 = __webpack_require__(/*! ../../modules/uuid */ "./src/modules/uuid.ts");
const AlertBox_1 = __webpack_require__(/*! ./AlertBox */ "./src/components/general/AlertBox.tsx");
let ErrorCatcherModules;
class ErrorCatcher extends React.Component {
constructor(props) {
super(props);
this.defaultProps = {
children: null
};
this.state = {
error: false,
hasSentNotification: false
};
}
static get original() {
return ErrorCatcher;
}
get modules() {
return ErrorCatcherModules || (ErrorCatcherModules = [
WebpackLoader_1.default.find(e => e.emptyStateImage && e.emptyState)
]);
}
render() {
if (!this.state.error) {
return this.props.children;
}
else { // try to render a user-friendly interface.
const [emptyClasses] = this.modules;
if (!emptyClasses) { // If we can't, render nothing and show a notification.
if (this.state.hasSentNotification)
return null; // If the notification was already sent, don't send one.
const notification = DiscordTools_1.default.showNotification({
body: "An error occured. Please check the console for more informations.",
icon: "https://github.com/lightcord.png",
onClick: noop_1.default,
onClose: noop_1.default,
onShow: noop_1.default,
title: "Lightcord Informations"
});
this.setState({
hasSentNotification: true
});
setTimeout(() => {
notification.close();
}, 2000);
return null;
}
return React.createElement("div", { className: emptyClasses.emptyState },
React.createElement("div", { className: emptyClasses.emptyStateImage, style: {
marginTop: "20px"
} }),
React.createElement("div", { className: emptyClasses.emptyStateHeader }, "An error occured"),
React.createElement("p", { className: emptyClasses.emptyStateSubtext }, "Please check the console for more informations. Join our \u00ADsupport server for more help."));
}
}
componentDidCatch(error, errorInfo) {
console.error(errorInfo.componentStack);
this.setState({
error: true
});
}
static get AllPreviews() {
return AllPreviews || (AllPreviews = [
[
{
children: React.createElement(AlertBox_1.default, { type: "info" }, "This AlertBox is protected by an ErrorCatcher.")
}
]
]);
}
}
exports.default = ErrorCatcher;
let AllPreviews;
function createProxyErrorCatcherClass(Class) {
var _a;
const ClassCopy = (_a = class Proxied extends React.Component {
render() {
return React.createElement(ErrorCatcher, { key: uuid_1.default() }, React.createElement(Class, Object.assign(Object.assign({ ref: "original" }, this.props), { key: uuid_1.default() })));
}
static get original() {
return Class;
}
},
_a.displayName = Class["displayName"] || Class["name"],
_a);
Object.entries(Object.getOwnPropertyDescriptors(Class)).forEach(value => {
if (value[0] in ClassCopy)
return;
Object.defineProperty(ClassCopy, value[0], value[1]);
});
return ClassCopy;
}
exports.createProxyErrorCatcherClass = createProxyErrorCatcherClass;
/***/ }),
/***/ "./src/components/general/Flex.tsx":
/*!*****************************************!*\
!*** ./src/components/general/Flex.tsx ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlexChild = void 0;
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
function getModules() {
return FlexModules || (FlexModules = [
(() => {
let Flex = WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Flex");
if (Flex)
Flex = Flex.default;
return Flex;
})()
]);
}
let FlexModules;
class Flex extends React.Component {
constructor(props) {
super(props);
}
get modules() {
return getModules();
}
render() {
let [FlexComponent] = this.modules;
return React.createElement(FlexComponent, Object.assign({}, this.props));
}
static get Direction() {
return getModules()[0].Direction;
}
static get Align() {
return getModules()[0].Align;
}
static get Justify() {
return getModules()[0].Justify;
}
static get Wrap() {
return getModules()[0].Justify;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
children: "Your components here."
}]);
return AllPreviews;
})();
}
}
exports.default = Flex;
let AllPreviews;
class FlexChild extends React.Component {
get modules() {
return getModules();
}
render() {
const [FlexComponent] = this.modules;
return React.createElement(FlexComponent.Child, Object.assign({}, this.props));
}
}
exports.FlexChild = FlexChild;
2020-06-26 21:05:09 +02:00
/***/ }),
/***/ "./src/components/general/SettingSubTitle.tsx":
/*!****************************************************!*\
!*** ./src/components/general/SettingSubTitle.tsx ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let TitleModules;
class SettingSubTitle extends React.Component {
get modules() {
return TitleModules || (TitleModules = [
WebpackLoader_1.default.find(e => typeof e.marginTop60 === "string"),
WebpackLoader_1.default.findByUniqueProperties(["h5"]),
window.Lightcord.Api.WebpackLoader.findByUniqueProperties(["size14"]),
window.Lightcord.Api.WebpackLoader.findByUniqueProperties(["colorStandard"])
]);
}
render() {
let [marginModule, titleModule, sizeModule, colorModule] = this.modules;
let props = this.props;
let className = `${colorModule.colorStandard} ${sizeModule.size14} ${titleModule.h5} ${marginModule.marginBottom4}`;
if (props.className)
className = +" " + props.className;
return React.createElement("h5", { className }, props.children);
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "Exemple title"
}
]);
return AllPreviews;
})();
}
}
exports.default = SettingSubTitle;
SettingSubTitle.defaultProps = {
children: [],
className: ""
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/general/SettingsTitle.tsx":
/*!**************************************************!*\
!*** ./src/components/general/SettingsTitle.tsx ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const Title_1 = __webpack_require__(/*! ./Title */ "./src/components/general/Title.tsx");
let TitleModules;
class SettingsTitle extends React.Component {
constructor(props) {
super(props);
}
get modules() {
return TitleModules || (TitleModules = [
WebpackLoader_1.default.find(e => typeof e.marginTop60 === "string")
]);
}
render() {
let [marginModule] = this.modules;
let props = this.props;
let className = `${marginModule.marginTop60} ${marginModule.marginBottom20}`;
if (props.className)
className = +" " + props.className;
return React.createElement(Title_1.default, { className }, props.children);
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "Exemple title"
}
]);
return AllPreviews;
})();
}
}
exports.default = SettingsTitle;
SettingsTitle.defaultProps = {
children: [""],
className: ""
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
/***/ }),
/***/ "./src/components/general/Tabs.tsx":
/*!*****************************************!*\
!*** ./src/components/general/Tabs.tsx ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tab = void 0;
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const Title_1 = __webpack_require__(/*! ./Title */ "./src/components/general/Title.tsx");
class Tabs extends React.Component {
constructor(props) {
super(props);
this.tabsElements = [];
this.state = {
active: this.props.active || null
};
}
get tabs() {
return this.props.tabs || [];
}
changeTab(tab) {
if (tab === this.state.active)
return;
if (this.props.onChange)
this.props.onChange(tab);
this.setState({
active: tab
});
this.tabsElements.forEach(e => e.setActive(tab === e.props.id));
}
render() {
return (React.createElement("div", { className: "lc-tabWrapper", style: this.props.style },
React.createElement("div", { className: "lc-tabnav", style: { flex: "0 1 auto" } }, this.tabs.map(tab => {
return React.createElement(Tab, { TabContainer: this, title: tab.label, id: tab.id, key: btoa(tab.label + ":" + tab.id) });
})),
React.createElement("div", { className: "lc-tab" }, this.props.children)));
}
isActive(tab) {
return this.state.active === tab;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: (React.createElement("div", { style: { marginTop: "20px", marginBottom: "20px" } },
React.createElement("div", { style: {
backgroundColor: "var(--background-primary)",
padding: "30px 30px",
borderRadius: "8px"
}, className: "lc-tab-box-shadow" },
React.createElement(Title_1.default, null, "Preview tabs"))))
}
], [
{
tabs: [
{
label: "Active tab",
id: "1"
},
{
label: "Unactive tab",
id: "2"
}
]
}
], [
{
active: "1"
}
], [
{
onChange: (tabId) => { }
}
]);
return AllPreviews;
})();
}
}
exports.default = Tabs;
Tabs.defaultProps = {
children: null,
tabs: [{ label: "No tabs was passed to <Tabs>.", id: "none" }],
active: null,
onChange: noop_1.default,
style: {}
};
let AllPreviews;
class Tab extends React.Component {
constructor(props) {
super(props);
this.state = {
active: props.TabContainer.isActive(props.id)
};
this.props.TabContainer.tabsElements.push(this);
}
setActive(isActive) {
this.setState({
active: !!isActive
});
}
render() {
let className = `lc-navItem`;
if (this.state.active) {
className += ` lc-navItemActive`;
}
else {
className += ` lc-navItemInactive`;
}
return (React.createElement("div", { className: className, onClick: () => {
this.props.TabContainer.changeTab(this.props.id);
} }, this.props.title));
}
}
exports.Tab = Tab;
2020-06-16 15:51:21 +02:00
2020-08-04 13:17:51 +02:00
/***/ }),
/***/ "./src/components/general/Text.ts":
/*!****************************************!*\
!*** ./src/components/general/Text.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Constants = void 0;
const React = __webpack_require__(/*! react */ "./src/alias/react.ts");
const Utils_1 = __webpack_require__(/*! ../../modules/Utils */ "./src/modules/Utils.ts");
class Text extends React.Component {
render() {
let classList = this.props.className ? this.props.className.split(" ") : [];
let style = this.props.style ? Object.assign({}, this.props.style) : {};
style.flexGrow = 0;
if (this.props.weight) {
classList.push(`lc-text-weight${Utils_1.default.firstLetterUppercase(this.props.weight)}`);
}
if (this.props.color) {
style.color = Utils_1.default.getColor(this.props.color) || this.props.color;
}
if (this.props.textCase) {
classList.push(`lc-text-cases${Utils_1.default.firstLetterUppercase(this.props.textCase)}`);
}
if (this.props.size) {
classList.push(...exports.Constants.sizes[this.props.size]);
}
if (this.props.family) {
classList.push(`lc-text-${this.props.family}`);
}
if (this.props.selectable) {
classList.push("lc-text-selectable");
}
return React.createElement(this.props.tag, {
style,
className: classList.join(" ")
}, this.props.children);
}
static get AllPreviews() {
return AllPreviews || (AllPreviews = [
this.weights.map(e => ({ weight: e })),
this.colors.map(e => ({ color: e })),
this.textCases.map(e => ({ textCase: e })),
this.sizes.map(e => ({ size: e })),
this.familys.map(e => ({ family: e })),
[
{
children: "Test Text"
}
],
["div", "p", ...Utils_1.default.executeXTimes((index) => {
return "h" + (index + 1);
}, 6)].map(e => ({ tag: e })),
[true, false].map(e => ({ selectable: e }))
]);
}
static get colors() {
return Object.keys(Lightcord.DiscordModules.constants.Colors).map(e => e.toLowerCase());
}
}
exports.default = Text;
Text.defaultProps = {
tag: "div",
children: null
};
Text.weights = ["light", "normal", "medium", "semibold", "bold"];
Text.textCases = ["lowercase", "uppercase"];
Text.sizes = ["small", "medium", "medium_small", "medium_large", "large"];
Text.familys = ["primary", "code"];
let AllPreviews;
exports.Constants = {
sizes: {
small: ["lc-text-size12", "lc-text-height16"],
medium_small: ["lc-text-size14", "lc-text-height16"],
medium: ["lc-text-size16", "lc-text-height20"],
medium_large: ["lc-text-size20", "lc-text-height26"],
large: ["lc-text-size28", "lc-text-height34"]
}
};
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/general/Title.tsx":
/*!******************************************!*\
!*** ./src/components/general/Title.tsx ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let TitleModules;
class Title extends React.Component {
constructor(props) {
super(props);
}
get modules() {
return TitleModules || (TitleModules = [
WebpackLoader_1.default.find(e => typeof e.colorStandard === "string"),
WebpackLoader_1.default.find(e => typeof e.size32 === "string"),
WebpackLoader_1.default.find(e => typeof e.h2 === "string")
]);
}
render() {
let [colorModule, sizeModule, titleModule] = this.modules;
let props = this.props;
let className = `${colorModule.colorStandard} ${sizeModule.size14} ${titleModule.h2} ${titleModule.defaultColor} ${titleModule.defaultMarginh2}`;
if (props.className)
className += " " + props.className;
return React.createElement("h2", { className }, props.children);
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "Exemple title"
}
]);
return AllPreviews;
})();
}
}
exports.default = Title;
Title.defaultProps = {
children: null,
className: null
};
let AllPreviews;
2020-06-16 15:51:21 +02:00
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/components/general/Tooltip.ts":
/*!*******************************************!*\
!*** ./src/components/general/Tooltip.ts ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const excludeProperties_1 = __webpack_require__(/*! ../../modules/excludeProperties */ "./src/modules/excludeProperties.ts");
let TooltipModules;
class Tooltip extends React.Component {
constructor(props) {
super(props);
}
get modules() {
return TooltipModules || (TooltipModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Tooltip")
]);
}
render() {
let [Tooltip] = this.modules;
let props = excludeProperties_1.default(this.props, ["children"]);
return React.createElement(Tooltip.default, props, (data) => {
return React.createElement("div", Object.assign(Object.assign({}, data), { style: {
width: "fit-content",
height: "fit-content"
} }), this.props.children);
});
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: React.createElement(window.Lightcord.Api.Components.inputs.Button, {
color: "green",
look: "ghost",
size: "small",
hoverColor: "yellow",
onClick: () => { },
wrapper: false
}, "Hover this button to see the tooltip")
}
]);
AllPreviews.push([
{
text: "Example Tooltip Text"
}
]);
let colors = [];
Tooltip.Colors.forEach(color => {
colors.push({
color: color
});
});
AllPreviews.push(colors);
let positions = [];
Tooltip.Positions.forEach(p => {
positions.push({
position: p
});
});
AllPreviews.push(positions);
return AllPreviews;
})();
}
}
exports.default = Tooltip;
Tooltip.defaultProps = {
children: null,
text: "No text was passed to Tooltip",
position: "top",
color: "brand"
};
Tooltip.Positions = ["top", "left", "right", "bottom"];
Tooltip.Colors = ["black", "grey", "brand", "green", "yellow", "red"];
let AllPreviews;
2020-07-04 22:42:26 +02:00
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/inputs/Button.tsx":
/*!******************************************!*\
!*** ./src/components/inputs/Button.tsx ***!
\******************************************/
2020-06-10 16:16:33 +02:00
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
2020-08-01 11:05:17 +02:00
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
2020-07-10 01:44:40 +02:00
let ButtonModules;
class Button extends React.Component {
constructor(props) {
super(props);
this.state = {
hover: false
};
}
get modules() {
return ButtonModules || (ButtonModules = [
WebpackLoader_1.default.findByUniqueProperties(["_horizontal"]),
WebpackLoader_1.default.findByUniqueProperties(["colorTransparent"]),
WebpackLoader_1.default.findByUniqueProperties(["buttonWrapper"]),
WebpackLoader_1.default.findByUniqueProperties(["ButtonColors"]),
]);
}
render() {
let [flexModule, euhModule1, buttonModule, colorsModule,] = this.modules;
let props = {};
if (this.props) {
if ("color" in this.props) {
props.color = this.props.color;
}
if ("children" in this.props) {
props.children = this.props.children;
}
if ("onClick" in this.props) {
props.onClick = this.props.onClick;
}
if ("wrapper" in this.props) {
props.wrapper = !!this.props.wrapper;
}
if ("look" in this.props) {
props.look = this.props.look;
}
if ("size" in this.props) {
props.size = this.props.size;
}
if ("hoverColor" in this.props) {
props.hoverColor = this.props.hoverColor;
}
if ("disabled" in this.props) {
props.disabled = this.props.disabled;
}
else {
props.disabled = false;
}
2020-08-01 11:05:17 +02:00
if ("style" in this.props) {
props.style = this.props.style;
}
else {
props.style = {};
}
if ("onRightClick" in this.props) {
props.onRightClick = this.props.onRightClick;
}
else {
props.onRightClick = noop_1.default;
}
2020-07-10 01:44:40 +02:00
}
if (props.color) {
props.color = props.color.toLowerCase();
if (!Button.Colors.includes(props.color)) {
props.color = Button.Colors[0];
}
}
else {
props.color = Button.Colors[0];
}
if (props.look) {
props.look = props.look.toLowerCase();
if (!Button.Looks.includes(props.look)) {
props.look = Button.Looks[0];
}
}
else {
props.look = Button.Looks[0];
}
if (props.size) {
props.size = props.size.toLowerCase();
if (!Button.Sizes.includes(props.size)) {
props.size = Button.Sizes[0];
}
}
else {
props.size = Button.Sizes[0];
}
if (props.hoverColor) {
props.hoverColor = props.hoverColor.toLowerCase();
if (!Button.HoverColors.includes(props.hoverColor)) {
props.hoverColor = Button.HoverColors[0];
}
}
else {
props.hoverColor = Button.HoverColors[0];
}
let buttonSize = props.size ? colorsModule.ButtonSizes[props.size.toUpperCase()] || "" : "";
if (buttonSize)
buttonSize = " " + buttonSize;
let hoverColor = props.hoverColor ? colorsModule.ButtonHovers[props.hoverColor.toUpperCase()] || "" : "";
if (hoverColor)
hoverColor = " " + hoverColor;
props.onClick = typeof props.onClick === "function" ? props.onClick : () => { };
if (typeof props.wrapper !== "boolean")
props.wrapper = true;
let hover = this.state.hover ? euhModule1.hasHover : "";
if (hover)
hover = " " + hover;
2020-08-01 11:05:17 +02:00
let button = React.createElement("button", { type: "button", ref: "button", className: `${flexModule.flexChild} ${euhModule1.button} ${colorsModule.ButtonLooks[props.look.toUpperCase()]} ${colorsModule.ButtonColors[props.color.toUpperCase()]}${buttonSize}${hoverColor}${hover} ${euhModule1.grow}`, style: Object.assign({ flex: "0 1 auto" }, props.style), onClick: () => props.onClick(), onMouseEnter: (ev) => {
2020-07-10 01:44:40 +02:00
if (!hoverColor)
return;
this.setState({ hover: true });
}, onMouseLeave: (ev) => {
if (!hoverColor)
return;
this.setState({ hover: false });
2020-08-01 11:05:17 +02:00
}, disabled: props.disabled, onContextMenu: () => props.onRightClick() },
2020-07-10 01:44:40 +02:00
React.createElement("div", { className: euhModule1.contents }, props.children));
if (props.wrapper) {
2020-08-01 11:05:17 +02:00
return React.createElement("div", { ref: "wrapper", className: buttonModule.buttonWrapper }, button);
2020-07-10 01:44:40 +02:00
}
return button;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
let colors = [];
for (let color of Button.Colors) {
colors.push({
color: color
});
}
AllPreviews.push(colors);
let looks = [];
for (let look of Button.Looks) {
looks.push({
look: look
});
}
AllPreviews.push(looks);
let sizes = [];
for (let size of Button.Sizes) {
sizes.push({
size: size
});
}
AllPreviews.push(sizes);
let hovers = [];
for (let hover of Button.HoverColors) {
hovers.push({
hoverColor: hover
});
}
AllPreviews.push(hovers);
AllPreviews.push([{ children: "Test Button" }]);
AllPreviews.push([{ onClick: () => { } }]);
AllPreviews.push([{ wrapper: false }]);
AllPreviews.push([{ disabled: false }, { disabled: true }]);
return AllPreviews;
})();
}
}
exports.default = Button;
Button.Colors = ["brand", "grey", "red", "green", "yellow", "primary", "link", "white", "black", "transparent"];
Button.Looks = ["filled", "inverted", "outlined", "ghost", "link", "blank"];
Button.Sizes = ["small", "medium", "large", "xlarge", "min", "max", "icon", "none"];
Button.HoverColors = ["default", ...Button.Colors];
let AllPreviews;
2020-06-10 16:16:33 +02:00
2020-07-11 21:29:08 +02:00
/***/ }),
/***/ "./src/components/inputs/ColorPicker.tsx":
/*!***********************************************!*\
!*** ./src/components/inputs/ColorPicker.tsx ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const Utils_1 = __webpack_require__(/*! ../../modules/Utils */ "./src/modules/Utils.ts");
const Constants = {
defaultColor: 10070709,
baseColors: [
1752220,
3066993,
3447003,
10181046,
15277667,
15844367,
15105570,
15158332,
9807270,
6323595,
1146986,
2067276,
2123412,
7419530,
11342935,
12745742,
11027200,
10038562,
9936031,
5533306
]
};
let ColorPickerModules;
let isFetching = null;
/**
* This componennt needs to be loaded. As a result, you may experience 100-300ms loading the first time.
* Render will return `null` before loaded.
*/
2020-07-11 21:29:08 +02:00
class ColorPicker extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
value: props.value || null,
lastColor: this.props.value
};
this.onChange = this.onChange.bind(this);
}
/** Preload the component. */
static preload() {
if (ColorPicker.prototype.modules[0])
return; // already loaded
if (isFetching)
return; // is fetching so don't double preload.
try { // If we caught an error
new ColorPicker({}).render();
}
catch (e) {
console.error(e);
}
}
2020-07-11 21:29:08 +02:00
onChange(val) {
this.props.onChange(val);
this.setState({
value: val
});
this.forceUpdate();
}
get modules() {
return ColorPickerModules || (ColorPickerModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "ColorPicker")
]);
}
renderColorPicker() {
let [ColorPickerComponent] = this.modules;
if (!ColorPickerComponent) {
if (isFetching) { // support for multiple color picker
isFetching.then(() => this.forceUpdate());
return null;
}
2020-07-11 21:29:08 +02:00
ColorPickerModules = null;
let resolve;
isFetching = new Promise(res => (resolve = res));
const GuildSettingsRoles = new (WebpackLoader_1.default.find(e => e.default && e.default.displayName && e.default.displayName.includes("GuildSettingsRoles")).default)().render().type;
const settings = GuildSettingsRoles.prototype.renderRoleSettings.call({
props: {
guild: {
roles: [],
id: null,
isOwner: () => false
},
currentUser: {
id: null
}
},
getSelectedRole() {
return {
id: null
};
},
renderHeader: GuildSettingsRoles.prototype.renderHeader
2020-07-11 21:29:08 +02:00
});
const GuildRoleSettings = settings.props.children[1].type;
2020-07-11 21:29:08 +02:00
let children = GuildRoleSettings.prototype.renderColorPicker.call({
props: {
role: {
id: null,
color: 0
},
locked: false,
everyone: false
}
}).props.children;
children.type(children.props).props.children.type._ctor().then(c => {
ColorPickerModules = null;
2020-07-11 21:29:08 +02:00
this.forceUpdate();
resolve();
});
return null;
}
return React.createElement(ColorPickerComponent.default, { colors: this.props.baseColors, defaultColor: this.props.defaultColor, value: this.state.value, disabled: this.props.disabled, onChange: this.onChange, customColor: this.props.customColor });
}
render() {
if (this.state.lastColor !== this.props.value) {
this.state = {
value: this.props.value,
lastColor: this.props.value
};
}
return this.renderColorPicker();
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
disabled: false
},
{
disabled: true
}
], [
{
value: Utils_1.default.HexColorToDecimal("#7289DA")
}, {
value: null
}
], [
{
onChange: (color) => { }
}
]);
return AllPreviews;
})();
}
}
exports.default = ColorPicker;
ColorPicker.defaultProps = {
defaultColor: Constants.defaultColor,
customColor: null,
baseColors: Constants.baseColors,
value: null,
disabled: false,
onChange: noop_1.default
};
ColorPicker.help = {
info: "To convert hex colors to decimal, you can do `Lightcord.Api.Utils.HexColorToDecimal('#7289DA')` and go back with `Lightcord.Api.Utils.DecimalColorToHex(7506394)`",
warn: "The component may not appear instantly. The component needs to be loaded, so you could experience 50-300ms loading time depending on your internet connection."
2020-07-11 21:29:08 +02:00
};
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/Dropdown.tsx":
/*!********************************************!*\
!*** ./src/components/inputs/Dropdown.tsx ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let DropdownModules;
class Dropdown extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.state = {
value: props.value || null
};
}
onChange(value) {
this.props.onChange(value);
this.setState({
value: value
});
}
get modules() {
return DropdownModules || (DropdownModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "SelectTempWrapper").default
]);
}
render() {
let [DropdownComponent] = this.modules;
let props = this.props;
let returnValue = React.createElement(DropdownComponent, Object.assign({}, props, { onChange: this.onChange, value: this.state.value }));
return returnValue;
}
get value() {
return this.state.value;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
error: null
}, {
error: "An error occured"
}], [{
options: [
{
value: "option1",
label: "Option 1"
},
{
value: "option2",
label: "Option 2"
},
{
value: "option3",
label: "Option 3"
}
]
}], [{
value: "option1"
}], [{
disabled: false
}, {
disabled: true
}], [{
searchable: true
}, {
searchable: false
}], [{
clearable: true
}, {
clearable: false
}], [{
isMulti: false
}, {
isMulti: true
}]);
return AllPreviews;
})();
}
}
exports.default = Dropdown;
Dropdown.defaultProps = {
className: null,
error: null,
options: [{
value: "none",
"label": "No options - No options was passed to Dropdown. If you meant to put an empty dropdown, input an empty array."
}],
valueRenderer: null,
multiValueRenderer: null,
optionRenderer: null,
onChange: noop_1.default,
value: null,
disabled: false,
searchable: false,
clearable: false,
styleOverrides: null,
lightThemeColorOverrides: null,
darkThemeColorOverrides: null,
isMulti: false
};
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/RadioGroup.tsx":
/*!**********************************************!*\
!*** ./src/components/inputs/RadioGroup.tsx ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let RadioGroupModule;
class RadioGroup extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.state = {
value: props.value
};
}
onChange(ev) {
this.props.onChange(ev.value);
this.setState({
value: ev.value
});
}
get modules() {
return RadioGroupModule || (RadioGroupModule = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "RadioGroup").default
]);
}
render() {
let [RadioGroupComponent] = this.modules;
let props = this.props;
return React.createElement(RadioGroupComponent, { options: props.options, onChange: this.onChange, value: this.state.value, disabled: props.disabled, size: RadioGroupComponent.Sizes[props.size.toUpperCase()], itemType: RadioGroupComponent.ItemTypes[props.itemType.toUpperCase()], infoClassName: props.infoClassName });
}
get value() {
return this.state.value;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
options: [
{
value: "option1",
name: "Option 1",
desc: "description 1"
},
{
value: "option2",
name: "Option 2",
desc: "description 2"
},
{
value: "option3",
name: "Option 3",
desc: "description 3"
}
]
}], [{
value: "option1"
}], [{
disabled: false
}, {
disabled: true
}], [{
size: "medium"
}, {
size: "small"
}], [{
itemType: "bar"
}, {
itemType: "panel"
}]);
return AllPreviews;
})();
}
}
exports.default = RadioGroup;
RadioGroup.defaultProps = {
options: [{
value: "none",
name: "No options",
desc: "No options was passed to Choices. If you meant to display no options at all, please pass an empty array.",
color: "#f04747"
}],
value: null,
disabled: false,
size: "medium",
itemType: "bar",
infoClassName: null,
onChange: noop_1.default
};
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/Switch.tsx":
/*!******************************************!*\
!*** ./src/components/inputs/Switch.tsx ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let SwitchModules;
class Switch extends React.Component {
constructor(props) {
super(props);
this.state = {
value: props.value || false
};
this.onChange = this.onChange.bind(this);
}
get modules() {
return SwitchModules || (SwitchModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Switch").default
]);
}
render() {
let [SwitchComponent] = this.modules;
let props = this.props;
return (React.createElement(SwitchComponent, { id: props.id, onChange: this.onChange, value: this.state.value || false, fill: props.fill, theme: SwitchComponent.Themes[props.theme.toUpperCase()], disabled: props.disabled, className: props.className, size: SwitchComponent.Sizes[props.size.toUpperCase()], style: props.style }));
}
onChange(value) {
this.props.onChange(!this.state.value);
this.setState({
value: !this.state.value
});
}
get value() {
return this.state.value;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{ onChange: (value) => { } }]);
AllPreviews.push([{
value: false
}], [{
theme: "default"
}, {
theme: "clear"
}], [{
disabled: false
}, {
disabled: true
}], [{
id: "api-preview-switch"
}], [{
fill: null
}], [{
size: "default"
}, {
size: "mini"
}], [{
style: {}
}]);
return AllPreviews;
})();
}
}
exports.default = Switch;
Switch.defaultProps = {
id: null,
onChange: noop_1.default,
value: false,
fill: null,
theme: "default",
disabled: false,
className: null,
size: "default",
style: {}
};
2020-07-11 21:29:08 +02:00
Switch.help = {
error: "The `clear` option doesn't work well on light theme."
};
2020-07-10 01:44:40 +02:00
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/TextArea.tsx":
/*!********************************************!*\
!*** ./src/components/inputs/TextArea.tsx ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let TextAreaModules;
class TextArea extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.onFocus = this.onFocus.bind(this);
this.onBlur = this.onBlur.bind(this);
this.onKeyDown = this.onKeyDown.bind(this);
this.state = {
value: props.value || ""
};
}
get modules() {
return TextAreaModules || (TextAreaModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "TextArea").default
]);
}
onChange(value, name) {
this.props.onChange(value, name);
this.setState({
value
});
}
onFocus(ev, name) {
this.props.onFocus(ev, name);
}
onBlur(ev, name) {
this.props.onBlur(ev, name);
}
onKeyDown(ev) {
this.props.onKeyDown(ev);
}
render() {
let [TextAreaComponent] = this.modules;
let props = this.props;
return React.createElement(TextAreaComponent, Object.assign({}, props, { onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, value: this.state.value }));
}
get value() {
return this.state.value || "";
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
name: "api-preview-textarea"
}]);
AllPreviews.push([{
disabled: false
}, {
disabled: true
}]);
AllPreviews.push([{
placeholder: null
}]);
AllPreviews.push([{
autoFocus: false
}, {
autoFocus: true
}]);
AllPreviews.push([{
resizeable: false
}, {
resizeable: true
}]);
AllPreviews.push([{
flex: false
}, {
flex: true
}]);
AllPreviews.push([{
autosize: false
}, {
autosize: true
}]);
AllPreviews.push([{
rows: 3
}, {
rows: 2
}, {
rows: 1
}]);
AllPreviews.push([{
value: ""
}]);
AllPreviews.push([{
error: null
}, {
error: "Example error"
}]);
AllPreviews.push([{
maxLength: 100
}]);
AllPreviews.push([{
className: ""
}]);
AllPreviews.push([{
inputClassName: ""
}]);
AllPreviews.push([{
id: "api-preview-textarea"
}]);
return AllPreviews;
})();
}
}
exports.default = TextArea;
TextArea.defaultProps = {
name: null,
disabled: false,
placeholder: null,
autoFocus: false,
resizeable: false,
flex: false,
autosize: false,
rows: 3,
value: "",
error: null,
maxLength: null,
className: null,
id: null,
onChange: noop_1.default,
onFocus: noop_1.default,
onBlur: noop_1.default,
onKeyDown: noop_1.default
};
2020-07-11 21:29:08 +02:00
TextArea.help = {
warn: "This should be used for multi line inputs."
};
2020-07-10 01:44:40 +02:00
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/TextInput.tsx":
/*!*********************************************!*\
!*** ./src/components/inputs/TextInput.tsx ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let TextInputModules;
class TextInput extends React.PureComponent {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.onFocus = this.onFocus.bind(this);
this.onBlur = this.onBlur.bind(this);
this.state = {
value: props.value || ""
};
}
get modules() {
return TextInputModules || (TextInputModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "TextInput").default
]);
}
onChange(value, name) {
this.hasSet = false;
this.props.onChange(value, name, this);
if (this.hasSet)
return; // prevent event if the onChange has changed the value.
this.setState({
value
});
this.forceUpdate();
}
onFocus(ev, name) {
this.props.onFocus(ev, name, this);
}
onBlur(ev, name) {
this.props.onBlur(ev, name, this);
}
render() {
let [TextAreaComponent] = this.modules;
let props = this.props;
return React.createElement(TextAreaComponent, Object.assign({}, props, { onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, value: this.state.value }));
}
get value() {
return this.state.value || "";
}
setValue(value) {
this.setState({
value: value
});
this.forceUpdate();
this.hasSet = true;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
name: "api-preview-textinput"
}], [{
size: "default"
}, {
size: "mini"
}], [{
disabled: false
}, {
disabled: true
}], [{
placeholder: ""
}], [{
value: ""
}], [{
error: null
}, {
error: "Example error"
}], [{
maxLength: 999
}], [{
className: ""
}], [{
inputClassName: ""
}], [{
id: "api-preview-textinput"
}], [{
onChange: (value, name) => { }
}]);
return AllPreviews;
})();
}
}
exports.default = TextInput;
TextInput.defaultProps = {
name: "",
size: "default",
disabled: false,
placeholder: "",
value: "",
error: null,
maxLength: 999,
className: "",
inputClassName: "",
id: null,
onChange: noop_1.default,
onFocus: noop_1.default,
onBlur: noop_1.default
};
2020-07-11 21:29:08 +02:00
TextInput.help = {
warn: "This should be used for single line inputs."
};
2020-07-10 01:44:40 +02:00
let AllPreviews;
/***/ }),
/***/ "./src/components/private/Notice.tsx":
/*!*******************************************!*\
!*** ./src/components/private/Notice.tsx ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultNotice = void 0;
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const Notices_1 = __webpack_require__(/*! ./Notices */ "./src/components/private/Notices.tsx");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let NoticeModules;
exports.defaultNotice = {
text: "",
id: "unknown id",
onClick: noop_1.default,
buttonText: null,
type: "default"
};
class Notice extends React.Component {
get modules() {
return NoticeModules || (NoticeModules = [
WebpackLoader_1.default.find(e => e.noticeInfo)
]);
}
render() {
const [noticeClasses] = this.modules;
const className = noticeClasses["notice" + this.props.type.slice(0, 1).toUpperCase() + this.props.type.slice(1)];
if (!className) {
Notices_1.notices.pop();
setImmediate(() => {
Notices_1.events.emit("noticeUpdate");
});
return null;
}
const button = this.props.buttonText ? React.createElement("button", { className: noticeClasses.button, onClick: () => {
Notices_1.notices.pop();
this.props.onClick();
Notices_1.events.emit("noticeUpdate");
} }, this.props.buttonText) : null;
return React.createElement("div", { className: className },
React.createElement("div", { className: noticeClasses.dismiss, role: "button", tabIndex: 0, onClick: () => {
Notices_1.notices.pop();
Notices_1.events.emit("noticeUpdate");
} }),
this.props.text,
button);
}
}
exports.default = Notice;
Notice.displayName = "LightcordNotice";
Notice.defaultProps = exports.defaultNotice;
/***/ }),
/***/ "./src/components/private/Notices.tsx":
/*!********************************************!*\
!*** ./src/components/private/Notices.tsx ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.notices = exports.events = void 0;
const Notice_1 = __webpack_require__(/*! ./Notice */ "./src/components/private/Notice.tsx");
const events_1 = __webpack_require__(/*! events */ "events");
exports.events = new events_1.EventEmitter();
class Notices extends React.Component {
constructor(props) {
super(props);
this.noticeHandler = this.noticeHandler.bind(this);
}
noticeHandler() {
this.forceUpdate();
}
componentWillMount() {
exports.events.on("noticeUpdate", this.noticeHandler);
}
componentWillUnmount() {
exports.events.off("noticeUpdate", this.noticeHandler);
}
render() {
if (!this.hasNotice)
return null;
const notice = exports.notices[0];
return React.createElement(Notice_1.default, Object.assign({}, notice));
}
get hasNotice() {
return exports.notices.length > 0;
}
}
exports.default = Notices;
Notices.displayName = "LightcordNotices";
Notices.defaultProps = {};
exports.notices = [];
2020-06-10 16:16:33 +02:00
/***/ }),
/***/ "./src/index.ts":
/*!**********************!*\
!*** ./src/index.ts ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ./modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const components_1 = __webpack_require__(/*! ./components/components */ "./src/components/components.ts");
const uuid_1 = __webpack_require__(/*! ./modules/uuid */ "./src/modules/uuid.ts");
const Utils_1 = __webpack_require__(/*! ./modules/Utils */ "./src/modules/Utils.ts");
const DiscordTools_1 = __webpack_require__(/*! ./modules/DiscordTools */ "./src/modules/DiscordTools.ts");
const patchers = __webpack_require__(/*! ./modules/patchers */ "./src/modules/patchers.ts");
const excludeProperties_1 = __webpack_require__(/*! ./modules/excludeProperties */ "./src/modules/excludeProperties.ts");
const cloneNullProto_1 = __webpack_require__(/*! ./modules/cloneNullProto */ "./src/modules/cloneNullProto.ts");
const noop_1 = __webpack_require__(/*! ./modules/noop */ "./src/modules/noop.ts");
const Unfreeze_1 = __webpack_require__(/*! ./modules/Unfreeze */ "./src/modules/Unfreeze.ts");
const environnement_1 = __webpack_require__(/*! ./modules/environnement */ "./src/modules/environnement.ts");
patchers.patch();
2020-07-10 01:44:40 +02:00
const LightcordApi = {
WebpackLoader: WebpackLoader_1.default,
Components: components_1.default,
uuid: uuid_1.default,
Utils: Utils_1.default,
DiscordTools: DiscordTools_1.default,
_: {
excludeProperties: excludeProperties_1.default,
cloneNullProto: cloneNullProto_1.default,
NOOP: noop_1.default,
unfreeze: Unfreeze_1.default
},
get isNative() { return environnement_1.isNative; },
get isImported() { return environnement_1.isImported; }
2020-07-10 01:44:40 +02:00
};
exports.default = LightcordApi;
Object.assign(window.Lightcord.Api, LightcordApi);
2020-06-10 16:16:33 +02:00
/***/ }),
/***/ "./src/modules/BDModules.ts":
/*!**********************************!*\
!*** ./src/modules/BDModules.ts ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
let req;
setReq();
function filterDangerous(mods) {
return mods.map(e => {
return protect(e);
});
}
function protect(exports) {
let theModule = exports.exports;
let mod = theModule.default;
if (!mod)
return exports;
if (mod.remove && mod.set && mod.clear && mod.get && !mod.sort)
return null;
if (!mod.getToken && !mod.getEmail && !mod.showToken)
return exports;
const proxy = new Proxy(mod, {
getOwnPropertyDescriptor: function (obj, prop) {
if (prop === "getToken" || prop === "getEmail" || prop === "showToken")
return undefined;
return Object.getOwnPropertyDescriptor(obj, prop);
},
get: function (obj, func) {
if (func == "getToken" && obj.getToken)
return () => "mfa.XCnbKzo0CLIqdJzBnL0D8PfDruqkJNHjwHXtr39UU3F8hHx43jojISyi5jdjO52e9_e9MjmafZFFpc-seOMa";
if (func == "getEmail" && obj.getEmail)
return () => "puppet11112@gmail.com";
if (func == "showToken" && obj.showToken)
return () => true;
if (func == "__proto__" && obj.__proto__)
return proxy;
return obj[func];
}
});
return Object.assign({}, exports, { exports: Object.assign({}, theModule, { default: proxy }) });
}
class Webpackloader {
get modules() {
if (req) {
return filterDangerous(Object.values(req.c).filter((e) => e && e.exports));
}
else {
setReq();
if (req) {
return filterDangerous(Object.values(req.c).filter((e) => e && e.exports));
}
else {
return [];
}
}
}
get(ids, modules) {
if (typeof ids === "function") {
return (modules || this.modules).map((mdl) => {
if (mdl && typeof mdl.exports !== "undefined") {
return mdl.exports;
}
else {
return null;
}
}).filter(e => e).filter(ids);
}
else if (Array.isArray(ids)) {
modules = modules || this.modules;
return ids.map(id => this.get(id, modules));
}
else {
modules = modules || this.modules;
let module = modules.filter(e => !!e).find(e => e.i === ids);
if (!module)
return undefined;
return module.exports;
}
}
get default() {
return this;
}
}
exports.default = new Webpackloader();
function setReq() {
try {
req = window["webpackJsonp"].push([[], { __extra_id__: (mdl, exports, req) => mdl.exports = req }, [["__extra_id__"]]]);
if (req) {
delete req.m.__extra_id__;
delete req.c.__extra_id__;
}
}
catch (e) {
req = undefined;
}
}
/***/ }),
/***/ "./src/modules/DiscordTools.ts":
/*!*************************************!*\
!*** ./src/modules/DiscordTools.ts ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Notice = void 0;
const Notices_1 = __webpack_require__(/*! ../components/private/Notices */ "./src/components/private/Notices.tsx");
const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/modules/Utils.ts");
const uuid_1 = __webpack_require__(/*! ./uuid */ "./src/modules/uuid.ts");
const cloneNullProto_1 = __webpack_require__(/*! ./cloneNullProto */ "./src/modules/cloneNullProto.ts");
const events_1 = __webpack_require__(/*! events */ "events");
const Notice_1 = __webpack_require__(/*! ../components/private/Notice */ "./src/components/private/Notice.tsx");
const excludeProperties_1 = __webpack_require__(/*! ./excludeProperties */ "./src/modules/excludeProperties.ts");
const noop_1 = __webpack_require__(/*! ./noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ./WebpackLoader */ "./src/modules/WebpackLoader.ts");
let soundModule;
exports.default = new class DiscordTools {
showNotice(data) {
if (typeof data !== "object" || typeof data.text !== "string")
throw new Error(`This notice is not valid. Given: ${Utils_1.default.formatJSObject(data)}`);
let newData = cloneNullProto_1.default(Object.assign({}, Notice_1.defaultNotice, data));
newData.id = uuid_1.default();
Notices_1.notices.push(newData);
Notices_1.events.emit("noticeUpdate");
const notice = new Notice(newData);
return notice;
}
get notices() {
return Notices_1.notices.map(data => new Notice(data));
}
/**
* Quickly send notification (Even when no focused.)
* @param data The notification. Be sure to include all properties except functions cause they're optional.
* Notifications have a timeout of 3-5 seconds.
* They look like this: https://i.imgur.com/jzuxKKu.png
*/
showNotification(data) {
const notification = new window.Notification(data.title, excludeProperties_1.default(data, [
"title",
"onClick",
"onClose",
"onShow"
]));
notification.onclick = data.onClick || noop_1.default;
notification.onshow = data.onShow || noop_1.default;
notification.onclose = data.onClose || noop_1.default;
return notification;
}
createSound(sound) {
soundModule = soundModule || WebpackLoader_1.default.findByUniqueProperties(["createSound"]);
if (!soundModule)
throw new WebpackLoader_1.WebpackLoaderError("Couldn't find soundModule here.");
const created = soundModule.createSound(sound);
return created;
}
playSound(sound) {
const created = this.createSound(sound);
created.play();
return created;
}
};
const EventHandler = function () {
if (this.removed !== this.state.removed) {
if (this.removed) {
this.emit("removed");
}
}
if (this.showing !== this.state.showing) {
if (this.showing) {
this.emit("showing", true);
}
else {
this.emit("showing", false);
}
}
if (this.index !== this.state.index) {
this.emit("index", this.index);
}
};
/** A notice interface for modifying it and subscribing to events. */
class Notice extends events_1.EventEmitter {
constructor(data) {
super();
this.nextTickRefresh = false;
this.data = data;
this.state = {
removed: this.removed,
showing: this.showing,
index: this.index
};
let eventFunc = EventHandler.bind(this);
Notices_1.events.on("noticeUpdate", eventFunc);
this.on("removed", () => {
Notices_1.events.off("noticeUpdate", eventFunc);
});
}
on(event, listener) {
return super.on(event, listener);
}
once(event, listener) {
return super.once(event, listener);
}
off(event, listener) {
return super.off(event, listener);
}
get removed() {
return !Notices_1.notices.find(e => e.id === this.id);
}
get showing() {
return this.index === 0;
}
get index() {
return Notices_1.notices.findIndex(e => e.id === this.id);
}
get id() {
return this.data.id;
}
update(data) {
for (let key in data) {
if (key === "id")
continue;
this.data[key] = data[key];
}
if (!this.nextTickRefresh) {
this.nextTickRefresh = true;
process.nextTick(() => {
this.nextTickRefresh = false;
Notices_1.events.emit("noticeUpdate");
});
}
}
get text() {
return this.data.text;
}
set text(text) {
this.update({
text
});
}
get type() {
return this.data.type;
}
set type(type) {
this.update({
type
});
}
get buttonText() {
return this.data.buttonText;
}
set buttonText(buttonText) {
this.update({
buttonText
});
}
get onClick() {
return this.data.onClick;
}
set onClick(onClick) {
this.update({
onClick
});
}
remove() {
if (this.removed)
return;
Notices_1.notices.splice(this.index, 1);
Notices_1.events.emit("noticeUpdate");
}
}
exports.Notice = Notice;
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/modules/PluginUtilities.ts":
/*!****************************************!*\
!*** ./src/modules/PluginUtilities.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const components_1 = __webpack_require__(/*! ../components/components */ "./src/components/components.ts");
const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/modules/Utils.ts");
const uuid_1 = __webpack_require__(/*! ./uuid */ "./src/modules/uuid.ts");
const TextInput_1 = __webpack_require__(/*! ../components/inputs/TextInput */ "./src/components/inputs/TextInput.tsx");
exports.default = new class PluginUtilities {
constructor() { }
renderSettings(settings) {
let items = this.renderSettingsToReact(settings);
let elem = React.createElement("div", { key: uuid_1.default() }, items);
return Utils_1.default.ReactToHTMLElement(elem);
}
renderSettingsToReact(settings) {
let items = [];
settings.forEach(item => {
if (typeof item !== "object")
return items.push(item);
if (item.props && "children" in item.props) {
if (!Array.isArray(item.props.children))
item.props.children = [item.props.children];
item.props.children = this.renderSettingsToReact(item.props.children);
}
if (!item.props)
item.props = {};
item.props.key = uuid_1.default();
let component = Utils_1.default.getNestedProps(components_1.default, item.component);
if (!component) {
let warning = new TextInput_1.default({
value: `Warning: No component was found for: "${item.component}". Please correct your code.`,
disabled: true,
error: `Warning: No component was found for: "${item.component}". Please correct your code.`
}).render();
items.push(warning);
return;
}
items.push(React.createElement(component, Object.create(item.props)));
});
return items;
}
};
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/modules/Unfreeze.ts":
/*!*********************************!*\
!*** ./src/modules/Unfreeze.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function unfreeze(o) {
var oo = undefined;
if (o instanceof Array) {
oo = [];
var clone = function (v) {
oo.push(v);
};
o.forEach(clone);
}
else if (o instanceof String) {
oo = new String(o).toString();
}
else if (typeof o == 'object') {
oo = {};
for (var property in o) {
oo[property] = o[property];
}
}
return oo;
}
exports.default = unfreeze;
Object.unfreeze = unfreeze;
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/modules/Utils.ts":
/*!******************************!*\
!*** ./src/modules/Utils.ts ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
2020-07-28 13:56:57 +02:00
exports.LightcordApiError = void 0;
2020-07-10 01:44:40 +02:00
const ReactDOM = __webpack_require__(/*! react-dom */ "./src/alias/react-dom.ts");
const PluginUtilities_1 = __webpack_require__(/*! ./PluginUtilities */ "./src/modules/PluginUtilities.ts");
exports.default = new class Utils {
constructor() { }
ReactToHTMLElement(ReactElement) {
const element = document.createElement("div");
ReactDOM.render(ReactElement, element);
return element;
}
get PluginUtils() { return PluginUtilities_1.default; }
getNestedProps(obj, path) {
let segments = path.split(".");
for (let seg of segments) {
obj = obj && (seg in obj) ? obj[seg] : undefined;
}
return obj;
}
2020-07-11 21:29:08 +02:00
DecimalColorToHex(color) {
return "#" + color.toString(16).toUpperCase();
2020-07-11 21:29:08 +02:00
}
HexColorToDecimal(color) {
color = color.replace(/[#;]/g, "");
let res = parseInt(color, 16);
if (isNaN(res))
throw new Error(`Invalid color: ${color}`);
return res;
}
removeDa(className) {
if (!className)
return className;
return className.split(" ").filter(e => !e.startsWith("da-")).join(" ");
}
FindReact(dom, traverseUp = 0) {
// taken from https://stackoverflow.com/questions/29321742/react-getting-a-component-from-a-dom-element-for-debugging#39165137
const key = Object.keys(dom).find(key => key.startsWith("__reactInternalInstance$"));
const domFiber = dom[key];
if (domFiber == null)
return null;
// react <16
if (domFiber._currentElement) {
let compFiber = domFiber._currentElement._owner;
for (let i = 0; i < traverseUp; i++) {
compFiber = compFiber._currentElement._owner;
}
return compFiber._instance;
}
// react 16+
const GetCompFiber = fiber => {
//return fiber._debugOwner; // this also works, but is __DEV__ only
let parentFiber = fiber.return;
while (typeof parentFiber.type == "string") {
parentFiber = parentFiber.return;
}
return parentFiber;
};
let compFiber = GetCompFiber(domFiber);
for (let i = 0; i < traverseUp; i++) {
compFiber = GetCompFiber(compFiber);
}
return compFiber.stateNode;
}
hasClass(classNames, className) {
if (!classNames || !className)
return false;
const classnames = classNames.split(" ");
for (let classname of this.removeDa(className).split(" ")) {
if (!classnames.includes(classname))
return false;
}
return true;
}
formatJSObject(obj) {
if (["string", "number", "boolean", "bigint", "undefined"].includes(typeof obj))
return JSON.stringify(obj);
if (obj === null)
return "null";
if (typeof obj === "function")
return String(obj);
if (typeof obj === "symbol")
return String(obj);
if (Array.isArray(obj)) {
if (!obj.length)
return "[]";
return `[\n ${obj.map(e => this.formatJSObject(e)).join(",\n ")}\n]`;
}
else {
const keys = Object.keys(obj);
if (keys.length === 0)
return "{}";
return `{\n ${keys.map(key => {
let original = key;
if (typeof key === "symbol")
key = "[" + String(key) + "]";
else {
if (typeof key === "number")
key = String(key);
else {
console.log(key);
if (isNaN(parseInt(key[0]))) {
key = this.formatJSObject(key);
}
else if (/[^\w\d_$]/g.test(key)) {
key = this.formatJSObject(key);
}
}
}
return `${key}: ${this.formatJSObject(obj[original])}`;
})}\n}`;
}
}
2020-08-04 13:17:51 +02:00
getColor(color_name) {
return Lightcord.DiscordModules.constants.Colors[color_name.toUpperCase()];
}
firstLetterUppercase(str) {
if (!str)
return "";
return str[0].toUpperCase() + str.slice(1);
}
executeXTimes(func, times) {
let results = [];
for (let i = 0; times > i; i++) {
results.push(func(i));
}
return results;
}
2020-07-10 01:44:40 +02:00
};
2020-07-28 13:56:57 +02:00
class LightcordApiError extends Error {
constructor() {
super(...arguments);
this.name = "LightcordApiError";
}
}
exports.LightcordApiError = LightcordApiError;
2020-06-16 15:51:21 +02:00
2020-06-10 16:16:33 +02:00
/***/ }),
/***/ "./src/modules/WebpackLoader.ts":
/*!**************************************!*\
!*** ./src/modules/WebpackLoader.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebpackLoaderError = void 0;
const BDModules = window.BDModules || __webpack_require__(/*! ./BDModules */ "./src/modules/BDModules.ts");
2020-07-10 01:44:40 +02:00
exports.default = new class WebpackLoader {
constructor() { }
get(id) {
return BDModules.get(id);
}
find(filter) {
2020-07-11 21:29:08 +02:00
let result = BDModules.get(filter)[0];
if (!result) {
console.warn(filter, "couldn't find the module.");
}
return result;
2020-07-10 01:44:40 +02:00
}
findByUniqueProperties(props) {
return BDModules.get((mod) => {
if (mod.__esModule && ("default" in mod)) {
let doesMatch = true;
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod.default, prop))
doesMatch = false;
}
if (doesMatch)
return true;
}
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod, prop))
return false;
}
return true;
})[0];
}
filter(filter) {
return BDModules.get(filter);
}
filterByUniqueProperties(props) {
return BDModules.get((mod) => {
if (mod.__esModule && ("default" in mod)) {
let doesMatch = true;
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod.default, prop))
doesMatch = false;
}
if (doesMatch)
return true;
}
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod, prop))
return false;
}
return true;
});
}
};
class WebpackLoaderError extends Error {
constructor(message = "") {
message += "\n\tThis error is related to Lightcord not being able to find a WebpackModule. \n\tPlease show this error and a few lines of logs above this error to the devs. \n\tOpen an issue on https://github.com/Lightcord/Lightcord or in our discord server.";
super(message);
this.name = "WebpackLoaderError";
}
}
exports.WebpackLoaderError = WebpackLoaderError;
2020-06-10 16:16:33 +02:00
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/modules/cloneNullProto.ts":
/*!***************************************!*\
!*** ./src/modules/cloneNullProto.ts ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Recreate the given object without the __proto__. Useful for better formatting when output in console.
* @param obj The object to recreate
*/
function cloneNullProto(obj) {
let o = Object.create(null);
Object.keys(obj).forEach(k => {
o[k] = obj[k];
});
return o;
}
exports.default = cloneNullProto;
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/modules/environnement.ts":
/*!**************************************!*\
!*** ./src/modules/environnement.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isImported = exports.isNative = void 0;
exports.isNative = typeof window.BDModules === "undefined";
exports.isImported = typeof window.BDModules !== "undefined";
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/modules/excludeProperties.ts":
/*!******************************************!*\
!*** ./src/modules/excludeProperties.ts ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
function excludeProperties(obj, props) {
let newObj = {};
Object.keys(obj).forEach((k) => {
if (props.includes(k))
return;
newObj[k] = obj[k];
});
return newObj;
}
exports.default = excludeProperties;
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/modules/noop.ts":
/*!*****************************!*\
!*** ./src/modules/noop.ts ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
function NOOP() { }
exports.default = NOOP;
/***/ }),
/***/ "./src/modules/patchers.ts":
/*!*********************************!*\
!*** ./src/modules/patchers.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.patch = void 0;
const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/modules/Utils.ts");
const Notices_1 = __webpack_require__(/*! ../components/private/Notices */ "./src/components/private/Notices.tsx");
const environnement_1 = __webpack_require__(/*! ./environnement */ "./src/modules/environnement.ts");
function patch() {
/** START NOTICE */
getModule(e => e.default && e.default.displayName === "ConnectedAppView")
.then(async (mod) => {
const appClasses = await getModule(e => e.hasNotice);
const buildRender = original => {
return function render() {
const returnValue = original.call(this, ...arguments);
const newchildren = [];
let children = returnValue.props.children[1].props.children;
if (!Array.isArray(children))
children = [children];
newchildren.push(children[0]);
newchildren.push(React.createElement(Notices_1.default, { container: this }));
newchildren.push(children[1]);
returnValue.props.children[1].props.children = newchildren;
returnValue.props.children[1].props.children[2].props.children[0].props.render = buildRenderChannelSidebar(returnValue.props.children[1].props.children[2].props.children[0].props.render);
return returnValue;
};
};
const buildRenderChannelSidebar = original => {
return function renderChannelSidebar() {
const returnValue = original.call(this, ...arguments);
const hasNotice = Notices_1.notices.length > 0;
if (!hasNotice)
return returnValue;
if (!Utils_1.default.hasClass(returnValue.props.className, appClasses.hasNotice)) {
returnValue.props.className += " " + Utils_1.default.removeDa(appClasses.hasNotice);
}
return returnValue;
};
};
mod.default.prototype.render = buildRender(mod.default.prototype.render);
(async function () {
const base = document.querySelector("." + Utils_1.default.removeDa(appClasses.base));
if (!base)
throw new Error(`Could not find base here`);
const elem = Utils_1.default.FindReact(base);
elem.render = buildRender(elem.render);
elem.forceUpdate();
})();
});
/** END NOTICE */
if (environnement_1.isNative) {
/** START USERPOPOUT PATCH */
awaitLogin()
.then(async () => {
let UserPopout = await getModule(e => e.default && e.default.displayName === "FluxContainer(ForwardRef(SubscribeGuildMembersContainer(UserPopout)))");
const userModule = await getModule(e => e.default && e.default.getCurrentUser);
const render1 = new UserPopout.default({ userId: userModule.default.getCurrentUser().id, guildId: null, channelId: null, disableUserProfileLink: true }).render();
const PopoutProps = render1.props;
const render2 = render1.type.render(PopoutProps, null);
const render3 = new render2.type(render2.props).render();
const UserPopoutComponent = render3.type;
if (!UserPopoutComponent)
throw new Error(`Couldn't find the UserPopoutComponent component.`);
const render = UserPopoutComponent.prototype.render;
UserPopoutComponent.prototype.render = function () {
const returnValue = render.call(this, ...arguments);
try {
returnValue.props.children.props["data-user-id"] = this.props.user.id;
}
catch (e) {
console.error(e);
}
return returnValue;
};
});
/** END USERPOPOUT PATCH*/
/** START USERPROFILE PATCH */
awaitLogin()
.then(async () => {
let UserProfile = await getModule(e => e.default && e.default.displayName === "UserProfile");
const userModule = await getModule(e => e.default && e.default.getCurrentUser);
const render1 = new UserProfile.default({
user: userModule.default.getCurrentUser()
}).render();
const render2 = new render1.type(render1.props).render();
const render3 = render2.type.render(render2.props, null);
const render4 = new render3.type(render3.props).render();
const UserProfileComponent = render4.type;
if (!UserProfileComponent)
throw new Error(`Couldn't find the UserProfileComponent component.`);
const render = UserProfileComponent.prototype.render;
UserProfileComponent.prototype.render = function () {
const returnValue = render.call(this, ...arguments);
console.log(returnValue);
try {
returnValue.props.children.props["data-user-id"] = this.props.user.id;
}
catch (e) {
console.error(e);
}
return returnValue;
};
});
/** END USERPROFILE PATCH */
/** START WEBHOOK PATCH */
/*
let usedWebhooks = {}
getModule(e => e && e.Request && e.Request.prototype && e.Request.prototype.end)
.then(RequestModule => {
const end = RequestModule.Request.prototype.end
RequestModule.Request.prototype.end = function(){
if(this.url.endsWith("/messages") && /\/channels\/\d+\/messages/g.test(this.url) && this.method === "POST"){ // sending message
let channelId = this.url.split("/channels/")[1].split("/messages")[0]
if(usedWebhooks[channelId]){ // webhook is availlable
let webhook = usedWebhooks[channelId]
let url = `/webhooks/${webhook.id}/${webhook.token}?wait=true`
this.url = url
}
}
return end.call(this, ...arguments)
}
})
getModule(e => e.default && e.default.displayName === "Webhook")
.then(webhookComponent => {
const renderEdit = webhookComponent.default.prototype.renderEdit
webhookComponent.default.prototype.renderEdit = function(){
const webhook = this.props.webhook
let returnValue = renderEdit.call(this, ...arguments)
returnValue.props.children = [returnValue.props.children]
let message = usedWebhooks[webhook.channel_id] && usedWebhooks[webhook.channel_id].id === webhook.id ? "Stop talking with this webhook" : "Talk with this webhook"
returnValue.props.children.push(React.createElement(window.Lightcord.Api.Components.inputs.Button, {color: "green", wrapper: false, onClick(){
if(usedWebhooks[webhook.channel_id] && usedWebhooks[webhook.channel_id].id === webhook.id){
delete usedWebhooks[webhook.channel_id]
}else{
usedWebhooks[webhook.channel_id] = {
id: webhook.id,
token: webhook.token
}
}
webhookPanels.forEach(e => e())
}}, message))
return returnValue
}
})
let webhookPanels = []
let getComp = (comp) => {
class SettingsWebhooks extends React.PureComponent {
constructor(props){
super(props)
}
componentWillMount(){
this.id = uuid()
this.component = new comp(this.props)
let func = () => {
this.component.forceUpdate()
}
func.id = this.id
webhookPanels.push(func)
}
componentWillUnmount(){
this.component = null
webhookPanels = webhookPanels.filter(e => e.id !== this.id)
}
render(){
return this.component.render()
}
static displayName = "SettingsWebhooks"
}
return SettingsWebhooks
}
getModule(e => e.default && e.default.displayName === "FluxContainer(SettingsWebhooks)")
.then(webhooksComponents => {
let comp = webhooksComponents.default
webhooksComponents.default = getComp(comp)
WebpackLoader.find(e => e.default && e.default.displayName === "FluxContainer(FluxContainer(SettingsWebhooks))")
.forEach(mod => {
mod.default = getComp(mod.default)
})
})*/
/** END WEBHOOK PATCH */
}
// TODO: Add in app-notifications / confirmations.
/** START IN-APP NOTIFICATIONS */
//getModule(e => true)
/** END IN-APP NOTIFICATIONS */
}
exports.patch = patch;
function getModule(filter) {
return new Promise((resolve) => {
window.Lightcord.Api.ensureExported(filter)
.then(resolve)
.catch(err => {
console.error("[LIGHTCORD]", err, filter);
});
});
}
let hasCompletedLogin = false;
let loginPromise;
function awaitLogin() {
if (hasCompletedLogin)
return Promise.resolve();
if (loginPromise)
return loginPromise;
return loginPromise = new Promise((resolve) => {
let isResolved = false;
window.Lightcord.DiscordModules.dispatcher.subscribe("CONNECTION_OPEN", (ev) => {
if (isResolved)
return;
hasCompletedLogin = true;
resolve();
isResolved = true;
});
});
}
window.Lightcord.DiscordModules.dispatcher.subscribe("LOGOUT", (ev) => {
hasCompletedLogin = false;
loginPromise = undefined;
});
/***/ }),
/***/ "./src/modules/uuid.ts":
/*!*****************************!*\
!*** ./src/modules/uuid.ts ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const uuidv1 = __webpack_require__(/*! uuid/v1 */ "uuid/v1");
const uuidv4 = __webpack_require__(/*! uuid/v4 */ "uuid/v4");
let uuid = Object.assign(function () {
return uuidv4();
}, { v1: () => uuidv1(), v4: () => uuidv4() });
exports.default = uuid;
/***/ }),
/***/ "events":
/*!*************************!*\
!*** external "events" ***!
\*************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = require("events");
/***/ }),
/***/ "powercord/webpack":
/*!************************************!*\
!*** external "powercord/webpack" ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = require("powercord/webpack");
/***/ }),
/***/ "uuid/v1":
/*!**************************!*\
!*** external "uuid/v1" ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = require("uuid/v1");
/***/ }),
/***/ "uuid/v4":
/*!**************************!*\
!*** external "uuid/v4" ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = require("uuid/v4");
2020-06-10 16:16:33 +02:00
/***/ })
/******/ });
2020-08-04 13:17:51 +02:00
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2FsaWFzL3JlYWN0LWRvbS50cyIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvYWxpYXMvcmVhY3QudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvY29tcG9uZW50cy50cyIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9nZW5lcmFsL0FsZXJ0Qm94LnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9nZW5lcmFsL0NvZGVCbG9jay50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvZ2VuZXJhbC9FcnJvckNhdGNoZXIudHN4Iiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9jb21wb25lbnRzL2dlbmVyYWwvRmxleC50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvZ2VuZXJhbC9TZXR0aW5nU3ViVGl0bGUudHN4Iiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9jb21wb25lbnRzL2dlbmVyYWwvU2V0dGluZ3NUaXRsZS50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvZ2VuZXJhbC9UYWJzLnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9nZW5lcmFsL1RleHQudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvZ2VuZXJhbC9UaXRsZS50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvZ2VuZXJhbC9Ub29sdGlwLnRzIiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9jb21wb25lbnRzL2lucHV0cy9CdXR0b24udHN4Iiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9jb21wb25lbnRzL2lucHV0cy9Db2xvclBpY2tlci50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvaW5wdXRzL0Ryb3Bkb3duLnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9pbnB1dHMvUmFkaW9Hcm91cC50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvaW5wdXRzL1N3aXRjaC50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvaW5wdXRzL1RleHRBcmVhLnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9pbnB1dHMvVGV4dElucHV0LnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9wcml2YXRlL05vdGljZS50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvcHJpdmF0ZS9Ob3RpY2VzLnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvaW5kZXgudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL21vZHVsZXMvQkRNb2R1bGVzLnRzIiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9tb2R1bGVzL0Rpc2NvcmRUb29scy50cyIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvbW9kdWxlcy9QbHVnaW5VdGlsaXRpZXMudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL21vZHVsZXMvVW5mcmVlemUudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL21vZHVsZXMvVXRpbHMudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL21vZHVsZXMvV2VicGFja0xvYWRlci50cyIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvbW9kdWxlcy9jbG9uZU51bGxQcm90by50cyIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvbW9kdWxlcy9lbnZpcm9ubmVtZW50LnRzIiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9tb2R1bGVzL2V4Y2x1ZGVQcm9wZXJ0aWVzLnRzIiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9tb2R1bGVzL25vb3AudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL21vZHVsZXMvcGF0Y2hlcnMudHMiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL21vZHVsZXMvdXVpZC50cyIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvZXh0ZXJuYWwgXCJldmVudHNcIiIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvZXh0ZXJuYWwgXCJwb3dlcmNvcmQvd2VicGFja1wiIiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS9leHRlcm5hbCBcInV1aWQvdjFcIiIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvZXh0ZXJuYWwgXCJ1dWlkL3Y0XCIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7UUFBQTtRQUNBOztRQUVBO1FBQ0E7O1FBRUE7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7O1FBRUE7UUFDQTs7UUFFQTtRQUNBOztRQUVBO1FBQ0E7UUFDQTs7O1FBR0E7UUFDQTs7UUFFQTtRQUNBOztRQUVBO1FBQ0E7UUFDQTtRQUNBLDBDQUEwQyxnQ0FBZ0M7UUFDMUU7UUFDQTs7UUFFQTtRQUNBO1FBQ0E7UUFDQSx3REFBd0Qsa0JBQWtCO1FBQzFFO1FBQ0EsaURBQWlELGNBQWM7UUFDL0Q7O1FBRUE7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBLHlDQUF5QyxpQ0FBaUM7UUFDMUUsZ0hBQWdILG1CQUFtQixFQUFFO1FBQ3JJO1FBQ0E7O1FBRUE7UUFDQTtRQUNBO1FBQ0EsMkJBQTJCLDBCQUEwQixFQUFFO1FBQ3ZELGlDQUFpQyxlQUFlO1FBQ2hEO1FBQ0E7UUFDQTs7UUFFQTtRQUNBLHNEQUFzRCwrREFBK0Q7O1FBRXJIO1FBQ0E7OztRQUdBO1FBQ0E7Ozs7Ozs7Ozs7Ozs7O0FDaEZBLGdGQUFnRjtBQUNoRixNQUFNLENBQUMsUUFBUSxHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sR0FBQyxNQUFNLENBQUMsSUFBSSxrQkFBa0I7SUFDMUQsQ0FBQyxHQUFFLEVBQUU7UUFDRCxJQUFHO1lBQ0MsT0FBTyxNQUFNLENBQUMsS0FBSyxDQUFDLFFBQVE7U0FDL0I7UUFBQSxPQUFNLENBQUMsRUFBQztZQUNMLE9BQU8sSUFBSTtTQUNkO0lBQ0wsQ0FBQyxDQUFDLEVBQUU7SUFDSixDQUFDLEd