/* Metro module 8859; source: design/components/Tabs/native/Tabs.native.tsx; dependencies: [31, 27, 1949, 33, 4017, 4501, 697, 4577, 7739, 8860, 5321, 477, 2] */ import LocaleStore from '../../../../modules/user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */ import ReanimatedRexport from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */ import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import * as CreateStylesModule from '../../Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as SpringModule from '../../../animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */ import * as TabItemNativeModule from './TabItem.native.tsx'; /* Metro dependency 8860 */ function _fun69053(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:6, offset: 0x01c665f0, size: 417 bytes, params: 8, frame: 20 const env0_0 = require; const closure = function(a0) { return a0.toLocaleString(LocaleStore.locale); }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactNativeModule; const env0_4 = value.View; const ScrollView = value.ScrollView; value = require(33) /* metro dependency 33 */; const env0_6 = value.jsx; const env0_7 = value.jsxs; const env0_8 = (ReanimatedRexport).createAnimatedComponent(ScrollView); const env0_9 = {'mass': 0.3, 'damping': 13, 'stiffness': 100, 'restDisplacementThreshold': 0.001, 'overshootClamping': true}; const env0_10 = (CreateStylesModule).createStyles(_fun69055); object = {code: 'function TabsNativeTsx1(){const{activeIndex,itemCount}=this.__closure;return Math.round(Math.min(Math.max(activeIndex.get(),0),itemCount-1));}'}; object = {code: 'function TabsNativeTsx2(){const{itemDimensions,clampedActiveIndex}=this.__closure;const activeItem=itemDimensions.get()[clampedActiveIndex.get()];if(activeItem==null)return 0;return activeItem.width;}'}; object = {code: 'function TabsNativeTsx3(){const{itemDimensions,clampedActiveIndex}=this.__closure;var _itemDimensions$get$c,_itemDimensions$get$c2;return(_itemDimensions$get$c=(_itemDimensions$get$c2=itemDimensions.get()[clampedActiveIndex.get()])===null||_itemDimensions$get$c2===void 0?void 0:_itemDimensions$get$c2.x)!==null&&_itemDimensions$get$c!==void 0?_itemDimensions$get$c:0;}'}; object = {code: "function TabsNativeTsx4(){const{indicatorTranslateX,pressedIndex,clampedActiveIndex,PRESSED_TRANSLATE_AMOUNT,indicatorWidth,scrollOverflow,interpolate,SCROLL_OVERFLOW_UPPER_BOUND,SCROLL_OVERFLOW_MAX_SCALE,withSpring,SELECTED_INDICATOR_SPRING}=this.__closure;let translateX=indicatorTranslateX.get();let scaleX=1;if(pressedIndex.get()>=0){if(pressedIndex.get()clampedActiveIndex.get()){scaleX+=PRESSED_TRANSLATE_AMOUNT;translateX+=indicatorWidth.get()*(PRESSED_TRANSLATE_AMOUNT/2);}}if(scrollOverflow.get()<0){const scaleFactor=interpolate(scrollOverflow.get(),[-SCROLL_OVERFLOW_UPPER_BOUND,0],[SCROLL_OVERFLOW_MAX_SCALE,1],'clamp');const scaleAmount=indicatorWidth.get()*(1-scaleFactor);scaleX=scaleFactor;translateX+=-scaleAmount/2;}else if(scrollOverflow.get()>0){const scaleFactor=interpolate(scrollOverflow.get(),[SCROLL_OVERFLOW_UPPER_BOUND,0],[SCROLL_OVERFLOW_MAX_SCALE,1],'clamp');const scaleAmount=indicatorWidth.get()*(1-scaleFactor);scaleX=scaleFactor;translateX+=scaleAmount/2;}return{width:withSpring(indicatorWidth.get(),SELECTED_INDICATOR_SPRING),transform:[{translateX:withSpring(translateX,SELECTED_INDICATOR_SPRING)},{scaleX:withSpring(scaleX,SELECTED_INDICATOR_SPRING)}]};}"}; object = {code: 'function TabsNativeTsx5(event){const{scrollOffset,onScrollWorklet}=this.__closure;var _onScrollWorklet;scrollOffset.set(event.contentOffset.x);(_onScrollWorklet=onScrollWorklet)===null||_onScrollWorklet===void 0||_onScrollWorklet(event.contentOffset.x);}'}; object = {code: 'function TabsNativeTsx6(){const{onEndDrag}=this.__closure;var _onEndDrag;(_onEndDrag=onEndDrag)===null||_onEndDrag===void 0||_onEndDrag();}'}; object = {code: 'function TabsNativeTsx7(){const{scrollOffset,activeIndex,itemDimensions}=this.__closure;return{scrollOffset:scrollOffset.get(),activeIndex:activeIndex.get(),itemDimensions:itemDimensions.get()};}'}; object = {code: 'function TabsNativeTsx8(props,prevState){const{cheapWorkletShallowEqual,itemSpacing,pageWidth,runOnJS,scrollToOffset,AUTO_SCROLL_BUFFER}=this.__closure;var _itemDimensions$activ,_itemDimensions$activ2,_itemDimensions$activ3;if(props.activeIndex===(prevState===null||prevState===void 0?void 0:prevState.activeIndex))return;if(cheapWorkletShallowEqual(props,prevState!==null&&prevState!==void 0?prevState:undefined))return;const{scrollOffset:scrollOffset,activeIndex:activeIndex,itemDimensions:itemDimensions}=props;const width=itemDimensions.reduce(function(sum,item){var _item$width;return sum+((_item$width=item===null||item===void 0?void 0:item.width)!==null&&_item$width!==void 0?_item$width:0);},0);const itemOffset=((_itemDimensions$activ=(_itemDimensions$activ2=itemDimensions[activeIndex])===null||_itemDimensions$activ2===void 0?void 0:_itemDimensions$activ2.x)!==null&&_itemDimensions$activ!==void 0?_itemDimensions$activ:0)+(activeIndex-1)*itemSpacing;const itemWidth=(_itemDimensions$activ3=itemDimensions[activeIndex])===null||_itemDimensions$activ3===void 0?void 0:_itemDimensions$activ3.width;if(width===0||itemOffset==null||itemWidth==null)return;if(scrollOffset+pageWidth {value14})(binding); if (value15 == null) { return binding2; } else { const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector; return ( {binding2} ); } function _fun69057({nativeEvent}) { // fn#69057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:5622, offset: 0x01c66e90, size: 41 bytes, params: 2, frame: 11 const binding = env0_18; binding.set(nativeEvent.layout.width); } function TabsW() { // fn#69059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:5881, owner: Tabs.W, offset: 0x01c66f0c, size: 51 bytes, params: 1, frame: 10 const itemDimensionsBinding = itemDimensions; let get = itemDimensionsBinding.get; const value2 = Reflect.apply(get, itemDimensionsBinding, []); const binding = env0_21; get = binding.get; const property = value2[Reflect.apply(get, binding, [])]; return property == null ? 0 : property.width; } function TabsN() { // fn#69060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:6072, owner: Tabs.N, offset: 0x01c66f3f, size: 63 bytes, params: 1, frame: 11 const itemDimensionsBinding = itemDimensions; let get = itemDimensionsBinding.get; const value2 = Reflect.apply(get, itemDimensionsBinding, []); const binding = env0_21; get = binding.get; return value2[Reflect.apply(get, binding, [])]?.x ?? 0; } function Tabs$() { // fn#69061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:6283, owner: Tabs.$, offset: 0x01c66f7e, size: 622 bytes, params: 1, frame: 23 var r4; var r5; var r3; var r6; var r10; var value5; var value6; var value8; var value11; var value13; var moduleValue; var value15; var value17; var value18; var moduleValue2; var value20; var value22; let binding = env0_23; let get = binding.get; const value2 = Reflect.apply(get, binding, []); const value3 = pressedIndex.get(); const value4 = 1; if (value3 >= 0) { value5 = pressedIndex.get(); binding = env0_21; if (value5 < binding.get()) { value11 = value2 - 0.02 * env0_22.get(); r4 = 1.04; r5 = value11; } else { value6 = pressedIndex.get(); binding = env0_21; if (value6 > binding.get()) { value8 = value2 + 0.02 * env0_22.get(); r4 = 1.04; r5 = value8; } else { r4 = value4; r5 = value2; } } r3 = r5; r6 = r4; } else { r3 = value2; r6 = value4; } get = scrollOverflow.get; if (Reflect.apply(get, scrollOverflowBinding, []) < 0) { value18 = environment.__proto__; moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */; value20 = moduleValue2.interpolate(scrollOverflow.get(), [-50, 0], [0.9, 1], 'clamp'); binding = env0_22; value22 = r3 + -binding.get() * (value4 - value20) / 2; r6 = value20; r10 = value22; } else { scrollOverflowBinding = scrollOverflow; if (scrollOverflowBinding.get() > 0) { value13 = environment.__proto__; moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */; value15 = moduleValue.interpolate(scrollOverflow.get(), [50, 0], [0.9, 1], 'clamp'); value17 = r3 + env0_22.get() * (value4 - value15) / 2; r6 = value15; r10 = value17; } else { r10 = r3; } } const object = {}; const withSpring = SpringModule.withSpring; const value = env0_22.get(); binding = env1_9; object.width = Reflect.apply(withSpring, SpringModule, [value, binding]); const object2 = {}; object2.translateX = SpringModule.withSpring(r10, binding); const items2 = [object2]; const object3 = {}; object3.scaleX = SpringModule.withSpring(r6, binding); items2[1] = object3; object.transform = items2; return object; } function _fun69064(a0) { // fn#69064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:7408, offset: 0x01c6722f, size: 54 bytes, params: 2, frame: 13 const current = env0_20.current; if (current != null) { current.scrollTo({x: a0, animated: !useReducedMotion}); } } function TabsX(a0, a1) { // fn#69066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:7691, owner: Tabs.X, offset: 0x01c672a2, size: 339 bytes, params: 3, frame: 21 var environment; var width; var r6; var value3; var moduleValue; var scrollOffset; var itemDimensions; var value4; var property; var value7; let value = a1; const activeIndex2 = a0.activeIndex; const value2 = undefined; let activeIndex = value == null ? value2 : value.activeIndex; if (activeIndex2 !== activeIndex) { value3 = environment.__proto__; moduleValue = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */; if (!moduleValue.cheapWorkletShallowEqual(a0, value ?? value2)) { scrollOffset = a0.scrollOffset; activeIndex = a0.activeIndex; itemDimensions = a0.itemDimensions; value = 0; value4 = itemDimensions.reduce(function(a0, a1) { return a0 + (a1?.width ?? 0); }, value); property = itemDimensions[activeIndex]; value7 = ((property == null ? value2 : property.x) ?? value) + (activeIndex - 1) * itemSpacing; property = itemDimensions[activeIndex]; width = property == null ? value2 : property.width; value = value !== value4; r6 = value && value7 != null; r6 = r6 && width != null; if (r6) { value = scrollOffset + pageWidth; if (value < value7 + width) { value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value = value.runOnJS(env0_24); value(value7 + 16); } else if (value7 < scrollOffset) { value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value = value.runOnJS(env0_24); value(value7 - 16); } } } } return value2; } function _fun69068() { // fn#69068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:8362, offset: 0x01c6741d, size: 67 bytes, params: 1, frame: 15 return ( {items.map(_fun69069)} ); function _fun69069({label, count, id}, a1) { // fn#69069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:8413, offset: 0x01c67460, size: 208 bytes, params: 3, frame: 21 var environment; const env0_0 = a1; let value = environment.__proto__.__proto__; value = undefined; const TabItem = (TabItemNativeModule).TabItem; const lengthBinding = length; const r7 = count != null ? env1_2(count) : value; const stateBinding = state; const growBinding = grow; const pressedIndexBinding = pressedIndex; const activeIndexBinding = activeIndex; const get = activeIndexBinding.get; return ( ); } } function _fun69073() { // fn#69073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9044:8723, offset: 0x01c6757e, size: 74 bytes, params: 1, frame: 13 var r0; var value3; var value4; const simultaneousHandlersBinding = simultaneousHandlers; const value2 = null; if (value2 == simultaneousHandlersBinding) { r0 = value2; } else { value3 = environment.__proto__; value4 = (require(5321) /* metro dependency 5321 */).Gesture.Native(); r0 = value4.simultaneousWithExternalGesture(simultaneousHandlers); } return r0; } } } global.__d(_fun69053, 8859, [31, 27, 1949, 33, 4017, 4501, 697, 4577, 7739, 8860, 5321, 477, 2]) /* metro module 8859, dependencies: [31, 27, 1949, 33, 4017, 4501, 697, 4577, 7739, 8860, 5321, 477, 2] */;