// Metro module 1820 (f1821). import { forwardRef } from "react"; import { Platform } from "react-native"; import * as _Module1606 from "./Module1606"; import Module1606, { useSharedValue, useDerivedValue, useAnimatedReaction, useAnimatedProps } from "./Module1606"; import { ClippingScrollView } from "./Module1596"; import Module1821 from "./Module1821"; Platform; const AnimatedComponent = Module1606.createAnimatedComponent(ClippingScrollView); const __initData = { code: "function pnpm_indexTsx1(){const{inverted,bottomPadding,contentInset}=this.__closure;var _contentInset,_contentInset2,_contentInset3,_contentInset4;const dynamicTop=inverted?bottomPadding.value:0;const dynamicBottom=!inverted?bottomPadding.value:0;return{dynamic:{top:dynamicTop,bottom:dynamicBottom},effective:{top:dynamicTop+(((_contentInset=contentInset)===null||_contentInset===void 0?void 0:_contentInset.top)||0),bottom:dynamicBottom+(((_contentInset2=contentInset)===null||_contentInset2===void 0?void 0:_contentInset2.bottom)||0),left:((_contentInset3=contentInset)===null||_contentInset3===void 0?void 0:_contentInset3.left)||0,right:((_contentInset4=contentInset)===null||_contentInset4===void 0?void 0:_contentInset4.right)||0}};}" }; const __initData2 = { code: "function pnpm_indexTsx2(){const{insets}=this.__closure;return insets.value.effective;}" }; const __initData3 = { code: "function pnpm_indexTsx3(current,previous){const{onContentInsetChange,runOnJS}=this.__closure;if(!onContentInsetChange){return;}if(previous&¤t.top===previous.top&¤t.bottom===previous.bottom&¤t.left===previous.left&¤t.right===previous.right){return;}runOnJS(onContentInsetChange)(current);}" }; const __initData4 = { code: "function pnpm_indexTsx4(){const{insets,scrollIndicatorPadding,bottomPadding,inverted,scrollIndicatorInsets,contentOffsetY,prevContentOffsetY}=this.__closure;var _scrollIndicatorPaddi,_scrollIndicatorInset,_scrollIndicatorInset2,_scrollIndicatorInset3,_scrollIndicatorInset4;const{dynamic:dynamic,effective:effective}=insets.value;const indicatorPadding=(_scrollIndicatorPaddi=scrollIndicatorPadding)!==null&&_scrollIndicatorPaddi!==void 0?_scrollIndicatorPaddi:bottomPadding;const indicatorTop=(inverted?indicatorPadding.value:0)+(((_scrollIndicatorInset=scrollIndicatorInsets)===null||_scrollIndicatorInset===void 0?void 0:_scrollIndicatorInset.top)||0);const indicatorBottom=(!inverted?indicatorPadding.value:0)+(((_scrollIndicatorInset2=scrollIndicatorInsets)===null||_scrollIndicatorInset2===void 0?void 0:_scrollIndicatorInset2.bottom)||0);const result={contentInset:effective,scrollIndicatorInsets:{bottom:indicatorBottom,top:indicatorTop,right:(_scrollIndicatorInset3=scrollIndicatorInsets)===null||_scrollIndicatorInset3===void 0?void 0:_scrollIndicatorInset3.right,left:(_scrollIndicatorInset4=scrollIndicatorInsets)===null||_scrollIndicatorInset4===void 0?void 0:_scrollIndicatorInset4.left},contentInsetBottom:dynamic.bottom,contentInsetTop:dynamic.top};if(contentOffsetY){const curr=contentOffsetY.value;if(curr!==prevContentOffsetY.value){prevContentOffsetY.value=curr;result.contentOffset={x:0,y:curr};}}return result;}" }; export default forwardRef(({ ScrollViewComponent, bottomPadding, scrollIndicatorPadding, contentInset, scrollIndicatorInsets, inverted, contentOffsetY, applyWorkaroundForContentInsetHitTestBug, onContentInsetChange, children, ...rest }, a1) => { let derivedValue; derivedValue = void 0; const sharedValue = useSharedValue(null); const T = function T() { const top = inverted ? bottomPadding.value : 0; const bottom = inverted ? 0 : bottomPadding.value; return { dynamic: { top, bottom }, effective: { top: top + (contentInset?.top || 0), bottom: bottom + (contentInset?.bottom || 0), left: contentInset?.left || 0, right: contentInset?.right || 0 } }; }; T.__closure = { inverted, bottomPadding, contentInset }; T.__workletHash = 788035152099; T.__initData = __initData; derivedValue = useDerivedValue(T, [inverted, contentInset?.top, contentInset?.bottom, contentInset?.left, contentInset?.right]); const B = () => derivedValue.value.effective; B.__closure = { insets: derivedValue }; B.__workletHash = 3359315898790; B.__initData = __initData2; const x = function x(a0, a1) { if (onContentInsetChange && !((a1 ? a0.top === a1.top : a1) && a0.bottom === a1.bottom && a0.left === a1.left && a0.right === a1.right)) { _Module1606.runOnJS(onContentInsetChange)(a0); } }; x.__closure = { onContentInsetChange, runOnJS: _Module1606.runOnJS }; x.__workletHash = 12461544130657; x.__initData = __initData3; useAnimatedReaction(B, x, [onContentInsetChange]); const w = function w() { const value = derivedValue.value; const { dynamic, effective } = value; let r6 = scrollIndicatorPadding; if (scrollIndicatorPadding == null) { r6 = bottomPadding; } const r15 = { contentInset: effective, scrollIndicatorInsets: { bottom: (inverted ? 0 : r6.value) + (scrollIndicatorInsets?.bottom || 0), top: (inverted ? r6.value : 0) + (scrollIndicatorInsets?.top || 0), right: scrollIndicatorInsets?.right, left: scrollIndicatorInsets?.left }, contentInsetBottom: dynamic.bottom, contentInsetTop: dynamic.top }; if (contentOffsetY) { const value2 = contentOffsetY.value; if (value2 !== sharedValue.value) { sharedValue.value = value2; r15.contentOffset = { x: 0, y: value2 }; } } return r15; }; w.__closure = { insets: derivedValue, scrollIndicatorPadding, bottomPadding, inverted, scrollIndicatorInsets, contentOffsetY, prevContentOffsetY: sharedValue }; w.__workletHash = 909305568735; w.__initData = __initData4; const animatedProps = useAnimatedProps(w, [scrollIndicatorInsets?.bottom, scrollIndicatorInsets?.top, scrollIndicatorInsets?.right, scrollIndicatorInsets?.left, inverted, contentOffsetY]); return {children} ; });