2026-08-15 05:55:55 +00:00
|
|
|
// Module ID: 1592
|
|
|
|
|
// Function ID: 1593
|
2026-08-06 08:05:19 +00:00
|
|
|
// Name: useNavigationState
|
2026-08-15 05:55:55 +00:00
|
|
|
// Dependencies: [32, 19, 21, 1578, 1522]
|
2026-08-06 08:05:19 +00:00
|
|
|
// Exports: NavigationStateListenerProvider, useNavigationState
|
|
|
|
|
|
2026-08-15 05:55:55 +00:00
|
|
|
// Module 1592 (useNavigationState)
|
2026-08-24 06:08:38 +00:00
|
|
|
import useEffectDefault from "useEffect" /* 1522 */;
|
|
|
|
|
import closure_3 from "_slicedToArray" /* 32 */;
|
|
|
|
|
import importAllResult from "noop" /* 19 */;
|
|
|
|
|
import { jsx } from "jsxProd" /* 21 */;
|
2026-08-06 08:05:19 +00:00
|
|
|
|
|
|
|
|
const require = arg1;
|
|
|
|
|
let c4 = importAllResult;
|
|
|
|
|
const context = importAllResult.createContext(undefined);
|
|
|
|
|
|
|
|
|
|
export const useNavigationState = function useNavigationState(fn) {
|
|
|
|
|
const _require = fn;
|
|
|
|
|
if (typeof fn !== "function") {
|
|
|
|
|
const _Error2 = Error;
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
2026-08-24 06:08:38 +00:00
|
|
|
error = new Error("A selector function must be provided (got " + typeof fn + ").");
|
2026-08-06 08:05:19 +00:00
|
|
|
throw error;
|
|
|
|
|
} else {
|
|
|
|
|
let obj = importAllResult;
|
|
|
|
|
const store = importAllResult.useContext(closure_6);
|
|
|
|
|
if (null == store) {
|
|
|
|
|
const _Error = Error;
|
|
|
|
|
const error1 = new Error("Couldn't get the navigation state. Is your component inside a navigator?");
|
|
|
|
|
throw error1;
|
|
|
|
|
} else {
|
|
|
|
|
const getState = store.getState;
|
|
|
|
|
const subscribe = store.subscribe;
|
|
|
|
|
callback = callback(obj.useReducer((arg0) => arg0 + 1, 0), 2)[1];
|
|
|
|
|
const tmp14 = fn(getState());
|
|
|
|
|
obj = { select: null, selected: null };
|
|
|
|
|
obj[0] = fn;
|
|
|
|
|
obj[1] = tmp14;
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_5 = obj.useRef(obj);
|
2026-08-06 08:05:19 +00:00
|
|
|
const clientLayoutEffect = _require(subscribe[3]).useClientLayoutEffect(() => {
|
|
|
|
|
closure_5.current = { select: closure_0, selected: closure_4 };
|
|
|
|
|
});
|
|
|
|
|
const items = [getState, subscribe];
|
|
|
|
|
const effect = obj.useEffect(() => {
|
|
|
|
|
let current = ref.current;
|
|
|
|
|
({ selected, select } = current);
|
|
|
|
|
if (!Object.is(selected, select(getState()))) {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
return subscribe(function checkForUpdates() {
|
|
|
|
|
const current = ref.current;
|
|
|
|
|
({ selected, select } = current);
|
|
|
|
|
if (!Object.is(selected, select(callback()))) {
|
|
|
|
|
callback2();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, items);
|
|
|
|
|
return tmp14;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export const NavigationStateListenerProvider = function NavigationStateListenerProvider(getState) {
|
|
|
|
|
getState = getState.getState;
|
2026-08-24 06:08:38 +00:00
|
|
|
importDefault = undefined;
|
|
|
|
|
dependencyMap = undefined;
|
2026-08-06 08:05:19 +00:00
|
|
|
({ state, children } = getState);
|
|
|
|
|
importDefault = importAllResult.useRef([]);
|
2026-08-24 06:08:38 +00:00
|
|
|
const tmp = useEffectDefault((arg0) => {
|
|
|
|
|
closure_0 = arg0;
|
2026-08-06 08:05:19 +00:00
|
|
|
let current = ref.current;
|
|
|
|
|
current.push(arg0);
|
|
|
|
|
return () => {
|
2026-08-24 06:08:38 +00:00
|
|
|
const current = closure_1_1.current;
|
|
|
|
|
closure_1_1.current = current.filter((arg0) => arg0 !== closure_0);
|
2026-08-06 08:05:19 +00:00
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
dependencyMap = tmp;
|
2026-08-15 05:55:55 +00:00
|
|
|
let obj = getState(1578);
|
2026-08-06 08:05:19 +00:00
|
|
|
const items = [state];
|
|
|
|
|
const clientLayoutEffect = obj.useClientLayoutEffect(() => {
|
|
|
|
|
const current = ref.current;
|
|
|
|
|
const item = current.forEach((arg0) => arg0());
|
|
|
|
|
}, items);
|
|
|
|
|
const items1 = [getState, tmp];
|
2026-08-24 06:08:38 +00:00
|
|
|
obj = { value: importAllResult.useMemo(() => ({ getState, subscribe: closure_2 }), items1), children };
|
|
|
|
|
return <redux.Provider value={importAllResult.useMemo(() => ({ getState, subscribe: closure_2 }), items1)}>{children}</redux.Provider>;
|
2026-08-06 08:05:19 +00:00
|
|
|
};
|