308 lines
13 KiB
TypeScript
308 lines
13 KiB
TypeScript
/* Metro module 12563; source: modules/message_previews/PreviewData.tsx; dependencies: [6, 7, 3794, 4605, 4625, 21, 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 MessageRecord from '../../records/MessageRecord.tsx'; /* Metro dependency 3794 */
|
|
import ReadStateStore from '../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun96158(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:6, offset: 0x02156a2a, size: 192 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_96161 = 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 Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = _fun96162();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/message_previews/PreviewData.tsx');
|
|
exports.PreviewData = value;
|
|
function _createForOfIteratorHelperLoose_96159(a0, a1) { // fn#96159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:140, offset: 0x02156aea, 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 _fun96160;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_96161(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_96161(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_96161(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun96160;
|
|
}
|
|
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 _fun96160() { // fn#96160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:711, 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 _fun96162() { // fn#96162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:1056, offset: 0x02156c5e, size: 288 bytes, params: 1, frame: 15
|
|
return CreateClass(PreviewData, [{key: 'isLatest', value: function(a0, a1) {
|
|
return this.messageGeneration(a0, a1) === a1;
|
|
}}, {key: 'messageGeneration', value: value_96165}, {key: 'messageId', value: function(a0) {
|
|
var r1;
|
|
var value = this.messages.get(a0);
|
|
var value2 = null;
|
|
r1 = value2 == value || value2 == value.message ? undefined : value.message.id;
|
|
return value2 != r1 ? r1 : value2;
|
|
}}, {key: 'messageRecord', value: value_96167}, {key: 'has', value: function(a0) {
|
|
return this.messages.has(a0);
|
|
}}, {key: 'put', value: function(a0, a1, a2) {
|
|
this.messages.set(a0, {message: a1, generation: a2});
|
|
}}, {key: 'putNew', value: value_96170}, {key: 'putMany', value: value_96171}, {key: 'update', value: value_96172},
|
|
{key: 'delete', value: function(a0) {
|
|
this.messages.delete(a0);
|
|
}}]);
|
|
function PreviewData() { // fn#96163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:1077, offset: 0x02156d7e, size: 69 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
env1_3(this, PreviewData);
|
|
this.localNeeded = true;
|
|
const Map = global.Map;
|
|
this.messages = new Map();
|
|
}
|
|
|
|
function value_96165(a0, a1) { // fn#96165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:1273, offset: 0x02156de0, size: 149 bytes, params: 3, frame: 17
|
|
var r1;
|
|
var r0;
|
|
var id;
|
|
var value4;
|
|
var readStateStoreBinding;
|
|
var set;
|
|
var object;
|
|
const value = a1;
|
|
let messages = this.messages;
|
|
const value2 = messages.get(a0);
|
|
if (value2 == null) {
|
|
r0 = -Infinity;
|
|
} else {
|
|
if (value2.generation === value) {
|
|
r1 = value2.generation;
|
|
} else if (value2.message == null) {
|
|
r1 = value2.generation;
|
|
} else {
|
|
id = value2.message.id;
|
|
value4 = environment.__proto__;
|
|
readStateStoreBinding = ReadStateStore;
|
|
if (id === readStateStoreBinding.lastMessageId(a0)) {
|
|
messages = this.messages;
|
|
set = messages.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, value2);
|
|
object['generation'] = value;
|
|
Reflect.apply(set, messages, [a0, object]);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value2.generation;
|
|
}
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_96167(a0) { // fn#96167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:1623, offset: 0x02156eb7, size: 137 bytes, params: 2, frame: 13
|
|
var value7;
|
|
var moduleValue;
|
|
const value = this.messages.get(a0);
|
|
const value2 = null;
|
|
let r1 = value2 == value || value2 == value.message;
|
|
r1 = !r1 ? value.message instanceof MessageRecord : r1;
|
|
if (!r1) {
|
|
value7 = environment.__proto__;
|
|
moduleValue = require(4625) /* metro dependency 4625: MessageRecordUtils */;
|
|
value.message = moduleValue.createMessageRecord(value.message);
|
|
}
|
|
const message = value2 == value ? undefined : value.message;
|
|
return value2 != message ? message : value2;
|
|
}
|
|
|
|
function value_96170(a0, a1, a2) { // fn#96170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:1977, offset: 0x02156f84, size: 143 bytes, params: 4, frame: 21
|
|
var id;
|
|
var r1;
|
|
var r0;
|
|
var id2;
|
|
let value = this.messages.get(a0);
|
|
const value2 = a1 != null;
|
|
if (value2) {
|
|
id2 = a1.id;
|
|
id = value == null || value.message == null ? undefined : value.message.id;
|
|
value = id == null;
|
|
if (value) {
|
|
r1 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.compare(id2, id);
|
|
value = value > 0;
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
if (r0) {
|
|
this.put(a0, a1, a2);
|
|
}
|
|
}
|
|
|
|
function value_96171(a0, a1) { // fn#96171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:2180, offset: 0x02157013, size: 75 bytes, params: 3, frame: 18
|
|
var r2;
|
|
var value3;
|
|
var put;
|
|
var channel_id;
|
|
var value4;
|
|
let value = environment.__proto__;
|
|
value = _createForOfIteratorHelperLoose_96159(a0);
|
|
const value2 = value();
|
|
let done = value2.done;
|
|
if (!done) {
|
|
for (r2 = value2; true; r2 = value4) {
|
|
value3 = r2.value;
|
|
put = this.put;
|
|
channel_id = value3.channel_id;
|
|
Reflect.apply(put, this, [channel_id, value3, a1]);
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_96172(a0) { // fn#96172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12753:2321, offset: 0x0215705e, size: 209 bytes, params: 2, frame: 18
|
|
var r5;
|
|
var channel_id;
|
|
var messages;
|
|
var value;
|
|
var value2;
|
|
var message;
|
|
var value3;
|
|
var value4;
|
|
var moduleValue;
|
|
var set;
|
|
var object;
|
|
let id = a0.id;
|
|
if (id != null) {
|
|
channel_id = a0.channel_id;
|
|
if (channel_id != null) {
|
|
channel_id = a0.channel_id;
|
|
messages = this.messages;
|
|
value = messages.get(channel_id);
|
|
value2 = undefined;
|
|
if (value == null) {
|
|
id = value2;
|
|
} else {
|
|
message = value.message;
|
|
id = message == null ? value2 : message.id;
|
|
}
|
|
if (id === a0.id) {
|
|
message = value.message;
|
|
value3 = environment.__proto__;
|
|
value4 = message instanceof MessageRecord;
|
|
moduleValue = require(dependencyMap[4]);
|
|
r5 = value4 ? moduleValue.updateMessageRecord(value.message,
|
|
a0) : moduleValue.updateServerMessage(value.message,
|
|
a0);
|
|
messages = this.messages;
|
|
set = messages.set;
|
|
object = {};
|
|
copyDataProperties(object, value, dependencyMap);
|
|
object['message'] = r5;
|
|
Reflect.apply(set, messages, [channel_id, object]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun96158, 12563, [6, 7, 3794, 4605, 4625, 21,
|
|
2]) /* metro module 12563, dependencies: [6, 7, 3794, 4605, 4625, 21, 2] */;
|