decord/source/modules/guild_progress/GuildProgressStore.tsx

343 lines
9.5 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 11505
// Function ID: 89599
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-27 11:26:19 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1194, 1348, 1838, 11499, 21, 566, 686, 2]
2026-07-23 10:11:24 +00:00
2026-07-27 11:26:19 +00:00
// Module 11505 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import closure_7 from "_isNativeReflectConstruct";
import closure_8 from "_isNativeReflectConstruct";
import closure_9 from "_createForOfIteratorHelperLoose";
import { Steps } from "Steps";
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
2026-07-23 10:11:24 +00:00
function _createForOfIteratorHelperLoose(iterable) {
let closure_0 = iterable;
iterable = "undefined" !== typeof Symbol;
if (iterable) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol;
2026-07-23 10:11:24 +00:00
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (!iterable) {
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (iterable) {
const iter = iterable.call(iterable);
2026-07-20 16:05:17 +00:00
const next = iter.next;
return next.bind(iter);
} else {
const _Array = Array;
2026-07-23 10:11:24 +00:00
let tmp = iterable;
if (!Array.isArray(iterable)) {
2026-07-20 16:05:17 +00:00
let tmp2;
2026-07-23 10:11:24 +00:00
if (iterable) {
if ("string" === typeof iterable) {
tmp2 = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
const toString = {}.toString;
2026-07-23 10:11:24 +00:00
const substr = toString.call(iterable).slice(8, -1);
2026-07-20 16:05:17 +00:00
let name = substr;
if (tmp3) {
2026-07-23 10:11:24 +00:00
name = iterable.constructor.name;
2026-07-20 16:05:17 +00:00
}
if ("Map" !== name) {
if ("Set" !== name) {
if ("Arguments" === name) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr;
}
const _Array2 = Array;
2026-07-23 10:11:24 +00:00
arr = Array.from(iterable);
const callResult = toString.call(iterable);
tmp3 = "Object" === substr && iterable.constructor;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2;
if (!tmp2) {
const _TypeError = TypeError;
const typeError = new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
throw typeError;
}
}
if (tmp) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0;
2026-07-20 16:05:17 +00:00
return () => {
2026-07-23 10:11:24 +00:00
if (closure_1 >= length.length) {
2026-07-20 16:05:17 +00:00
let obj = { done: true };
} else {
obj = { done: false };
closure_1 = tmp3 + 1;
2026-07-23 10:11:24 +00:00
obj.value = length[+closure_1];
2026-07-20 16:05:17 +00:00
}
return obj;
};
}
}
function _arrayLikeToArray(arg0, arg1) {
let length;
if (tmp) {
length = arg0.length;
}
const ArrayResult = Array(length);
for (let num = 0; num < length; num = num + 1) {
ArrayResult[num] = arg0[num];
}
return ArrayResult;
}
2026-07-23 10:11:24 +00:00
function completeStep(guild_id, CHANNEL) {
2026-07-20 16:05:17 +00:00
let tmp = null != obj;
if (tmp) {
2026-07-23 10:11:24 +00:00
let flag = !obj.has(CHANNEL);
2026-07-20 16:05:17 +00:00
if (flag) {
const _Set = Set;
2026-07-23 10:11:24 +00:00
const set = new Set(obj.add(CHANNEL));
dependencyMap[guild_id] = set;
2026-07-20 16:05:17 +00:00
flag = true;
}
tmp = flag;
}
return tmp;
}
let closure_11 = {};
2026-07-23 10:11:24 +00:00
let tmp2 = ((PersistedStore) => {
2026-07-20 16:05:17 +00:00
class GuildProgressStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_2(this, GuildProgressStore);
obj = outer1_5(GuildProgressStore);
tmp2 = outer1_4;
if (outer1_12()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_5;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_5(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(GuildProgressStore, PersistedStore);
let obj = {
key: "initialize",
value(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
this.waitFor(outer1_7, outer1_8, outer1_9);
const outer1_11 = {};
2026-07-20 16:05:17 +00:00
if (null != arg0) {
2026-07-23 10:11:24 +00:00
const keys = GuildProgressStore(outer1_1[9]).keys(arg0);
2026-07-20 16:05:17 +00:00
const item = keys.forEach((arg0) => {
let tmp2 = null != tmp;
if (tmp2) {
const _Symbol = Symbol;
tmp2 = "function" === typeof tmp[Symbol.iterator];
}
if (tmp2) {
const _Set = Set;
const set = new Set(tmp);
2026-07-23 10:11:24 +00:00
outer2_11[arg0] = set;
2026-07-20 16:05:17 +00:00
}
});
2026-07-23 10:11:24 +00:00
const obj = GuildProgressStore(outer1_1[9]);
2026-07-20 16:05:17 +00:00
}
}
};
const items = [obj, , , ];
obj = {
key: "getProgress",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_11[arg0];
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "hasProgress",
value(arg0) {
let tmp = null != obj;
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = !obj.has(outer1_10.DISMISSED);
2026-07-20 16:05:17 +00:00
}
return tmp;
}
};
items[2] = obj;
items[3] = {
key: "getState",
value() {
2026-07-23 10:11:24 +00:00
return outer1_11;
2026-07-20 16:05:17 +00:00
}
};
return callback(GuildProgressStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").PersistedStore);
2026-07-20 16:05:17 +00:00
tmp2.displayName = "GuildProgressStore";
tmp2.persistKey = "GuildProgressStore";
2026-07-23 10:11:24 +00:00
tmp2 = new tmp2(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
const items = [];
2026-07-23 10:11:24 +00:00
const keys = items(21).keys(closure_11);
2026-07-20 16:05:17 +00:00
const item = keys.forEach((arg0) => {
2026-07-23 10:11:24 +00:00
if (obj.has(outer1_10.COMPLETED)) {
2026-07-20 16:05:17 +00:00
items.push(arg0);
}
});
2026-07-23 10:11:24 +00:00
const item1 = items.forEach((arg0) => outer1_15(arg0, outer1_10.DISMISSED));
2026-07-20 16:05:17 +00:00
},
GUILD_PROGRESS_INITIALIZE: function handleInitialize(guildId) {
guildId = guildId.guildId;
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[guildId]) {
2026-07-20 16:05:17 +00:00
const _Set = Set;
const set = new Set();
2026-07-23 10:11:24 +00:00
dependencyMap[guildId] = set;
2026-07-20 16:05:17 +00:00
}
if (!obj.has(Steps.COMPLETED)) {
2026-07-23 10:11:24 +00:00
dependencyMap[guildId].delete(Steps.DISMISSED);
const obj2 = dependencyMap[guildId];
2026-07-20 16:05:17 +00:00
}
},
GUILD_PROGRESS_COMPLETED_SEEN: function handleCompletedSeen(guildId) {
guildId = guildId.guildId;
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[guildId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const _Set = Set;
2026-07-23 10:11:24 +00:00
const set = new Set(dependencyMap[guildId].add(Steps.COMPLETED));
dependencyMap[guildId] = set;
2026-07-20 16:05:17 +00:00
}
},
GUILD_PROGRESS_DISMISS: function handleGuildProgressDismiss(guildId) {
return completeStep(guildId.guildId, Steps.DISMISSED);
},
GUILD_CREATE: function handleGuildCreate(guild) {
guild = guild.guild;
guild = guild.getGuild(guild.id);
if (null == guild) {
return false;
} else {
let tmp3 = guild.ownerId === store.getId();
if (tmp3) {
2026-07-23 10:11:24 +00:00
tmp3 = null != dependencyMap[guild.id];
2026-07-20 16:05:17 +00:00
}
if (tmp3) {
if (null != guild.icon) {
2026-07-23 10:11:24 +00:00
dependencyMap[guild.id].add(Steps.AVATAR);
const obj = dependencyMap[guild.id];
2026-07-20 16:05:17 +00:00
}
if (guild.member_count > 1) {
2026-07-23 10:11:24 +00:00
dependencyMap[guild.id].add(Steps.INVITE);
const obj2 = dependencyMap[guild.id];
2026-07-20 16:05:17 +00:00
}
}
}
},
CHANNEL_CREATE: function handleChannelCreate(channel) {
channel = channel.channel;
let tmp = null != channel && null != channel.guild_id;
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = null != dependencyMap[channel.guild_id];
2026-07-20 16:05:17 +00:00
}
if (tmp) {
tmp = completeStep(channel.guild_id, Steps.CHANNEL);
}
return tmp;
},
CHANNEL_UPDATES: function handleChannelUpdates(channels) {
let iter3;
const tmp = _createForOfIteratorHelperLoose(channels.channels);
const iter = tmp();
let iter2 = iter;
let flag = false;
let flag2 = false;
if (!iter.done) {
do {
let value = iter2.value;
let tmp2 = null != value && null != value.guild_id;
if (tmp2) {
2026-07-23 10:11:24 +00:00
let tmp3 = dependencyMap;
tmp2 = null != dependencyMap[value.guild_id];
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
2026-07-23 10:11:24 +00:00
let tmp4 = completeStep;
let tmp5 = Steps;
tmp2 = false !== completeStep(value.guild_id, Steps.CHANNEL);
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
flag = true;
}
iter3 = tmp();
iter2 = iter3;
flag2 = flag;
} while (!iter3.done);
}
return flag2;
},
GUILD_SETTINGS_SUBMIT_SUCCESS: function handleGuildSettings(guild) {
guild = guild.guild;
let tmp = null != guild;
if (tmp) {
let tmp2 = null != guild.id;
if (tmp2) {
2026-07-23 10:11:24 +00:00
tmp2 = null != dependencyMap[guild.id];
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
tmp2 = null != guild.icon;
}
if (tmp2) {
tmp2 = completeStep(guild.id, Steps.AVATAR);
}
tmp = tmp2;
}
return tmp;
},
MESSAGE_CREATE: function handleMessage(channelId) {
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(channelId.channelId);
2026-07-20 16:05:17 +00:00
const author = channelId.message.author;
let id;
if (null != author) {
id = author.id;
}
let tmp3 = id === store.getId() && null != channel;
if (tmp3) {
2026-07-23 10:11:24 +00:00
tmp3 = null != dependencyMap[channel.guild_id];
2026-07-20 16:05:17 +00:00
}
if (tmp3) {
tmp3 = completeStep(channel.guild_id, Steps.MESSAGE);
}
return tmp3;
},
GUILD_MEMBER_LIST_UPDATE: function handleGuildMember(guildId) {
guildId = guildId.guildId;
2026-07-23 10:11:24 +00:00
let tmp2 = null != dependencyMap[guildId];
2026-07-20 16:05:17 +00:00
if (tmp2) {
tmp2 = tmp > 1;
}
if (tmp2) {
tmp2 = completeStep(guildId, Steps.INVITE);
}
return tmp2;
}
});
2026-07-23 10:11:24 +00:00
let result = require("_possibleConstructorReturn").fileFinishedImporting("modules/guild_progress/GuildProgressStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp2;