globalThis.process ??= {};
globalThis.process.env ??= {};
import { r as __exportAll } from "./rolldown-runtime_-UtK6b3T.mjs";
import { d as mapContentError, u as jsonOk } from "./crypto_CY2zBtG3.mjs";
import { r as buildAuthEngine } from "./admin-engine_Cqzo5vQB.mjs";
import { s as resolveSession } from "./auth_B0DWM0G6.mjs";
import { env } from "cloudflare:workers";
//#region src/pages/api/admin/me.ts
var me_exports = /* @__PURE__ */ __exportAll({
	GET: () => GET,
	prerender: () => false,
	resolveMe: () => resolveMe
});
async function resolveMe(request, engine, sink) {
	try {
		const { principal } = await resolveSession(request, engine, sink);
		return jsonOk(principal);
	} catch (error) {
		if (error?.name === "InvalidSessionError") return jsonOk(null);
		return mapContentError(error);
	}
}
var GET = ({ request, cookies }) => resolveMe(request, buildAuthEngine(env), cookies);
//#endregion
//#region \0virtual:astro:page:src/pages/api/admin/me@_@ts
var page = () => me_exports;
//#endregion
export { page };
