/* Metro module 15314; source: modules/launchpad/native/useLaunchPadState.native.tsx; dependencies: [31, 11324, 15315, 4017, 14283, 11281, 11282, 2] */ function _fun117064(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:6, offset: 0x024a2250, size: 345 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importAll(31) /* metro dependency 31 */; const launchPadConstantsModule = require(11324) /* metro dependency 11324: LaunchPadConstants */; const env0_4 = launchPadConstantsModule.LAUNCH_PAD_PULL_TAB_MAX_POSITION; const env0_5 = launchPadConstantsModule.LAUNCH_PAD_PULL_TAB_SCALE_OFFSET; const env0_6 = {'active': false, 'initialLaunchPadPosition': 0, 'initialPullTabPosition': 0, 'initialTouchX': 0, 'initialTouchY': 0, 'positionOffsetX': 0, 'positionOffsetY': 0, 'startTime': -1, 'requiresPop': false, 'startShown': false}; ({'position': null, 'scale': 1, 'offset': 0, 'minimized': false}).position = (require(15315) /* metro dependency 15315: LaunchPadPullTabCache */).getLaunchPadPullTabPositionCached(); object = {code: 'function useLaunchPadStateNativeTsx1(shown){const{launchPadShown}=this.__closure;launchPadShown.set(shown);}'}; object = {code: 'function useLaunchPadStateNativeTsx2(value){const{launchPadSharedState}=this.__closure;launchPadSharedState.set(Math.max(Math.min(value,1),0));}'}; object = {code: 'function useLaunchPadStateNativeTsx3(positionY){const{getWindowDimensionsWorklet,launchPadPullTabState,LAUNCH_PAD_PULL_TAB_MAX_POSITION,getSafeAreaInsetsWorklet,LAUNCH_PAD_PULL_TAB_SCALE_OFFSET,updateSharedValueIfChanged,runOnJS,persistLaunchPadPullTabPosition}=this.__closure;const positionYMax=getWindowDimensionsWorklet().height-launchPadPullTabState.get().offset-LAUNCH_PAD_PULL_TAB_MAX_POSITION;const positionYMin=getSafeAreaInsetsWorklet().top+LAUNCH_PAD_PULL_TAB_SCALE_OFFSET;const position=Math.max(Math.min(positionY,positionYMax),positionYMin);updateSharedValueIfChanged(launchPadPullTabState,{position:position});runOnJS(persistLaunchPadPullTabPosition)(position);}'}; object = {code: 'function useLaunchPadStateNativeTsx4(translationY){const{gestureState,setLaunchPadPullTabBoundedPosition}=this.__closure;const positionY=gestureState.get().initialPullTabPosition+translationY;setLaunchPadPullTabBoundedPosition(positionY);}'}; object = {code: 'function useLaunchPadStateNativeTsx5(position,offset){const{updateSharedValueIfChanged,launchPadPullTabState}=this.__closure;updateSharedValueIfChanged(launchPadPullTabState,{position:position,offset:offset});}'}; object = {code: 'function useLaunchPadStateNativeTsx6(scale){const{updateSharedValueIfChanged,launchPadPullTabState}=this.__closure;updateSharedValueIfChanged(launchPadPullTabState,{scale:scale});}'}; object = {code: 'function useLaunchPadStateNativeTsx7(minimized){const{updateSharedValueIfChanged,launchPadPullTabState}=this.__closure;updateSharedValueIfChanged(launchPadPullTabState,{minimized:minimized});}'}; object = {code: 'function useLaunchPadStateNativeTsx8(){const{launchPadPullTabState,setLaunchPadPullTabBoundedPosition}=this.__closure;const positionY=launchPadPullTabState.get().position;setLaunchPadPullTabBoundedPosition(positionY);}'}; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/launchpad/native/useLaunchPadState.native.tsx'); exports.default = useLaunchPadState; } function useLaunchPadState() { // fn#117065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:2613, offset: 0x024a23a9, size: 197 bytes, params: 1, frame: 20 const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(env0_6); const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(env0_7); const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0); const value5 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false); const binding = value5; const useMemo = binding.useMemo; let object = [value2, value3, value4, value5]; object = {launchPadSharedState: value4, launchPadPullTabState: value3, launchPadShown: value5, gestureState: value2, updaters: Reflect.apply(useMemo, binding, [_fun117066, object])}; return object; } function _fun117066() { // fn#117066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:2772, offset: 0x024a246e, size: 626 bytes, params: 1, frame: 22 var object2; let closure = setLaunchPadShown; closure.__closure = {launchPadShown: env0_3}; closure.__workletHash = 17051366113851; closure.__initData = env1_8; const closure2 = setLaunchPadPosition; closure2.__closure = {launchPadSharedState: env0_2}; closure2.__workletHash = 128574367175; closure2.__initData = env1_9; const closure3 = setLaunchPadPullTabBoundedPosition; object2 = {}; const getWindowDimensionsWorklet = (require(14283) /* metro dependency 14283: useWindowDimensionsSharedValueNative */).getWindowDimensionsWorklet; object2.getWindowDimensionsWorklet = getWindowDimensionsWorklet; const binding = env0_1; object2.launchPadPullTabState = binding; object2.LAUNCH_PAD_PULL_TAB_MAX_POSITION = LAUNCH_PAD_PULL_TAB_MAX_POSITION; const getSafeAreaInsetsWorklet = (require(11281) /* metro dependency 11281: useSafeAreaInsetsSharedValueNative */).getSafeAreaInsetsWorklet; object2.getSafeAreaInsetsWorklet = getSafeAreaInsetsWorklet; object2.LAUNCH_PAD_PULL_TAB_SCALE_OFFSET = LAUNCH_PAD_PULL_TAB_SCALE_OFFSET; object2.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */; object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS; object2.persistLaunchPadPullTabPosition = (require(15315) /* metro dependency 15315: LaunchPadPullTabCache */).persistLaunchPadPullTabPosition; closure3.__closure = object2; closure3.__workletHash = 10962658404039; closure3.__initData = env1_10; object2 = {setLaunchPadShown: closure, setLaunchPadPosition: closure2}; closure = setLaunchPadPullTabTranslation; closure.__closure = {gestureState: env0_0, setLaunchPadPullTabBoundedPosition: closure3}; closure.__workletHash = 14133148345236; closure.__initData = env1_11; object2.setLaunchPadPullTabTranslation = closure; closure = setLaunchPadPullTabPosition; closure.__closure = {updateSharedValueIfChanged: importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */, launchPadPullTabState: binding}; closure.__workletHash = 2910499659585; closure.__initData = env1_12; object2.setLaunchPadPullTabPosition = closure; closure = setLaunchPadPullTabScale; closure.__closure = {updateSharedValueIfChanged: importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */, launchPadPullTabState: binding}; closure.__workletHash = 2074690206772; closure.__initData = env1_13; object2.setLaunchPadPullTabScale = closure; closure = setLaunchPadPullTabMinimized; closure.__closure = {updateSharedValueIfChanged: importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */, launchPadPullTabState: binding}; closure.__workletHash = 6903049267633; closure.__initData = env1_14; object2.setLaunchPadPullTabMinimized = closure; closure = onWindowHeightChange; closure.__closure = {launchPadPullTabState: binding, setLaunchPadPullTabBoundedPosition: closure3}; closure.__workletHash = 11005162001151; closure.__initData = env1_15; object2.onWindowHeightChange = closure; return object2; } function setLaunchPadShown(a0) { // fn#117067, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:2803, offset: 0x024a26e0, size: 24 bytes, params: 2, frame: 11 env1_3.set(a0); } function setLaunchPadPosition(a0) { // fn#117068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:2909, offset: 0x024a26f8, size: 65 bytes, params: 2, frame: 17 const value = environment.__proto__; const binding = env1_2; const set = binding.set; const Math = global.Math; const max = Math.max; const Math2 = global.Math; Reflect.apply(set, binding, [Reflect.apply(max, Math, [Math2.min(a0, 1), 0])]); } function setLaunchPadPullTabBoundedPosition(a0) { // fn#117069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:3044, offset: 0x024a2739, size: 223 bytes, params: 2, frame: 21 let value = environment.__proto__.__proto__; const useWindowDimensionsSharedValueNativeModule = require(14283) /* metro dependency 14283: useWindowDimensionsSharedValueNative */; const getWindowDimensionsWorklet = useWindowDimensionsSharedValueNativeModule.getWindowDimensionsWorklet; const height = Reflect.apply(getWindowDimensionsWorklet, useWindowDimensionsSharedValueNativeModule, []).height; const binding = env1_1; const get = binding.get; const value4 = height - Reflect.apply(get, binding, []).offset - LAUNCH_PAD_PULL_TAB_MAX_POSITION; const useSafeAreaInsetsSharedValueNativeModule = require(11281) /* metro dependency 11281: useSafeAreaInsetsSharedValueNative */; const getSafeAreaInsetsWorklet = useSafeAreaInsetsSharedValueNativeModule.getSafeAreaInsetsWorklet; const value5 = Reflect.apply(getSafeAreaInsetsWorklet, useSafeAreaInsetsSharedValueNativeModule, []).top + LAUNCH_PAD_PULL_TAB_SCALE_OFFSET; const Math = global.Math; const max = Math.max; const Math2 = global.Math; const value6 = Reflect.apply(max, Math, [Math2.min(a0, value4), value5]); (importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(binding, {position: value6}); value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS((require(15315) /* metro dependency 15315: LaunchPadPullTabCache */).persistLaunchPadPullTabPosition)(value6); } function setLaunchPadPullTabTranslation(a0) { // fn#117070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:3770, offset: 0x024a2818, size: 45 bytes, params: 2, frame: 11 const value = environment.__proto__; const binding = env1_0; const get = binding.get; setLaunchPadPullTabBoundedPosition(Reflect.apply(get, binding, []).initialPullTabPosition + a0); } function setLaunchPadPullTabPosition(a0, a1) { // fn#117071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:3972, offset: 0x024a2845, size: 57 bytes, params: 3, frame: 14 const value = environment.__proto__.__proto__; (importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_1, {position: a0, offset: a1}); } function setLaunchPadPullTabScale(a0) { // fn#117072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:4169, offset: 0x024a287e, size: 50 bytes, params: 2, frame: 14 const value = environment.__proto__.__proto__; (importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_1, {scale: a0}); } function setLaunchPadPullTabMinimized(a0) { // fn#117073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:4356, offset: 0x024a28b0, size: 50 bytes, params: 2, frame: 14 const value = environment.__proto__.__proto__; (importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_1, {minimized: a0}); } function onWindowHeightChange() { // fn#117074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15511:4539, offset: 0x024a28e2, size: 37 bytes, params: 1, frame: 11 const binding = env1_1; const get = binding.get; setLaunchPadPullTabBoundedPosition(Reflect.apply(get, binding, []).position); }