/* Metro module 12677; source: modules/share/native/ShareAttachments.tsx; dependencies: [31, 27, 33, 4017, 4589, 1305, 4501, 697, 4504, 4000, 1244, 11143, 4660, 2] */ function _fun97136(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:6, offset: 0x02173f68, size: 569 bytes, params: 8, frame: 22 var object2; const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importAll(31) /* metro dependency 31 */; const env0_4 = (require(27) /* metro dependency 27 */).View; let value = require(33) /* metro dependency 33 */; const env0_5 = value.jsx; const env0_6 = value.jsxs; const env0_7 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(importDefault(4589) /* metro dependency 4589 */); object2 = {duration: 300}; const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING; object2.easing = STANDARD_EASING; value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object2 = {}; let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object2.containerRevamp = {marginHorizontal: -PX_16}; const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object2.attachmentPreviewContentContainer = {flexDirection: 'row', gap: PX_8}; PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object2.attachmentPreviewContentContainerRevamp = {paddingHorizontal: PX_16}; const object3 = {'height': 60, 'backgroundColor': null, 'overflow': 'hidden'}; const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; object3.backgroundColor = BACKGROUND_BASE_LOW; object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm; object2.attachmentPreview = object3; object2.leftGradient = {'width': 50, 'position': 'absolute', 'left': 0, 'top': 0, 'bottom': 0, 'zIndex': 100}; object2.rightGradient = {'width': 50, 'position': 'absolute', 'right': 0, 'top': 0, 'bottom': 0, 'zIndex': 100}; const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; object2.gradient = {color: BACKGROUND_SURFACE_HIGH}; const env0_9 = Reflect.apply(createStyles, value, [object2]); object2 = {code: 'function ShareAttachmentsTsx1(){const{withTiming,contentOffset,GRADIENT_EASING_CONFIG}=this.__closure;return{opacity:withTiming(contentOffset.get()<=0?0:1,GRADIENT_EASING_CONFIG)};}'}; object2 = {code: 'function ShareAttachmentsTsx2(){const{withTiming,contentOffset,layoutWidth,contentWidth,GRADIENT_EASING_CONFIG}=this.__closure;return{opacity:withTiming(contentOffset.get()+layoutWidth.get()>=contentWidth.get()?0:1,GRADIENT_EASING_CONFIG)};}'}; object2 = {code: 'function ShareAttachmentsTsx3(event){const{contentOffset,contentWidth,layoutWidth}=this.__closure;contentOffset.set(event.contentOffset.x);contentWidth.set(event.contentSize.width);layoutWidth.set(event.layoutMeasurement.width);}'}; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/share/native/ShareAttachments.tsx'); exports.default = ShareAttachments; } function ShareAttachments({attachments, isRevamp}) { // fn#97137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:1597, offset: 0x021741a1, size: 956 bytes, params: 2, frame: 31 var r0; var items3; var ScrollView; var object4; var intl; let value = undefined; isRevamp = !(isRevamp === value) && isRevamp; const styles = useStyles(); const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0); const value5 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0); const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0); const env0_3 = value6; const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */; let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle; let closure = ShareAttachmentsY; const object2 = {}; object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming; object2.contentOffset = value4; let binding = env0_8; object2.GRADIENT_EASING_CONFIG = binding; closure.__closure = object2; closure.__workletHash = 3302668154466; closure.__initData = env0_10; const value7 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]); const moduleValue5 = reanimatedRexportModule; useAnimatedStyle = moduleValue5.useAnimatedStyle; closure = ShareAttachmentsS; closure.__closure = {withTiming: (require(4504) /* metro dependency 4504: timing */).withTiming, contentOffset: value4, layoutWidth: value6, contentWidth: value5, GRADIENT_EASING_CONFIG: binding}; closure.__workletHash = 13996707009656; closure.__initData = env0_11; const value8 = Reflect.apply(useAnimatedStyle, moduleValue5, [closure]); const moduleValue6 = reanimatedRexportModule; const useAnimatedScrollHandler = moduleValue6.useAnimatedScrollHandler; closure = ShareAttachmentsV; closure.__closure = {contentOffset: value4, contentWidth: value5, layoutWidth: value6}; closure.__workletHash = 12660577105859; closure.__initData = env0_12; const value9 = Reflect.apply(useAnimatedScrollHandler, moduleValue6, [closure]); binding = env0_3; const value10 = binding.useCallback(_fun97141, [value6]); const value11 = binding.useCallback(_fun97142, [value5]); const useMemo = binding.useMemo; let gradient = styles.gradient; let color = gradient.color; const value12 = Reflect.apply(useMemo, binding, [_fun97143, [color]]); if (attachments.length === 0) { r0 = null; } else { var viewBindingProps = {style: isRevamp ? styles.containerRevamp : value}; binding = env0_7; gradient = styles.gradient; color = gradient.color; items3 = [((Component) => )(binding)]; gradient = styles.gradient; color = gradient.color; items3[1] = ((Component) => )(binding); ScrollView = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).ScrollView; var scrollViewProps = {contentContainerStyle: [styles.attachmentPreviewContentContainer, isRevamp ? styles.attachmentPreviewContentContainerRevamp : value], horizontal: true, onScroll: value9, onLayout: value10, onContentSizeChange: value11, scrollEventThrottle: 16, showsHorizontalScrollIndicator: false, accessibilityRole: 'list'}; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; scrollViewProps.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.RhtzFe); items3[2] = {attachments.map(_fun97144)}; value = {items3}; r0 = value; } return r0; } function ShareAttachmentsY() { // fn#97138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:1785, owner: ShareAttachments.y, offset: 0x0217455d, size: 78 bytes, params: 1, frame: 16 const timingModule = require(4504) /* metro dependency 4504: timing */; const withTiming = timingModule.withTiming; const value3 = env0_1.get(); const value4 = 0; return {opacity: Reflect.apply(withTiming, timingModule, [value3 <= value4 ? value4 : 1, env1_8])}; } function ShareAttachmentsS() { // fn#97139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:2002, owner: ShareAttachments.S, offset: 0x021745ab, size: 106 bytes, params: 1, frame: 17 const timingModule = require(4504) /* metro dependency 4504: timing */; const withTiming = timingModule.withTiming; let binding = env0_1; let get = binding.get; const value3 = Reflect.apply(get, binding, []); binding = env0_3; get = binding.get; const value4 = value3 + Reflect.apply(get, binding, []); binding = env0_2; get = binding.get; return {opacity: Reflect.apply(withTiming, timingModule, [value4 >= Reflect.apply(get, binding, []) ? 0 : 1, env1_8])}; } function ShareAttachmentsV({contentOffset, contentSize, layoutMeasurement}) { // fn#97140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:2270, owner: ShareAttachments.v, offset: 0x02174615, size: 85 bytes, params: 2, frame: 13 let binding = env0_1; binding.set(contentOffset.x); binding = env0_2; binding.set(contentSize.width); binding = env0_3; binding.set(layoutMeasurement.width); } function _fun97141({nativeEvent}) { // fn#97141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:2492, offset: 0x0217466a, size: 41 bytes, params: 2, frame: 11 const binding = env0_3; binding.set(nativeEvent.layout.width); } function _fun97143() { // fn#97143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:2587, offset: 0x02174693, size: 59 bytes, params: 1, frame: 13 let value = environment.__proto__; value = require(4000) /* metro dependency 4000: ColorUtils */; return value.hexWithOpacity(styles.gradient.color, 0); } function _fun97144(a0, a1) { // fn#97144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12867:3307, offset: 0x021746ce, size: 200 bytes, params: 3, frame: 24 let value = environment.__proto__; const AttachmentPreview = importDefault(11143) /* metro dependency 11143: AttachmentPreview */; const defaultImportProps = {'uri': null, 'width': 60, 'height': 60, uri: a0.uri}; value = require(4660) /* metro dependency 4660: UploadUtils */; defaultImportProps.isImage = value.isImage(a0.uri, a0.mimeType); value = require(4660) /* metro dependency 4660: UploadUtils */; defaultImportProps.isVideo = value.isVideo(a0.uri, a0.mimeType); defaultImportProps.fileName = a0.name; defaultImportProps.showPlayOnVideoPreview = true; return ( ); }