/* Metro module 1841; source: unknown; dependencies: [31, 27, 1842, 1610, 1840] */ function _fun19969(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#19969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1968:6, offset: 0x00ebb1ae, size: 156 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = (require(31) /* metro dependency 31 */).useCallback; const env0_3 = (require(27) /* metro dependency 27 */).Platform; object = {code: 'function pnpm_indexTs1(target){const{contentOffsetY,IS_FABRIC,Platform,scrollTo,scrollViewRef}=this.__closure;if(contentOffsetY&&IS_FABRIC){contentOffsetY.value=target;}else if(Platform.OS==="android"){requestAnimationFrame(function(){scrollTo(scrollViewRef,0,target,false);});}else{scrollTo(scrollViewRef,0,target,false);}}'}; object = {code: 'function pnpm_indexTs2(){const{extraContentPadding}=this.__closure;return extraContentPadding.value;}'}; object = {code: 'function pnpm_indexTs3(current,previous){const{freeze,blankSpace,keyboardPadding,isScrollAtEnd,scroll,layout,size,inverted,keyboardLiftBehavior,shouldShiftContent,scrollToTarget}=this.__closure;if(freeze.value||previous===null){return;}const rawDelta=current-previous;if(rawDelta===0){return;}const previousTotal=Math.max(blankSpace.value,keyboardPadding.value+previous);const currentTotal=Math.max(blankSpace.value,keyboardPadding.value+current);const effectiveDelta=currentTotal-previousTotal;if(effectiveDelta===0){return;}const atEnd=isScrollAtEnd(scroll.value,layout.value.height,size.value.height,inverted);if(keyboardLiftBehavior==="persistent"&&effectiveDelta<0&&!atEnd){return;}if(!shouldShiftContent(keyboardLiftBehavior,atEnd)){return;}if(inverted){const target=Math.max(scroll.value-effectiveDelta,-currentTotal);scrollToTarget(target);}else{const maxScroll=Math.max(size.value.height-layout.value.height+currentTotal,0);const target=Math.min(scroll.value+effectiveDelta,maxScroll);scrollToTarget(target);}}'}; exports.useExtraContentPadding = useExtraContentPadding; } function useExtraContentPadding({scrollViewRef, extraContentPadding, keyboardPadding, blankSpace, scroll, layout, size, contentOffsetY, inverted, keyboardLiftBehavior, freeze}) { // fn#19970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1968:1642, offset: 0x00ebb24a, size: 465 bytes, params: 2, frame: 31 const env0_4 = scroll; const env0_5 = layout; const env0_6 = size; let closure = useExtraContentPaddingPnpm_indexTs1; let object2 = {contentOffsetY: contentOffsetY}; const IS_FABRIC = (require(1842) /* metro dependency 1842 */).IS_FABRIC; object2.IS_FABRIC = IS_FABRIC; object2.Platform = Platform; object2.scrollTo = (require(1610) /* metro dependency 1610 */).scrollTo; object2.scrollViewRef = scrollViewRef; closure.__closure = object2; closure.__workletHash = 2925167321956; closure.__initData = env0_4; const value2 = useCallback(closure, [scrollViewRef, contentOffsetY]); const moduleValue = require(1610) /* metro dependency 1610 */; const useAnimatedReaction = moduleValue.useAnimatedReaction; closure = function() { return extraContentPadding.value; }; closure.__closure = {extraContentPadding: extraContentPadding}; closure.__workletHash = 6627638143453; closure.__initData = env0_5; const closure2 = pnpm_indexTs3; object2 = {freeze: freeze, blankSpace: blankSpace, keyboardPadding: keyboardPadding}; object2.isScrollAtEnd = (require(1840) /* metro dependency 1840 */).isScrollAtEnd; object2.scroll = scroll; object2.layout = layout; object2.size = size; object2.inverted = inverted; object2.keyboardLiftBehavior = keyboardLiftBehavior; object2.shouldShiftContent = (require(1840) /* metro dependency 1840 */).shouldShiftContent; object2.scrollToTarget = value2; closure2.__closure = object2; closure2.__workletHash = 14660760767987; closure2.__initData = env0_6; Reflect.apply(useAnimatedReaction, moduleValue, [closure, closure2, [inverted, keyboardLiftBehavior]]); } function useExtraContentPaddingPnpm_indexTs1(a0) { // fn#19971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1968:1871, owner: useExtraContentPadding.pnpm_indexTs1, offset: 0x00ebb41b, size: 89 bytes, params: 2, frame: 14 var environment; var value2; const env0_0 = a0; if (contentOffsetY) { value2 = environment.__proto__; if ((require(1842) /* metro dependency 1842 */).IS_FABRIC) { contentOffsetY.value = a0; } else { global.requestAnimationFrame(_fun19972); } } else { global.requestAnimationFrame(_fun19972); } } function pnpm_indexTs3(a0, a1) { // fn#19974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1968:2319, owner: useExtraContentPadding.pnpm_indexTs3, offset: 0x00ebb4bc, size: 407 bytes, params: 3, frame: 25 var Math; var max; var blankSpaceBinding; var value3; var keyboardPaddingBinding; var value5; var value8; var value9; var value10; var moduleValue; var invertedBinding; var isScrollAtEnd2; var moduleValue2; var value16; if (!freeze.value) { if (a1 !== null) { if (a0 - a1 != 0) { Math = global.Math; max = Math.max; blankSpaceBinding = blankSpace; value3 = blankSpaceBinding.value; keyboardPaddingBinding = keyboardPadding; value5 = Reflect.apply(max, Math, [value3, keyboardPaddingBinding.value + a1]); Math = global.Math; value8 = Math.max(blankSpaceBinding.value, keyboardPaddingBinding.value + a0); value9 = value8 - value5; if (value9 !== 0) { value10 = environment.__proto__; moduleValue = require(1840) /* metro dependency 1840 */; isScrollAtEnd2 = moduleValue.isScrollAtEnd(scroll.value, layout.value.height, size.value.height, inverted); if (keyboardLiftBehavior !== 'persistent') { moduleValue2 = require(1840) /* metro dependency 1840 */; if (moduleValue2.shouldShiftContent(keyboardLiftBehavior, isScrollAtEnd2)) { invertedBinding = inverted; Math = global.Math; max = Math.max; if (invertedBinding) { env0_11(Reflect.apply(max, Math, [scroll.value - value9, -value8])); } else { value16 = Reflect.apply(max, Math, [size.value.height - layout.value.height + value8, 0]); Math = global.Math; env0_11(Math.min(scroll.value + value9, value16)); } } } else if (value9 < 0) { if (isScrollAtEnd2) { moduleValue2 = require(1840) /* metro dependency 1840 */; if (moduleValue2.shouldShiftContent(keyboardLiftBehavior, isScrollAtEnd2)) { invertedBinding = inverted; Math = global.Math; max = Math.max; if (invertedBinding) { env0_11(Reflect.apply(max, Math, [scroll.value - value9, -value8])); } else { value16 = Reflect.apply(max, Math, [size.value.height - layout.value.height + value8, 0]); Math = global.Math; env0_11(Math.min(scroll.value + value9, value16)); } } } } else { moduleValue2 = require(1840) /* metro dependency 1840 */; if (moduleValue2.shouldShiftContent(keyboardLiftBehavior, isScrollAtEnd2)) { invertedBinding = inverted; Math = global.Math; max = Math.max; if (invertedBinding) { env0_11(Reflect.apply(max, Math, [scroll.value - value9, -value8])); } else { value16 = Reflect.apply(max, Math, [size.value.height - layout.value.height + value8, 0]); Math = global.Math; env0_11(Math.min(scroll.value + value9, value16)); } } } } } } } } function _fun19972() { // fn#19972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1968:1951, offset: 0x00ebb474, size: 58 bytes, params: 1, frame: 18 let value = environment.__proto__.__proto__; value = require(1610) /* metro dependency 1610 */; value.scrollTo(scrollViewRef, 0, env0_0, false); }