240 lines
10 KiB
TypeScript
240 lines
10 KiB
TypeScript
/* Metro module 9706; source: modules/self_mod/ChannelSafetyWarningsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 672, 566, 694, 2] */
|
|
function _fun76269(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:6, offset: 0x01dc8f05, size: 557 bytes, params: 8, frame: 24
|
|
var object3;
|
|
const closure = CONNECTION_OPEN_76275;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_0 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_1 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_2 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_3 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_4 = importDefault(18) /* metro dependency 18 */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const SECOND = Millis.SECOND;
|
|
const env0_6 = 5 * SECOND;
|
|
object3 = {STRANGER_DANGER: 1};
|
|
object3[1] = 'STRANGER_DANGER';
|
|
object3.INAPPROPRIATE_CONVERSATION_TIER_1 = 2;
|
|
object3[2] = 'INAPPROPRIATE_CONVERSATION_TIER_1';
|
|
object3.INAPPROPRIATE_CONVERSATION_TIER_2 = 3;
|
|
object3[3] = 'INAPPROPRIATE_CONVERSATION_TIER_2';
|
|
object3.LIKELY_ATO = 4;
|
|
object3[4] = 'LIKELY_ATO';
|
|
const object4 = {UPVOTE: 0};
|
|
object4[0] = 'UPVOTE';
|
|
object4.DOWNVOTE = 1;
|
|
object4[1] = 'DOWNVOTE';
|
|
const env0_8 = [];
|
|
const env0_9 = {};
|
|
const Set = global.Set;
|
|
let set = new Set();
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
set = _fun76277(Store);
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CHANNEL_CREATE: function(a0) {
|
|
processChannel_76273(a0.channel);
|
|
}, CHANNEL_DELETE: CHANNEL_DELETE_76285, CHANNEL_UPDATES: function({channels}) {
|
|
channels.forEach(_fun76287);
|
|
}, CONNECTION_OPEN: closure, CONNECTION_OPEN_SUPPLEMENTAL: closure,
|
|
CHANNEL_SAFETY_WARNING_FEEDBACK: CHANNEL_SAFETY_WARNING_FEEDBACK,
|
|
CLEAR_CHANNEL_SAFETY_WARNINGS: CLEAR_CHANNEL_SAFETY_WARNINGS,
|
|
DISMISS_CHANNEL_SAFETY_WARNINGS: DISMISS_CHANNEL_SAFETY_WARNINGS,
|
|
ACKNOWLEDGE_CHANNEL_SAFETY_WARNING_TOOLTIP: ACKNOWLEDGE_CHANNEL_SAFETY_WARNING_TOOLTIP});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/self_mod/ChannelSafetyWarningsStore.tsx');
|
|
exports.default = set;
|
|
exports.SafetyWarningTypes = object3;
|
|
exports.SafetyWarningFeedbackTypes = object4;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_76270() { // fn#76270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:158, offset: 0x01dc9132, 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_76270_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function processChannel_76273(a0) { // fn#76273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:733, offset: 0x01dc9194, size: 150 bytes, params: 2, frame: 14
|
|
var binding;
|
|
var id;
|
|
var value2;
|
|
const safetyWarnings = a0.safetyWarnings;
|
|
if (safetyWarnings != null) {
|
|
binding = env0_9;
|
|
binding[a0.id] = safetyWarnings;
|
|
value2 = safetyWarnings.some(_fun76274);
|
|
binding = env0_10;
|
|
if (value2) {
|
|
binding.add(a0.id);
|
|
} else {
|
|
binding.delete(a0.id);
|
|
}
|
|
}
|
|
if (safetyWarnings == null) {
|
|
binding = env0_9;
|
|
id = a0.id;
|
|
if (binding[id] != null) {
|
|
delete env0_9[a0.id];
|
|
}
|
|
binding = env0_10;
|
|
id = a0.id;
|
|
binding.delete(id);
|
|
}
|
|
}
|
|
|
|
function CONNECTION_OPEN_76275() { // fn#76275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1172, offset: 0x01dc92b7, size: 64 bytes, params: 1, frame: 12
|
|
env0_9 = {};
|
|
const Object = global.Object;
|
|
const values = Object.values;
|
|
const getMutablePrivateChannels = ChannelStore.getMutablePrivateChannels;
|
|
Reflect.apply(values, Object, [Reflect.apply(getMutablePrivateChannels, ChannelStore, [])]).forEach(function(a0) {
|
|
processChannel_76273(a0);
|
|
});
|
|
}
|
|
|
|
function _fun76277(a0) { // fn#76277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1294, offset: 0x01dc930a, size: 149 bytes, params: 2, frame: 16
|
|
const closure = ChannelSafetyWarningsStore;
|
|
env0_4(closure, a0);
|
|
return env0_1(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(ChannelStore);
|
|
}}, {key: 'getChannelSafetyWarning', value: value_76280}, {key: 'getChannelSafetyWarnings', value: value_76282},
|
|
{key: 'hasShownInitialTooltipForChannel', value: value_76283}]);
|
|
}
|
|
|
|
function CHANNEL_DELETE_76285({channel}) { // fn#76285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2077, offset: 0x01dc93ed, size: 66 bytes, params: 2, frame: 12
|
|
if (env0_9[channel.id] != null) {
|
|
delete env0_9[channel.id];
|
|
}
|
|
env0_10.delete(channel.id);
|
|
}
|
|
|
|
function CHANNEL_UPDATES_76286({channels}) { // fn#76286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2187, offset: 0x01dc942f, size: 32 bytes, params: 2, frame: 11
|
|
channels.forEach(function(a0) {
|
|
processChannel_76273(a0);
|
|
});
|
|
}
|
|
|
|
function CHANNEL_SAFETY_WARNING_FEEDBACK({channelId, warningId, feedbackType}) { // fn#76288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2385, offset: 0x01dc944f, size: 76 bytes, params: 2, frame: 13
|
|
const property = env0_9[channelId];
|
|
if (property != null) {
|
|
env0_9[channelId] = property.map(function(a0) {
|
|
var r0;
|
|
var object;
|
|
var value = a0;
|
|
var id = value.id;
|
|
if (id !== warningId) {
|
|
r0 = value;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, value, id);
|
|
object['feedback_type'] = feedbackType;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
});
|
|
}
|
|
}
|
|
|
|
function CLEAR_CHANNEL_SAFETY_WARNINGS({channelId}) { // fn#76290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2575, offset: 0x01dc94cf, size: 70 bytes, params: 2, frame: 13
|
|
const property = env0_9[channelId];
|
|
env0_10.delete(channelId);
|
|
if (property != null) {
|
|
env0_9[channelId] = property.map(function(a0) {
|
|
var r2;
|
|
var object = {};
|
|
copyDataProperties(object, a0, r2);
|
|
object['dismiss_timestamp'] = undefined;
|
|
return object;
|
|
});
|
|
}
|
|
}
|
|
|
|
function DISMISS_CHANNEL_SAFETY_WARNINGS({channelId, warningIds}) { // fn#76292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2750, offset: 0x01dc952e, size: 112 bytes, params: 2, frame: 15
|
|
var Date;
|
|
var value2;
|
|
var date;
|
|
var env0_1;
|
|
const property = env0_9[channelId];
|
|
if (property != null) {
|
|
Date = global.Date;
|
|
value2 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
env0_1 = (date instanceof Object ? date : value2).toISOString();
|
|
env0_9[channelId] = property.map(_fun76293);
|
|
}
|
|
}
|
|
|
|
function ACKNOWLEDGE_CHANNEL_SAFETY_WARNING_TOOLTIP({channelId}) { // fn#76294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2984, offset: 0x01dc95db, size: 29 bytes, params: 2, frame: 11
|
|
env0_10.add(channelId);
|
|
}
|
|
|
|
function _fun76274(a0) { // fn#76274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:811, offset: 0x01dc922a, size: 141 bytes, params: 2, frame: 14
|
|
var dismiss_timestamp;
|
|
var Date;
|
|
var value5;
|
|
var date;
|
|
var time;
|
|
const type = a0.type;
|
|
const value = environment.__proto__;
|
|
const INAPPROPRIATE_CONVERSATION_TIER_1 = env1_7.INAPPROPRIATE_CONVERSATION_TIER_1;
|
|
let r0 = (type === INAPPROPRIATE_CONVERSATION_TIER_1 || a0.type === env1_7.INAPPROPRIATE_CONVERSATION_TIER_2) && a0.dismiss_timestamp != null;
|
|
if (r0) {
|
|
dismiss_timestamp = a0.dismiss_timestamp;
|
|
Date = global.Date;
|
|
value5 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
time = (date instanceof Object ? date : value5).getTime();
|
|
Date = global.Date;
|
|
r0 = !(time > Date.now() - env1_6);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_76280(a0, a1) { // fn#76280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1720, offset: 0x01dc939f, size: 54 bytes, params: 3, frame: 12
|
|
var environment;
|
|
const env0_0 = a1;
|
|
const value = environment.__proto__;
|
|
return env1_9[a0]?.find(function({id}) {
|
|
return id === require;
|
|
});
|
|
}
|
|
|
|
function _fun76293(a0) { // fn#76293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2888, offset: 0x01dc959e, size: 61 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var object2;
|
|
const value = a0;
|
|
const warningIdsBinding = warningIds;
|
|
if (warningIdsBinding.includes(value.id)) {
|
|
object2 = {};
|
|
copyDataProperties(object2, value, warningIdsBinding);
|
|
object2['dismiss_timestamp'] = env0_1;
|
|
r0 = object2;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|