/* Metro module 1776; source: unknown; dependencies: [31, 27, 33, 1709, 1644, 1753] */
function _fun19548(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#19548, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:6, offset: 0x00ead142, size: 484 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(31) /* metro dependency 31 */;
const env0_2 = value.useEffect;
const env0_3 = value.useRef;
importDefault(31) /* metro dependency 31 */;
value = require(27) /* metro dependency 27 */;
const StyleSheet = value.StyleSheet;
const TextInput = value.TextInput;
const env0_4 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.jsxs;
object = {code: 'function createCircularDoublesBuffer_Pnpm_PerformanceMonitorTsx1(size){return{next:0,buffer:new Float32Array(size),size:size,count:0,push:function(value){const oldValue=this.buffer[this.next];const oldCount=this.count;this.buffer[this.next]=value;this.next=(this.next+1)%this.size;this.count=Math.min(this.size,this.count+1);return oldCount===this.size?oldValue:null;},front:function(){const notEmpty=this.count>0;if(notEmpty){const current=this.next-1;const index=current<0?this.size-1:current;return this.buffer[index];}return null;},back:function(){const notEmpty=this.count>0;return notEmpty?this.buffer[this.next]:null;}};}'};
const env0_8 = _fun19559();
(require(1709) /* metro dependency 1709 */).addWhitelistedNativeProps({text: true});
const env0_9 = (require(1644) /* metro dependency 1644 */).createAnimatedComponent(TextInput);
object = {code: 'function getFps_Pnpm_PerformanceMonitorTsx2(renderTimeInMs){return 1000/renderTimeInMs;}'};
const env0_11 = _fun19564();
object = {code: 'function completeBufferRoutine_Pnpm_PerformanceMonitorTsx3(buffer,timestamp){const{getFps}=this.__closure;var _buffer$push;timestamp=Math.round(timestamp);const droppedTimestamp=(_buffer$push=buffer.push(timestamp))!==null&&_buffer$push!==void 0?_buffer$push:timestamp;const measuredRangeDuration=timestamp-droppedTimestamp;return getFps(measuredRangeDuration/buffer.count);}'};
const env0_13 = _fun19566();
object = {code: "function pnpm_PerformanceMonitorTsx4(){const{jsFps}=this.__closure;var _jsFps$value;const text='JS: '+((_jsFps$value=jsFps.value)!==null&&_jsFps$value!==void 0?_jsFps$value:'N/A')+' ';return{text:text,defaultValue:text};}"};
object = {code: 'function pnpm_PerformanceMonitorTsx5({timestamp:timestamp}){const{circularBuffer,createCircularDoublesBuffer,smoothingFrames,completeBufferRoutine,uiFps}=this.__closure;if(circularBuffer.value===null){circularBuffer.value=createCircularDoublesBuffer(smoothingFrames);}timestamp=Math.round(timestamp);const currentFps=completeBufferRoutine(circularBuffer.value,timestamp);uiFps.value=currentFps.toFixed(0);}'};
object = {code: "function pnpm_PerformanceMonitorTsx6(){const{uiFps}=this.__closure;var _uiFps$value;const text='UI: '+((_uiFps$value=uiFps.value)!==null&&_uiFps$value!==void 0?_uiFps$value:'N/A')+' ';return{text:text,defaultValue:text};}"};
const env0_17 = StyleSheet.create({monitor: {'flexDirection': 'row', 'position': 'absolute',
'backgroundColor': '#0006', 'zIndex': 1000}, header: {'fontSize': 14, 'color': '#ffff', 'paddingHorizontal': 5},
text: {'fontSize': 13, 'fontVariant': null, 'color': '#ffff', 'fontFamily': 'monospace', 'paddingHorizontal': 3,
fontVariant: ['tabular-nums']}, container: {'alignItems': 'center', 'justifyContent': 'center',
'flexDirection': 'row', 'flexWrap': 'wrap'}});
exports.PerformanceMonitor = PerformanceMonitor;
}
function JsPerformance({smoothingFrames}) { // fn#19549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2570, offset: 0x00ead326, size: 266 bytes, params: 2, frame: 20
const value2 = (require(1753) /* metro dependency 1753 */).useSharedValue(null);
const value3 = (require(1753) /* metro dependency 1753 */).useSharedValue(0);
const env0_1 = useRef(env0_8(smoothingFrames));
useEffect(function() {
_fun19551(_fun19554);
}, [value2, value3]);
const moduleValue3 = require(1753) /* metro dependency 1753 */;
const useAnimatedProps = moduleValue3.useAnimatedProps;
const closure = pnpm_PerformanceMonitorTsx4;
closure.__closure = {jsFps: value2};
closure.__workletHash = 12993491204154;
closure.__initData = env0_14;
return (
{((Component) => )(env0_9)}
);
}
function UiPerformance({smoothingFrames}) { // fn#19556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:3903, offset: 0x00ead545, size: 319 bytes, params: 2, frame: 22
const value2 = (require(1753) /* metro dependency 1753 */).useSharedValue(null);
const value3 = (require(1753) /* metro dependency 1753 */).useSharedValue(null);
const moduleValue3 = require(1753) /* metro dependency 1753 */;
const useFrameCallback = moduleValue3.useFrameCallback;
let closure = pnpm_PerformanceMonitorTsx5;
closure.__closure = {circularBuffer: value3, createCircularDoublesBuffer: env0_8, smoothingFrames: smoothingFrames,
completeBufferRoutine: env0_13, uiFps: value2};
closure.__workletHash = 10137562113926;
closure.__initData = env0_15;
Reflect.apply(useFrameCallback, moduleValue3, [closure]);
const moduleValue4 = moduleValue3;
const useAnimatedProps = moduleValue4.useAnimatedProps;
closure = pnpm_PerformanceMonitorTsx6;
closure.__closure = {uiFps: value2};
closure.__workletHash = 1865752198941;
closure.__initData = env0_16;
return (
{((Component) => )(env0_9)}
);
}
function _fun19559() { // fn#19559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:858, offset: 0x00ead73d, size: 46 bytes, params: 1, frame: 2
const closure = function(a0) {
var Float32Array = global.Float32Array;
return {next: 0, buffer: new Float32Array(a0), size: a0, count: 0, push: _fun19561, front: _fun19562,
back: _fun19563};
};
closure.__closure = {};
closure.__workletHash = 7814494919003;
closure.__initData = env0_7;
return closure;
}
function _fun19564() { // fn#19564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:1616, offset: 0x00ead89b, size: 46 bytes, params: 1, frame: 2
const closure = function(a0) {
return 1000 / a0;
};
closure.__closure = {};
closure.__workletHash = 14651351045012;
closure.__initData = env0_10;
return closure;
}
function _fun19566() { // fn#19566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2127, offset: 0x00ead8d8, size: 57 bytes, params: 1, frame: 4
const closure = completeBufferRoutine;
closure.__closure = {getFps: env0_11};
closure.__workletHash = 5653450315763;
closure.__initData = env0_12;
return closure;
}
function PerformanceMonitor({smoothingFrames}) { // fn#19568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:5040, offset: 0x00ead95c, size: 114 bytes, params: 2, frame: 19
const r8 = smoothingFrames === undefined ? 20 : smoothingFrames;
return (
);
}
function _fun19550() { // fn#19550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2692, offset: 0x00ead430, size: 21 bytes, params: 1, frame: 11
((a0) => {
var env0_0 = a0;
var env0_1 = 0;
var closure = _fun19552;
var env0_2 = closure;
closure();
})(_fun19554);
}
function pnpm_PerformanceMonitorTsx4() { // fn#19555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2972, owner: JsPerformance.pnpm_PerformanceMonitorTsx4, offset: 0x00ead506, size: 63 bytes, params: 1, frame: 3
let value = env0_0.value;
value = 'JS: ' + (value ?? 'N/A') + ' ';
return {text: value, defaultValue: value};
}
function pnpm_PerformanceMonitorTsx5({timestamp}) { // fn#19557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:4046, owner: UiPerformance.pnpm_PerformanceMonitorTsx5, offset: 0x00ead684, size: 122 bytes, params: 2, frame: 15
var binding;
var value3;
if (env0_2.value === null) {
binding = env0_2;
value3 = environment.__proto__;
binding.value = env1_8(smoothingFrames);
}
const Math = global.Math;
env0_1.value = env1_13(env0_2.value, Math.round(timestamp)).toFixed(0);
}
function pnpm_PerformanceMonitorTsx6() { // fn#19558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:4388, owner: UiPerformance.pnpm_PerformanceMonitorTsx6, offset: 0x00ead6fe, size: 63 bytes, params: 1, frame: 3
let value = env0_1.value;
value = 'UI: ' + (value ?? 'N/A') + ' ';
return {text: value, defaultValue: value};
}
function createCircularDoublesBuffer(a0) { // fn#19560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:875, offset: 0x00ead76b, size: 90 bytes, params: 2, frame: 14
const Float32Array = global.Float32Array;
return {next: 0, buffer: new Float32Array(a0), size: a0, count: 0, push: function(a0) {
var property = this.buffer;
property = property[this.next];
var count = this.count;
this.buffer[this.next] = a0;
this.next = (this.next + 1) % this.size;
var Math = global.Math;
this.count = Math.min(this.size, this.count + 1);
return count !== this.size ? null : property;
}, front: function() {
var value;
if (this.count > 0) {
value = this.next - 1;
return this.buffer[value < 0 ? this.size - 1 : value];
}
return null;
}, back: function() {
var r0;
var property;
if (this.count > 0) {
property = this.buffer;
property = property[this.next];
r0 = property;
} else {
r0 = null;
}
return r0;
}};
}
function completeBufferRoutine(a0, a1) { // fn#19567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2144, offset: 0x00ead911, size: 75 bytes, params: 3, frame: 13
const Math = global.Math;
let value = Math.round(a1);
const r1 = a0.push(value) ?? value;
const binding = env1_11;
value -= r1;
return binding(value / a0.count);
}
function loopAnimationFrame(a0) { // fn#19551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2704, offset: 0x00ead445, size: 32 bytes, params: 2, frame: 9
const env0_0 = a0;
(function() {
global.requestAnimationFrame(_fun19553);
})();
}
function _fun19554(a0, a1) { // fn#19554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2847, offset: 0x00ead4b6, size: 80 bytes, params: 3, frame: 14
const Math = global.Math;
let value = Math.round(a1);
let binding = env2_13;
value = binding(env1_1.current, value);
binding = env1_0;
value = 2 * value;
binding.value = value.toFixed(0);
}
function loopAnimationFrameLoop() { // fn#19552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2744, owner: loopAnimationFrame.loop, offset: 0x00ead465, size: 24 bytes, params: 1, frame: 11
global.requestAnimationFrame(_fun19553);
}
function _fun19553(a0) { // fn#19553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1903:2783, offset: 0x00ead47d, size: 57 bytes, params: 2, frame: 14
if (env1_1 > 0) {
env1_0(env1_1, a0);
}
env1_1 = a0;
global.requestAnimationFrame(loopAnimationFrameLoop);
}