import { LocaleStorage, getLocaleFromStorage, setLocaleInStorage } from "../@intlayer/core/dist/esm/utils/localeStorage.mjs";
import { localeStorageOptions } from "../@intlayer/core/dist/esm/localization/getBrowserLocale.mjs";
import { useMemo } from "react";

//#region ../react-intlayer/dist/esm/client/useLocaleStorage.mjs
/**
* Get the locale cookie
*/
/**
* Get the locale cookie
*/
const localeInStorage = getLocaleFromStorage(localeStorageOptions);
/**
* @deprecated Use localeInStorage instead
*
* Get the locale cookie
*/
const localeCookie = localeInStorage;
/**
* Set the locale cookie
*/
const setLocaleInStorage$1 = (locale, isCookieEnabled) => setLocaleInStorage(locale, {
	...localeStorageOptions,
	isCookieEnabled
});
/**
* @deprecated Use setLocaleInStorage instead
*
* Set the locale cookie
*/
const setLocaleCookie = setLocaleInStorage$1;
/**
* Hook that provides the locale cookie and a function to set it
*/
const useLocaleStorage = (isCookieEnabled) => useMemo(() => LocaleStorage({
	...localeStorageOptions,
	isCookieEnabled
}), [isCookieEnabled]);
/**
* @deprecated Use useLocaleStorage instead
*
* For GDPR compliance, use useLocaleStorage instead
*
* Hook that provides the locale cookie and a function to set it
*/
const useLocaleCookie = (isCookieEnabled) => {
	const storage = useLocaleStorage(isCookieEnabled);
	return {
		localeCookie: storage.getLocale(),
		setLocaleCookie: storage.setLocale
	};
};

//#endregion
export { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage$1 as setLocaleInStorage, useLocaleCookie, useLocaleStorage };
//# sourceMappingURL=useLocaleStorage.mjs.map