decord/source/1694_isReducedMotionEnabledInSystem.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-08-11 06:20:06 +00:00
// Module ID: 1694
// Function ID: 1695
2026-07-29 08:29:29 +00:00
// Name: isReducedMotionEnabledInSystem
2026-08-11 06:20:06 +00:00
// Dependencies: [1656, 1690]
2026-07-29 08:29:29 +00:00
// Exports: isReducedMotionEnabledInSystem
2026-08-11 06:20:06 +00:00
// Module 1694 (isReducedMotionEnabledInSystem)
2026-07-29 08:29:29 +00:00
import isJest from "isJest";
import addCompilerSafeGetAndSet from "addCompilerSafeGetAndSet";
if (isJest.isWeb()) {
const _module1 = require("isJest");
let matches = _module1.isWindowAvailable();
if (matches) {
let _window = window;
matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
let prop = matches;
} else {
prop = global._REANIMATED_IS_REDUCED_MOTION;
}
const obj = { jsValue: prop, uiValue: null, setEnabled: null };
function isReducedMotionEnabledInSystem() {
if (obj.isWeb()) {
2026-08-11 06:20:06 +00:00
let matches = require(1656) /* isJest */.isWindowAvailable();
2026-07-29 08:29:29 +00:00
if (matches) {
const _window = window;
matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
let prop = matches;
2026-08-11 06:20:06 +00:00
const tmpResult = require(1656) /* isJest */;
2026-07-29 08:29:29 +00:00
} else {
prop = global._REANIMATED_IS_REDUCED_MOTION;
}
return prop;
}
obj[1] = addCompilerSafeGetAndSet.makeMutable(prop);
obj[2] = function setEnabled(jsValue) {
obj.jsValue = jsValue;
obj.uiValue.value = jsValue;
};
export { isReducedMotionEnabledInSystem };
export const ReducedMotionManager = obj;