Files
discord-decomp/sources/modules/dice_roll/native/DiceRollBar.tsx
T
2026-07-27 16:20:00 +03:00

160 lines
8.5 KiB
TypeScript

/* Metro module 11850; source: modules/dice_roll/native/DiceRollBar.tsx; dependencies: [31, 27, 4502, 11526, 33, 4501, 697, 566, 4017, 4504, 1305, 11851, 11852, 4573, 2] */
function _fun90811(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12036:6, offset: 0x02047513, size: 356 bytes, params: 8, frame: 22
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;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(11526) /* metro dependency 11526: DiceRollStore */).useDiceRollState;
let value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object2 = {'flexDirection': 'row', 'alignItems': 'center', 'paddingHorizontal': 16, 'paddingVertical': 8,
'gap': 12, 'borderTopWidth': 1};
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object2.borderColor = BORDER_SUBTLE;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
const env0_9 = Reflect.apply(createStyles, value, [{animatedContainer: {overflow: 'hidden'}, container: object2}]);
object = {code: 'function DiceRollBarTsx1(){const{useReducedMotion,height,opacity,withTiming,ANIMATION_DURATION_MS,DECELERATED_EASING}=this.__closure;if(useReducedMotion){return{height:height.get(),opacity:opacity.get()};}return{height:withTiming(height.get(),{duration:ANIMATION_DURATION_MS,easing:DECELERATED_EASING}),opacity:withTiming(opacity.get(),{duration:ANIMATION_DURATION_MS,easing:DECELERATED_EASING})};}'};
object = {code: 'function DiceRollBarTsx2(){const{rotation}=this.__closure;return{transform:[{rotate:rotation.get()+"deg"}]};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/dice_roll/native/DiceRollBar.tsx');
exports.default = DiceRollBar;
}
function DiceRollBar({channelId}) { // fn#90812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12036:1076, offset: 0x02047677, size: 750 bytes, params: 2, frame: 27
var object2;
const styles = useStyles();
const value3 = useDiceRollState(channelId);
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
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 r3 = value3 != null && !value3.dismissing;
const rolling = value3?.rolling;
const r6 = rolling != null && rolling;
const binding = env0_3;
binding.useEffect(_fun90814, [r3, value4, value5]);
binding.useEffect(_fun90815, [r6, useReducedMotion, value6]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = DiceRollBarP;
object2 = {useReducedMotion: useReducedMotion, height: value4, opacity: value5};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.ANIMATION_DURATION_MS = 300;
const DECELERATED_EASING = (require(1305) /* metro dependency 1305: native */).DECELERATED_EASING;
object2.DECELERATED_EASING = DECELERATED_EASING;
closure.__closure = object2;
closure.__workletHash = 2405066513233;
closure.__initData = env0_10;
const value10 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const moduleValue6 = reanimatedRexportModule;
useAnimatedStyle = moduleValue6.useAnimatedStyle;
closure = DiceRollBarY;
closure.__closure = {rotation: value6};
closure.__workletHash = 12265072947874;
closure.__initData = env0_11;
const value11 = Reflect.apply(useAnimatedStyle, moduleValue6, [closure]);
if (value3 == null) {
return null;
}
const barText = (require(11851) /* metro dependency 11851: DiceRollUtils */).getBarText(r6, value3.results);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items2 = [value10];
items2[1] = styles.animatedContainer;
const View3 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const DiceIcon = (require(11852) /* metro dependency 11852: DiceIcon */).DiceIcon;
const view = <View3 style={value11}><DiceIcon size="md" /></View3>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View2 style={items2}>
<View style={styles.container}>
{view}
<Text variant="text-sm/normal" color="text-default">
{barText}
</Text>
</View>
</View2>
);
}
function _fun90814() { // fn#90814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12036:1352, offset: 0x02047965, size: 59 bytes, params: 1, frame: 14
let binding = env0_1;
const value2 = 0;
binding.set(env0_4 ? 56 : value2);
binding = env0_2;
binding.set(env0_4 ? 1 : value2);
}
function _fun90815() { // fn#90815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12036:1408, offset: 0x020479a0, size: 172 bytes, params: 1, frame: 23
var binding;
var set;
var withRepeat;
var moduleValue;
var withTiming;
var object2;
var value;
if (env0_5) {
if (useReducedMotion) {
env0_3.set(0);
} else {
binding = env0_3;
set = binding.set;
value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
withRepeat = value.withRepeat;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object2 = {duration: 800};
object2.easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing.linear;
Reflect.apply(set, binding, [Reflect.apply(withRepeat, value, [Reflect.apply(withTiming, moduleValue, [360,
object2]), -1, false])]);
}
} else {
env0_3.set(0);
}
}
function DiceRollBarP() { // fn#90816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12036:1579, owner: DiceRollBar.p, offset: 0x02047a4c, size: 210 bytes, params: 1, frame: 22
var value2;
var moduleValue;
var withTiming;
var binding;
const DECELERATED_EASING = (require(1305) /* metro dependency 1305: native */).DECELERATED_EASING;
var moduleValue2;
const object2 = {};
if (useReducedMotion) {
binding = env0_1;
object2.height = binding.get();
binding = env0_2;
object2.opacity = binding.get();
} else {
value2 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
binding = env0_1;
object2.height = Reflect.apply(withTiming, moduleValue, [binding.get(), {duration: 300,
easing: DECELERATED_EASING}]);
moduleValue2 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue2.withTiming;
binding = env0_2;
object2.opacity = Reflect.apply(withTiming, moduleValue2, [binding.get(), {duration: 300,
easing: DECELERATED_EASING}]);
}
return object2;
}
function DiceRollBarY() { // fn#90817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12036:2040, owner: DiceRollBar.y, offset: 0x02047b1e, size: 68 bytes, params: 1, frame: 15
const object = {};
object.rotate = '' + env0_3.get() + 'deg';
return {transform: [object]};
}