'use client'; 'use strict'; var React = require('react'); var useIsomorphicEffect = require('../use-isomorphic-effect/use-isomorphic-effect.cjs'); function getOS() { if (typeof window === "undefined") { return "undetermined"; } const { userAgent } = window.navigator; const macosPlatforms = /(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i; const windowsPlatforms = /(Win32)|(Win64)|(Windows)|(WinCE)/i; const iosPlatforms = /(iPhone)|(iPad)|(iPod)/i; if (macosPlatforms.test(userAgent)) { return "macos"; } if (iosPlatforms.test(userAgent)) { return "ios"; } if (windowsPlatforms.test(userAgent)) { return "windows"; } if (/Android/i.test(userAgent)) { return "android"; } if (/Linux/i.test(userAgent)) { return "linux"; } return "undetermined"; } function useOs(options = { getValueInEffect: true }) { const [value, setValue] = React.useState(options.getValueInEffect ? "undetermined" : getOS()); useIsomorphicEffect.useIsomorphicEffect(() => { if (options.getValueInEffect) { setValue(getOS); } }, []); return value; } exports.useOs = useOs; //# sourceMappingURL=use-os.cjs.map