318 lines
12 KiB
React
318 lines
12 KiB
React
/* Metro module 6484; source: unknown; dependencies: [6411, 6365, 31, 6485, 6486, 6487, 6488] */
|
|
function _fun51057(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#51057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:6, offset: 0x01227d18, size: 154 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const closure = getFormattedString;
|
|
const runScrollBenchmark = function(a0, a1, a2) {
|
|
return _runScrollBenchmark.apply(this, arguments);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6411) /* metro dependency 6411 */;
|
|
const env0_3 = importDefault(6365) /* metro dependency 6365 */;
|
|
const env0_4 = (require(31) /* metro dependency 31 */).useEffect;
|
|
exports.useBenchmark = useBenchmark;
|
|
exports.getFormattedString = closure;
|
|
}
|
|
|
|
function getFormattedString(a0) { // fn#51058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:139, offset: 0x01227db2, size: 304 bytes, params: 2, frame: 25
|
|
var maxBlankArea;
|
|
var r0;
|
|
let js = a0.js;
|
|
let value = undefined;
|
|
const averageFPS = js == null ? value : js.averageFPS;
|
|
js = a0.js;
|
|
const minFPS = js == null ? value : js.minFPS;
|
|
js = a0.js;
|
|
const value2 = 'Results:\n\nJS FPS: Avg: ' + averageFPS + ' | Min: ' + minFPS + ' | Max: ' + (js == null ? value : js.maxFPS) + '\n\n';
|
|
let blankArea = a0.blankArea;
|
|
const value3 = '';
|
|
if (blankArea) {
|
|
blankArea = a0.blankArea;
|
|
maxBlankArea = blankArea == null ? value : blankArea.maxBlankArea;
|
|
blankArea = a0.blankArea;
|
|
value = 'Blank Area: Max: ' + maxBlankArea + ' Cumulative: ' + (blankArea == null ? value : blankArea.cumulativeBlankArea) + '\n\n';
|
|
r0 = value;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return value2 + r0 + (a0.suggestions.length > 0 ? 'Suggestions:\n\n' + a0.suggestions.map(function(a0, a1) {
|
|
return '' + (a1 + 1) + '. ' + a0;
|
|
}).join('\n') : value3);
|
|
}
|
|
|
|
function _runScrollBenchmark() { // fn#51061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:695, offset: 0x01227f0f, size: 48 bytes, params: 1, frame: 14
|
|
return env0_2(_fun51063).apply(this, arguments);
|
|
}
|
|
|
|
function useBenchmark(a0, a1) { // fn#51065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:1174, offset: 0x01228093, size: 162 bytes, params: 3, frame: 20
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const r1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
const moduleValue = require(6485) /* metro dependency 6485 */;
|
|
const useBlankAreaTracker = moduleValue.useBlankAreaTracker;
|
|
const value3 = env0_3(Reflect.apply(useBlankAreaTracker, moduleValue, [a0, undefined,
|
|
{sumNegativeValues: r1.sumNegativeBlankAreaValues, startDelayInMs: 0}]), 2);
|
|
var env0_3 = value3[0];
|
|
const property = value3[1];
|
|
useEffect(_fun51066, []);
|
|
return [property];
|
|
}
|
|
|
|
function* _fun51063(a0, a1, a2) { // fn#51063, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:756, offset: 0x01227f48, size: 268 bytes, params: 4, frame: 26
|
|
var environment;
|
|
var horizontal;
|
|
var recyclerlistview_unsafe;
|
|
var contentDimension;
|
|
var value4;
|
|
var closure;
|
|
var value5;
|
|
var binding;
|
|
var value6;
|
|
var autoScroll;
|
|
var value9;
|
|
let value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
const env0_0 = a0;
|
|
let current = a0.current;
|
|
if (current) {
|
|
current = a0.current;
|
|
horizontal = current.props.horizontal;
|
|
current = a0.current;
|
|
recyclerlistview_unsafe = current.recyclerlistview_unsafe;
|
|
if (recyclerlistview_unsafe) {
|
|
value = recyclerlistview_unsafe.getRenderedSize();
|
|
contentDimension = recyclerlistview_unsafe.getContentDimension();
|
|
value4 = contentDimension.width - value.width;
|
|
value = contentDimension.height - value.height;
|
|
closure = scrollNow_51064;
|
|
value5 = environment.__proto__.__proto__;
|
|
binding = env2_0;
|
|
value6 = binding(env2_1[4]);
|
|
autoScroll = value6.autoScroll;
|
|
yield Reflect.apply(autoScroll, value6, [closure, 0, 0, value4, value, a2, a1]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env2_0;
|
|
value9 = binding(env2_1[4]);
|
|
autoScroll = value9.autoScroll;
|
|
yield Reflect.apply(autoScroll, value9, [closure, value4, value, 0, 0, a2, a1]);
|
|
value = undefined;
|
|
return undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun51066() { // fn#51066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:1404, offset: 0x01228135, size: 226 bytes, params: 1, frame: 18
|
|
var environment;
|
|
var startDelayInMs;
|
|
var Number;
|
|
var data;
|
|
var setTimeout;
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const Cancellable = (require(6486) /* metro dependency 6486 */).Cancellable;
|
|
const cancellable = new Cancellable();
|
|
const env0_1 = [];
|
|
if (cancellable.current) {
|
|
Number = global.Number;
|
|
data = cancellable.current.props.data;
|
|
if (Number(data == null ? value2 : data.length) > 0) {
|
|
setTimeout = global.setTimeout;
|
|
value = env1_2(_fun51068);
|
|
startDelayInMs = env0_2.startDelayInMs;
|
|
startDelayInMs = !startDelayInMs ? 3000 : startDelayInMs;
|
|
var env0_2 = setTimeout(value, startDelayInMs);
|
|
return _fun51072;
|
|
}
|
|
throw new global.Error('Data is empty, cannot run benchmark');
|
|
}
|
|
setTimeout = global.setTimeout;
|
|
value = env1_2(_fun51068);
|
|
startDelayInMs = env0_2.startDelayInMs;
|
|
startDelayInMs = !startDelayInMs ? 3000 : startDelayInMs;
|
|
var env0_2 = setTimeout(value, startDelayInMs);
|
|
return _fun51072;
|
|
}
|
|
|
|
function* _fun51068() { // fn#51068, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:1602, offset: 0x01228220, size: 423 bytes, params: 1, frame: 28
|
|
var environment;
|
|
var r8;
|
|
var r1;
|
|
var r6;
|
|
var binding2;
|
|
var speedMultiplier;
|
|
var value11;
|
|
var value12;
|
|
var value13;
|
|
var object4;
|
|
var binding4;
|
|
var binding5;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
let binding = env3_0;
|
|
const value3 = undefined;
|
|
const JSFPSMonitor = binding(env3_1[5]).JSFPSMonitor;
|
|
const jSFPSMonitor = new JSFPSMonitor();
|
|
jSFPSMonitor.startTracking();
|
|
let repeatCount = env2_2.repeatCount;
|
|
repeatCount = !repeatCount ? 1 : repeatCount;
|
|
const value8 = 0;
|
|
const value9 = 1;
|
|
if (value8 < repeatCount) {
|
|
r8 = value8;
|
|
while (true) {
|
|
binding = env3_6;
|
|
binding2 = env1_0;
|
|
speedMultiplier = env2_2.speedMultiplier;
|
|
r1 = speedMultiplier || value9;
|
|
yield binding(require, binding2, r1);
|
|
value11 = undefined;
|
|
value12 = false;
|
|
if (value12) {
|
|
return value11;
|
|
}
|
|
value13 = typeof r8 === 'bigint' ? r8 + 1n : +r8 + 1;
|
|
repeatCount = env2_2.repeatCount;
|
|
if (repeatCount) {
|
|
r6 = repeatCount;
|
|
continue;
|
|
}
|
|
r6 = value9;
|
|
continue;
|
|
if (value13 < r6) {
|
|
r8 = value13;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
const value14 = jSFPSMonitor.stopAndGetData();
|
|
if (value14.averageFPS < 35) {
|
|
require.push('Your average JS FPS is low. This can indicate that your components are doing too much work. Try to optimize your components and reduce re-renders if any');
|
|
}
|
|
computeSuggestions(require, require);
|
|
binding = env2_3;
|
|
const binding3 = env1_0;
|
|
const object3 = {js: value14};
|
|
if (binding.maxBlankArea >= value8) {
|
|
object4 = {};
|
|
binding4 = env3_0;
|
|
binding5 = env3_1;
|
|
object4.maxBlankArea = binding4(binding5[6]).roundToDecimalPlaces(binding.maxBlankArea, value8);
|
|
object4.cumulativeBlankArea = binding4(binding5[6]).roundToDecimalPlaces(binding.cumulativeBlankArea, value8);
|
|
r8 = object4;
|
|
} else {
|
|
r8 = value3;
|
|
}
|
|
object3.blankArea = r8;
|
|
object3.suggestions = require;
|
|
object3.interrupted = binding3.isCancelled();
|
|
if (!binding3.isCancelled()) {
|
|
object3.formattedString = env3_5(object3);
|
|
}
|
|
dependencyMap(object3);
|
|
return value3;
|
|
}
|
|
|
|
function _fun51072() { // fn#51072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:3212, offset: 0x012285c9, size: 38 bytes, params: 1, frame: 12
|
|
global.clearTimeout(env0_2);
|
|
env0_0.cancel();
|
|
}
|
|
|
|
function computeSuggestions(a0, a1) { // fn#51069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:1957, offset: 0x012283c7, size: 400 bytes, params: 3, frame: 18
|
|
var environment;
|
|
var estimatedFirstItemOffset;
|
|
var props;
|
|
var value;
|
|
var roundToDecimalPlaces;
|
|
var firstItemOffset;
|
|
var value2;
|
|
var recyclerlistview_unsafe;
|
|
var horizontal;
|
|
var Math;
|
|
var abs;
|
|
let current = a0.current;
|
|
if (current) {
|
|
current = a0.current;
|
|
props = current.props;
|
|
if (props.data.length < 200) {
|
|
a1.push("Data count is low. Try to increase it to a large number (e.g 200) using the 'useDataMultiplier' hook.");
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
value = env4_0(env4_1[6]);
|
|
roundToDecimalPlaces = value.roundToDecimalPlaces;
|
|
current = a0.current;
|
|
firstItemOffset = current.firstItemOffset;
|
|
value2 = 0;
|
|
value = Reflect.apply(roundToDecimalPlaces, value, [firstItemOffset, value2]);
|
|
current = a0.current;
|
|
props = current.props;
|
|
estimatedFirstItemOffset = props.estimatedFirstItemOffset;
|
|
estimatedFirstItemOffset = !estimatedFirstItemOffset ? value2 : estimatedFirstItemOffset;
|
|
if (estimatedFirstItemOffset !== value) {
|
|
a1.push('estimatedFirstItemOffset can be set to ' + value);
|
|
}
|
|
current = a0.current;
|
|
recyclerlistview_unsafe = current.recyclerlistview_unsafe;
|
|
current = a0.current;
|
|
props = current.props;
|
|
horizontal = props.horizontal;
|
|
if (recyclerlistview_unsafe) {
|
|
props = recyclerlistview_unsafe.props;
|
|
value = props.dataProvider.getAllData();
|
|
value = value.map(_fun51070);
|
|
Math = global.Math;
|
|
value = Math.round(value.reduce(function(a0, a1) {
|
|
return a0 + a1;
|
|
}, value2) / value.length);
|
|
Math = global.Math;
|
|
abs = Math.abs;
|
|
props = a0.current.props;
|
|
if (Reflect.apply(abs, Math,
|
|
[value - (props.estimatedItemSize ?? a0.current.state.layoutProvider.defaultEstimatedItemSize)]) > 5) {
|
|
a1.push('estimatedItemSize can be set to ' + value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun51070(a0, a1) { // fn#51070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6662:2440, offset: 0x01228557, size: 114 bytes, params: 3, frame: 16
|
|
var height;
|
|
var width;
|
|
var r0;
|
|
var value3;
|
|
var value4;
|
|
var layout;
|
|
const horizontalBinding = horizontal;
|
|
const getLayout = recyclerlistview_unsafe.getLayout;
|
|
const value2 = getLayout == null;
|
|
if (horizontalBinding) {
|
|
value4 = undefined;
|
|
if (value2) {
|
|
width = value4;
|
|
} else {
|
|
layout = recyclerlistview_unsafe.getLayout(a1);
|
|
width = layout == null ? value4 : layout.width;
|
|
}
|
|
width = !width ? 0 : width;
|
|
r0 = width;
|
|
} else {
|
|
value3 = undefined;
|
|
if (value2) {
|
|
height = value3;
|
|
} else {
|
|
layout = recyclerlistview_unsafe.getLayout(a1);
|
|
height = layout == null ? value3 : layout.height;
|
|
}
|
|
height = !height ? 0 : height;
|
|
r0 = height;
|
|
}
|
|
return r0;
|
|
}
|
|
|