181 lines
10 KiB
TypeScript
181 lines
10 KiB
TypeScript
/* Metro module 10132; source: modules/virtual_currency/native/BalanceCounter.tsx; dependencies: [57, 31, 33, 4017, 3875, 4577, 10133, 4573, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as AccessibilityPreferencesContextModule from '../../../external/discord_common/js/packages/design/components/AccessibilityPreferencesContext/AccessibilityPreferencesContext.tsx'; /* Metro dependency 3875 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as SpringModule from '../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
|
|
|
|
function _fun79049(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:6, offset: 0x01e426d5, size: 241 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {code: 'function BalanceCounterTsx1(){const{runOnJS,setIsAnimating}=this.__closure;runOnJS(setIsAnimating)(false);}'};
|
|
object = {code: 'function BalanceCounterTsx2(){const{isAnimating,animatedValue,runOnJS,setDisplayValue,setMaxDigits}=this.__closure;if(isAnimating){const roundedValue=Math.round(animatedValue.get());runOnJS(setDisplayValue)(roundedValue);runOnJS(setMaxDigits)(roundedValue.toString().length);}return{};}'};
|
|
const BalanceCounter2 = BalanceCounter;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/virtual_currency/native/BalanceCounter.tsx');
|
|
exports.default = BalanceCounter2;
|
|
exports.BalanceCounter = BalanceCounter2;
|
|
function BalanceCounter({value, onValueChange, onValueReached, style}) { // fn#79050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:626, offset: 0x01e427c6, size: 560 bytes, params: 2, frame: 32
|
|
const env0_2 = useRef(null);
|
|
const value4 = (ReanimatedRexportModule).useSharedValue(0);
|
|
const env0_3 = value4;
|
|
const env0_4 = useRef(null);
|
|
let binding = ReactModule;
|
|
const useContext = binding.useContext;
|
|
const AccessibilityPreferencesContext = (AccessibilityPreferencesContextModule).AccessibilityPreferencesContext;
|
|
const enabled = Reflect.apply(useContext, binding, [AccessibilityPreferencesContext]).reducedMotion.enabled;
|
|
const value5 = useState(0);
|
|
binding = env0_3;
|
|
const value6 = binding(value5, 2);
|
|
const property = value6[0];
|
|
const property2 = value6[1];
|
|
const [property3, property4] = binding(useState(1), 2);
|
|
const [property5, env0_9] = binding(useState(false), 2);
|
|
let closure = _fun79051;
|
|
let object = [value, onValueChange, onValueReached, value4, useCallback(closure, []), enabled];
|
|
useEffect(_fun79054, object);
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
closure = BalanceCounterF;
|
|
object = {isAnimating: property5, animatedValue: value4};
|
|
object.runOnJS = ReanimatedRexportModule.runOnJS;
|
|
object.setDisplayValue = property2;
|
|
object.setMaxDigits = property4;
|
|
closure.__closure = object;
|
|
closure.__workletHash = 4408542396979;
|
|
closure.__initData = env0_11;
|
|
if (value === null) {
|
|
return null;
|
|
} else {
|
|
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
return (
|
|
<View style={[Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]),
|
|
{minWidth: 7 * property3}]}>
|
|
{((Text) => <Text variant="text-sm/semibold" style={style} maxFontSizeMultiplier={2}>{property.toFixed(0)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
|
|
</View>
|
|
);
|
|
}
|
|
function _fun79051(a0, a1, a2) { // fn#79051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:907, offset: 0x01e429f6, size: 175 bytes, params: 4, frame: 24
|
|
const binding = env0_9;
|
|
binding(true);
|
|
const set = a0.set;
|
|
const withSpring = SpringModule.withSpring;
|
|
const s_790522 = s_79052;
|
|
const object2 = {};
|
|
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
|
|
object2.setIsAnimating = binding;
|
|
s_790522.__closure = object2;
|
|
s_790522.__workletHash = 16153226572520;
|
|
s_790522.__initData = env1_10;
|
|
Reflect.apply(set, a0, [Reflect.apply(withSpring, SpringModule, [a1, {'duration': null, 'damping': 15,
|
|
'stiffness': 150, 'mass': 1, duration: a2}, 'respect-motion-settings', s_790522])]);
|
|
function s_79052() { // fn#79052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:1031, offset: 0x01e42aa5, size: 51 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
value = value.runOnJS(env1_9);
|
|
value(false);
|
|
}
|
|
|
|
}
|
|
|
|
function clearAnimationTimeout() { // fn#79053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:1198, owner: BalanceCounter.clearAnimationTimeout, offset: 0x01e42ad8, size: 63 bytes, params: 1, frame: 14
|
|
var clearTimeout;
|
|
var binding;
|
|
if (env0_4.current != null) {
|
|
clearTimeout = global.clearTimeout;
|
|
binding = env0_4;
|
|
clearTimeout(binding.current);
|
|
binding.current = null;
|
|
}
|
|
env0_9(false);
|
|
}
|
|
|
|
function _fun79054() { // fn#79054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:1271, offset: 0x01e42b17, size: 260 bytes, params: 1, frame: 18
|
|
var environment;
|
|
var binding;
|
|
var value3;
|
|
var value4;
|
|
var moduleValue;
|
|
var value5;
|
|
var duration;
|
|
var delay;
|
|
var clearAnimationTimeoutBinding;
|
|
let valueBinding = value;
|
|
if (valueBinding !== null) {
|
|
var current = env0_2.current;
|
|
if (current === null) {
|
|
binding = ReactModule.useRef;
|
|
valueBinding = value;
|
|
binding(valueBinding);
|
|
binding = env0_3;
|
|
binding.set(valueBinding);
|
|
env0_2.current = valueBinding;
|
|
return undefined;
|
|
}
|
|
if (enabled) {
|
|
binding = ReactModule.useRef;
|
|
valueBinding = value;
|
|
binding(valueBinding);
|
|
binding = env0_3;
|
|
binding.set(valueBinding);
|
|
env0_2.current = valueBinding;
|
|
return undefined;
|
|
}
|
|
valueBinding = value;
|
|
current = env0_2.current;
|
|
if (valueBinding !== current) {
|
|
valueBinding = value;
|
|
binding = env0_2;
|
|
value3 = valueBinding - binding.current;
|
|
onValueChange(value3);
|
|
binding.current = valueBinding;
|
|
value4 = environment.__proto__;
|
|
moduleValue = require(10133) /* metro dependency 10133: AnimationUtils */;
|
|
value5 = moduleValue.getDesiredAnimationConfigs(value3,
|
|
(require(10133) /* metro dependency 10133: AnimationUtils */).EXPECTED_ORB_LOTTIE_ANIMATION_DURATION_MS);
|
|
duration = value5.duration;
|
|
delay = value5.delay;
|
|
clearAnimationTimeoutBinding = clearAnimationTimeout;
|
|
clearAnimationTimeoutBinding();
|
|
binding = env0_4;
|
|
binding.current = global.setTimeout(_fun79055, delay);
|
|
return clearAnimationTimeoutBinding;
|
|
}
|
|
binding = ReactModule.useRef;
|
|
binding(value);
|
|
}
|
|
function _fun79055() { // fn#79055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:1574, offset: 0x01e42c1b, size: 45 bytes, params: 1, frame: 16
|
|
env1_10(env1_3, value, duration);
|
|
env1_4.current = null;
|
|
}
|
|
|
|
}
|
|
|
|
function BalanceCounterF() { // fn#79056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10318:1690, owner: BalanceCounter.F, offset: 0x01e42c48, size: 131 bytes, params: 1, frame: 17
|
|
var Math;
|
|
var round;
|
|
var binding;
|
|
var value2;
|
|
var value3;
|
|
var moduleValue;
|
|
if (ReactModule) {
|
|
Math = global.Math;
|
|
round = Math.round;
|
|
binding = env0_3;
|
|
value2 = Reflect.apply(round, Math, [binding.get()]);
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
moduleValue.runOnJS(ReactModule.useRef)(value2);
|
|
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(ReactModule.useCallback)(value2.toString().length);
|
|
}
|
|
return {};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun79049, 10132, [57, 31, 33, 4017, 3875, 4577, 10133, 4573,
|
|
2]) /* metro module 10132, dependencies: [57, 31, 33, 4017, 3875, 4577, 10133, 4573, 2] */;
|