Files
discord-decomp/sources/by-id/module-00389.jsx
T
2026-07-28 01:06:53 +03:00

224 lines
11 KiB
React

/* Metro module 389; source: unknown; dependencies: [57, 29, 31, 33, 383, 325, 390, 253] */
import ObjectWithoutProperties from './module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
import Module00057 from './module-00057.js'; /* Metro dependency 57 */
import Module00253 from './module-00253.js'; /* Metro dependency 253 */
import Module00325 from './module-00325.js'; /* Metro dependency 325 */
import Module00390 from './module-00390.js'; /* Metro dependency 390 */
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from './module-00033-JsxRuntime.js'; /* Metro dependency 33 */
function _fun5718(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#5718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:6, offset: 0x00ce3e50, size: 275 bytes, params: 8, frame: 20
const env0_0 = require;
const env0_3 = ['ref'];
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_14 = (Module00253).create({header: {zIndex: 10}, fill: {flex: 1}});
exports.default = ScrollViewStickyHeader;
function ScrollViewStickyHeader(a0) { // fn#5719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:302, offset: 0x00ce3f63, size: 729 bytes, params: 2, frame: 36
const ref = a0.ref;
let binding = ObjectWithoutProperties;
const value2 = binding(a0, env0_3);
const inverted = value2.inverted;
const scrollViewHeight = value2.scrollViewHeight;
const hiddenOnScroll = value2.hiddenOnScroll;
const scrollAnimatedValue = value2.scrollAnimatedValue;
const scrollAnimatedValue2 = scrollAnimatedValue;
const nextHeaderLayoutY = value2.nextHeaderLayoutY;
const value3 = useState(false);
binding = scrollAnimatedValue2;
const value4 = binding(value3, 2);
const property = value4[0];
const env0_6 = value4[1];
const [property2, env0_8] = binding(useState(0), 2);
const [property3, env0_10] = binding(useState(0), 2);
const value7 = null;
const [property4, env0_12] = binding(useState(value7), 2);
const [property5, env0_14] = binding(useState(nextHeaderLayoutY), 2);
const [property6, env0_16] = binding(useState(false), 2);
const value12 = (Module00325)(useCallback(_fun5720, []), ref);
const value13 = useMemo(_fun5721, [scrollAnimatedValue, property3, property2, hiddenOnScroll]);
const [property7, env0_18] = binding(useState(_fun5722), 2);
const env0_19 = useRef(true);
const env0_20 = useRef(value7);
useEffect(_fun5723, [property4]);
useEffect(_fun5726, [property5, property, property3, property2, scrollViewHeight, scrollAnimatedValue, inverted,
value13, useCallback(_fun5724, []), property6]);
const Children = env0_6.Children;
const value16 = Children.only(value2.children);
const r5 = property6 && value7 != property4 ? {style: {transform: [{translateY: property4}]}} : value7;
const View = (Module00390).View;
binding = env0_14;
return (
<View
collapsable={false}
nativeID={value2.nativeID}
onLayout={onLayout_5728}
ref={value12}
style={[value16.props.style, binding.header, {transform: [{translateY: property7}]}]}
passthroughAnimatedPropExplicitValues={r5}
>
{cloneElement(value16, {style: binding.fill, onLayout: undefined})}
</View>
);
function _fun5720(a0) { // fn#5720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:647, offset: 0x00ce423c, size: 71 bytes, params: 2, frame: 13
var value;
var binding;
if (a0 != null) {
a0.setNextHeaderY = env0_14;
binding = env0_16;
value = environment.__proto__;
value = require(383) /* metro dependency 383 */;
binding(value.isPublicInstance(a0));
}
}
function _fun5721() { // fn#5721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:746, offset: 0x00ce4283, size: 189 bytes, params: 1, frame: 20
var r0;
var value3;
var defaultImport;
var diffClamp;
var scrollAnimatedValueBinding;
var interpolate;
var binding;
var value4;
if (hiddenOnScroll !== true) {
r0 = null;
} else {
value3 = environment.__proto__;
defaultImport = importDefault(390) /* metro dependency 390 */;
diffClamp = defaultImport.diffClamp;
scrollAnimatedValueBinding = scrollAnimatedValue;
interpolate = scrollAnimatedValueBinding.interpolate;
binding = ReactModule.cloneElement;
value4 = Reflect.apply(interpolate, scrollAnimatedValueBinding, [{extrapolateLeft: 'clamp',
inputRange: [binding,
binding + 1], outputRange: [0, 1]}]);
interpolate = value4.interpolate;
r0 = Reflect.apply(diffClamp, defaultImport, [Reflect.apply(interpolate, value4, [{inputRange: [0, 1],
outputRange: [0, -1]}]), -ReactModule.useEffect, 0]);
}
return r0;
}
function _fun5722() { // fn#5722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:947, offset: 0x00ce4340, size: 115 bytes, params: 1, frame: 15
const value2 = scrollAnimatedValue.interpolate({inputRange: [-1, 0], outputRange: [0, 0]});
return env0_17 == null ? value2 : (importDefault(390) /* metro dependency 390 */).add(value2, env0_17);
}
function _fun5723() { // fn#5723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:1106, offset: 0x00ce43b3, size: 45 bytes, params: 1, frame: 4
if (ReactModule.useRef !== 0 && ReactModule.useRef != null) {
env0_19.current = false;
}
}
function _fun5724({value}) { // fn#5724, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:1166, offset: 0x00ce43e0, size: 129 bytes, params: 2, frame: 14
if (value !== 0) {
if (env0_20.current != null) {
global.clearTimeout(env0_20.current);
}
env0_20.current = global.setTimeout(_fun5725, 15);
} else if (env0_19.current) {
if (env0_20.current != null) {
global.clearTimeout(env0_20.current);
}
env0_20.current = global.setTimeout(_fun5725, 15);
} else {
env0_19.current = true;
}
function _fun5725() { // fn#5725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:1277, offset: 0x00ce4461, size: 23 bytes, params: 1, frame: 11
return env1_12(value);
}
}
function _fun5726() { // fn#5726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:1330, offset: 0x00ce4478, size: 471 bytes, params: 1, frame: 18
var environment;
var r3;
var push;
var binding;
var value5;
var value7;
const items3 = [-1];
let value = 0;
items3[1] = value;
const items2 = [0, 0];
if (ObjectWithoutProperties) {
if (inverted === true) {
if (scrollViewHeight != null) {
value5 = ReactModule.cloneElement + ReactModule.useEffect - scrollViewHeight;
if (value5 > value) {
items3.push(value5);
items2.push(value);
items3.push(value5 + 1);
items2.push(1);
value = (JsxRuntimeModule.jsx || value) - ReactModule.useEffect;
value -= scrollViewHeight;
if (value > value5) {
items3.push(value, value + 1);
items2.push(value - value5, value - value5);
}
}
}
} else {
items3.push(ReactModule.cloneElement);
items2.push(value);
binding = JsxRuntimeModule.jsx;
value = (binding || value) - ReactModule.useEffect;
if (value >= ReactModule.cloneElement) {
items3.push(value, value + 1);
push = items2.push;
binding = ReactModule.cloneElement;
Reflect.apply(push, items2, [value - binding, value - binding]);
} else {
items3.push(ReactModule.cloneElement + 1);
items2.push(1);
}
}
}
const scrollAnimatedValueBinding = scrollAnimatedValue;
value = scrollAnimatedValueBinding.interpolate({inputRange: items3, outputRange: items2});
if (env0_17 == null) {
r3 = value;
} else {
value7 = environment.__proto__;
value = (importDefault(390) /* metro dependency 390 */).add(value, env0_17);
r3 = value;
}
if (env0_15) {
var env0_0 = r3.addListener(env0_21);
}
env0_18(r3);
return _fun5727;
function _fun5727() { // fn#5727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:1729, offset: 0x00ce464f, size: 75 bytes, params: 1, frame: 11
if (env0_0) {
env0_1.removeListener(env0_0);
}
if (env1_20.current != null) {
global.clearTimeout(env1_20.current);
}
}
}
function ScrollViewStickyHeaderOnLayout(a0) { // fn#5728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:430:1991, owner: ScrollViewStickyHeader.onLayout, offset: 0x00ce469a, size: 147 bytes, params: 2, frame: 13
let binding = env0_8;
binding(a0.nativeEvent.layout.y);
env0_10(a0.nativeEvent.layout.height);
env0_6(true);
binding = env0_0;
binding.onLayout(a0);
let value = environment.__proto__;
const Children = env1_6.Children;
value = Children.only(binding.children);
if (value.props.onLayout) {
value.props.onLayout(a0);
}
}
}
}
global.__d(_fun5718, 389, [57, 29, 31, 33, 383, 325, 390,
253]) /* metro module 389, dependencies: [57, 29, 31, 33, 383, 325, 390, 253] */;