/* Metro module 6462; source: unknown; dependencies: [6445] */ function _fun50727(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:6, offset: 0x0121fecf, size: 134 bytes, params: 8, frame: 16 let value = this; const env0_0 = require; if (value && value.__extends) { } const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); exports.LayoutManager = undefined; exports.WrapGridLayoutManager = undefined; value = (() => { var closure = _fun50734; closure.prototype.getOffsetForIndex = _fun50735; closure.prototype.getStyleOverridesForIndex = _fun50736; closure.prototype.removeLayout = _fun50737; return closure; })(); exports.LayoutManager = value; exports.WrapGridLayoutManager = _fun50738(value); } function extendStatics_50728(a0, a1) { // fn#50728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:78, offset: 0x0121ff55, size: 78 bytes, params: 3, frame: 13 var r3; var Array; var value; const Object = global.Object; const setPrototypeOf = Object.setPrototypeOf; if (setPrototypeOf) { r3 = setPrototypeOf; } else { Array = global.Array; value = Object.create([]); value = value instanceof Array; r3 = value && (function(a0, a1) { a0.__proto__ = a1; }); } r3 = !r3 ? function(a0, a1) { var r3; var propertyName; var propertyName2; var hasOwnProperty; for (propertyName in a1) { hasOwnProperty = global.Object.prototype.hasOwnProperty; if (!hasOwnProperty.call(a1, propertyName)) { r3 = propertyName2; continue; } a0[propertyName] = a1[propertyName]; r3 = propertyName2; } } : r3; return r3(a0, a1); } function _fun50731(a0, a1) { // fn#50731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:293, offset: 0x0121ffa3, size: 177 bytes, params: 3, frame: 15 var r1; var value; var prototype; var closure2; var TypeError; var value3; var typeError; const env0_0 = a0; const closure = ___50732; if (typeof a1 === 'function') { extendStatics_50728(a0, a1); if (a1 === null) { r1 = global.Object.create(a1); } else { prototype = a1.prototype; closure.prototype = prototype; prototype = closure.prototype; value = Object.create(prototype, {constructor: {value: closure}}); closure2 = new closure(); value = closure2 instanceof Object ? closure2 : value; r1 = value; } a0.prototype = r1; } else { if (a1 !== null) { TypeError = global.TypeError; value = global.String(a1); value = 'Class extends value ' + value; value3 = Object.create(TypeError.prototype, {constructor: {value: TypeError}}); value += ' is not a constructor or null'; typeError = new TypeError(); value = typeError instanceof Object ? typeError : value3; throw value; } extendStatics_50728(a0, a1); if (a1 === null) { r1 = global.Object.create(a1); } else { prototype = a1.prototype; closure.prototype = prototype; prototype = closure.prototype; value = Object.create(prototype, {constructor: {value: closure}}); closure2 = new closure(); value = closure2 instanceof Object ? closure2 : value; r1 = value; } a0.prototype = r1; } } function _fun50733() { // fn#50733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:643, offset: 0x01220054, size: 57 bytes, params: 1, frame: 4 const closure = function() { }; closure.prototype.getOffsetForIndex = getOffsetForIndex; closure.prototype.getStyleOverridesForIndex = function(a0) { }; closure.prototype.removeLayout = function(a0) { var property; var value = this.getLayouts(); if (a0 < value.length) { value.splice(a0, 1); } if (a0 === 0) { if (value.length > 0) { property = value[0]; property.x = 0; property.y = 0; } } }; return closure; } function _fun50738(a0) { // fn#50738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:1166, offset: 0x0122015f, size: 207 bytes, params: 2, frame: 14 const env0_0 = a0; const closure = WrapGridLayoutManager; env0_3(closure, a0); closure.prototype.getContentDimension = function() { return {height: this._totalHeight, width: this._totalWidth}; }; closure.prototype.removeLayout = removeLayout_50741; closure.prototype.getLayouts = function() { return this._layouts; }; closure.prototype.getOffsetForIndex = getOffsetForIndex_50743; closure.prototype.overrideLayout = function(a0, a1) { var property = this._layouts[a0]; if (property) { property.isOverridden = true; property.width = a1.width; property.height = a1.height; } return true; }; closure.prototype.setMaxBounds = function(a0) { var property = this._isHorizontal; var Math = global.Math; var min = Math.min; var _window = this._window; if (property) { a0.height = Reflect.apply(min, Math, [_window.height, a0.height]); } else { a0.width = Reflect.apply(min, Math, [_window.width, a0.width]); } }; closure.prototype.relayoutFromIndex = relayoutFromIndex; closure.prototype._pointDimensionsToRect = function(a0) { if (this._isHorizontal) { this._totalWidth = a0.x; } else { this._totalHeight = a0.y; } }; closure.prototype._setFinalDimensions = function(a0) { var _isHorizontal = this._isHorizontal; var _window = this._window; if (_isHorizontal) { this._totalHeight = _window.height; this._totalWidth += a0; } else { this._totalWidth = _window.width; this._totalHeight += a0; } }; closure.prototype._locateFirstNeighbourIndex = function(a0) { var r2; var r1; var _isHorizontal; var property; if (a0 === 0) { return 0; } var value = a0 - 1; if (value >= 0) { r2 = value; reducibleLoop2: while (true) { _isHorizontal = this._isHorizontal; property = this._layouts[r2]; if (_isHorizontal) { reducibleJoin5: while (true) { if (property.y === 0) { r1 = r2; break reducibleLoop2; } break reducibleJoin5; } } else { reducibleJoin5: while (true) { if (property.x === 0) { r1 = r2; break reducibleLoop2; } break reducibleJoin5; } } value = typeof r2 === 'bigint' ? r2 - 1n : +r2 - 1; if (value >= 0) { r2 = value; continue reducibleLoop2; } r1 = value; break reducibleLoop2; } } else { r1 = value; } return r1; }; closure.prototype._checkBounds = function(a0, a1, a2, a3) { var r0; var value; if (a3) { value = a1 + a2.height; value = value <= this._window.height + 0.9; r0 = value; } else { value = a0 + a2.width; value = value <= this._window.width + 0.9; r0 = value; } return r0; }; return closure; } function getOffsetForIndex(a0) { // fn#50735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:729, offset: 0x0122008d, size: 135 bytes, params: 2, frame: 13 let value = this.getLayouts(); if (value.length > a0) { return {x: value[a0].x, y: value[a0].y}; } value = environment.__proto__; throw new (require(6445) /* metro dependency 6445 */).default({message: 'No layout available for index: ' + a0, type: 'LayoutUnavailableException'}); } function WrapGridLayoutManager(a0, a1, a2, a3) { // fn#50739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:1178, offset: 0x0122022e, size: 99 bytes, params: 5, frame: 13 const value = a2; const value2 = a3; const value3 = this; const r2 = value !== undefined ? value : false; const r0 = env0_0.call(value3) || value3; r0._layoutProvider = a0; r0._window = a1; r0._totalHeight = 0; r0._totalWidth = 0; r0._isHorizontal = !!r2; r0._layouts = value2 || []; return r0; } function removeLayout_50741(a0) { // fn#50741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:1572, offset: 0x012202ac, size: 68 bytes, params: 2, frame: 13 env0_0.prototype.removeLayout.call(this, a0); if (this._layouts.length === 0) { this._totalHeight = 0; this._totalWidth = 0; } } function getOffsetForIndex_50743(a0) { // fn#50743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:1816, offset: 0x012202fb, size: 143 bytes, params: 2, frame: 13 var object2; let _layouts = this._layouts; if (_layouts.length > a0) { object2 = {}; _layouts = this._layouts; object2.x = _layouts[a0].x; _layouts = this._layouts; object2.y = _layouts[a0].y; return object2; } const value = environment.__proto__; throw new (require(6445) /* metro dependency 6445 */).default({message: 'No layout available for index: ' + a0, type: 'LayoutUnavailableException'}); } function relayoutFromIndex(a0, a1) { // fn#50746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6640:2386, offset: 0x01220416, size: 601 bytes, params: 3, frame: 35 var y; var x; var r3; var r4; var r9; var r10; var r14; var r17; var r18; var r21; var r22; var r15; var r16; var r20; var r12; var r1; var _pointDimensionsToRect; var _layoutProvider; var getLayoutTypeForIndex; var isOverridden; var type; var setComputedLayout; var height; var width; var setMaxBounds; var _checkBounds; var _isHorizontal; var value3; var _totalHeight; var value4; var _totalWidth; var Math; var max; var value5; var value6; var push; var splice; let value = this._locateFirstNeighbourIndex(a0); let _layouts = this._layouts; let property = _layouts[value]; const value2 = 0; reducibleJoin2: while (true) { if (property) { x = property.x; y = property.y; _pointDimensionsToRect = this._pointDimensionsToRect; Reflect.apply(_pointDimensionsToRect, this, [property]); break reducibleJoin2; } y = value2; x = value2; break reducibleJoin2; } const length = this._layouts.length; const object2 = {'height': 0, 'width': 0}; if (value < a1) { r3 = value; r4 = value2; r9 = y; r10 = x; reducibleLoop3: while (true) { _layouts = this._layouts; property = _layouts[r3]; _layoutProvider = this._layoutProvider; getLayoutTypeForIndex = _layoutProvider.getLayoutTypeForIndex; value = Reflect.apply(getLayoutTypeForIndex, _layoutProvider, [r3]); reducibleJoin8: while (true) { reducibleJoin6: while (true) { if (property) { isOverridden = property.isOverridden; if (isOverridden) { type = property.type; if (type === value) { height = property.height; object2.height = height; width = property.width; object2.width = width; break reducibleJoin8; } break reducibleJoin6; } break reducibleJoin6; } break reducibleJoin6; } _layoutProvider = this._layoutProvider; setComputedLayout = _layoutProvider.setComputedLayout; Reflect.apply(setComputedLayout, _layoutProvider, [value, object2, r3]); break reducibleJoin8; } setMaxBounds = this.setMaxBounds; Reflect.apply(setMaxBounds, this, [object2]); _checkBounds = this._checkBounds; _isHorizontal = this._isHorizontal; if (Reflect.apply(_checkBounds, this, [r10, r9, object2, _isHorizontal])) { r15 = r10; r16 = r9; r20 = r4; } else { r14 = r4; r17 = r9; r18 = r10; reducibleLoop9: while (true) { _isHorizontal = this._isHorizontal; if (_isHorizontal) { value4 = r18 + r14; _totalWidth = this._totalWidth; this._totalWidth = _totalWidth + r14; r21 = value2; r22 = value4; } else { value3 = r17 + r14; _totalHeight = this._totalHeight; this._totalHeight = _totalHeight + r14; r21 = value3; r22 = value2; } _checkBounds = this._checkBounds; _isHorizontal = this._isHorizontal; if (Reflect.apply(_checkBounds, this, [r22, r21, object2, _isHorizontal])) { r15 = r22; r16 = r21; r20 = value2; break reducibleLoop9; } r14 = value2; r17 = r21; r18 = r22; continue reducibleLoop9; } } _isHorizontal = this._isHorizontal; Math = global.Math; max = Math.max; if (_isHorizontal) { value6 = Reflect.apply(max, Math, [r20, object2.width]); r12 = value6; } else { value5 = Reflect.apply(max, Math, [r20, object2.height]); r12 = value5; } if (r3 > length - 1) { _layouts = this._layouts; push = _layouts.push; height = object2.height; width = object2.width; Reflect.apply(push, _layouts, [{x: r15, y: r16, height: height, width: width, type: value}]); } else { _layouts = this._layouts; property = _layouts[r3]; property.x = r15; property.y = r16; property.type = value; width = object2.width; property.width = width; height = object2.height; property.height = height; } _isHorizontal = this._isHorizontal; if (_isHorizontal) { height = object2.height; r9 = r16 + height; r10 = r15; } else { width = object2.width; value = r15 + width; r9 = r16; r10 = value; } value = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1; if (value < a1) { r3 = value; r4 = r12; continue reducibleLoop3; } r1 = r12; break reducibleLoop3; } } else { r1 = value2; } reducibleJoin25: while (true) { if (length > a1) { _layouts = this._layouts; splice = _layouts.splice; Reflect.apply(splice, _layouts, [a1, length - a1]); break reducibleJoin25; } break reducibleJoin25; } this._setFinalDimensions(r1); }