decord/alpha/source/components_native/chat/JumpToPresentButton.tsx
2026-10-13 12:43:34 +00:00

278 lines
9.5 KiB
TypeScript

// Module ID: 12482
// Function ID: 12483
// Name: JumpToPresentButton
// Dependencies: [19, 17, 9384, 5757, 5432, 21, 5092, 587, 1382, 4818, 558, 576, 504, 11026, 1126, 12483, 12484, 12485, 2]
// Module 12482 (JumpToPresentButton)
import react_native from "react-native" /* 17 */;
import Fragment from "Fragment" /* 21 */;
import nativeDefault from "native" /* 587 */;
import useToken from "useToken" /* 4818 */;
import react from "react" /* 19 */;
import useChatBottomManagerUIStore_mod from "useChatBottomManagerUIStore" /* 9384 */;
import GatewayConnectionStore from "GatewayConnectionStore" /* 5757 */;
import MessageStore from "MessageStore" /* 5432 */;
import createStyles from "createStyles" /* 5092 */;
import PlatformUtils from "PlatformUtils" /* 1382 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
let dependencyMap;
let closure_4;
let hasOwnProperty;
let obj2;
const View = react_native.View;
let useChatBottomManagerUIStore = useChatBottomManagerUIStore_mod;
({ useChatInputContainerHeight: closure_4, useSmallSuggestionBarHeight: hasOwnProperty } = useChatBottomManagerUIStore);
useChatBottomManagerUIStore = useChatBottomManagerUIStore_mod;
const jsx = Fragment.jsx;
let obj = { container: obj2, containerIOS: { bottom: "100%", pointerEvents: "box-none" } };
obj2 = { borderRadius: nativeDefault.radii.round, position: "absolute", right: nativeDefault.modules.mobile.JUMP_TO_PRESENT_RIGHT_SPACING };
let closure_10 = createStyles.createStyles(obj);
let closure_11 = PlatformUtils.isIOS() ? ((arg0) => {
let token;
const obj = { marginBottom: token + hasOwnProperty(arg0) };
const obj2 = useToken;
token = obj2.useToken(nativeDefault.modules.mobile.JUMP_TO_PRESENT_BOTTOM_SPACING);
return obj;
}) : ((arg0) => {
let sum;
const obj2 = { bottom: sum + hasOwnProperty(arg0) };
const obj = useToken;
const token = obj.useToken(nativeDefault.modules.mobile.JUMP_TO_PRESENT_BOTTOM_SPACING);
sum = React3(arg0) + token;
return obj2;
});
let tmp4 = ReactCompilerGating.isReactCompilerEnabled() ? (function JumpToPresentButton(channelId) {
let connected;
let stateFromStores;
let tmp6;
let tmp7;
let tmp8;
let tmp = channelId;
const obj = channelId(stateFromStores[11]);
const cResult = obj.c(25);
channelId = channelId.channelId;
const screenIndex = channelId.screenIndex;
const onJumpToPresent = channelId.onJumpToPresent;
const tmp4 = closure_10();
let tmp5 = closure_11(screenIndex);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [GatewayConnectionStore];
const fn = function s() {
return connected.isConnected();
};
const items1 = [];
cResult[0] = items;
cResult[1] = fn;
cResult[2] = items1;
tmp6 = items;
tmp7 = fn;
tmp8 = items1;
} else {
[tmp6, tmp7, tmp8] = cResult;
}
const tmpResult = tmp(stateFromStores[12]);
stateFromStores = tmpResult.useStateFromStores(tmp6, tmp7, tmp8);
if (cResult[3] === channelId) {
if (cResult[4] === stateFromStores) {
let tmp11;
let tmp16;
let tmp18;
if (cResult[5] === screenIndex) {
tmp11 = cResult[6];
}
const tmp13 = useChatBottomManagerUIStore(tmp11);
const tmpResult5 = tmp(stateFromStores[13]);
const isVoicePanelMounted = tmpResult5.useIsVoicePanelMounted(channelId);
const _Symbol = Symbol;
const tmpResult6 = tmp(stateFromStores[13]);
const isVoicePanelOpen = tmpResult6.useIsVoicePanelOpen(channelId);
if (cResult[7] === Symbol.for("react.memo_cache_sentinel")) {
const items2 = [MessageStore];
cResult[7] = items2;
tmp16 = items2;
} else {
tmp16 = cResult[7];
}
if (cResult[8] !== channelId) {
const fn3 = function f() {
return null != MessageStore.getMessages(channelId).jumpReturnTargetId;
};
cResult[8] = channelId;
cResult[9] = fn3;
tmp18 = fn3;
} else {
tmp18 = cResult[9];
}
const tmpResult7 = tmp(stateFromStores[12]);
const stateFromStores1 = tmpResult7.useStateFromStores(tmp16, tmp18);
if (!tmp13) {
return null;
}
if (cResult[10] === tmp5) {
let tmp21;
let tmp23;
if (cResult[11] === tmp4.containerIOS) {
tmp21 = cResult[12];
}
if (cResult[13] !== stateFromStores1) {
let stringResult;
const intl = tmp(tmp2[14]).intl;
const string = intl.string;
const t = tmp(tmp2[14]).t;
if (stateFromStores1) {
stringResult = string(t.dpjpOp);
} else {
stringResult = string(t.gpoQsB);
}
cResult[13] = stateFromStores1;
cResult[14] = stringResult;
tmp23 = stringResult;
} else {
tmp23 = cResult[14];
}
if (cResult[15] === tmp21) {
let tmp25;
let tmp27Result;
if (cResult[16] === tmp4.container) {
tmp25 = cResult[17];
}
if (cResult[18] === tmp23) {
if (cResult[19] === onJumpToPresent) {
let tmp26;
if (cResult[20] === tmp13) {
tmp26 = cResult[21];
}
if (cResult[22] === tmp26) {
let tmp31;
if (cResult[23] === tmp25) {
tmp31 = cResult[24];
}
return tmp31;
}
const tmp34 = <View style={tmp25}>{tmp26}</View>;
cResult[22] = tmp26;
cResult[23] = tmp25;
cResult[24] = tmp34;
tmp31 = tmp34;
}
}
if (tmp13) {
const obj3 = { accessibilityLabel: tmp23, icon: screenIndex(stateFromStores[16]), onPress: onJumpToPresent };
const tmp30 = screenIndex(stateFromStores[15]);
tmp27Result = tmp27(tmp30, obj3);
} else {
tmp27Result = tmp27(tmp(tmp2[17]).MemoedVoicePanelDismissChatButton, {});
}
cResult[18] = tmp23;
cResult[19] = onJumpToPresent;
cResult[20] = tmp13;
cResult[21] = tmp27Result;
tmp26 = tmp27Result;
}
const items3 = [tmp4.container, tmp21];
cResult[15] = tmp21;
cResult[16] = tmp4.container;
cResult[17] = items3;
tmp25 = items3;
}
let tmp22 = tmp5;
const tmpResult8 = tmp(stateFromStores[8]);
if (tmpResult8.isIOS()) {
const items4 = [tmp4.containerIOS, tmp5];
tmp22 = items4;
}
cResult[10] = tmp5;
cResult[11] = tmp4.containerIOS;
cResult[12] = tmp22;
tmp21 = tmp22;
}
}
const fn2 = function v(showingAutoComplete) {
let tmp = stateFromStores;
if (tmp) {
showingAutoComplete = showingAutoComplete.showingAutoComplete;
const value = showingAutoComplete.get(screenIndex);
let tmp5 = !value;
const tmp3 = screenIndex;
if (tmp5) {
const showJumpToPresentButtonChannelId = showingAutoComplete.showJumpToPresentButtonChannelId;
tmp5 = showJumpToPresentButtonChannelId.get(tmp3) === channelId;
}
tmp = tmp5;
}
return tmp;
};
cResult[3] = channelId;
cResult[4] = stateFromStores;
cResult[5] = screenIndex;
cResult[6] = fn2;
tmp11 = fn2;
}) : (function JumpToPresentButton(channelId) {
let closure_2;
let connected;
let stringResult;
let tmp12Result;
channelId = channelId.channelId;
const screenIndex = channelId.screenIndex;
const onJumpToPresent = channelId.onJumpToPresent;
let tmp = closure_10();
const tmp2 = closure_11(screenIndex);
let tmp3 = channelId;
const items = [GatewayConnectionStore];
const obj = channelId(504);
dependencyMap = obj.useStateFromStores(items, () => connected.isConnected(), []);
let tmp5 = useChatBottomManagerUIStore((showingAutoComplete) => {
let tmp = closure_2;
if (tmp) {
showingAutoComplete = showingAutoComplete.showingAutoComplete;
const value = showingAutoComplete.get(screenIndex);
let tmp5 = !value;
const tmp3 = screenIndex;
if (tmp5) {
const showJumpToPresentButtonChannelId = showingAutoComplete.showJumpToPresentButtonChannelId;
tmp5 = showJumpToPresentButtonChannelId.get(tmp3) === channelId;
}
tmp = tmp5;
}
return tmp;
});
const obj2 = channelId(11026);
const isVoicePanelMounted = obj2.useIsVoicePanelMounted(channelId);
const obj3 = channelId(11026);
const isVoicePanelOpen = obj3.useIsVoicePanelOpen(channelId);
const items1 = [MessageStore];
const obj4 = channelId(504);
const stateFromStores = obj4.useStateFromStores(items1, () => null != MessageStore.getMessages(channelId).jumpReturnTargetId);
if (!tmp5) {
return null;
}
let tmp10 = tmp2;
const tmp3Result = tmp3(1382);
if (tmp3Result.isIOS()) {
const items2 = [tmp.containerIOS, tmp2];
tmp10 = items2;
}
const intl = tmp3(1126).intl;
const string = intl.string;
const t = tmp3(1126).t;
if (stateFromStores) {
stringResult = string(t.dpjpOp);
} else {
stringResult = string(t.gpoQsB);
}
const items3 = [tmp.container, tmp10];
if (tmp5) {
const obj6 = { accessibilityLabel: stringResult, icon: screenIndex(12484), onPress: onJumpToPresent };
const tmp16 = screenIndex(12483);
tmp12Result = tmp12(tmp16, obj6);
} else {
tmp12Result = tmp12(tmp3(12485).MemoedVoicePanelDismissChatButton, {});
}
return <tmp13 style={items3}>{tmp12Result}</tmp13>;
});
const result = size.fileFinishedImporting("components_native/chat/JumpToPresentButton.tsx");
export default tmp4;