Files
discord-decomp/sources/modules/channel/VoiceChannelStartTimeStore.tsx
2026-07-28 01:06:53 +03:00

275 lines
12 KiB
TypeScript

/* Metro module 9858; source: modules/channel/VoiceChannelStartTimeStore.tsx; dependencies: [6, 7, 15, 17, 18, 4257, 672, 677, 566, 694, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */
import GatewayConnectionStore from '../gateway/GatewayConnectionStore.tsx'; /* Metro dependency 4257 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun77281(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:6, offset: 0x01df81c3, size: 422 bytes, params: 8, frame: 22
const env0_0 = require;
const _arrayLikeToArray_77287 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const CONNECTION_RESUMED_772892 = CONNECTION_RESUMED_77289;
const GUILD_CREATE_772902 = GUILD_CREATE_77290;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const Set = global.Set;
let set = new Set();
const env0_10 = {};
const Store = (Flux).Store;
_fun77291(Store).displayName = 'VoiceChannelStartTimeStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {GUILD_CREATE: GUILD_CREATE_772902,
GUILD_DELETE: GUILD_CREATE_772902, CONNECTION_RESUMED: CONNECTION_RESUMED_772892,
CONNECTION_OPEN: CONNECTION_RESUMED_772892, VOICE_CHANNEL_START_TIME_UPDATE: VOICE_CHANNEL_START_TIME_UPDATE,
CHANNEL_INFO: CHANNEL_INFO_77297, FETCH_CHANNEL_INFO: FETCH_CHANNEL_INFO_77298});
(FileImportTrackerModule).fileFinishedImporting('modules/channel/VoiceChannelStartTimeStore.tsx');
exports.default = set;
function _isNativeReflectConstruct_77282() { // fn#77282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:160, offset: 0x01df8369, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_77282_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_77285(a0, a1) { // fn#77285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:353, offset: 0x01df83cb, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun77286;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_77287(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_77287(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_77287(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun77286;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun77286() { // fn#77286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:924, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function _toTimestampMs(a0) { // fn#77288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1282, offset: 0x01df853f, size: 84 bytes, params: 2, frame: 12
const Date = global.Date;
const Millis = (Durations).Millis;
const SECOND = Millis.SECOND;
const value = a0 * SECOND;
const value2 = Object.create(Date.prototype, {constructor: {value: Date}});
const date = new Date();
return (date instanceof Object ? date : value2).getTime();
}
function CONNECTION_OPEN_77289() { // fn#77289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1360, offset: 0x01df8593, size: 21 bytes, params: 1, frame: 9
env0_9.clear();
}
function GUILD_CREATE_77290({guild}) { // fn#77290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1403, offset: 0x01df85a8, size: 34 bytes, params: 2, frame: 11
env0_9.delete(guild.id);
}
function _fun77291(a0) { // fn#77291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1459, offset: 0x01df85ca, size: 122 bytes, params: 2, frame: 16
const VoiceChannelStartTimeStore2 = VoiceChannelStartTimeStore;
Inherits(VoiceChannelStartTimeStore2, a0);
return CreateClass(VoiceChannelStartTimeStore2, [{key: 'initialize', value: function() {
this.waitFor(GatewayConnectionStore);
}}, {key: 'getStartTime', value: value_77294}, {key: 'hasRequestedStartTimes', value: value_77295}]);
function VoiceChannelStartTimeStore() { // fn#77292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1471, offset: 0x0102b796, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_3(this, VoiceChannelStartTimeStore);
const value3 = env1_6(VoiceChannelStartTimeStore);
return env1_5(this, _isNativeReflectConstruct_77282() ? global.Reflect.construct(value3, arguments,
env1_6(this).constructor) : value3.apply(this, arguments));
}
function value_77294(a0) { // fn#77294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1874, offset: 0x01df8644, size: 101 bytes, params: 2, frame: 15
var property;
if (a0 != null) {
if (a0.guild_id == null) {
return undefined;
}
var type = a0.type;
var value2 = undefined;
var ChannelTypes = (require(677) /* metro dependency 677: ChannelTypes */).ChannelTypes;
var GUILD_VOICE = ChannelTypes.GUILD_VOICE;
if (type === GUILD_VOICE) {
property = env1_10[a0.guild_id];
return property == null ? value2 : property[a0.id];
}
}
}
function value_77295(a0) { // fn#77295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:2049, offset: 0x0119ac41, size: 22 bytes, params: 2, frame: 11
return env1_9.has(a0);
}
}
function VOICE_CHANNEL_START_TIME_UPDATE({guildId, id, voiceStartTime}) { // fn#77296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:2332, offset: 0x01df86a9, size: 80 bytes, params: 2, frame: 15
if (env0_10[guildId] == null) {
env0_10[guildId] = {};
}
env0_10[guildId][id] = voiceStartTime != null ? _toTimestampMs(voiceStartTime) : undefined;
}
function CHANNEL_INFO_77297({guildId, channels}) { // fn#77297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:2487, offset: 0x01df86f9, size: 115 bytes, params: 2, frame: 19
var r2;
var r1;
var value5;
var id;
var voiceStartTime;
var property;
var value6;
var value7;
env0_10[guildId] = {};
const value3 = _createForOfIteratorHelperLoose_77285(channels);
const value4 = value3();
let done = value4.done;
if (!done) {
r2 = value4;
while (true) {
value5 = r2.value;
id = value5.id;
voiceStartTime = value5.voiceStartTime;
property = env0_10[guildId];
if (voiceStartTime != null) {
value6 = _toTimestampMs(voiceStartTime);
r1 = value6;
} else {
r1 = undefined;
}
property[id] = r1;
value7 = value3();
done = value7.done;
if (done) {
break;
}
r2 = value7;
continue;
}
}
}
function FETCH_CHANNEL_INFO_77298({guildId}) { // fn#77298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:2710, offset: 0x01df876c, size: 29 bytes, params: 2, frame: 11
env0_9.add(guildId);
}
}
global.__d(_fun77281, 9858, [6, 7, 15, 17, 18, 4257, 672, 677, 566, 694,
2]) /* metro module 9858, dependencies: [6, 7, 15, 17, 18, 4257, 672, 677, 566, 694, 2] */;