"use client";
import { createContext, use } from "react";
//#region packages/@mantine/core/src/core/utils/create-safe-context/create-safe-context.tsx
function createSafeContext(errorMessage) {
	const Context = createContext(null);
	const useSafeContext = () => {
		const ctx = use(Context);
		if (ctx === null) throw new Error(errorMessage);
		return ctx;
	};
	return [Context, useSafeContext];
}
//#endregion
export { createSafeContext };

//# sourceMappingURL=create-safe-context.mjs.map