"use client";
import { I18N_CONFIG } from "./config/index.js";
function setUserLocaleClient(locale) {
  if (!I18N_CONFIG.supportedLocales.includes(locale)) {
    throw new Error(
      `Unsupported locale: ${locale}. Supported locales: ${I18N_CONFIG.supportedLocales.join(", ")}`
    );
  }
  const cookieConfig = I18N_CONFIG.cookie;
  const expires = new Date(Date.now() + cookieConfig.maxAge);
  document.cookie = `${cookieConfig.name}=${locale}; expires=${expires.toUTCString()}; path=${cookieConfig.path}; SameSite=${cookieConfig.sameSite}`;
}
export {
  I18N_CONFIG,
  setUserLocaleClient
};
