230 lines
9.9 KiB
TypeScript
230 lines
9.9 KiB
TypeScript
/* Metro module 6270; source: lib/guild/GuildMemberRequester.tsx; dependencies: [6, 7, 4041, 22, 2] */
|
|
function _fun49525(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:6, offset: 0x011fc0cd, size: 149 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = _fun49526();
|
|
const value = _fun49535();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('lib/guild/GuildMemberRequester.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _fun49526() { // fn#49526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:118, offset: 0x011fc162, size: 124 bytes, params: 1, frame: 15
|
|
return env0_4(GuildMemberRequestState, [{key: 'acknowledge', value: function(a0) {
|
|
this._unacknowledgedRequests.delete(a0);
|
|
this._pendingRequests.delete(a0);
|
|
}}, {key: 'flushRequests', value: function(a0) {
|
|
var items;
|
|
var _pendingRequests;
|
|
var env0_0 = this;
|
|
if (this._pendingRequests.size !== 0) {
|
|
items = [];
|
|
var env0_1 = items;
|
|
_pendingRequests = this._pendingRequests;
|
|
_pendingRequests.forEach(_fun49531);
|
|
if (items.length > 0) {
|
|
a0(this._guildId, items);
|
|
}
|
|
_pendingRequests = this._pendingRequests;
|
|
_pendingRequests.clear();
|
|
}
|
|
}}, {key: 'requestUnacknowledged', value: function() {
|
|
var r0;
|
|
var env0_0 = this;
|
|
var value = this._unacknowledgedRequests.size !== 0;
|
|
if (value) {
|
|
this._unacknowledgedRequests.forEach(_fun49533);
|
|
r0 = this._pendingRequests.size !== 0 && undefined;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}}, {key: 'request', value: function(a0) {
|
|
if (this._guildMemberExists(a0)) {
|
|
return false;
|
|
}
|
|
if (this._sentRequests.has(a0)) {
|
|
return false;
|
|
}
|
|
if (this._pendingRequests.has(a0)) {
|
|
return false;
|
|
}
|
|
this._pendingRequests.add(a0);
|
|
}}]);
|
|
}
|
|
|
|
function _fun49535() { // fn#49535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:1195, offset: 0x011fc450, size: 195 bytes, params: 1, frame: 15
|
|
return env0_4(GuildMemberRequester, [{key: 'reset', value: function() {
|
|
this._guildStates = {};
|
|
this._flush.cancel();
|
|
}}, {key: 'request', value: function(a0, a1) {
|
|
var value = this._getGuildState(a0);
|
|
value = value.request(a1);
|
|
if (value !== false) {
|
|
this._flush.delay(false);
|
|
}
|
|
}}, {key: 'acknowledge', value: function(a0, a1) {
|
|
this._getGuildState(a0).acknowledge(a1);
|
|
}}, {key: 'flushRequests', value: value_49541}, {key: 'requestUnacknowledged', value: value_49543},
|
|
{key: '_getGuildState', value: value_49545}, {key: 'getDebugState', value: value_49546}]);
|
|
}
|
|
|
|
function GuildMemberRequestState(a0, a1) { // fn#49527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:139, offset: 0x011fc1de, size: 158 bytes, params: 3, frame: 16
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value = environment.__proto__;
|
|
env1_3(this, GuildMemberRequestState);
|
|
let Set = global.Set;
|
|
this._pendingRequests = new Set();
|
|
Set = global.Set;
|
|
this._sentRequests = new Set();
|
|
Set = global.Set;
|
|
this._unacknowledgedRequests = new Set();
|
|
this._guildId = a0;
|
|
this._guildMemberExists = _guildMemberExists;
|
|
}
|
|
|
|
function value_49530(a0) { // fn#49530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:493, offset: 0x011fc2be, size: 101 bytes, params: 2, frame: 15
|
|
var items2;
|
|
let _pendingRequests = this._pendingRequests;
|
|
if (_pendingRequests.size !== 0) {
|
|
items2 = [];
|
|
_pendingRequests = this._pendingRequests;
|
|
_pendingRequests.forEach(_fun49531);
|
|
if (items2.length > 0) {
|
|
a0(this._guildId, items2);
|
|
}
|
|
_pendingRequests = this._pendingRequests;
|
|
_pendingRequests.clear();
|
|
}
|
|
}
|
|
|
|
function value_49532() { // fn#49532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:788, offset: 0x011fc371, size: 75 bytes, params: 1, frame: 14
|
|
var r0;
|
|
const value = this._unacknowledgedRequests.size !== 0;
|
|
if (value) {
|
|
this._unacknowledgedRequests.forEach(_fun49533);
|
|
r0 = this._pendingRequests.size !== 0 && undefined;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function GuildMemberRequester(a0, a1) { // fn#49536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:1216, offset: 0x011fc513, size: 118 bytes, params: 3, frame: 15
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
env1_3(this, GuildMemberRequester);
|
|
this._guildStates = {};
|
|
const DelayedCall = (require(4041) /* metro dependency 4041: Timers */).DelayedCall;
|
|
this._flush = new DelayedCall(0, _fun49537);
|
|
this._guildMemberExists = a0;
|
|
this._onChange = a1;
|
|
}
|
|
|
|
function value_49541() { // fn#49541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:1693, offset: 0x011fc618, size: 58 bytes, params: 1, frame: 14
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
value.forEach(this._guildStates, _fun49542);
|
|
}
|
|
|
|
function value_49543() { // fn#49543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:1813, offset: 0x011fc66f, size: 77 bytes, params: 1, frame: 17
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
if (value.reduce(this._guildStates, function(a0, a1) {
|
|
return a1.requestUnacknowledged() !== false || a0;
|
|
}, false)) {
|
|
this._flush.delay();
|
|
}
|
|
}
|
|
|
|
function value_49545(a0) { // fn#49545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:1955, offset: 0x011fc6da, size: 73 bytes, params: 2, frame: 15
|
|
var r0;
|
|
var value;
|
|
var binding;
|
|
var _guildMemberExists;
|
|
var binding2;
|
|
let _guildStates = this._guildStates;
|
|
const property = _guildStates[a0];
|
|
if (property != null) {
|
|
r0 = property;
|
|
} else {
|
|
_guildStates = this._guildStates;
|
|
value = environment.__proto__;
|
|
binding = env1_5;
|
|
_guildMemberExists = this._guildMemberExists;
|
|
binding2 = new binding(a0);
|
|
_guildStates[a0] = binding2;
|
|
r0 = binding2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_49546(a0) { // fn#49546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:2099, offset: 0x011fc723, size: 108 bytes, params: 2, frame: 16
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
value.forEach(this._guildStates, _fun49547);
|
|
return {pendingRequestGuildIds: [], unacknowledgedRequestGuildIds: [], sentRequestGuildIds: []};
|
|
}
|
|
|
|
function _guildMemberExists(a0) { // fn#49528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:343, owner: GuildMemberRequestState._guildMemberExists, offset: 0x011fc27c, size: 24 bytes, params: 2, frame: 13
|
|
return require(env0_0, a0);
|
|
}
|
|
|
|
function _fun49531(a0) { // fn#49531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:580, offset: 0x011fc323, size: 78 bytes, params: 2, frame: 13
|
|
let binding = env0_0;
|
|
if (!binding._guildMemberExists(a0)) {
|
|
binding = env0_0;
|
|
binding._unacknowledgedRequests.add(a0);
|
|
binding._sentRequests.add(a0);
|
|
binding = env0_1;
|
|
binding.push(a0);
|
|
}
|
|
}
|
|
|
|
function _fun49533(a0) { // fn#49533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:884, offset: 0x011fc3bc, size: 66 bytes, params: 2, frame: 12
|
|
let binding = env0_0;
|
|
const value2 = binding._guildMemberExists(a0);
|
|
binding = env0_0;
|
|
if (value2) {
|
|
binding._unacknowledgedRequests.delete(a0);
|
|
} else {
|
|
binding._pendingRequests.add(a0);
|
|
}
|
|
}
|
|
|
|
function _fun49537() { // fn#49537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:1341, offset: 0x011fc589, size: 19 bytes, params: 1, frame: 9
|
|
return env0_0.flushRequests();
|
|
}
|
|
|
|
function _fun49542(a0) { // fn#49542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:1739, offset: 0x011fc652, size: 29 bytes, params: 2, frame: 11
|
|
return a0.flushRequests(env0_0._onChange);
|
|
}
|
|
|
|
function _fun49547(a0) { // fn#49547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6448:2172, offset: 0x011fc78f, size: 139 bytes, params: 2, frame: 13
|
|
var binding;
|
|
const _pendingRequests = a0._pendingRequests;
|
|
if (_pendingRequests.has(env0_0)) {
|
|
binding = env0_1;
|
|
binding.push(a0._guildId);
|
|
}
|
|
const _unacknowledgedRequests = a0._unacknowledgedRequests;
|
|
if (_unacknowledgedRequests.has(env0_0)) {
|
|
binding = env0_2;
|
|
binding.push(a0._guildId);
|
|
}
|
|
const _sentRequests = a0._sentRequests;
|
|
if (_sentRequests.has(env0_0)) {
|
|
binding = env0_3;
|
|
binding.push(a0._guildId);
|
|
}
|
|
}
|
|
|