Files
2026-07-28 01:06:53 +03:00

833 lines
42 KiB
TypeScript

/* Metro module 9865; source: modules/summaries/SummaryStore.tsx; dependencies: [57, 153, 6, 7, 15, 17, 18, 4107, 7233, 1379, 1867, 4605, 1934, 4864, 1878, 9866, 7234, 21, 672, 9867, 566, 694, 9868, 22, 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 SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import Module00022 from '../../by-id/module-00022.js'; /* Metro dependency 22 */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import Module00153 from '../../by-id/module-00153.js'; /* Metro dependency 153 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import ExperimentStore from '../experiments/ExperimentStore.tsx'; /* Metro dependency 4107 */
import ReadStateStore from '../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
import UserGuildSettingsStore from '../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
import QuickSwitcherStore from '../quickswitcher/QuickSwitcherStore.tsx'; /* Metro dependency 7233 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module00022Module from '../../by-id/module-00022.js'; /* Metro dependency 22 */
import * as AutocompleterModule from '../autocompleter/index.tsx'; /* Metro dependency 7234 */
import * as SummaryConstantsModule from './SummaryConstants.tsx'; /* Metro dependency 9866 */
import * as ChannelSummariesExperimentModule from '../../experiments/ChannelSummariesExperiment.tsx'; /* Metro dependency 9867 */
import * as SummaryModule from './Summary.tsx'; /* Metro dependency 9868 */
function _fun77360(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6, offset: 0x01dfa2a7, size: 816 bytes, params: 8, frame: 19
const env0_0 = require;
const handleQuickSwitcherUpdate = function() {
env0_29 = QuickSwitcherStore.getProps().results.filter(_fun77365).map(_fun77366);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
Module00153;
let env0_23 = {};
let env0_24 = {};
const env0_25 = {};
const env0_26 = [];
const env0_27 = {};
const object2 = {'status': null, 'lastRequest': null, 'lastResponse': null};
const OK = ({FETCHING: 'fetching', OK: 'ok', ERROR: 'error'}).OK;
object2.status = OK;
let env0_29 = [];
const env0_30 = [];
const PersistedStore = (Flux).PersistedStore;
let value = _fun77367(PersistedStore);
value.persistKey = 'SummaryStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
return false;
}, CHANNEL_SELECT: CHANNEL_SELECT_77394, TOGGLE_TOPICS_BAR: TOGGLE_TOPICS_BAR,
RECEIVE_CHANNEL_SUMMARY: RECEIVE_CHANNEL_SUMMARY, REQUEST_CHANNEL_SUMMARY: REQUEST_CHANNEL_SUMMARY,
RECEIVE_CHANNEL_SUMMARIES: RECEIVE_CHANNEL_SUMMARIES, REQUEST_CHANNEL_SUMMARIES: REQUEST_CHANNEL_SUMMARIES,
SET_HIGHLIGHTED_SUMMARY: SET_HIGHLIGHTED_SUMMARY, UPDATE_VISIBLE_MESSAGES: UPDATE_VISIBLE_MESSAGES,
SET_SELECTED_SUMMARY: SET_SELECTED_SUMMARY, SET_SUMMARY_FEEDBACK: SET_SUMMARY_FEEDBACK,
REQUEST_CHANNEL_AFFINITIES: REQUEST_CHANNEL_AFFINITIES, RECEIVE_CHANNEL_AFFINITIES: RECEIVE_CHANNEL_AFFINITIES,
REQUEST_CHANNEL_SUMMARIES_BULK: REQUEST_CHANNEL_SUMMARIES_BULK,
RECEIVE_CHANNEL_SUMMARIES_BULK: RECEIVE_CHANNEL_SUMMARIES_BULK,
CONVERSATION_SUMMARY_UPDATE: CONVERSATION_SUMMARY_UPDATE, CLEAR_CONVERSATION_SUMMARIES: function() {
env0_23 = {};
env0_24 = {};
}, DELETE_SUMMARY: DELETE_SUMMARY});
(FileImportTrackerModule).fileFinishedImporting('modules/summaries/SummaryStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_77361() { // fn#77361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:287, offset: 0x01dfa5d7, 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_77361_isNativeReflectConstruct = function() {
return !!result;
})();
}
function handleQuickSwitcherUpdate() { // fn#77364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:657, offset: 0x01dfa639, size: 67 bytes, params: 1, frame: 13
const quickSwitcherStoreBinding = QuickSwitcherStore;
const getProps = quickSwitcherStoreBinding.getProps;
env0_29 = Reflect.apply(getProps, quickSwitcherStoreBinding, []).results.filter(_fun77365).map(function(a0) {
return a0.record.id;
});
function _fun77365(a0) { // fn#77365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:725, offset: 0x01dfa67c, size: 71 bytes, params: 2, frame: 13
const type = a0.type;
const value = environment.__proto__;
const AutocompleterResultTypes = (AutocompleterModule).AutocompleterResultTypes;
const TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
return type === TEXT_CHANNEL && a0.record.type === 0;
}
}
function _fun77367(a0) { // fn#77367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:833, offset: 0x01dfa6d3, size: 513 bytes, params: 2, frame: 16
const SummaryStore2 = SummaryStore;
Inherits(SummaryStore2, a0);
return CreateClass(SummaryStore2, [{key: 'getState', value: value_77369}, {key: 'initialize', value: function(a0) {
var r1;
var value = undefined;
r1 = a0 == null ? value : a0.shouldShowTopicsBar;
env1_18 = r1 == null || r1;
this.waitFor(ChannelStore, ExperimentStore, GuildStore, QuickSwitcherStore, ReadStateStore,
SelectedChannelStore,
UserGuildSettingsStore, UserStore);
this.syncWith([QuickSwitcherStore], handleQuickSwitcherUpdate);
return value;
}}, {key: 'allSummaries', value: value_77371}, {key: 'topSummaries', value: value_77372}, {key: 'summaries',
value: value_77375}, {key: 'shouldShowTopicsBar', value: value_77376}, {key: 'findSummary', value: function(a0,
a1) {
var env0_0 = a1;
var value = this.summaries(a0);
value = value.find(_fun77378);
var value2 = null;
return value2 != value ? value : value2;
}}, {key: 'selectedSummary', value: value_77379}, {key: 'summaryFeedback', value: value_77380}, {key: 'isFetching',
value: value_77381}, {key: 'status', value: value_77382}, {key: 'shouldFetch', value: value_77383},
{key: 'channelAffinities', value: value_77384}, {key: 'channelAffinitiesById', value: value_77385},
{key: 'channelAffinitiesStatus', value: value_77386}, {key: 'shouldFetchChannelAffinities', value: value_77387},
{key: 'defaultChannelIds', value: value_77388}, {key: 'visibleSummaryIndex', value: value_77392}]);
function SummaryStore() { // fn#77368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:845, offset: 0x01dfa8d4, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_4(this, SummaryStore);
const value3 = env1_7(SummaryStore);
return env1_6(this, _isNativeReflectConstruct_77361() ? global.Reflect.construct(value3, arguments,
env1_7(this).constructor) : value3.apply(this, arguments));
}
function value_77369() { // fn#77369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1121, offset: 0x01dfa945, size: 16 bytes, params: 1, frame: 2
return {shouldShowTopicsBar: env1_18};
}
function value_77371() { // fn#77371, offset: 0x00df3ac4, size: 9 bytes, params: 1, frame: 1
return env1_23;
}
function value_77372() { // fn#77372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1409, offset: 0x01dfa9ca, size: 74 bytes, params: 1, frame: 12
var environment;
const Object = global.Object;
const values = Object.values;
let value = environment.__proto__;
value = Reflect.apply(values, Object, [env1_23]);
value = value.flat();
value = value.filter(_fun77373);
return value.sort(_fun77374);
function _fun77373(a0) { // fn#77373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1482, offset: 0x01dfaa14, size: 145 bytes, params: 2, frame: 15
var r0;
var Date;
var value2;
var date;
let value = a0.people.length > 1;
if (value) {
value = environment.__proto__.__proto__;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.extractTimestamp(a0.endId);
Date = global.Date;
value2 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
value = value > (date instanceof Object ? date : value2).getTime() - 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.HOUR;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun77374({endId}, {endId}) { // fn#77374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1591, offset: 0x01dfaaa5, size: 80 bytes, params: 3, frame: 15
let value = environment.__proto__.__proto__;
value = Reflect.apply((importDefault(21) /* metro dependency 21: SnowflakeUtils */).extractTimestamp, value,
[endId]);
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
return value - defaultImport.extractTimestamp(endId);
}
}
function value_77375(a0) { // fn#77375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1715, offset: 0x01dfaaf5, size: 26 bytes, params: 2, frame: 3
return env1_23[a0] ?? env1_30;
}
function value_77376() { // fn#77376, offset: 0x00df0e82, size: 9 bytes, params: 1, frame: 1
return env1_18;
}
function value_77377(a0, a1) { // fn#77377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1841, offset: 0x01dfab0f, size: 58 bytes, params: 3, frame: 12
const env0_0 = a1;
let value = this.summaries(a0);
value = value.find(function({id}) {
return id === require;
});
const value2 = null;
return value2 != value ? value : value2;
function _fun77378({id}) { // fn#77378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1901, offset: 0x00db0c48, size: 21 bytes, params: 2, frame: 2
return id === require;
}
}
function value_77379(a0) { // fn#77379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:1954, offset: 0x01dfab49, size: 91 bytes, params: 2, frame: 16
var r0;
var findSummary;
var binding;
let value = environment.__proto__;
const value2 = null;
if (value2 != env1_21) {
if (env1_21.channelId !== a0) {
r0 = value2;
} else if (value2 != env1_21.summaryId) {
findSummary = this.findSummary;
binding = env1_21;
value = undefined;
value = Reflect.apply(findSummary, this, [a0, value2 == binding ? value : binding.summaryId]);
r0 = value;
} else {
r0 = value2;
}
} else {
r0 = value2;
}
return r0;
}
function value_77380(a0) { // fn#77380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:2110, offset: 0x01dfaba4, size: 30 bytes, params: 2, frame: 3
const value = null;
return value == a0 ? value : env1_25[a0.id];
}
function value_77381(a0, a1) { // fn#77381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:2176, offset: 0x01dfabc2, size: 78 bytes, params: 3, frame: 6
var r0;
var value;
var property;
if (a1 != null) {
value = environment.__proto__;
property = env1_24[a0];
value = undefined;
value = (property == null ? value : property.summaryId) === a1;
r0 = value;
} else {
value = environment.__proto__;
property = env1_24[a0];
value = undefined;
value = (property == null ? value : property.fetching) === true;
r0 = value;
}
return r0;
}
function value_77382(a0) { // fn#77382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:2315, offset: 0x01dfac10, size: 16 bytes, params: 2, frame: 2
return env1_24[a0];
}
function value_77383(a0, a1) { // fn#77383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:2366, offset: 0x01dfac20, size: 228 bytes, params: 3, frame: 18
var lastReceivedAt;
var r6;
var Date;
let value = environment.__proto__;
const property = env1_24[a0];
const channel = ChannelStore.getChannel(a0);
const value3 = undefined;
if (ChannelSummariesExperimentModule.canSeeChannelSummaries(channel)) {
if (a1 != null) {
r6 = (property == null ? value3 : property.summaryIdLastRequestedAt) ?? 0;
Date = global.Date;
return a1 !== (property == null ? value3 : property.summaryId) || Date.now() - r6 > SUMMARY_POLL_INTERVAL;
}
lastReceivedAt = property == null ? value3 : property.lastReceivedAt;
value = 0;
r6 = lastReceivedAt ?? value;
return !global.Boolean(property == null ? value3 : property.fetching) && value === r6;
}
return false;
}
function value_77384() { // fn#77384, offset: 0x00df3adf, size: 9 bytes, params: 1, frame: 1
return env1_26;
}
function value_77385() { // fn#77385, offset: 0x00df3b32, size: 9 bytes, params: 1, frame: 1
return env1_27;
}
function value_77386() { // fn#77386, offset: 0x0108042c, size: 9 bytes, params: 1, frame: 1
return env1_28;
}
function value_77387() { // fn#77387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:2909, offset: 0x01dfad04, size: 129 bytes, params: 1, frame: 14
const value = environment.__proto__;
const status = env1_28.status;
const FETCHING = env1_22.FETCHING;
return status !== FETCHING && !(env1_28.lastResponse != null && global.Date.now() - env1_28.lastResponse < 30 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND);
}
function value_77388({withQuickSwitcher, withChannelAffinities, withUnreads, numChannels}) { // fn#77388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:3060, offset: 0x01dfad85, size: 162 bytes, params: 2, frame: 18
var environment;
var r6;
var r5;
var value;
var concat;
var binding;
numChannels = numChannels === undefined ? 25 : numChannels;
const items2 = [];
if (withQuickSwitcher) {
concat = items2.concat;
value = environment.__proto__;
value = Reflect.apply(concat, items2, [env1_29]);
r6 = value;
} else {
r6 = items2;
}
if (withChannelAffinities) {
concat = r6.concat;
value = environment.__proto__;
binding = env1_26;
value = Reflect.apply(concat, r6, [binding.map(function(a0) {
return a0.channel_id;
})]);
r5 = value;
} else {
r5 = r6;
}
return (withUnreads ? r5.filter(_fun77390) : r5).filter(_fun77391).slice(0, numChannels);
function _fun77390(a0) { // fn#77390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:3240, offset: 0x01dfae27, size: 73 bytes, params: 2, frame: 15
const value = environment.__proto__.__proto__;
const channel = ChannelStore.getChannel(a0);
return channel != null && !UserGuildSettingsStore.isChannelMuted(channel.guild_id,
a0) && ReadStateStore.hasUnread(a0);
}
function _fun77391(a0) { // fn#77391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:3347, offset: 0x01dfae70, size: 59 bytes, params: 2, frame: 14
const value = environment.__proto__.__proto__;
return (ChannelSummariesExperimentModule).canSeeChannelSummaries(ChannelStore.getChannel(a0),
false, false);
}
}
function value_77392() { // fn#77392, offset: 0x00e4253a, size: 9 bytes, params: 1, frame: 1
return env1_20;
}
}
function CHANNEL_SELECT_77394({channelId}) { // fn#77394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:3594, offset: 0x01dfaeab, size: 43 bytes, params: 2, frame: 7
const channelId = env0_21?.channelId;
if (channelId === channelId) {
}
}
function TOGGLE_TOPICS_BAR() { // fn#77395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:3678, offset: 0x01dfaed6, size: 18 bytes, params: 1, frame: 2
result = !env0_18;
}
function RECEIVE_CHANNEL_SUMMARY({summary, channelId, error, receivedAt}) { // fn#77396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:3704, offset: 0x01dfaee8, size: 277 bytes, params: 2, frame: 22
var r12;
var r9;
var Object;
var length;
var value;
var summaryFromServer;
var object;
var index;
if (summary != null) {
Object = global.Object;
length = Object.keys(summary).length;
value = 0;
if (length > value) {
summaryFromServer = require(dependencyMap[22]).createSummaryFromServer(summary, channelId);
r9 = env0_23[channelId] ?? [];
object = [];
arraySpread(object, r9, value, dependencyMap);
index = object.findIndex(_fun77397);
if (index > -1) {
object[index] = summaryFromServer;
} else {
object.push(summaryFromServer);
}
env0_23[channelId] = object;
r12 = value;
}
}
object = {};
copyDataProperties(object, env0_24[channelId] ?? ({fetching: false}), r12);
object['summaryId'] = undefined;
object['summaryIdLastReceivedAt'] = receivedAt;
object['summaryIdError'] = error;
env0_24[channelId] = object;
function _fun77397({id}) { // fn#77397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:3905, offset: 0x01dfaffd, size: 41 bytes, params: 2, frame: 4
const id = env0_0?.id;
return id === id;
}
}
function REQUEST_CHANNEL_SUMMARY({channelId, summaryId, requestedAt}) { // fn#77398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4078, offset: 0x01dfb026, size: 89 bytes, params: 2, frame: 17
var r7;
var r3;
var value;
const binding = env0_24;
const object = {};
const property = binding[channelId];
if (property != null) {
r3 = property;
} else {
value = false;
r3 = {fetching: value};
r7 = value;
}
copyDataProperties(object, r3, r7);
object['summaryId'] = summaryId;
object['summaryIdLastRequestedAt'] = requestedAt;
binding[channelId] = object;
}
function RECEIVE_CHANNEL_SUMMARIES({summaries, channelId, error, receivedAt}) { // fn#77399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4230, offset: 0x01dfb07f, size: 285 bytes, params: 2, frame: 20
var value3;
let value = summaries.filter(function(a0) {
var property = global.Object;
property = property.keys(a0).length;
return property > 0;
});
value = value.map(_fun77401);
if (env0_21 != null) {
if (env0_21.channelId === channelId) {
if (!value.some(_fun77402)) {
value3 = (env0_23[channelId] ?? []).find(_fun77403);
if (value3 != null) {
value.push(value3);
}
}
}
}
const binding = env0_23;
const value4 = (Module00022Module).sortBy(value, _fun77404);
binding[channelId] = value4.reverse();
const object = {};
copyDataProperties(object, env0_24[channelId], value);
object['fetching'] = false;
object['error'] = undefined;
object['lastReceivedAt'] = receivedAt;
if (error != null) {
object.error = error;
}
env0_24[channelId] = object;
function _fun77401(a0) { // fn#77401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4354, offset: 0x01dfb1be, size: 49 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = require(9868) /* metro dependency 9868: Summary */;
return value.createSummaryFromServer(a0, channelId);
}
function _fun77402({id}) { // fn#77402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4435, offset: 0x01dfb1ef, size: 38 bytes, params: 2, frame: 4
const value = environment.__proto__;
return id === env1_21?.summaryId;
}
function _fun77403({id}) { // fn#77403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4532, offset: 0x01dfb1ef, size: 38 bytes, params: 2, frame: 4
const value = environment.__proto__;
return id === env1_21?.summaryId;
}
function _fun77404({startId}) { // fn#77404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4635, offset: 0x01dfb215, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (SnowflakeUtils).extractTimestamp(startId);
}
}
function REQUEST_CHANNEL_SUMMARIES(a0) { // fn#77405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4774, offset: 0x01dfb244, size: 84 bytes, params: 2, frame: 15
const binding = env0_24;
const channelId = a0.channelId;
const object = {};
copyDataProperties(object, env0_24[a0.channelId] ?? ({}), null);
object['fetching'] = true;
object['lastRequestedAt'] = a0.requestedAt;
binding[channelId] = object;
}
function SET_HIGHLIGHTED_SUMMARY(a0) { // fn#77406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:4902, offset: 0x01dfb298, size: 240 bytes, params: 2, frame: 17
var channelId;
var r4;
var channelId2;
var binding;
var value3;
var summaryId2;
var property;
var index;
const value2 = null;
if (value2 != env0_19) {
channelId2 = a0.channelId;
binding = env0_19;
value3 = undefined;
channelId = value2 == binding ? value3 : binding.channelId;
if (channelId2 !== channelId) {
r4 = value2 != a0.channelId ? {channelId: a0.channelId,
summaryId: value2 != a0.summaryId ? a0.summaryId : value2} : value2;
env0_19 = r4;
if (value2 != r4) {
if (env0_19.channelId === a0.channelId) {
if (value2 != env0_19.summaryId) {
property = env0_23[env0_19.channelId];
if (value2 != property) {
index = property.findIndex(_fun77407);
}
}
}
}
return value3;
}
summaryId2 = a0.summaryId;
binding = env0_19;
if (summaryId2 === (value2 == binding ? value3 : binding.summaryId)) {
return false;
}
channelId = a0.channelId;
r4 = value2 != channelId ? {channelId: a0.channelId,
summaryId: value2 != a0.summaryId ? a0.summaryId : value2} : value2;
} else {
if (value2 == a0.channelId) {
return false;
}
channelId2 = a0.channelId;
binding = env0_19;
value3 = undefined;
if (channelId2 !== (value2 == binding ? value3 : binding.channelId)) {
r4 = value2 != a0.channelId ? {channelId: a0.channelId,
summaryId: value2 != a0.summaryId ? a0.summaryId : value2} : value2;
env0_19 = r4;
if (value2 != r4) {
if (env0_19.channelId === a0.channelId) {
if (value2 != env0_19.summaryId) {
property = env0_23[env0_19.channelId];
if (value2 != property) {
index = property.findIndex(_fun77407);
}
}
}
}
return value3;
}
summaryId2 = a0.summaryId;
binding = env0_19;
if (summaryId2 === (value2 == binding ? value3 : binding.summaryId)) {
return false;
}
r4 = value2 != a0.channelId ? {channelId: a0.channelId,
summaryId: value2 != a0.summaryId ? a0.summaryId : value2} : value2;
}
env0_19 = r4;
if (value2 != r4) {
if (env0_19.channelId === a0.channelId) {
if (value2 != env0_19.summaryId) {
property = env0_23[env0_19.channelId];
if (value2 != property) {
index = property.findIndex(_fun77407);
}
}
}
}
return value3;
function _fun77407({id}) { // fn#77407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:5282, offset: 0x01dfb388, size: 38 bytes, params: 2, frame: 4
const value = environment.__proto__;
return id === env1_19?.summaryId;
}
}
function UPDATE_VISIBLE_MESSAGES(a0) { // fn#77408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:5344, offset: 0x01dfb3ae, size: 163 bytes, params: 2, frame: 15
var property;
var index;
var index2;
const env0_0 = a0;
const channelId = SelectedChannelStore.getChannelId();
if (channelId != null) {
if (env0_19 == null) {
property = env0_23[channelId];
if (property != null) {
index = property.findIndex(_fun77410);
}
} else if (env0_19.channelId !== channelId) {
property = env0_23[channelId];
if (property != null) {
index = property.findIndex(_fun77410);
}
} else if (env0_19.summaryId != null) {
property = env0_23[env0_19.channelId];
if (property != null) {
index2 = property.findIndex(_fun77409);
}
} else {
property = env0_23[channelId];
if (property != null) {
index = property.findIndex(_fun77410);
}
}
}
function _fun77409({id}) { // fn#77409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:5504, offset: 0x01dfb388, size: 38 bytes, params: 2, frame: 4
const value = environment.__proto__;
return id === env1_19?.summaryId;
}
function _fun77410({startId, endId}) { // fn#77410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:5612, offset: 0x01dfb451, size: 66 bytes, params: 2, frame: 7
const {topVisibleMessage, bottomVisibleMessage} = env0_0;
let r0 = topVisibleMessage == null || topVisibleMessage > endId;
r0 = !r0 ? bottomVisibleMessage == null : r0;
r0 = !r0 ? bottomVisibleMessage < startId : r0;
return !r0;
}
}
function SET_SELECTED_SUMMARY(a0) { // fn#77411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:5760, offset: 0x01dfb493, size: 119 bytes, params: 2, frame: 10
var summaryId;
var r1;
var r0;
var binding;
var value3;
var object;
const channelId2 = a0.channelId;
const value = null;
if (value == channelId2) {
r0 = value;
} else {
binding = env0_21;
value3 = undefined;
r1 = channelId2 !== (value == binding ? value3 : binding.channelId) || a0.summaryId !== (value == env0_21 ? value3 : env0_21.summaryId);
if (r1) {
object = {channelId: channelId2};
summaryId = a0.summaryId;
object.summaryId = value != summaryId ? summaryId : value;
r1 = value3;
}
r0 = r1;
}
return r0;
}
function SET_SUMMARY_FEEDBACK({summary, rating}) { // fn#77412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:5978, offset: 0x01dfb50a, size: 59 bytes, params: 2, frame: 4
if (rating != null) {
env0_25[summary.id] = rating;
} else {
delete env0_25[summary.id];
}
}
function REQUEST_CHANNEL_AFFINITIES() { // fn#77413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6055, offset: 0x01dfb545, size: 71 bytes, params: 1, frame: 13
const object = {};
copyDataProperties(object, env0_28, undefined);
const FETCHING = env0_22.FETCHING;
object['status'] = FETCHING;
const Date = global.Date;
object['lastRequest'] = Date.now();
}
function RECEIVE_CHANNEL_AFFINITIES({affinities, error}) { // fn#77414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6135, offset: 0x01dfb58c, size: 232 bytes, params: 2, frame: 17
var object2;
var object;
if (error != null) {
env0_26 = [];
env0_27 = {};
object = {};
copyDataProperties(object, object2, affinities);
object['status'] = env0_22.ERROR;
object['lastResponse'] = global.Date.now();
object2 = object;
} else {
if (affinities == null) {
object = [];
}
if (affinities?.reduce(function(a0, a1) {
a0[a1.channel_id] = a1.affinity;
return a0;
}, {}) == null) {
object = {};
}
object = {};
copyDataProperties(object, object2, affinities);
var OK = env0_22.OK;
object['status'] = OK;
object['lastResponse'] = global.Date.now();
}
}
function REQUEST_CHANNEL_SUMMARIES_BULK({channelIds, requestedAt}) { // fn#77416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6420, offset: 0x01dfb68b, size: 76 bytes, params: 2, frame: 13
const value = channelIds.reduce(_fun77417, {});
const object = {};
copyDataProperties(object, value, copyDataProperties(object, env0_24, channelIds));
function _fun77417(a0, a1) { // fn#77417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6497, offset: 0x01dfb6d7, size: 83 bytes, params: 3, frame: 14
const r3 = env1_24[a1] ?? ({});
const object = {};
copyDataProperties(object, r3, undefined);
object['fetching'] = true;
object['lastRequestedAt'] = requestedAt;
object['error'] = undefined;
a0[a1] = object;
return a0;
}
}
function RECEIVE_CHANNEL_SUMMARIES_BULK({summaries, receivedAt, error, requestArgs}) { // fn#77418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6618, offset: 0x01dfb72a, size: 200 bytes, params: 2, frame: 17
const channelIds = requestArgs.channelIds;
const value2 = (Module00022).toPairs(summaries);
const env0_2 = value2.reduce(_fun77419, {});
const value3 = channelIds.reduce(_fun77423, {summariesByChannel: {}, summaryFetchStatusByChannel: {}});
object = {};
copyDataProperties(object, env0_23, value2);
copyDataProperties(object, value3.summariesByChannel, value2);
object = {};
copyDataProperties(object, env0_24, value2);
copyDataProperties(object, value3.summaryFetchStatusByChannel, value2);
function _fun77419(a0, a1) { // fn#77419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6746, offset: 0x01dfb7f2, size: 165 bytes, params: 3, frame: 17
var environment;
let value = environment.__proto__;
const value2 = env1_3(a1, 2);
let property = value2[0];
const property2 = value2[1];
value = Reflect.apply((importDefault(22) /* metro dependency 22 */).chain, value, [property2.map(_fun77420)]);
value = value.sortBy(_fun77421);
value = value.takeRight(75);
value = value.reverse();
value = value.filter(function(a0) {
var property = global.Object;
property = property.keys(a0).length;
return property > 0;
});
a0[property] = value.value();
return a0;
function _fun77420(a0) { // fn#77420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6805, offset: 0x01dfb897, size: 49 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__;
return (SummaryModule).createSummaryFromServer(a0, env0_0);
}
function _fun77421({startId}) { // fn#77421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:6857, offset: 0x01dfb8c8, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__;
return (SnowflakeUtils).extractTimestamp(startId);
}
}
function _fun77423(a0, a1) { // fn#77423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:7002, offset: 0x01dfb8f7, size: 111 bytes, params: 3, frame: 16
let property = env1_24[a1];
const r5 = property ?? ({});
property = env0_2[a1];
if (property != null) {
a0.summariesByChannel[a1] = property;
}
const summaryFetchStatusByChannel = a0.summaryFetchStatusByChannel;
const object = {};
copyDataProperties(object, r5, undefined);
object['fetching'] = false;
object['error'] = error;
object['lastReceivedAt'] = receivedAt;
summaryFetchStatusByChannel[a1] = object;
return a0;
}
}
function CONVERSATION_SUMMARY_UPDATE(a0) { // fn#77424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:7302, offset: 0x01dfb966, size: 362 bytes, params: 2, frame: 20
const channel_id = a0.channel_id;
const summaries = a0.summaries;
a0.guild_id;
const Date = global.Date;
const value = Date.now();
const value3 = undefined;
const value10 = (importDefault(22) /* metro dependency 22 */).chain(summaries).sortBy(_fun77425).filter(function(a0) {
var property = global.Object;
property = property.keys(a0).length;
return property > 0;
}).map(_fun77427).reverse().value();
let property = env0_23[channel_id];
env0_23[channel_id] = (importDefault(22) /* metro dependency 22 */).chain(value10).concat(property ?? []).sortBy(_fun77428).takeRight(75).uniqBy('id').reverse().value();
const binding = env0_24;
const object = {};
copyDataProperties(object, binding[channel_id], 23);
object['error'] = value3;
property = env0_24[channel_id];
const fetching = property == null ? value3 : property.fetching;
object['fetching'] = fetching != null && fetching;
object['lastReceivedAt'] = value;
binding[channel_id] = object;
return value3;
function _fun77425({start_id}) { // fn#77425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:7420, offset: 0x01dfbad0, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (SnowflakeUtils).extractTimestamp(start_id);
}
function _fun77427(a0) { // fn#77427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:7505, offset: 0x01dfb1be, size: 49 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = require(9868) /* metro dependency 9868: Summary */;
return value.createSummaryFromServer(a0, channel_id);
}
function _fun77428({startId}) { // fn#77428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:7626, offset: 0x01dfb215, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (SnowflakeUtils).extractTimestamp(startId);
}
}
function DELETE_SUMMARY(a0) { // fn#77430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:7863, offset: 0x01dfbb12, size: 89 bytes, params: 2, frame: 14
const channelId = a0.summary.channelId;
const r4 = env0_23[channelId] ?? [];
const value2 = r4.indexOf(a0.summary);
if (value2 !== -1) {
env0_23[channelId].splice(value2, 1);
}
}
}
function _fun77366({record}) { // fn#77366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10051:810, offset: 0x01dfa6c3, size: 16 bytes, params: 2, frame: 1
return record.id;
}
global.__d(_fun77360, 9865, [57, 153, 6, 7, 15, 17, 18, 4107, 7233, 1379, 1867, 4605, 1934, 4864, 1878, 9866, 7234,
21, 672, 9867, 566, 694, 9868, 22,
2]) /* metro module 9865, dependencies: [57, 153, 6, 7, 15, 17, 18, 4107, 7233, 1379, 1867, 4605, 1934, 4864, 1878, 9866, 7234, 21, 672, 9867, 566, 694, 9868, 22, 2] */;