/* Metro module 7465; source: unknown; dependencies: [7365, 7368, 7370, 7396, 7374, 7397, 7369, 7466, 7383, 7403, 7404] */ import * as RegisterSpanErrorInstrumentationModule from './module-07365-registerSpanErrorInstrumentation.js'; /* Metro dependency 7365 */ import * as DEBUG_BUILDModule from './module-07368-DEBUG_BUILD.js'; /* Metro dependency 7368 */ import * as Module07370Module from './module-07370.js'; /* Metro dependency 7370 */ import * as Module07383Module from './module-07383.js'; /* Metro dependency 7383 */ import * as Module07466Module from './module-07466.js'; /* Metro dependency 7466 */ function _fun60204(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:6, offset: 0x016fe04a, size: 171 bytes, params: 8, frame: 20 const env0_0 = require; const getMetricsAggregatorForClient2 = getMetricsAggregatorForClient; const distribution_602102 = distribution_60210; const ensureNumber = function(a0) { var r0; var value = a0; if (typeof value !== 'string') { r0 = value; } else { value = (0, global.parseInt)(value); r0 = value; } return r0; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); RegisterSpanErrorInstrumentationModule; DEBUG_BUILDModule; exports.metrics = {increment: function(a0, a1) { var r2; var r6; var value = undefined; var value2 = 1; r2 = arguments.length > 2 ? value === arguments[2] ? value2 : arguments[2] : value2; r6 = arguments.length > 3 ? arguments[3] : value; var addToMetricsAggregatorBinding = addToMetricsAggregator; var COUNTER_METRIC_TYPE = require(dependencyMap[7]).COUNTER_METRIC_TYPE; addToMetricsAggregatorBinding(a0, COUNTER_METRIC_TYPE, a1, ensureNumber(r2), r6); return value; }, distribution: distribution_602102, set: function(a0, a1, a2, a3) { var addToMetricsAggregatorBinding = addToMetricsAggregator; var SET_METRIC_TYPE = require(dependencyMap[7]).SET_METRIC_TYPE; addToMetricsAggregatorBinding(a0, SET_METRIC_TYPE, a1, a2, a3); }, gauge: gauge_60214, timing: timing_60215, getMetricsAggregatorForClient: getMetricsAggregatorForClient2}; function getMetricsAggregatorForClient(a0, a1) { // fn#60205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:30, offset: 0x016fe0f5, size: 153 bytes, params: 3, frame: 17 let value = Module07370Module; value = value.getGlobalSingleton('globalMetricsAggregators', function() { var WeakMap = global.WeakMap; var value = Object.create(WeakMap.prototype, {constructor: {value: WeakMap}}); var value2 = new WeakMap(); return value2 instanceof Object ? value2 : value; }); let value2 = value.get(a0); if (value2) { return value2; } const value4 = new a1(a0); a0.on('flush', _fun60207); a0.on('close', _fun60208); value.set(a0, value4); return value4; function _fun60207() { // fn#60207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:229, offset: 0x0136bce9, size: 19 bytes, params: 1, frame: 9 return env0_0.flush(); } function _fun60208() { // fn#60208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:274, offset: 0x016fe18e, size: 19 bytes, params: 1, frame: 9 return env0_0.close(); } } function addToMetricsAggregator(a0, a1, a2, a3) { // fn#60209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:318, offset: 0x016fe1a1, size: 432 bytes, params: 5, frame: 29 var r10; var r2; var object; var activeSpan; var moduleValue4; var unit; var tags; var timestamp; var options; var release; var environment; var metricsAggregatorForClient; var add; var Object; const value = undefined; const r4 = arguments.length > 4 && value !== arguments[4] ? arguments[4] : {}; const r3 = r4.client || (require(7396) /* metro dependency 7396 */).getClient(); if (r3) { activeSpan = (require(7374) /* metro dependency 7374 */).getActiveSpan(); r10 = activeSpan ? (require(7374) /* metro dependency 7374 */).getRootSpan(activeSpan) : value; if (r10) { moduleValue4 = require(7374) /* metro dependency 7374 */; r2 = moduleValue4.spanToJSON(r10).description; } else { r2 = r10; } unit = r4.unit; tags = r4.tags; timestamp = r4.timestamp; options = r3.getOptions(); release = options.release; environment = options.environment; object = {}; if (release) { object.release = release; } if (environment) { object.environment = environment; } if (r2) { object.transaction = r2; } if ((require(7397) /* metro dependency 7397 */).DEBUG_BUILD) { (require(7369) /* metro dependency 7369 */).logger.log('Adding value of ' + a3 + ' to ' + a1 + ' metric ' + a2); } metricsAggregatorForClient = getMetricsAggregatorForClient(r3, a0); add = metricsAggregatorForClient.add; Object = global.Object; Reflect.apply(add, metricsAggregatorForClient, [a1, a2, a3, unit, Object.assign({}, object, tags), timestamp]); } return value; } function distribution_60210(a0, a1, a2, a3) { // fn#60210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:862, offset: 0x016fe351, size: 64 bytes, params: 5, frame: 19 const addToMetricsAggregatorBinding = addToMetricsAggregator; const DISTRIBUTION_METRIC_TYPE = (Module07466Module).DISTRIBUTION_METRIC_TYPE; addToMetricsAggregatorBinding(a0, DISTRIBUTION_METRIC_TYPE, a1, ensureNumber(a2), a3); } function gauge_60214(a0, a1, a2, a3) { // fn#60214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:1372, offset: 0x016fe45e, size: 64 bytes, params: 5, frame: 19 const addToMetricsAggregatorBinding = addToMetricsAggregator; const GAUGE_METRIC_TYPE = (Module07466Module).GAUGE_METRIC_TYPE; addToMetricsAggregatorBinding(a0, GAUGE_METRIC_TYPE, a1, ensureNumber(a2), a3); } function timing_60215(a0, a1, a2) { // fn#60215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:1476, offset: 0x016fe49e, size: 245 bytes, params: 4, frame: 22 var value7; let value = undefined; const env0_0 = a0; const env0_1 = a1; const env0_2 = a2; const value2 = 'second'; const r1 = arguments.length > 3 ? value === arguments[3] ? value2 : arguments[3] : value2; const r10 = arguments.length > 4 ? arguments[4] : value; if (typeof a2 === 'function') { value7 = (require(7383) /* metro dependency 7383 */).timestampInSeconds(); value = require(7403) /* metro dependency 7403 */; return value.startSpanManual({op: 'metrics.timing', name: a1, startTime: value7, onlyIfParent: true}, _fun60216); } const distribution_60210Binding = distribution_60210; const Object = global.Object; distribution_60210Binding(a0, a1, a2, Object.assign({}, r10, {unit: r1})); return value; function _fun60216(a0) { // fn#60216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:1759, offset: 0x016fe593, size: 64 bytes, params: 2, frame: 15 var environment; const env0_0 = a0; const value = environment.__proto__; return (require(7404) /* metro dependency 7404 */).handleCallbackErrors(function() { return importDefault(); }, function() { }, _fun60219); function _fun60219() { // fn#60219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7643:1849, offset: 0x016fe5e2, size: 129 bytes, params: 1, frame: 22 const value2 = (Module07383Module).timestampInSeconds(); const distribution_60210Binding = distribution_60210; const binding = env1_0; const value3 = value2 - env1_4; const Object = global.Object; distribution_60210Binding(binding, require, value3, Object.assign({}, env1_3, {unit: 'second'})); env0_0.end(value2); } } } } global.__d(_fun60204, 7465, [7365, 7368, 7370, 7396, 7374, 7397, 7369, 7466, 7383, 7403, 7404]) /* metro module 7465, dependencies: [7365, 7368, 7370, 7396, 7374, 7397, 7369, 7466, 7383, 7403, 7404] */;