import { createContext, useContext } from "react";
//#region src/hooks/useEngineContext.ts
const defaultContext = createContext({});
const useEngineContext = () => {
	const context = useContext(window.__appContext || defaultContext);
	if (!Object.keys(context).length) return window.__injectedContext;
	return context || {};
};
const usePisellOS = () => {
	var _context$appHelper;
	const context = useEngineContext();
	const { pisellos } = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
	return pisellos;
};
const usePlatform = () => {
	var _context$appHelper2;
	const context = useEngineContext();
	const { platform } = (context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.constants) || {};
	return platform;
};
//#endregion
export { useEngineContext as default, usePisellOS, usePlatform };
