const DEFAULT_PLAN = "free";
const DEFAULT_FLAGS = [];
const userDataCache = /* @__PURE__ */ new Map();
function extractUserPlanData(user) {
  if (!user) {
    return {
      plan: DEFAULT_PLAN,
      flags: DEFAULT_FLAGS
    };
  }
  return {
    plan: DEFAULT_PLAN,
    flags: DEFAULT_FLAGS
  };
}
function clearUserDataCache(userId) {
  if (userId) {
    userDataCache.delete(userId);
  } else {
    userDataCache.clear();
  }
}
function getUserDataCacheStats() {
  const entries = Array.from(userDataCache.entries());
  return {
    size: userDataCache.size,
    keys: entries.map(([key]) => key),
    oldestEntry: entries.length > 0 ? Math.min(...entries.map(([, data]) => data.timestamp)) : null,
    newestEntry: entries.length > 0 ? Math.max(...entries.map(([, data]) => data.timestamp)) : null
  };
}
export {
  clearUserDataCache,
  extractUserPlanData,
  getUserDataCacheStats
};
