/* Metro module 8811; source: design/components/ContextMenu/native/ContextMenu.native.tsx; dependencies: [31, 33, 4020, 477, 4017, 1478, 8812, 4584, 8813, 4570, 8814, 4002, 1244, 8815, 5321, 4081, 4559, 2] */ function _fun68866(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6, offset: 0x01c5fc5f, size: 347 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 */; let value = require(33) /* metro dependency 33 */; const env0_4 = value.Fragment; const env0_5 = value.jsx; value = require(4020) /* metro dependency 4020: FabricUtils */; value = value.isFabric(); if (value) { value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isIOS(); } object = {code: "function ContextMenuNativeTsx1(){const{_isFabricIOS,buttonTagSV,measureInWindowForFWO,measure,buttonRef,title,itemCount,dividerIndexes,approximateItemHeight,CONTEXT_MENU_DIVIDER_HEIGHT,CONTEXT_MENU_OFFSET,screenHeight,CONTEXT_MENU_EDGE_OFFSET,screenWidth,CONTEXT_MENU_MIN_WIDTH,menuAlign,runOnJS,showMenu}=this.__closure;let pageX;let pageY;let width;let height;if(_isFabricIOS){const tag=buttonTagSV.get();if(tag===-1)return;const m=measureInWindowForFWO(tag);if(m==null)return;pageX=m.x;pageY=m.y;width=m.width;height=m.height;}else{const m=measure(buttonRef);if(m==null)return;pageX=m.pageX;pageY=m.pageY;width=m.width;height=m.height;}const rowCount=title!=null?itemCount+1:itemCount;const dividerCount=(title!=null?1:0)+dividerIndexes.length;const menuHeight=approximateItemHeight.get()*rowCount+CONTEXT_MENU_DIVIDER_HEIGHT*dividerCount;const positionBelowOffset=pageY+height+CONTEXT_MENU_OFFSET;const positionAboveOffset=screenHeight-pageY+CONTEXT_MENU_OFFSET;const availableSpaceBelow=screenHeight-positionBelowOffset-CONTEXT_MENU_EDGE_OFFSET;const availableSpaceAbove=pageY-CONTEXT_MENU_EDGE_OFFSET;const wouldOverflowBelow=availableSpaceBelowavailableSpaceAbove){positionY='below';}else{positionY='above';}}else if(wouldOverflowBelow){positionY='above';}else{positionY='below';}y=(positionY==='above'?positionAboveOffset:positionBelowOffset)+(offset!==null&&offset!==void 0?offset:0);return{y:y,positionY:positionY};}function autoPositionHorizontal(){'worklet';const distanceFromLeftEdge=pageX-CONTEXT_MENU_EDGE_OFFSET;const distanceFromRightEdge=screenWidth-CONTEXT_MENU_EDGE_OFFSET-(pageX+CONTEXT_MENU_MIN_WIDTH);let positionX='left';let x=pageX;if(distanceFromLeftEdge>distanceFromRightEdge){positionX='right';x=minimumRightPosition;}return{x:x,positionX:positionX};}if(menuAlign==='auto'){const{y:y,positionY:positionY}=autoPositionVertical();const{x:x,positionX:positionX}=autoPositionHorizontal();runOnJS(showMenu)(x,y,positionX,positionY,menuHeight,width);}else if(menuAlign==='above'||menuAlign==='below'){const positionY=menuAlign;const y=positionY==='above'?positionAboveOffset:positionBelowOffset;const{x:x,positionX:positionX}=autoPositionHorizontal();runOnJS(showMenu)(x,y,positionX,positionY,menuHeight,width);}else{const positionX=menuAlign==='left'?'right':'left';const x=positionX==='left'?pageX+width+CONTEXT_MENU_OFFSET:minimumRightPosition+width+CONTEXT_MENU_OFFSET;const{y:y,positionY:positionY}=autoPositionVertical(-1*(CONTEXT_MENU_OFFSET+height));runOnJS(showMenu)(x,y,positionX,positionY,menuHeight,width);}}"}; object = {code: "function autoPositionVertical_ContextMenuNativeTsx2(offset){const{pageY,height,CONTEXT_MENU_OFFSET,wouldOverflowBelow,wouldOverflowAbove,availableSpaceBelow,availableSpaceAbove,positionAboveOffset,positionBelowOffset}=this.__closure;let positionY='below';let y=pageY+height+CONTEXT_MENU_OFFSET;if(wouldOverflowBelow===wouldOverflowAbove){if(availableSpaceBelow>availableSpaceAbove){positionY='below';}else{positionY='above';}}else if(wouldOverflowBelow){positionY='above';}else{positionY='below';}y=(positionY==='above'?positionAboveOffset:positionBelowOffset)+(offset!==null&&offset!==void 0?offset:0);return{y:y,positionY:positionY};}"}; object = {code: "function autoPositionHorizontal_ContextMenuNativeTsx3(){const{pageX,CONTEXT_MENU_EDGE_OFFSET,screenWidth,CONTEXT_MENU_MIN_WIDTH,minimumRightPosition}=this.__closure;const distanceFromLeftEdge=pageX-CONTEXT_MENU_EDGE_OFFSET;const distanceFromRightEdge=screenWidth-CONTEXT_MENU_EDGE_OFFSET-(pageX+CONTEXT_MENU_MIN_WIDTH);let positionX='left';let x=pageX;if(distanceFromLeftEdge>distanceFromRightEdge){positionX='right';x=minimumRightPosition;}return{x:x,positionX:positionX};}"}; object = {code: 'function onPanGestureEnd_ContextMenuNativeTsx4(){const{state,runOnJS,requestClose}=this.__closure;const{activeIndex:activeIndex}=state;const isDismiss=activeIndex.get()===-1;runOnJS(requestClose)(isDismiss);}'}; object = {code: 'function ContextMenuNativeTsx5(e){const{updateContextMenuState,state}=this.__closure;updateContextMenuState(e.absoluteX,e.absoluteY,state);}'}; object = {code: 'function ContextMenuNativeTsx6(){const{runOnJS,triggerHapticFeedback,HapticFeedbackTypes,measureButtonAndShowMenu}=this.__closure;runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);measureButtonAndShowMenu();}'}; object = {code: 'function ContextMenuNativeTsx7(){const{measureButtonAndShowMenu}=this.__closure;measureButtonAndShowMenu();}'}; object = {code: 'function ContextMenuNativeTsx8(e){const{updateContextMenuState,state}=this.__closure;updateContextMenuState(e.absoluteX,e.absoluteY,state);}'}; object = {code: 'function ContextMenuNativeTsx9(){const{runOnJS,triggerHapticFeedback,HapticFeedbackTypes,measureButtonAndShowMenu}=this.__closure;runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);measureButtonAndShowMenu();}'}; (require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/ContextMenu/native/ContextMenu.native.tsx'); exports.ContextMenu = ContextMenu; } function ContextMenu({children, items, triggerOnLongPress, triggerOnTap, disableGesture, align, title, onOpen, onClose, keyboardShouldPersistTaps, returnRef, enabled, buttonRef}) { // fn#68867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5427, offset: 0x01c5fdba, size: 1467 bytes, params: 2, frame: 45 var object2; triggerOnLongPress = !(triggerOnLongPress === undefined) && triggerOnLongPress; triggerOnTap = !(triggerOnTap === undefined) && triggerOnTap; disableGesture = !(disableGesture === undefined) && disableGesture; align = align === undefined ? 'auto' : align; const env0_3 = align; const env0_6 = onClose; const env0_7 = keyboardShouldPersistTaps; enabled = enabled === undefined || enabled; const r11 = buttonRef ?? (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef(); const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */; let useSharedValue = reanimatedRexportModule.useSharedValue; const value9 = Reflect.apply(useSharedValue, reanimatedRexportModule, [-1]); let binding = env0_3; binding.useEffect(function() { return buttonRef.observe(_fun68869); }, [r11, value9]); const {items, dividerIndexes} = binding.useMemo(function() { var r2; var itemsBinding = items; var Array = global.Array; var isArray = Array.isArray(itemsBinding[0]); itemsBinding = items; r2 = isArray ? itemsBinding.flat() : itemsBinding; var env0_0 = r2; if (isArray) { items.forEach(_fun68871); } return {items: r2, dividerIndexes: []}; }, [itemsBinding]); const length = itemsBinding.length; const {width, height} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: (require(477) /* metro dependency 477: PlatformUtils */).isAndroid()}); const value12 = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).useContextMenuState(); const activeIndex = value12.activeIndex; const value13 = (require(4584) /* metro dependency 4584: useFontScale */).useFontScale(); const r7 = returnRef !== undefined ? returnRef : r11; const value14 = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).useActiveContextMenu(); const moduleValue7 = reanimatedRexportModule; useSharedValue = moduleValue7.useSharedValue; const Math = global.Math; const max = Math.max; const CONTEXT_MENU_ITEM_BASE_HEIGHT = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_ITEM_BASE_HEIGHT; const CONTEXT_MENU_ITEM_PADDING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_ITEM_PADDING; const value17 = Reflect.apply(useSharedValue, moduleValue7, [Reflect.apply(max, Math, [(CONTEXT_MENU_ITEM_BASE_HEIGHT - 2 * CONTEXT_MENU_ITEM_PADDING) * value13 + 2 * CONTEXT_MENU_ITEM_PADDING, CONTEXT_MENU_ITEM_BASE_HEIGHT])]); binding = env0_3; const env0_21 = binding.useRef(itemsBinding); binding.useLayoutEffect(_fun68872, [itemsBinding]); binding.useLayoutEffect(_fun68873, [value14, value12]); let useCallback = binding.useCallback; const value18 = Reflect.apply(useCallback, binding, [_fun68874, [activeIndex, onClose]]); const value20 = binding.useCallback(_fun68876, [onOpen, value12, itemsBinding, title, keyboardShouldPersistTaps, value18, binding.useCallback(_fun68875, [r7]), dividerIndexes]); useCallback = binding.useCallback; const closure = ContextMenuV; object2 = {_isFabricIOS: env0_6, buttonTagSV: value9}; object2.measureInWindowForFWO = (require(8815) /* metro dependency 8815: FWOMeasureUtils */).measureInWindowForFWO; object2.measure = reanimatedRexportModule.measure; object2.buttonRef = r11; object2.title = title; object2.itemCount = length; object2.dividerIndexes = dividerIndexes; object2.approximateItemHeight = value17; const CONTEXT_MENU_DIVIDER_HEIGHT = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_DIVIDER_HEIGHT; object2.CONTEXT_MENU_DIVIDER_HEIGHT = CONTEXT_MENU_DIVIDER_HEIGHT; const CONTEXT_MENU_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_OFFSET; object2.CONTEXT_MENU_OFFSET = CONTEXT_MENU_OFFSET; object2.screenHeight = height; const CONTEXT_MENU_EDGE_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET; object2.CONTEXT_MENU_EDGE_OFFSET = CONTEXT_MENU_EDGE_OFFSET; object2.screenWidth = width; const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH; object2.CONTEXT_MENU_MIN_WIDTH = CONTEXT_MENU_MIN_WIDTH; object2.menuAlign = align; object2.runOnJS = reanimatedRexportModule.runOnJS; object2.showMenu = value20; closure.__closure = object2; closure.__workletHash = 6408542373252; closure.__initData = env0_7; const value21 = Reflect.apply(useCallback, binding, [closure, [r11, value9, value17, title, length, height, align, value20, width, dividerIndexes]]); const value22 = binding.useMemo(_fun68882, [triggerOnLongPress, triggerOnTap, value18, enabled, value12, value21]); const value23 = binding.useMemo(function() { return items.map(_fun68891); }, [itemsBinding]); const value24 = binding.useCallback(_fun68892, [itemsBinding]); const value25 = binding.useCallback(_fun68894, [value21]); const value26 = binding.useCallback(_fun68895, [value21]); object2 = {ref: r11, onPress: value25}; object2.onLongPress = triggerOnLongPress && disableGesture ? value26 : undefined; object2.accessibilityActions = value23; object2.onAccessibilityAction = value24; if (disableGesture) { return ( <> {children(object2)} ); } else { const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector; return ( {children(object2)} ); } } function _fun68868() { // fn#68868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5730, offset: 0x01c60375, size: 29 bytes, params: 1, frame: 11 return buttonRef.observe(_fun68869); } function _fun68870() { // fn#68870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5795, offset: 0x01c603b0, size: 105 bytes, params: 1, frame: 14 let itemsBinding = items; const Array = global.Array; const isArray2 = Array.isArray(itemsBinding[0]); itemsBinding = items; const r2 = isArray2 ? itemsBinding.flat() : itemsBinding; if (isArray2) { items.forEach(_fun68871); } return {items: r2, dividerIndexes: []}; } function _fun68872() { // fn#68872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6440, offset: 0x01c6044d, size: 21 bytes, params: 1, frame: 2 env0_21.current = items; } function _fun68873() { // fn#68873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6483, offset: 0x01c60462, size: 57 bytes, params: 1, frame: 12 var value2; if (env0_19 == null) { value2 = environment.__proto__; (require(8812) /* metro dependency 8812: ContextMenuStateNative */).resetContextMenuState(env0_17); } } function _fun68874(a0) { // fn#68874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6562, offset: 0x01c6049b, size: 113 bytes, params: 2, frame: 13 var property; if (onClose != null) { onClose(a0); } (require(8812) /* metro dependency 8812: ContextMenuStateNative */).hideContextMenu(); const value3 = activeIndex.get(); if (value3 !== -1) { property = env0_21.current[value3]; if (property != null) { property.action(); } } } function _fun68875() { // fn#68875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6693, offset: 0x01c6050c, size: 51 bytes, params: 1, frame: 13 const value = environment.__proto__; (require(4570) /* metro dependency 4570: setAccessibilityFocusAndroid */).setAccessibilityFocus({ref: returnRef}); } function _fun68876(a0, a1, a2, a3, a4, a5) { // fn#68876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6761, offset: 0x01c6053f, size: 303 bytes, params: 7, frame: 16 var AccessibilityAnnouncer; var announce; var intl; if (onOpen != null) { onOpen(); } const object2 = {}; object2.key = (require(8814) /* metro dependency 8814: UID */).uid(); object2.x = a0; object2.y = a1; object2.positionX = a2; object2.positionY = a3; object2.height = a4; object2.width = a5; object2.state = env0_17; object2.items = items; object2.title = title; object2.keyboardShouldPersistTaps = keyboardShouldPersistTaps; object2.requestClose = env0_22; object2.onClose = env0_23; object2.dividerIndexes = dividerIndexes; (require(8812) /* metro dependency 8812: ContextMenuStateNative */).showContextMenu(object2); const value = require(477) /* metro dependency 477: PlatformUtils */; if (value.isAndroid()) { AccessibilityAnnouncer = (require(4002) /* metro dependency 4002: shared */).AccessibilityAnnouncer; announce = AccessibilityAnnouncer.announce; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; Reflect.apply(announce, AccessibilityAnnouncer, [intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ZqK0uI)]); } } function ContextMenuV() { // fn#68877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:7131, owner: ContextMenu.V, offset: 0x01c6066e, size: 924 bytes, params: 1, frame: 31 var environment; var width2; var r11; var r13; var r15; var r14; var r12; var value5; var value6; var x; var y; var width4; var height3; var value25; var positionY; var value31; var positionX; var value32; var value33; let value = environment.__proto__; if (env1_6) { value5 = env0_11.get(); if (value5 === -1) { return undefined; } value6 = (require(8815) /* metro dependency 8815: FWOMeasureUtils */).measureInWindowForFWO(value5); if (value6 == null) { return undefined; } x = value6.x; y = value6.y; width4 = value6.width; height3 = value6.height; width2 = width4; r11 = height3; r13 = x; r15 = y; } else { var moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */; var value3 = moduleValue.measure(buttonRef); if (value3 == null) { return undefined; } var pageX = value3.pageX; var pageY = value3.pageY; var width3 = value3.width; var height2 = value3.height; width2 = width3; r11 = height2; r13 = pageX; r15 = pageY; } const r4 = title != null ? length + 1 : length; const value11 = (title != null ? 1 : 0) + dividerIndexes.length; const binding = env0_20; const get = binding.get; const value12 = Reflect.apply(get, binding, []) * r4; const CONTEXT_MENU_DIVIDER_HEIGHT = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_DIVIDER_HEIGHT; const value13 = value12 + CONTEXT_MENU_DIVIDER_HEIGHT * value11; const value14 = r15 + r11; const CONTEXT_MENU_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_OFFSET; const value15 = value14 + CONTEXT_MENU_OFFSET; const value17 = height - r15 + CONTEXT_MENU_OFFSET; const value18 = height - value15; const CONTEXT_MENU_EDGE_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET; const value19 = value18 - CONTEXT_MENU_EDGE_OFFSET; const value20 = r15 - CONTEXT_MENU_EDGE_OFFSET; const result = value19 < value13; const result_2 = value20 < value13; const Math = global.Math; const value22 = Math.max(width - r13 - width2, CONTEXT_MENU_EDGE_OFFSET); const value23 = _fun68878(); const value24 = _fun68880(); let alignBinding = align; if (alignBinding === 'auto') { value32 = value23(); y = value32.y; positionY = value32.positionY; value33 = value24(); x = value33.x; positionX = value33.positionX; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(x, y, positionX, positionY, value13, width2); } else { alignBinding = align; if (alignBinding === 'above') { alignBinding = align; r12 = alignBinding !== 'above' ? value15 : value17; value31 = value24(); x = value31.x; positionX = value31.positionX; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(x, r12, positionX, alignBinding, value13, width2); } else { alignBinding = align; if (alignBinding === 'below') { alignBinding = align; r12 = alignBinding !== 'above' ? value15 : value17; value31 = value24(); x = value31.x; positionX = value31.positionX; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(x, r12, positionX, alignBinding, value13, width2); } else { alignBinding = align; value25 = 'left'; r15 = value25 !== alignBinding ? value25 : 'right'; r14 = value25 === r15 ? r13 + width2 + CONTEXT_MENU_OFFSET : value22 + width2 + CONTEXT_MENU_OFFSET; value = value23(-1 * (CONTEXT_MENU_OFFSET + r11)); y = value.y; positionY = value.positionY; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(r14, y, r15, positionY, value13, width2); } } } } function _fun68882() { // fn#68882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:9749, offset: 0x01c60c46, size: 745 bytes, params: 1, frame: 23 var r0; const Gesture = (require(5321) /* metro dependency 5321 */).Gesture; var value4; var enabledBinding; var value5; var onBegin; var closure; const runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS; const triggerHapticFeedback = (require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback; const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes; var value6; var onUpdate; const updateContextMenuState = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).updateContextMenuState; var onStart; var value8; var enabled4; var value9; var shouldCancelWhenOutside2; let value = _fun68883(); if (triggerOnLongPress) { value8 = Gesture.Pan(); enabled4 = value8.enabled; enabledBinding = enabled; value9 = Reflect.apply(enabled4, value8, [enabledBinding]); onUpdate = value9.onUpdate; closure = i_68885; closure.__closure = {updateContextMenuState: updateContextMenuState, state: env0_17}; closure.__workletHash = 2460213213323; closure.__initData = env1_11; value = Reflect.apply(onUpdate, value9, [closure]).onEnd(value); shouldCancelWhenOutside2 = Gesture.LongPress().enabled(enabledBinding).shouldCancelWhenOutside(false); onStart = shouldCancelWhenOutside2.onStart; closure = n_68886; closure.__closure = {runOnJS: runOnJS, triggerHapticFeedback: triggerHapticFeedback, HapticFeedbackTypes: HapticFeedbackTypes, measureButtonAndShowMenu: env0_25}; closure.__workletHash = 12352363869337; closure.__initData = env1_12; return Gesture.Simultaneous(Reflect.apply(onStart, shouldCancelWhenOutside2, [closure]), value); } if (triggerOnTap) { value = Gesture.Tap(); value = value.enabled(enabled); onStart = value.onStart; closure = o_68887; closure.__closure = {measureButtonAndShowMenu: env0_25}; closure.__workletHash = 13410382812897; closure.__initData = env1_13; value = Reflect.apply(onStart, value, [closure]); r0 = value; } else { value4 = Gesture.Pan(); value5 = value4.enabled(enabled); onBegin = value5.onBegin; closure = t_68888; closure.__closure = {runOnJS: runOnJS, triggerHapticFeedback: triggerHapticFeedback, HapticFeedbackTypes: HapticFeedbackTypes, measureButtonAndShowMenu: env0_25}; closure.__workletHash = 12845174582902; closure.__initData = env1_15; value6 = Reflect.apply(onBegin, value5, [closure]); onUpdate = value6.onUpdate; closure = e_68889; closure.__closure = {updateContextMenuState: updateContextMenuState, state: env0_17}; closure.__workletHash = 17473642675622; closure.__initData = env1_14; value = Reflect.apply(onUpdate, value6, [closure]).onEnd(value); r0 = value; } return r0; } function _fun68890() { // fn#68890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11526, offset: 0x01c6107a, size: 28 bytes, params: 1, frame: 11 return items.map(function(a0) { return {name: a0.label, label: a0.label}; }); } function _fun68892(a0) { // fn#68892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11596, offset: 0x01c610af, size: 68 bytes, params: 2, frame: 12 const env0_0 = a0; const value = items.find(_fun68893); if (!(value == null || value.action == null)) { value.action(); } } function _fun68894() { // fn#68894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11716, offset: 0x01c61114, size: 115 bytes, params: 1, frame: 14 let value = environment.__proto__; if ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() && (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled()) { value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnUI(env0_25)(); } } function _fun68895() { // fn#68895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11825, offset: 0x01c61187, size: 49 bytes, params: 1, frame: 12 let value = environment.__proto__; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnUI(env0_25)(); } function _fun68869(a0) { // fn#68869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5745, offset: 0x01c60392, size: 30 bytes, params: 2, frame: 11 var value; if (a0 != null) { value = environment.__proto__; env1_11.set(a0); } } function _fun68871(a0, a1) { // fn#68871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5908, offset: 0x01c60419, size: 52 bytes, params: 3, frame: 14 var binding; var push; var binding2; if (a1 > 0) { binding = env0_1; push = binding.push; binding2 = env0_0; Reflect.apply(push, binding, [binding2.indexOf(a0[0])]); } } function _fun68878() { // fn#68878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:7675, offset: 0x01c60a0a, size: 167 bytes, params: 1, frame: 15 const closure = autoPositionVertical; const object2 = {}; object2.pageY = env0_1; object2.height = height; const CONTEXT_MENU_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_OFFSET; object2.CONTEXT_MENU_OFFSET = CONTEXT_MENU_OFFSET; object2.wouldOverflowBelow = result; object2.wouldOverflowAbove = result_2; object2.availableSpaceBelow = env0_5; object2.availableSpaceAbove = env0_6; object2.positionAboveOffset = env0_4; object2.positionBelowOffset = env0_3; closure.__closure = object2; closure.__workletHash = 15309589830995; closure.__initData = env2_8; return closure; } function _fun68880() { // fn#68880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:8210, offset: 0x01c60b3e, size: 136 bytes, params: 1, frame: 17 const closure = autoPositionHorizontal; const object2 = {}; object2.pageX = env0_0; const CONTEXT_MENU_EDGE_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET; object2.CONTEXT_MENU_EDGE_OFFSET = CONTEXT_MENU_EDGE_OFFSET; object2.screenWidth = width; const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH; object2.CONTEXT_MENU_MIN_WIDTH = CONTEXT_MENU_MIN_WIDTH; object2.minimumRightPosition = env0_9; closure.__closure = object2; closure.__workletHash = 14761866330436; closure.__initData = env2_9; return closure; } function _fun68883() { // fn#68883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:9770, offset: 0x01c60f2f, size: 99 bytes, params: 1, frame: 15 const closure = onPanGestureEnd; const object2 = {}; object2.state = env1_17; object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS; object2.requestClose = env1_22; closure.__closure = object2; closure.__workletHash = 12851223476540; closure.__initData = env2_10; return closure; } function i_68885({absoluteX, absoluteY}) { // fn#68885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:10098, offset: 0x01c60fe0, size: 62 bytes, params: 2, frame: 16 const value = environment.__proto__.__proto__; (require(8812) /* metro dependency 8812: ContextMenuStateNative */).updateContextMenuState(absoluteX, absoluteY, env1_17); } function n_68886() { // fn#68886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:10385, offset: 0x01c6101e, size: 92 bytes, params: 1, frame: 15 let value = environment.__proto__.__proto__; value = Reflect.apply((require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS, value, [(require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback]); const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes; const IMPACT_MEDIUM = HapticFeedbackTypes.IMPACT_MEDIUM; value(IMPACT_MEDIUM); value = environment.__proto__; env1_25(); } function autoPositionVertical(a0) { // fn#68879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:7711, offset: 0x01c60ab1, size: 141 bytes, params: 2, frame: 14 const value = a0; (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_OFFSET; const r1 = result === result_2 ? env1_5 > env1_6 ? 'below' : 'above' : result ? 'above' : 'below'; return {y: (r1 === 'above' ? env1_4 : env1_3) + (value ?? 0), positionY: r1}; } function autoPositionHorizontal() { // fn#68881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:8248, offset: 0x01c60bc6, size: 128 bytes, params: 1, frame: 16 var r1; var r2; const value = environment.__proto__; let binding = env1_0; const CONTEXT_MENU_EDGE_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET; const value3 = binding - CONTEXT_MENU_EDGE_OFFSET; const value5 = width - CONTEXT_MENU_EDGE_OFFSET; binding = env1_0; const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH; const value6 = value5 - (binding + CONTEXT_MENU_MIN_WIDTH); binding = env1_0; if (value3 > value6) { binding = env1_9; r1 = 'right'; r2 = binding; } else { r1 = 'left'; r2 = binding; } return {x: r2, positionX: r1}; } function onPanGestureEnd() { // fn#68884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:9801, offset: 0x01c60f92, size: 78 bytes, params: 1, frame: 13 const value = environment.__proto__.__proto__; (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env2_22)(env2_17.activeIndex.get() === -1); }