138 lines
5.3 KiB
TypeScript
138 lines
5.3 KiB
TypeScript
/* Metro module 3787; source: lib/MuteTimers.tsx; dependencies: [6, 7, 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 * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun28791(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#28791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3914:6, offset: 0x00f8288a, size: 146 bytes, params: 8, frame: 18
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = _fun28792();
|
|
(FileImportTrackerModule).fileFinishedImporting('lib/MuteTimers.tsx');
|
|
exports.default = value;
|
|
exports.computeIsMuted = function({muted, mute_config}) {
|
|
var r1;
|
|
var r0;
|
|
var end_time;
|
|
var value2;
|
|
var value3;
|
|
var value4;
|
|
if (muted) {
|
|
r1 = mute_config == null || mute_config.end_time == null;
|
|
if (!r1) {
|
|
muted = global.Date;
|
|
end_time = mute_config.end_time;
|
|
value2 = new muted();
|
|
muted = global.Date;
|
|
value3 = Object.create(muted.prototype, {constructor: {value: muted}});
|
|
value4 = new muted();
|
|
value2 = value2 >= (value4 instanceof Object ? value4 : value3);
|
|
r1 = value2;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = !!muted;
|
|
}
|
|
return r0;
|
|
};
|
|
exports.isTemporarilyMuted = function({muted, mute_config}) {
|
|
var r0;
|
|
var end_time;
|
|
var value2;
|
|
var value3;
|
|
var value4;
|
|
r0 = (muted ? mute_config != null : !!muted) && mute_config.end_time != null;
|
|
if (r0) {
|
|
muted = global.Date;
|
|
end_time = mute_config.end_time;
|
|
value2 = new muted();
|
|
muted = global.Date;
|
|
value3 = Object.create(muted.prototype, {constructor: {value: muted}});
|
|
value4 = new muted();
|
|
value2 = value2 >= (value4 instanceof Object ? value4 : value3);
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
};
|
|
function _fun28792() { // fn#28792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3914:122, offset: 0x00f8291c, size: 101 bytes, params: 1, frame: 15
|
|
return CreateClass(MuteTimers, [{key: 'reset', value: function() {
|
|
var Object = global.Object;
|
|
Object.values(this.timers).forEach(_fun28795);
|
|
this.timers = {};
|
|
}}, {key: 'setTimer', value: value_28796}, {key: 'clearTimer', value: function(a0) {
|
|
if (a0 != null && a0 in this.timers) {
|
|
global.clearTimeout(this.timers[a0]);
|
|
delete this.timers[a0];
|
|
}
|
|
}}]);
|
|
function MuteTimers() { // fn#28793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3914:143, offset: 0x00f82981, size: 35 bytes, params: 1, frame: 13
|
|
env1_0(this, MuteTimers);
|
|
this.timers = {};
|
|
}
|
|
|
|
function value_28794() { // fn#28794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3914:221, offset: 0x00f829a4, size: 56 bytes, params: 1, frame: 12
|
|
const Object = global.Object;
|
|
Object.values(this.timers).forEach(function(a0) {
|
|
return (0, global.clearTimeout)(a0);
|
|
});
|
|
this.timers = {};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun28795(a0) { // fn#28795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3914:268, offset: 0x00dc9fae, size: 20 bytes, params: 2, frame: 11
|
|
return global.clearTimeout(a0);
|
|
}
|
|
|
|
function value_28796(a0, a1, a2) { // fn#28796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3914:328, offset: 0x00f829dc, size: 180 bytes, params: 4, frame: 18
|
|
var r8;
|
|
var r1;
|
|
var r0;
|
|
var Date;
|
|
var value2;
|
|
var date;
|
|
var time;
|
|
var timers;
|
|
var setTimeout;
|
|
let value = null;
|
|
if (value == a0) {
|
|
return false;
|
|
}
|
|
if (value == a1) {
|
|
return false;
|
|
}
|
|
let end_time = a1.end_time;
|
|
if (value == end_time) {
|
|
r8 = value;
|
|
} else {
|
|
Date = global.Date;
|
|
end_time = a1.end_time;
|
|
value2 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date(end_time);
|
|
time = (date instanceof Object ? date : value2).getTime();
|
|
Date = global.Date;
|
|
r8 = time - Date.now();
|
|
}
|
|
value = value != r8;
|
|
if (value) {
|
|
value = r8 <= 0;
|
|
if (value) {
|
|
r1 = value;
|
|
} else {
|
|
timers = this.timers;
|
|
setTimeout = global.setTimeout;
|
|
value = global.Math.max(0, r8);
|
|
timers[a0] = setTimeout(a2, value);
|
|
value = false;
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
global.__d(_fun28791, 3787, [6, 7, 2]) /* metro module 3787, dependencies: [6, 7, 2] */;
|