require("../_virtual/_rolldown/runtime.js");
let react = require("react");
//#region src/hooks/useWindowSize.ts
const useWindowSize = (options = {}) => {
	const { debounceMs = 100 } = options;
	(0, react.useEffect)(() => {
		let timeoutId;
		const setRealVH = () => {
			let height = window.innerHeight;
			if (new URLSearchParams(window.location.search).has("fromTabbar")) height = height - 54;
			const vh = height * .01;
			document.documentElement.style.setProperty("--vh", `${vh}px`);
		};
		const debouncedHandleResize = () => {
			clearTimeout(timeoutId);
			timeoutId = setTimeout(setRealVH, debounceMs);
		};
		debouncedHandleResize();
		window.addEventListener("resize", debouncedHandleResize);
		return () => {
			window.removeEventListener("resize", debouncedHandleResize);
			clearTimeout(timeoutId);
		};
	}, [debounceMs]);
};
//#endregion
exports.default = useWindowSize;
