import { createContext, useContext, createElement } from 'react';

// src/auth/context.ts
var AuthContext = createContext(null);
function useAuthContext() {
  const ctx = useContext(AuthContext);
  if (!ctx) {
    throw new Error(
      "useAuthContext must be used within an AuthProvider. Wrap your app with <ElevasisUIProvider> or a custom AuthProvider."
    );
  }
  return ctx;
}
function AuthProvider({ value, children }) {
  return createElement(AuthContext.Provider, { value }, children);
}

export { AuthProvider, useAuthContext };
