decord/alpha/source/modules/messages/useMessageMaxLength.tsx

57 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 9232
// Function ID: 9233
2026-07-29 08:29:29 +00:00
// Name: useMessageMaxLength
2026-10-09 10:00:15 +00:00
// Dependencies: [1390, 1085, 4728, 558, 576, 504, 2]
2026-10-03 08:58:59 +00:00
// Exports: getMaxMessageLength
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 9232 (useMessageMaxLength)
2026-10-03 08:58:59 +00:00
import react from "react" /* 576 */;
2026-10-09 10:00:15 +00:00
import PremiumUtilsDefault from "PremiumUtils" /* 4728 */;
import UserStore from "UserStore" /* 1390 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let closure_4;
let hasOwnProperty;
let tmp;
const get_initialized = tmp(504);
({ MAX_MESSAGE_LENGTH_PREMIUM: closure_4, MAX_MESSAGE_LENGTH: hasOwnProperty } = Constants);
2026-10-08 09:57:35 +00:00
const tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (function useMessageMaxLength() {
2026-10-03 08:58:59 +00:00
let currentUser;
let tmp4;
let tmp5;
let obj = react;
const cResult = obj.c(2);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [UserStore];
const fn = function n() {
const obj = PremiumUtilsDefault;
return obj.canUseIncreasedMessageLength(currentUser.getCurrentUser()) ? closure_1_4 : closure_1_5;
};
cResult[0] = items;
cResult[1] = fn;
tmp4 = items;
tmp5 = fn;
} else {
[tmp4, tmp5] = cResult;
}
const tmpResult = get_initialized;
return tmpResult.useStateFromStores(tmp4, tmp5);
2026-10-08 09:57:35 +00:00
}) : (function useMessageMaxLength() {
2026-10-03 08:58:59 +00:00
let currentUser;
let obj = get_initialized;
const items = [UserStore];
return obj.useStateFromStores(items, () => {
const obj = PremiumUtilsDefault;
return obj.canUseIncreasedMessageLength(currentUser.getCurrentUser()) ? closure_1_4 : closure_1_5;
});
});
const result = size.fileFinishedImporting("modules/messages/useMessageMaxLength.tsx");
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
export default tmp3;
2026-07-20 16:05:17 +00:00
export const getMaxMessageLength = function getMaxMessageLength() {
2026-10-03 08:58:59 +00:00
const obj = PremiumUtilsDefault;
return obj.canUseIncreasedMessageLength(UserStore.getCurrentUser()) ? React3 : hasOwnProperty;
2026-07-20 16:05:17 +00:00
};