253 lines
13 KiB
JavaScript
253 lines
13 KiB
JavaScript
/* Metro module 6493; source: unknown; dependencies: [6411, 6365, 31, 6494, 6394, 6495] */
|
|
import Module06365 from './module-06365.js'; /* Metro dependency 6365 */
|
|
import Module06411 from './module-06411.js'; /* Metro dependency 6411 */
|
|
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
|
|
|
|
function _fun51137(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#51137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:6, offset: 0x0122a31c, size: 181 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getFormattedString_511382 = getFormattedString_51138;
|
|
const runScrollBenchmark_51140 = function(a0, a1, a2) {
|
|
return _runScrollBenchmark_51141.apply(this, arguments);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = ReactModule;
|
|
const env0_4 = value.useEffect;
|
|
const env0_5 = value.useState;
|
|
const env0_6 = value.useCallback;
|
|
const env0_7 = value.useRef;
|
|
exports.useBenchmark = useBenchmark_51145;
|
|
exports.getFormattedString = getFormattedString_511382;
|
|
function getFormattedString_51138(a0) { // fn#51138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:183, offset: 0x0122a3d1, size: 207 bytes, params: 2, frame: 23
|
|
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;
|
|
value = 'Results:\n\nJS FPS: Avg: ' + averageFPS + ' | Min: ' + minFPS + ' | Max: ' + (js == null ? value : js.maxFPS) + '\n\n';
|
|
return value + (a0.suggestions.length > 0 ? 'Suggestions:\n\n' + a0.suggestions.map(function(a0, a1) {
|
|
return '' + (a1 + 1) + '. ' + a0;
|
|
}).join('\n') : '');
|
|
}
|
|
|
|
function _runScrollBenchmark_51141() { // fn#51141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:582, offset: 0x0122a4a0, size: 48 bytes, params: 1, frame: 14
|
|
return Module06411(_fun51143).apply(this, arguments);
|
|
function* _fun51143(a0, a1, a2) { // fn#51143, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:643, offset: 0x0122a4d9, size: 262 bytes, params: 4, frame: 26
|
|
var environment;
|
|
var horizontal;
|
|
var childContainerDimensions;
|
|
var value4;
|
|
var scrollNow_511442;
|
|
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;
|
|
if (current) {
|
|
value = current.getWindowSize();
|
|
childContainerDimensions = current.getChildContainerDimensions();
|
|
value4 = childContainerDimensions.width - value.width;
|
|
value = childContainerDimensions.height - value.height;
|
|
scrollNow_511442 = scrollNow_51144;
|
|
value5 = environment.__proto__.__proto__;
|
|
binding = env2_0;
|
|
value6 = binding(env2_1[3]);
|
|
autoScroll = value6.autoScroll;
|
|
yield Reflect.apply(autoScroll, value6, [scrollNow_511442, 0, 0, value4, value, a2, a1]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env2_0;
|
|
value9 = binding(env2_1[3]);
|
|
autoScroll = value9.autoScroll;
|
|
yield Reflect.apply(autoScroll, value9, [scrollNow_511442, value4, value, 0, 0, a2, a1]);
|
|
value = undefined;
|
|
return undefined;
|
|
}
|
|
}
|
|
function scrollNow_51144(a0, a1) { // fn#51144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:823, offset: 0x01228054, size: 63 bytes, params: 3, frame: 14
|
|
const value = a0;
|
|
const value2 = a1;
|
|
const current = env0_0.current;
|
|
if (current != null) {
|
|
current.scrollToOffset({offset: horizontal ? value : value2, animated: false});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useBenchmark_51145(a0, a1) { // fn#51145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:1043, offset: 0x0122a5df, size: 202 bytes, params: 3, frame: 18
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const r2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
const [property, env0_4] = Module06365(useState(false), 2);
|
|
const env0_5 = useRef(null);
|
|
const value4 = useCallback(_fun51146, [a1, a0, property, r2.repeatCount, r2.speedMultiplier]);
|
|
useEffect(_fun51151, []);
|
|
return {startBenchmark: value4, isBenchmarkRunning: property};
|
|
function _fun51146() { // fn#51146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:1180, offset: 0x0122a6a9, size: 242 bytes, params: 1, frame: 17
|
|
var Number;
|
|
var data;
|
|
var Error;
|
|
var dataEmptyCannotRunBenchmark;
|
|
if (!Module06365) {
|
|
var value3 = undefined;
|
|
var Cancellable = (require(6494) /* metro dependency 6494 */).Cancellable;
|
|
var cancellable = new Cancellable();
|
|
var cancellable2 = cancellable;
|
|
env0_5.current = cancellable;
|
|
var env0_1 = [];
|
|
if (cancellable2.current) {
|
|
Number = global.Number;
|
|
data = cancellable2.current.props.data;
|
|
if (Number(data == null ? value3 : data.length) > 0) {
|
|
env0_4(true);
|
|
_fun51147()();
|
|
return undefined;
|
|
}
|
|
Error = global.Error;
|
|
dataEmptyCannotRunBenchmark = (require(6394) /* metro dependency 6394 */).ErrorMessages.dataEmptyCannotRunBenchmark;
|
|
throw new Error();
|
|
}
|
|
env0_4(true);
|
|
_fun51147()();
|
|
}
|
|
function _fun51147() { // fn#51147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:1407, offset: 0x0122a79b, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = env2_2(_fun51149);
|
|
return runBenchmark;
|
|
function* _fun51149() { // fn#51149, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:1427, offset: 0x0122a7c4, size: 377 bytes, params: 1, frame: 23
|
|
var r9;
|
|
var r1;
|
|
var r5;
|
|
var binding2;
|
|
var speedMultiplier;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var value13;
|
|
var object;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
var binding = env4_0;
|
|
var JSFPSMonitor = binding(env4_1[5]).JSFPSMonitor;
|
|
var jSFPSMonitor = new JSFPSMonitor();
|
|
jSFPSMonitor.startTracking();
|
|
var repeatCount = env3_2.repeatCount;
|
|
repeatCount = !repeatCount ? 1 : repeatCount;
|
|
var value7 = 0;
|
|
var value8 = 1;
|
|
if (value7 < repeatCount) {
|
|
r9 = value7;
|
|
while (true) {
|
|
binding = env4_9;
|
|
binding2 = env2_0;
|
|
speedMultiplier = env3_2.speedMultiplier;
|
|
r1 = speedMultiplier || value8;
|
|
yield binding(require, binding2, r1);
|
|
value10 = undefined;
|
|
value11 = false;
|
|
if (value11) {
|
|
return value10;
|
|
}
|
|
value12 = typeof r9 === 'bigint' ? r9 + 1n : +r9 + 1;
|
|
repeatCount = env3_2.repeatCount;
|
|
if (repeatCount) {
|
|
r5 = repeatCount;
|
|
continue;
|
|
}
|
|
r5 = value8;
|
|
continue;
|
|
if (value12 < r5) {
|
|
r9 = value12;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
value13 = jSFPSMonitor.stopAndGetData();
|
|
if (value13.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');
|
|
}
|
|
r5 = require.current && require.current.props.data.length < 200;
|
|
if (r5) {
|
|
require.push("Data count is low. Try to increase it to a large number (e.g 200) using the 'useDataMultiplier' hook.");
|
|
}
|
|
binding = env2_0;
|
|
object = {js: value13, suggestions: require};
|
|
object.interrupted = binding.isCancelled();
|
|
binding = env2_0;
|
|
if (!binding.isCancelled()) {
|
|
object.formattedString = env4_8(object);
|
|
}
|
|
dependencyMap(object);
|
|
useEffect(false);
|
|
} else {
|
|
value13 = jSFPSMonitor.stopAndGetData();
|
|
if (value13.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');
|
|
}
|
|
if (require.current && require.current.props.data.length < 200) {
|
|
require.push("Data count is low. Try to increase it to a large number (e.g 200) using the 'useDataMultiplier' hook.");
|
|
}
|
|
binding = env2_0;
|
|
object = {js: value13, suggestions: require};
|
|
object.interrupted = binding.isCancelled();
|
|
binding = env2_0;
|
|
if (!binding.isCancelled()) {
|
|
object.formattedString = env4_8(object);
|
|
}
|
|
dependencyMap(object);
|
|
useEffect(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
function runBenchmark() { // fn#51150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:2157, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun51151() { // fn#51151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:2274, offset: 0x0122a93d, size: 75 bytes, params: 1, frame: 14
|
|
if (Module06411.startManually) {
|
|
return undefined;
|
|
}
|
|
const setTimeout = global.setTimeout;
|
|
let startDelayInMs = Module06411.startDelayInMs;
|
|
startDelayInMs = !startDelayInMs ? 3000 : startDelayInMs;
|
|
const env0_0 = setTimeout(_fun51152, startDelayInMs);
|
|
return _fun51153;
|
|
function _fun51152() { // fn#51152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:2324, offset: 0x0122a988, size: 15 bytes, params: 1, frame: 9
|
|
env1_6();
|
|
}
|
|
|
|
function _fun51153() { // fn#51153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6671:2371, offset: 0x0122a997, size: 58 bytes, params: 1, frame: 11
|
|
global.clearTimeout(env0_0);
|
|
if (env1_5.current) {
|
|
env1_5.current.cancel();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun51137, 6493, [6411, 6365, 31, 6494, 6394,
|
|
6495]) /* metro module 6493, dependencies: [6411, 6365, 31, 6494, 6394, 6495] */;
|