This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,100 @@
// Metro module 13507 (f13508).
import AuthenticationStore from "../../../stores/AuthenticationStore";
import ChannelStore from "../../../stores/ChannelStore";
import RelationshipStore from "../../../stores/RelationshipStore";
import UserStore from "../../../stores/UserStore";
import { isIOS } from "../../../utils/PlatformUtils";
import { NativePhoneIntegrationEnabled } from "../../user_settings/UserSettings";
import { computeChannelName } from "../../channel/useChannelName";
import { AccessibilityAnnouncer } from "../../../design/shared";
import { intl, t } from "../../../intl/index.native";
import LifecycleManager from "../../../lib/LifecycleManager";
import Dispatcher from "../../../Dispatcher";
let c9376_7 = new Set();
let c9376_8 = new Map();
class AccessibilityCallManager extends LifecycleManager {
handleCallCreate = ({ channelId, ongoingRings }) => {
const id = AuthenticationStore.getId();
const r0 = id != null && id in ongoingRings;
L9: {
c9376_8.set(channelId, r0);
if (r0 && !c9376_7.has(channelId)) {
if (isIOS() && NativePhoneIntegrationEnabled.getSetting()) {
break L9;
}
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
const callLocation = computeChannelName(channel, UserStore, RelationshipStore);
if (callLocation != null) {
c9376_7.add(channelId);
AccessibilityAnnouncer.announce(intl.formatToPlainString(t["Bm0A/p"], {
callLocation
}), "assertive");
}
}
}
}
};
handleCallUpdate = ({ channelId, ongoingRings }) => {
const id = AuthenticationStore.getId();
let r17 = c9376_8.get(channelId);
if (r17 == null) {
r17 = false;
}
const r0 = id != null && id in ongoingRings;
L16: {
c9376_8.set(channelId, r0);
if (!r17 && r0) {
if (c9376_7.has(channelId)) {
break L16;
}
if (isIOS() && NativePhoneIntegrationEnabled.getSetting()) {
break L16;
}
const channel = ChannelStore.getChannel(channelId);
if (channel == null) {
break L16;
}
const callLocation = computeChannelName(channel, UserStore, RelationshipStore);
if (callLocation == null) {
break L16;
}
c9376_7.add(channelId);
AccessibilityAnnouncer.announce(intl.formatToPlainString(t["Bm0A/p"], {
callLocation
}), "assertive");
} else {
if (r17) {
r17 = !r0;
}
if (r17) {
c9376_7.delete(channelId);
}
}
}
};
handleCallDelete = ({ channelId }) => {
c9376_8.delete(channelId);
c9376_7.delete(channelId);
};
handleConnectionOpen = () => {
c9376_8.clear();
c9376_7.clear();
};
_initialize() {
Dispatcher.subscribe("CALL_CREATE", this.handleCallCreate);
Dispatcher.subscribe("CALL_UPDATE", this.handleCallUpdate);
Dispatcher.subscribe("CALL_DELETE", this.handleCallDelete);
Dispatcher.subscribe("CONNECTION_OPEN", this.handleConnectionOpen);
}
_terminate() {
Dispatcher.unsubscribe("CALL_CREATE", this.handleCallCreate);
Dispatcher.unsubscribe("CALL_UPDATE", this.handleCallUpdate);
Dispatcher.unsubscribe("CALL_DELETE", this.handleCallDelete);
Dispatcher.unsubscribe("CONNECTION_OPEN", this.handleConnectionOpen);
c9376_8.clear();
c9376_7.clear();
}
}
const accessibilityCallManager = new AccessibilityCallManager();
export default accessibilityCallManager;
@@ -0,0 +1,84 @@
// Metro module 4585 (f4586).
import { NativeModules } from "react-native";
import Logger from "../../debug/Logger";
import LifecycleManager from "../../../lib/LifecycleManager";
import { getIsScreenReaderEnabled, addScreenReaderEnabledListener } from "./useIsScreenReaderEnabled.native";
import { isAndroid } from "../../../utils/PlatformUtils";
import Module4587 from "../../../_bundle/Module4587";
let c2792_4 = new Logger("AccessibilityFocusLockManager");
class AccessibilityFocusLockManager extends LifecycleManager {
_screenReaderEnabled = getIsScreenReaderEnabled();
_focusLockedNativeIDGroups = new Map();
_focusLockEnabled = false;
_focusLockEnabledDelayTimeoutId = -1;
_focusLockEnabledDelayTimeout = 250;
_updateAccessibilityFocusLock(r3 = false) {
let c14333_1;
let c14333_0 = r3;
let r4 = void 0;
c14333_1 = void 0;
clearTimeout(this._focusLockEnabledDelayTimeoutId);
c14333_1 = void 0;
for (const item of this._focusLockedNativeIDGroups.values()) {
r4 = item;
c14333_1 = item;
}
if (r4 != null && this._screenReaderEnabled) {
this._focusLockEnabledDelayTimeoutId = setTimeout(() => {
if (isAndroid()) {
Module4587.enableFocusLock(c14333_1, c14333_0);
} else {
NativeModules.DCDAccessibilityManager.enableFocusLock(c14333_1, c14333_0);
}
}, this._focusLockEnabledDelayTimeout);
this._focusLockEnabled = true;
} else if (this._focusLockEnabled) {
if (isAndroid()) {
Module4587.disableFocusLock();
} else {
NativeModules.DCDAccessibilityManager.disableFocusLock();
}
this._focusLockEnabled = false;
}
}
_initialize() {
this._screenReaderEnabledListener = addScreenReaderEnabledListener((a0) => {
this._screenReaderEnabled = a0;
this._updateAccessibilityFocusLock();
});
}
_terminate() {
const _screenReaderEnabledListener = this._screenReaderEnabledListener;
if (_screenReaderEnabledListener != null) {
_screenReaderEnabledListener.call(this);
}
this._focusLockedNativeIDGroups.clear();
this._updateAccessibilityFocusLock();
}
enableAccessibilityFocusLock(a0) {
if (a0.length === 0) {
c2792_4.error("No target view nativeIDs to add.");
}
for (const item of this._focusLockedNativeIDGroups.values()) {
for (const item2 of item) {
if (a0.includes(item2)) {
c2792_4.error(`Duplicate target view nativeID ${item2} already accessibility focus locked.`);
}
}
}
this._focusLockedNativeIDGroups.set(a0[0], a0);
this._updateAccessibilityFocusLock(true);
}
disableAccessibilityFocusLock(a0) {
if (a0.length === 0) {
c2792_4.error("No target view nativeIDs to remove.");
}
if (!this._focusLockedNativeIDGroups.has(a0[0])) {
c2792_4.error(`No target view nativeID ${a0[0]} accessibility focus locked.`);
}
this._focusLockedNativeIDGroups.delete(a0[0]);
this._updateAccessibilityFocusLock();
}
}
const accessibilityFocusLockManager = new AccessibilityFocusLockManager();
export default accessibilityFocusLockManager;
@@ -0,0 +1,22 @@
// Metro module 7735 (f7736).
import { createApexExperiment } from "../../experiments/apex/index";
import { getIsScreenReaderEnabled } from "./useIsScreenReaderEnabled.native";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-03-mobile-accessibility-label-optimization",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
const config = apexExperiment.getConfig({
location: "default"
});
export default apexExperiment;
export function shouldSkipAccessibilityLabels() {
return config.enabled && !getIsScreenReaderEnabled();
}
@@ -0,0 +1,82 @@
// Metro module 13499 (f13500).
import { AccessibilityInfo, Appearance } from "react-native";
import AccessibilityStore from "../AccessibilityStore";
import { AnalyticEvents } from "../../../Constants";
import { SystemTheme } from "../../user_settings/ThemeConstants";
import AccessibilitySystemFeatures from "./AccessibilitySystemFeatures";
import Dispatcher from "../../../Dispatcher";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { updateSaturation } from "../../themes/native/updateSaturation";
import updateSharedValueIfChanged_native from "../../reanimated/utils/updateSharedValueIfChanged.native";
import { accessibilityPreferencesSharedValue } from "./AccessibilityPreferencesSharedValue";
import { setSystemTheme } from "../../user_settings/ThemeActionCreators";
import { AccessibilityAnnouncer } from "../../../design/shared";
const r27 = {
init: function init() {
AccessibilitySystemFeatures.init();
this.updateNativeColors();
this.updateMotionSettings();
AccessibilityStore.addChangeListener(this.updateNativeColors);
AccessibilityStore.addChangeListener(this.updateMotionSettings);
Dispatcher.subscribe("CONNECTION_OPEN", this.updateMotionSettings);
Appearance.addChangeListener(this.updateSystemAppearance);
AccessibilityInfo.addEventListener("screenReaderChanged", (a0) => {
this.updateScreenReaderEnabled(a0);
});
Dispatcher.subscribe("ACCESSIBILITY_COLORBLIND_TOGGLE", () => {
AnalyticsUtils.track(AnalyticEvents.LOCAL_SETTINGS_UPDATED, {
colorblind_enabled: AccessibilityStore.colorblindMode
});
});
this.startAnnouncementQueue();
},
updateNativeColors: () => {
updateSaturation(AccessibilityStore.saturation);
},
updateMotionSettings: () => {
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, {
reduceMotion: AccessibilityStore.useReducedMotion,
prefersCrossfades: AccessibilityStore.systemPrefersCrossfades
});
},
checkScreenreaderEnabled: async function checkScreenreaderEnabled() {
const _this = this;
let c27478_1;
c27478_1 = void 0;
let c30632_0 = await AccessibilityInfo.isScreenReaderEnabled();
_this.updateScreenReaderEnabled(c30632_0);
},
updateScreenReaderEnabled: (a0) => {
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, {
screenReaderEnabled: a0
});
},
updateSystemAppearance: (a0) => {
let NO_PREFERENCE = SystemTheme.NO_PREFERENCE;
const colorScheme = a0.colorScheme;
if (colorScheme === "light") {
NO_PREFERENCE = SystemTheme.LIGHT;
} else if (colorScheme === "dark") {
NO_PREFERENCE = SystemTheme.DARK;
}
setSystemTheme(NO_PREFERENCE);
},
startAnnouncementQueue: () => {
let c20500_0 = new Set();
AccessibilityInfo.addEventListener("announcementFinished", (a0) => {
if (!a0.success) {
if (!c20500_0.has(a0.announcement)) {
c20500_0.add(a0.announcement);
setTimeout(() => {
AccessibilityAnnouncer.announce(a0.announcement);
}, 150);
} else {
c20500_0.delete(a0.announcement);
}
} else {
c20500_0.delete(a0.announcement);
}
});
}
};
export default r27;
@@ -0,0 +1,35 @@
// Metro module 13625 (f13626).
import { useMemo } from "react";
import AccessibilityStore from "../AccessibilityStore";
import { useStateFromStoresObject, useStateFromStores } from "../../../_bundle/Module589";
import { AccessibilityPreferencesContext } from "../../../_bundle/Module3908";
export default function AccessibilityPreferencesContextProvider(props) {
let stateFromStores, stateFromStoresObject2, stateFromStores2, stateFromStores3, stateFromStores4;
const children = props.children;
stateFromStores = void 0;
stateFromStoresObject2 = void 0;
stateFromStores2 = void 0;
stateFromStores3 = void 0;
stateFromStores4 = void 0;
const stateFromStoresObject = useStateFromStoresObject([AccessibilityStore], () => ({
enabled: AccessibilityStore.useReducedMotion,
rawValue: AccessibilityStore.rawPrefersReducedMotion
}));
stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.systemPrefersCrossfades);
stateFromStoresObject2 = useStateFromStoresObject([AccessibilityStore], () => ({
enabled: AccessibilityStore.useForcedColors,
rawValue: AccessibilityStore.systemForcedColors
}));
stateFromStores2 = useStateFromStores([AccessibilityStore], () => AccessibilityStore.alwaysShowLinkDecorations);
stateFromStores3 = useStateFromStores([AccessibilityStore], () => AccessibilityStore.keyboardModeEnabled);
stateFromStores4 = useStateFromStores([AccessibilityStore], () => AccessibilityStore.isSwitchIconsEnabled);
return <AccessibilityPreferencesContext.Provider value={useMemo(() => ({
reducedMotion: stateFromStoresObject,
prefersCrossfades: stateFromStores,
forcedColors: stateFromStoresObject2,
alwaysShowLinkDecorations: stateFromStores2,
highContrastModeEnabled: false,
keyboardModeEnabled: stateFromStores3,
switchIconsEnabled: stateFromStores4
}), [stateFromStoresObject, stateFromStores, stateFromStoresObject2, stateFromStores2, stateFromStores3, stateFromStores4])}>{children}</AccessibilityPreferencesContext.Provider>;
};
@@ -0,0 +1,9 @@
// Metro module 13501 (f13502).
import { AccessibilityFeatureFlags } from "../AccessibilityConstants";
import * as _native from "../../../design/native";
const r13 = {};
r13[AccessibilityFeatureFlags.REDUCED_MOTION] = "reduceMotion";
r13[AccessibilityFeatureFlags.REDUCED_MOTION_PREFERS_CROSSFADES] = "prefersCrossfades";
r13[AccessibilityFeatureFlags.SCREENREADER] = "screenReaderEnabled";
export { r13 as A11Y_FEATURE_MAP };
export const accessibilityPreferencesSharedValue = _native.accessibilityPreferencesSharedValue;
@@ -0,0 +1,257 @@
// Metro module 13500 (f13501).
import { AccessibilityInfo, AppState, Appearance } from "react-native";
import AccessibilityStore from "../AccessibilityStore";
import { AccessibilityFeatureFlags } from "../AccessibilityConstants";
import { A11Y_FEATURE_MAP, accessibilityPreferencesSharedValue } from "./AccessibilityPreferencesSharedValue";
import updateSharedValueIfChanged_native from "../../reanimated/utils/updateSharedValueIfChanged.native";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { systemPrefersReducedMotionChanged, systemPrefersCrossfadesChanged } from "../AccessibilityActionCreators";
const NONE = AccessibilityFeatureFlags.NONE;
const r24 = {
init: function init() {
AccessibilityStore.addChangeListener(this.handleAccessibilityStoreChanged);
AccessibilityInfo.addEventListener("reduceMotionChanged", this.handleReduceMotionChanged);
AccessibilityInfo.isReduceMotionEnabled().then(this.handleReduceMotionChanged);
AccessibilityInfo.addEventListener("reduceTransparencyChanged", this.handleReduceTransparencyChanged);
AccessibilityInfo.isReduceTransparencyEnabled().then(this.handleReduceTransparencyChanged);
AccessibilityInfo.addEventListener("boldTextChanged", this.handleBoldTextChanged);
AccessibilityInfo.isBoldTextEnabled().then(this.handleBoldTextChanged);
AccessibilityInfo.addEventListener("grayscaleChanged", this.handleGrayscaleChanged);
AccessibilityInfo.isGrayscaleEnabled().then(this.handleGrayscaleChanged);
AccessibilityInfo.addEventListener("invertColorsChanged", this.handleInvertColorsChanged);
AccessibilityInfo.isInvertColorsEnabled().then(this.handleInvertColorsChanged);
this.handlePreferredColorSchemeChanged({
colorScheme: Appearance.getColorScheme()
});
Appearance.addChangeListener(this.handlePreferredColorSchemeChanged);
AppState.addEventListener("change", this.handleAppStateChange);
AnalyticsUtils.setSystemAccessibilityFeatures(this.getActiveFeatures);
},
getActiveFeatures: () => NONE,
handleReduceMotionChanged: (a0) => {
systemPrefersReducedMotionChanged(a0 ? "reduce" : "no-preference");
const REDUCED_MOTION = AccessibilityFeatureFlags.REDUCED_MOTION;
if (AccessibilityStore.useReducedMotion) {
NONE = NONE | REDUCED_MOTION;
} else {
NONE = NONE & ~REDUCED_MOTION;
}
const r22 = A11Y_FEATURE_MAP[REDUCED_MOTION];
if (r22 != null) {
const r29 = {};
r29[r22] = AccessibilityStore.useReducedMotion;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r29);
}
},
handleReduceTransparencyChanged: (a0) => {
const REDUCED_TRANSPARENCY = AccessibilityFeatureFlags.REDUCED_TRANSPARENCY;
if (a0) {
NONE = NONE | REDUCED_TRANSPARENCY;
} else {
NONE = NONE & ~REDUCED_TRANSPARENCY;
}
const r15 = A11Y_FEATURE_MAP[REDUCED_TRANSPARENCY];
if (r15 != null) {
const r22 = {};
r22[r15] = a0;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r22);
}
},
handleBoldTextChanged: (a0) => {
const BOLD_TEXT = AccessibilityFeatureFlags.BOLD_TEXT;
if (a0) {
NONE = NONE | BOLD_TEXT;
} else {
NONE = NONE & ~BOLD_TEXT;
}
const r15 = A11Y_FEATURE_MAP[BOLD_TEXT];
if (r15 != null) {
const r22 = {};
r22[r15] = a0;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r22);
}
},
handleGrayscaleChanged: (a0) => {
const GRAYSCALE = AccessibilityFeatureFlags.GRAYSCALE;
if (a0) {
NONE = NONE | GRAYSCALE;
} else {
NONE = NONE & ~GRAYSCALE;
}
const r15 = A11Y_FEATURE_MAP[GRAYSCALE];
if (r15 != null) {
const r22 = {};
r22[r15] = a0;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r22);
}
},
handleInvertColorsChanged: (a0) => {
const INVERT_COLORS = AccessibilityFeatureFlags.INVERT_COLORS;
if (a0) {
NONE = NONE | INVERT_COLORS;
} else {
NONE = NONE & ~INVERT_COLORS;
}
const r15 = A11Y_FEATURE_MAP[INVERT_COLORS];
if (r15 != null) {
const r22 = {};
r22[r15] = a0;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r22);
}
},
handlePreferredColorSchemeChanged: ({ colorScheme }) => {
if (colorScheme === "dark") {
const PREFERS_COLOR_SCHEME_LIGHT3 = AccessibilityFeatureFlags.PREFERS_COLOR_SCHEME_LIGHT;
NONE = NONE & ~PREFERS_COLOR_SCHEME_LIGHT3;
const r93 = A11Y_FEATURE_MAP[PREFERS_COLOR_SCHEME_LIGHT3];
if (r93 != null) {
const r101 = {};
r101[r93] = false;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r101);
}
const PREFERS_COLOR_SCHEME_DARK3 = AccessibilityFeatureFlags.PREFERS_COLOR_SCHEME_DARK;
NONE = NONE | PREFERS_COLOR_SCHEME_DARK3;
const r110 = A11Y_FEATURE_MAP[PREFERS_COLOR_SCHEME_DARK3];
if (r110 != null) {
const r117 = {};
r117[r110] = true;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r117);
}
} else if (colorScheme === "light") {
const PREFERS_COLOR_SCHEME_DARK2 = AccessibilityFeatureFlags.PREFERS_COLOR_SCHEME_DARK;
NONE = NONE & ~PREFERS_COLOR_SCHEME_DARK2;
const r55 = A11Y_FEATURE_MAP[PREFERS_COLOR_SCHEME_DARK2];
if (r55 != null) {
const r63 = {};
r63[r55] = false;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r63);
}
const PREFERS_COLOR_SCHEME_LIGHT2 = AccessibilityFeatureFlags.PREFERS_COLOR_SCHEME_LIGHT;
NONE = NONE | PREFERS_COLOR_SCHEME_LIGHT2;
const r72 = A11Y_FEATURE_MAP[PREFERS_COLOR_SCHEME_LIGHT2];
if (r72 != null) {
const r79 = {};
r79[r72] = true;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r79);
}
} else {
const PREFERS_COLOR_SCHEME_DARK = AccessibilityFeatureFlags.PREFERS_COLOR_SCHEME_DARK;
NONE = NONE & ~PREFERS_COLOR_SCHEME_DARK;
const r10 = A11Y_FEATURE_MAP[PREFERS_COLOR_SCHEME_DARK];
if (r10 != null) {
const r25 = {};
r25[r10] = false;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r25);
}
const PREFERS_COLOR_SCHEME_LIGHT = AccessibilityFeatureFlags.PREFERS_COLOR_SCHEME_LIGHT;
NONE = NONE & ~PREFERS_COLOR_SCHEME_LIGHT;
const r34 = A11Y_FEATURE_MAP[PREFERS_COLOR_SCHEME_LIGHT];
if (r34 != null) {
const r41 = {};
r41[r34] = false;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r41);
}
}
},
handleAccessibilityStoreChanged: () => {
const REDUCED_MOTION = AccessibilityFeatureFlags.REDUCED_MOTION;
if (AccessibilityStore.useReducedMotion) {
NONE = NONE | REDUCED_MOTION;
} else {
NONE = NONE & ~REDUCED_MOTION;
}
const r12 = A11Y_FEATURE_MAP[REDUCED_MOTION];
if (r12 != null) {
const r25 = {};
r25[r12] = AccessibilityStore.useReducedMotion;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r25);
}
const REDUCED_MOTION_FROM_USER_SETTINGS = AccessibilityFeatureFlags.REDUCED_MOTION_FROM_USER_SETTINGS;
const r2 = AccessibilityStore.rawPrefersReducedMotion !== "auto";
if (r2) {
NONE = NONE | REDUCED_MOTION_FROM_USER_SETTINGS;
} else {
NONE = NONE & ~REDUCED_MOTION_FROM_USER_SETTINGS;
}
const r37 = A11Y_FEATURE_MAP[REDUCED_MOTION_FROM_USER_SETTINGS];
if (r37 != null) {
const r44 = {};
r44[r37] = r2;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r44);
}
const SATURATION_LEVEL_DECREASED = AccessibilityFeatureFlags.SATURATION_LEVEL_DECREASED;
const r48 = AccessibilityStore.saturation < 1;
if (r48) {
NONE = NONE | SATURATION_LEVEL_DECREASED;
} else {
NONE = NONE & ~SATURATION_LEVEL_DECREASED;
}
const r56 = A11Y_FEATURE_MAP[SATURATION_LEVEL_DECREASED];
if (r56 != null) {
const r63 = {};
r63[r56] = r48;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r63);
}
const CONTRAST_LEVEL_DECREASED = AccessibilityFeatureFlags.CONTRAST_LEVEL_DECREASED;
const r67 = AccessibilityStore.contrast < 1;
if (r67) {
NONE = NONE | CONTRAST_LEVEL_DECREASED;
} else {
NONE = NONE & ~CONTRAST_LEVEL_DECREASED;
}
const r75 = A11Y_FEATURE_MAP[CONTRAST_LEVEL_DECREASED];
if (r75 != null) {
const r82 = {};
r82[r75] = r67;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r82);
}
const CONTRAST_LEVEL_INCREASED = AccessibilityFeatureFlags.CONTRAST_LEVEL_INCREASED;
const r86 = AccessibilityStore.contrast > 1;
if (r86) {
NONE = NONE | CONTRAST_LEVEL_INCREASED;
} else {
NONE = NONE & ~CONTRAST_LEVEL_INCREASED;
}
const r94 = A11Y_FEATURE_MAP[CONTRAST_LEVEL_INCREASED];
if (r94 != null) {
const r101 = {};
r101[r94] = r86;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r101);
}
},
handleAppStateChange: (a0) => {
if (a0 === "active") {
AccessibilityInfo.isReduceMotionEnabled().then((result) => {
systemPrefersReducedMotionChanged(result ? "reduce" : "no-preference");
const REDUCED_MOTION = AccessibilityFeatureFlags.REDUCED_MOTION;
if (AccessibilityStore.useReducedMotion) {
NONE = NONE | REDUCED_MOTION;
} else {
NONE = NONE & ~REDUCED_MOTION;
}
const r22 = A11Y_FEATURE_MAP[REDUCED_MOTION];
if (r22 != null) {
const r29 = {};
r29[r22] = AccessibilityStore.useReducedMotion;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r29);
}
});
AccessibilityInfo.prefersCrossFadeTransitions().then((result) => {
const REDUCED_MOTION_PREFERS_CROSSFADES = AccessibilityFeatureFlags.REDUCED_MOTION_PREFERS_CROSSFADES;
if (result) {
NONE = NONE | REDUCED_MOTION_PREFERS_CROSSFADES;
} else {
NONE = NONE & ~REDUCED_MOTION_PREFERS_CROSSFADES;
}
const r8 = A11Y_FEATURE_MAP[REDUCED_MOTION_PREFERS_CROSSFADES];
if (r8 != null) {
const r22 = {};
r22[r8] = result;
updateSharedValueIfChanged_native(accessibilityPreferencesSharedValue, r22);
}
systemPrefersCrossfadesChanged(result);
});
}
}
};
export default r24;
@@ -0,0 +1,15 @@
// Metro module 11728 (f11729).
import * as _Module17 from "react-native";
import { isIosFabric } from "../../../utils/native/FabricUtils";
import * as _Module11729 from "../../../_bundle/Module11729";
let View2 = _Module17.View;
if (isIosFabric()) {
View2 = _Module11729.default;
}
const View = View2;
export default function PortalAccessibilityWorkaroundView(props) {
return <View {...props} {...isIosFabric() ? {
accessibilityLabel: " ",
accessible: false
} : null} collapsable={false} />;
};
@@ -0,0 +1,8 @@
// Metro module 4532 (f4533).
import { NativeModules } from "react-native";
import { isIOS } from "../../../utils/PlatformUtils";
export default function markAccessibilityFocus() {
if (isIOS()) {
NativeModules.DCDAccessibilityManager.markCurrentFocus();
}
};
@@ -0,0 +1,23 @@
// Metro module 4596 (f4597).
import { AccessibilityInfo, findNodeHandle } from "react-native";
import Logger from "../../debug/Logger";
import Module4587 from "../../../_bundle/Module4587";
import { isFabric } from "../../../utils/native/FabricUtils";
let c2799_5 = new Logger("setAccessibilityFocus");
export function setAccessibilityFocus({ ref, delay = 0 }) {
let c14339_0;
c14339_0 = void 0;
if (ref != null) {
const r10 = findNodeHandle(ref.current);
c14339_0 = r10;
if (r10 != null) {
setTimeout(() => {
if (isFabric()) {
AccessibilityInfo.setAccessibilityFocus(c14339_0);
} else {
Module4587.setAccessibilityFocus(c14339_0).catch((error) => c2799_5.warn("Failed with reason:", error));
}
}, delay);
}
}
}
@@ -0,0 +1,8 @@
// Metro module 4531 (f4532).
import { NativeModules } from "react-native";
import { isIOS } from "../../../utils/PlatformUtils";
export default function setAccessibilityFocusPrevious() {
if (isIOS()) {
NativeModules.DCDAccessibilityManager.restorePreviousFocus();
}
};
@@ -0,0 +1,21 @@
// Metro module 8293 (f8294).
import { useRef, useEffect, useMemo } from "react";
export default function useAccessibilityPress(a0, a1) {
const current = a0;
const label = a1;
const ref = useRef(a0);
useEffect(() => {
ref.current = current;
}, [a0]);
return useMemo(() => ({
onAccessibilityAction: (a0) => {
if (a0.nativeEvent.actionName === "activate") {
ref.current();
}
},
accessibilityActions: [{
name: "activate",
label
}]
}), [a1]);
};
@@ -0,0 +1,55 @@
// Metro module 10186 (f10187).
import { useRef, useEffect, useCallback } from "react";
import { AccessibilityInfo } from "react-native";
import { AccessibilityAnnouncer } from "../../../design/shared";
import { isIOS } from "../../../utils/PlatformUtils";
import { getIsScreenReaderEnabled } from "./useIsScreenReaderEnabled.native";
export default function useAnnounceAsyncCompletion() {
const ref = useRef(null);
useEffect(() => () => {
const current = ref.current;
if (current != null) {
current.call(ref);
}
ref.current = null;
}, []);
return useCallback(function(a0) {
let r26;
let c26630_0 = a0;
let r6 = arguments[1];
if (r6 === void 0) {
r6 = "assertive";
}
AccessibilityAnnouncer.announce(a0, r6);
if (isIOS() && getIsScreenReaderEnabled()) {
const current = ref.current;
if (current != null) {
current.call(ref);
}
r26 = new Promise((c30202_0) => {
let c30202_2;
let c30202_1 = setTimeout(() => {
const current = ref.current;
return current == null ? void 0 : current.call(ref);
}, 1800);
c30202_2 = AccessibilityInfo.addEventListener("announcementFinished", (a0) => {
if (a0.announcement === c26630_0 && a0.success) {
const current = ref.current;
if (current != null) {
current.call(ref);
}
}
});
ref.current = () => {
clearTimeout(c30202_1);
c30202_2.remove();
ref.current = null;
c30202_0();
};
});
} else {
r26 = Promise.resolve();
}
return r26;
}, []);
};
@@ -0,0 +1,68 @@
// Metro module 4586 (f4587).
import { AccessibilityInfo } from "react-native";
import { Storage } from "../../../_bundle/Module595";
import { create } from "../../../_bundle/Module644";
import { batchUpdates } from "../../../_bundle/Module705";
function $mk103931($env) {
return () => $env.$parent[0]($mk114597($env));
}
function $mk114597($env) {
return (a0) => {
let r1 = a0;
const screenReaderEnabled = a0.screenReaderEnabled;
const screenReaderEnabled2 = $env[0];
if (screenReaderEnabled !== screenReaderEnabled2) {
const r7 = $env.$parent.$parent;
(0, r7[0])(r7[1][1]).Storage.set(r7[4], screenReaderEnabled2);
r1 = {
screenReaderEnabled: screenReaderEnabled2
};
}
return r1;
};
}
let c2793_4, c2793_5;
let env2793 = {};
const SCREEN_READER_ENABLED_GETTER = (a0) => a0.screenReaderEnabled;
c2793_4 = "screenReaderEnabled";
c2793_5 = create((a0) => {
let env14335 = {
$parent: env2793
};
env14335[0] = a0;
const updateScreenReaderEnabled = function updateScreenReaderEnabled(a0) {
let env25250;
const r1 = env25250 = {
$parent: env14335
};
env25250[0] = a0;
batchUpdates($mk103931(r1));
};
AccessibilityInfo.isScreenReaderEnabled().then(updateScreenReaderEnabled).catch(() => {
let env25251;
const r1 = env25251 = {
$parent: env14335
};
env25251[0] = false;
batchUpdates($mk103931(r1));
});
AccessibilityInfo.addEventListener("screenReaderChanged", updateScreenReaderEnabled);
let screenReaderEnabled = Storage.get(c2793_4);
if (screenReaderEnabled == null) {
screenReaderEnabled = false;
}
return {
screenReaderEnabled
};
});
export function addScreenReaderEnabledListener(c14336_0) {
return c2793_5.subscribe((a0) => {
c14336_0(a0.screenReaderEnabled);
});
}
export function getIsScreenReaderEnabled() {
return c2793_5.getState().screenReaderEnabled;
}
export function useIsScreenReaderEnabled() {
return c2793_5(SCREEN_READER_ENABLED_GETTER);
}