170 lines
6.6 KiB
TypeScript
170 lines
6.6 KiB
TypeScript
/* Metro module 11274; source: modules/messages/native/VisibleMessagesWindowHandler.tsx; dependencies: [7, 6, 8178, 2] */
|
|
function _fun86106(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11460:6, offset: 0x01f87f4a, size: 160 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = importDefault(7) /* metro dependency 7 */;
|
|
const env0_0 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_1 = (require(8178) /* metro dependency 8178: RowGeneratorConstants */).RowType;
|
|
value = value(function() {
|
|
this(this, VisibleMessagesWindowHandler);
|
|
this.data = null;
|
|
this.callback = null;
|
|
this.setCallback = _fun86109;
|
|
this.clearCallback = _fun86110;
|
|
this.handleScrollPosition = _fun86111;
|
|
});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/VisibleMessagesWindowHandler.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function getRowMessageId(a0) { // fn#86107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11460:134, offset: 0x01f87fea, size: 102 bytes, params: 2, frame: 4
|
|
if (a0 == null) {
|
|
return undefined;
|
|
}
|
|
if ('rowType' in a0) {
|
|
if (a0.rowType === RowType.MESSAGE) {
|
|
return a0.message.id;
|
|
}
|
|
return undefined;
|
|
}
|
|
const type = a0.type;
|
|
const MESSAGE = RowType.MESSAGE;
|
|
if (type !== MESSAGE) {
|
|
return undefined;
|
|
}
|
|
return a0.message?.id;
|
|
}
|
|
|
|
function VisibleMessagesWindowHandler() { // fn#86108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11460:317, offset: 0x01f88050, size: 87 bytes, params: 1, frame: 14
|
|
this(this, VisibleMessagesWindowHandler);
|
|
this.data = null;
|
|
this.callback = null;
|
|
this.setCallback = setCallback;
|
|
this.clearCallback = clearCallback;
|
|
this.handleScrollPosition = handleScrollPosition;
|
|
}
|
|
|
|
function setCallback(a0) { // fn#86109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11460:445, owner: VisibleMessagesWindowHandler.setCallback, offset: 0x01f880a7, size: 51 bytes, params: 2, frame: 11
|
|
let binding = env0_0;
|
|
binding.callback = a0;
|
|
if (binding.data != null) {
|
|
binding = env0_0;
|
|
binding.callback(binding.data);
|
|
}
|
|
}
|
|
|
|
function clearCallback() { // fn#86110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11460:527, owner: VisibleMessagesWindowHandler.clearCallback, offset: 0x01f880da, size: 25 bytes, params: 1, frame: 3
|
|
const binding = env0_0;
|
|
binding.callback = null;
|
|
binding.data = null;
|
|
}
|
|
|
|
function VisibleMessagesWindowHandlerHandleScrollPosition({rows, firstVisibleMessageRowIndex, lastVisibleMessageRowIndex}) { // fn#86111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11460:593, owner: VisibleMessagesWindowHandler.handleScrollPosition, offset: 0x01f880f3, size: 316 bytes, params: 2, frame: 20
|
|
var r1;
|
|
var r4;
|
|
var r6;
|
|
var r7;
|
|
var r3;
|
|
var value3;
|
|
var rowMessageId;
|
|
var value5;
|
|
var length;
|
|
var value6;
|
|
var rowMessageId2;
|
|
var value8;
|
|
var Math;
|
|
var value9;
|
|
var value10;
|
|
var rowMessageId3;
|
|
var value12;
|
|
var binding;
|
|
if (env0_0.callback != null) {
|
|
if (firstVisibleMessageRowIndex != null) {
|
|
value3 = environment.__proto__;
|
|
if (firstVisibleMessageRowIndex >= 0) {
|
|
r1 = firstVisibleMessageRowIndex;
|
|
while (true) {
|
|
rowMessageId = getRowMessageId(rows[r1]);
|
|
if (rowMessageId != null) {
|
|
r4 = rowMessageId;
|
|
break;
|
|
}
|
|
value5 = typeof r1 === 'bigint' ? r1 - 1n : +r1 - 1;
|
|
if (value5 >= 0) {
|
|
r1 = value5;
|
|
continue;
|
|
}
|
|
r4 = null;
|
|
break;
|
|
}
|
|
} else {
|
|
r4 = null;
|
|
}
|
|
} else {
|
|
r4 = null;
|
|
}
|
|
if (lastVisibleMessageRowIndex != null) {
|
|
length = rows.length;
|
|
value6 = environment.__proto__;
|
|
if (lastVisibleMessageRowIndex < length) {
|
|
r6 = lastVisibleMessageRowIndex;
|
|
while (true) {
|
|
rowMessageId2 = getRowMessageId(rows[r6]);
|
|
if (rowMessageId2 != null) {
|
|
r1 = rowMessageId2;
|
|
break;
|
|
}
|
|
value8 = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
|
|
length = rows.length;
|
|
if (value8 < length) {
|
|
r6 = value8;
|
|
continue;
|
|
}
|
|
r1 = null;
|
|
break;
|
|
}
|
|
} else {
|
|
r1 = null;
|
|
}
|
|
} else {
|
|
r1 = null;
|
|
}
|
|
if (firstVisibleMessageRowIndex != null) {
|
|
if (lastVisibleMessageRowIndex != null) {
|
|
Math = global.Math;
|
|
value9 = firstVisibleMessageRowIndex + Math.floor((lastVisibleMessageRowIndex - firstVisibleMessageRowIndex) / 2);
|
|
length = rows.length;
|
|
value10 = environment.__proto__;
|
|
if (value9 < length) {
|
|
r7 = value9;
|
|
while (true) {
|
|
rowMessageId3 = getRowMessageId(rows[r7]);
|
|
if (rowMessageId3 != null) {
|
|
r3 = rowMessageId3;
|
|
break;
|
|
}
|
|
value12 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
|
|
length = rows.length;
|
|
if (value12 < length) {
|
|
r7 = value12;
|
|
continue;
|
|
}
|
|
r3 = null;
|
|
break;
|
|
}
|
|
} else {
|
|
r3 = null;
|
|
}
|
|
} else {
|
|
r3 = null;
|
|
}
|
|
} else {
|
|
r3 = null;
|
|
}
|
|
binding = env0_0;
|
|
binding.data = {topVisibleMessage: r4, middleVisibleMessage: r3, bottomVisibleMessage: r1};
|
|
binding.callback(binding.data);
|
|
}
|
|
}
|
|
|