globalThis.__nitro_main__ = import.meta.url;
import { a as toEventHandler, c as NodeResponse, i as defineLazyEventHandler, l as serve, n as HTTPError, r as defineHandler, t as H3Core } from "./_libs/h3+rou3+srvx.mjs";
import { i as withoutTrailingSlash, n as joinURL, r as withLeadingSlash, t as decodePath } from "./_libs/ufo.mjs";
import { promises } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
//#region #nitro-vite-setup
function lazyService(loader) {
	let promise, mod;
	return { fetch(req) {
		if (mod) return mod.fetch(req);
		if (!promise) promise = loader().then((_mod) => mod = _mod.default || _mod);
		return promise.then((mod) => mod.fetch(req));
	} };
}
var services = { ["ssr"]: lazyService(() => import("./_ssr/ssr.mjs")) };
globalThis.__nitro_vite_envs__ = services;
//#endregion
//#region node_modules/nitro/dist/runtime/internal/route-rules.mjs
var headers = ((m) => function headersRouteRule(event) {
	for (const [key, value] of Object.entries(m.options || {})) event.res.headers.set(key, value);
});
//#endregion
//#region #nitro/virtual/public-assets-data
var public_assets_data_default = {
	"/favicon.ico": {
		"type": "image/vnd.microsoft.icon",
		"etag": "\"f1e-ESBTjHetHyiokkO0tT/irBbMO8Y\"",
		"mtime": "2026-05-10T09:04:44.621Z",
		"size": 3870,
		"path": "../public/favicon.ico"
	},
	"/logo192.png": {
		"type": "image/png",
		"etag": "\"14e3-f08taHgqf6/O2oRVTsq5tImHdQA\"",
		"mtime": "2026-05-10T09:04:44.621Z",
		"size": 5347,
		"path": "../public/logo192.png"
	},
	"/manifest.json": {
		"type": "application/json",
		"etag": "\"1f2-Oqn/x1R1hBTtEjA8nFhpBeFJJNg\"",
		"mtime": "2026-05-10T09:04:44.621Z",
		"size": 498,
		"path": "../public/manifest.json"
	},
	"/robots.txt": {
		"type": "text/plain; charset=utf-8",
		"etag": "\"43-BEzmj4PuhUNHX+oW9uOnPSihxtU\"",
		"mtime": "2026-05-10T09:04:44.621Z",
		"size": 67,
		"path": "../public/robots.txt"
	},
	"/assets/arrow-left-9Wn53Zfu.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"a4-dmPJwbPHSiRoehsIqJv80yWO6/0\"",
		"mtime": "2026-05-10T09:04:44.219Z",
		"size": 164,
		"path": "../public/assets/arrow-left-9Wn53Zfu.js"
	},
	"/assets/cart-DbCdgo5T.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"871-ZkSoe5vToefmQp+3mPvx0++Ehw8\"",
		"mtime": "2026-05-10T09:04:44.219Z",
		"size": 2161,
		"path": "../public/assets/cart-DbCdgo5T.js"
	},
	"/assets/cart-query-hooks-BCr0eax3.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"54f-/wz5N2J2i6NV0rmOV+OFVxLJ00A\"",
		"mtime": "2026-05-10T09:04:44.219Z",
		"size": 1359,
		"path": "../public/assets/cart-query-hooks-BCr0eax3.js"
	},
	"/assets/checkout-C55r-QU8.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"a79-ytWuhyykctWUPJibFig5SjGd6uI\"",
		"mtime": "2026-05-10T09:04:44.220Z",
		"size": 2681,
		"path": "../public/assets/checkout-C55r-QU8.js"
	},
	"/assets/central-product-store-DGoerB5U.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"f3-4DIoL/Br3/ESYGDc8q8U97GGBoE\"",
		"mtime": "2026-05-10T09:04:44.219Z",
		"size": 243,
		"path": "../public/assets/central-product-store-DGoerB5U.js"
	},
	"/logo512.png": {
		"type": "image/png",
		"etag": "\"25c0-RpFfnQJpTtSb/HqVNJR2hBA9w/4\"",
		"mtime": "2026-05-10T09:04:44.621Z",
		"size": 9664,
		"path": "../public/logo512.png"
	},
	"/assets/createLucideIcon-7nArgiy8.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"36e-lquoEHW36jx8i09nsP8mRS8BJbs\"",
		"mtime": "2026-05-10T09:04:44.222Z",
		"size": 878,
		"path": "../public/assets/createLucideIcon-7nArgiy8.js"
	},
	"/assets/flash-DjIFIcDF.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"95d-DtYlrSJ6KS0HMixQujJp2dcT6JY\"",
		"mtime": "2026-05-10T09:04:44.222Z",
		"size": 2397,
		"path": "../public/assets/flash-DjIFIcDF.js"
	},
	"/assets/flash.order-success-BtcExp1_.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"40a-6NUBimIuU11Ohui5FEb7PmXkGiY\"",
		"mtime": "2026-05-10T09:04:44.222Z",
		"size": 1034,
		"path": "../public/assets/flash.order-success-BtcExp1_.js"
	},
	"/assets/home-D1N8PZL-.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"51a5-OYE//TidMYwiWZJzwDE5WlcyL3s\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 20901,
		"path": "../public/assets/home-D1N8PZL-.js"
	},
	"/assets/home.checkout-Bl0spbDU.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"a78-4zlCHRLxKbTcF2hPC6CE5Zb1qRQ\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 2680,
		"path": "../public/assets/home.checkout-Bl0spbDU.js"
	},
	"/assets/home.order-success-DnDz5HMq.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"41b-wVh8GBJPULQRezoVHneAneb21/0\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 1051,
		"path": "../public/assets/home.order-success-DnDz5HMq.js"
	},
	"/assets/flash.product._id-B92HJYgs.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"774-u8nknEdDnkZh0gtF10jcv7wUcec\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 1908,
		"path": "../public/assets/flash.product._id-B92HJYgs.js"
	},
	"/assets/flash.checkout-4WSH7Rnu.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"a91-S4Ybzvy6gwEEzT6IVeQs6+O9CJI\"",
		"mtime": "2026-05-10T09:04:44.222Z",
		"size": 2705,
		"path": "../public/assets/flash.checkout-4WSH7Rnu.js"
	},
	"/assets/flash.cart-Uj5DbknX.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"91a-d88Cmug84cr6F34K+R6J79F6dOY\"",
		"mtime": "2026-05-10T09:04:44.222Z",
		"size": 2330,
		"path": "../public/assets/flash.cart-Uj5DbknX.js"
	},
	"/assets/home.product._id-u1x5UAhj.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"a04-naqf8Swwk/vUP6IVT57Or2TpVto\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 2564,
		"path": "../public/assets/home.product._id-u1x5UAhj.js"
	},
	"/assets/home.cart-CQsu3-8T.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"876-z3ao5uRtYGBIPLjkJ9gTj7vwAYI\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 2166,
		"path": "../public/assets/home.cart-CQsu3-8T.js"
	},
	"/assets/home.search-Dx-x6e4a.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"6259-lqHZx1nQVBQKC2UkF5kAeAEGHms\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 25177,
		"path": "../public/assets/home.search-Dx-x6e4a.js"
	},
	"/assets/map-pin-DbTySZl1.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"cc-7oo9bqGsktF6pukhFTYJwZclUdU\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 204,
		"path": "../public/assets/map-pin-DbTySZl1.js"
	},
	"/assets/login-6RtWYa3a.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"77ec-LHQS+N9JUikGXu8NxZ1xDHgs8eE\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 30700,
		"path": "../public/assets/login-6RtWYa3a.js"
	},
	"/assets/index-BXnbw4dQ.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"474c3-00aDeYN2RIHfAjgEoZygcpiA4Q8\"",
		"mtime": "2026-05-10T09:04:44.219Z",
		"size": 292035,
		"path": "../public/assets/index-BXnbw4dQ.js"
	},
	"/assets/me-BCl-FNTs.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"b39-rIdPCMWECnFt53A3d6BzFfEnZZs\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 2873,
		"path": "../public/assets/me-BCl-FNTs.js"
	},
	"/assets/me.about-CQEAs02D.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"80f-VJjuFzQVdqDCXtcvYVKntSHrLm0\"",
		"mtime": "2026-05-10T09:04:44.223Z",
		"size": 2063,
		"path": "../public/assets/me.about-CQEAs02D.js"
	},
	"/assets/me.addresses-BJHDsZnx.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"648-m+QqtXwHeCwtHRptBLdTjvYAAsE\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 1608,
		"path": "../public/assets/me.addresses-BJHDsZnx.js"
	},
	"/assets/me.complaints-Z0J1UdPZ.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"9d6-63lzES2NZOetkWZd4tRqKAms94M\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 2518,
		"path": "../public/assets/me.complaints-Z0J1UdPZ.js"
	},
	"/assets/me.coupons-Cxfwr8iO.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"622-p+qo3l4Jh9z4ZFddIQV8TF0Lkb0\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 1570,
		"path": "../public/assets/me.coupons-Cxfwr8iO.js"
	},
	"/assets/me.edit-profile-Djrkm7XG.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"63a-/tmOXDqL9P24CdKDRmTynbXgpzY\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 1594,
		"path": "../public/assets/me.edit-profile-Djrkm7XG.js"
	},
	"/assets/me.orders-Dg14cvEl.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"6cb-ZMTPYgeo27vXQhKvIwK8gyNRVk8\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 1739,
		"path": "../public/assets/me.orders-Dg14cvEl.js"
	},
	"/assets/me.orders._id-C7HAI1M3.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"c79-n2aSRVTHsG/19ZgxdhiH3U7cxFU\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 3193,
		"path": "../public/assets/me.orders._id-C7HAI1M3.js"
	},
	"/assets/me.terms-D4lFagim.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"669-8SUydCZFrUkZl7bauddWmRTE6sI\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 1641,
		"path": "../public/assets/me.terms-D4lFagim.js"
	},
	"/assets/message-square-BE-hnHXL.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"b2-hvz2JCLpdTHaMDjxQa7D0JD9TGs\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 178,
		"path": "../public/assets/message-square-BE-hnHXL.js"
	},
	"/assets/package-CgMILU3n.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"167-mU42gKFmkg2nZbyPoqPnTpydiWM\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 359,
		"path": "../public/assets/package-CgMILU3n.js"
	},
	"/assets/prominent-api-hooks-DipwWw0H.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"a550-s6iNCOHLarjD7drE+t9oAfkI6/w\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 42320,
		"path": "../public/assets/prominent-api-hooks-DipwWw0H.js"
	},
	"/assets/react-BnURElzN.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"283-YI8LtHRoPaXJimSGwDsIus+402s\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 643,
		"path": "../public/assets/react-BnURElzN.js"
	},
	"/assets/shopping-cart-BBNoSjWE.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"123-NMsp9paxQw07XJhc2XzDtG02YMs\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 291,
		"path": "../public/assets/shopping-cart-BBNoSjWE.js"
	},
	"/assets/register-D51Ue4qE.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"6a8-++K3EsEW7yDbmt1j543BZuS/m5w\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 1704,
		"path": "../public/assets/register-D51Ue4qE.js"
	},
	"/assets/src-C0xjWfnx.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"8ae0-36J/xJmELd9R6pMhu0IrR4BUEq4\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 35552,
		"path": "../public/assets/src-C0xjWfnx.js"
	},
	"/assets/stores-DmmchhEr.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"67c-RAh6mfpiRdvT0yeNys7eqxrIBaQ\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 1660,
		"path": "../public/assets/stores-DmmchhEr.js"
	},
	"/assets/preload-helper-mv2i1dUS.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"7d5a-K/HygaEGNJP976HlJbxyhvmMwRc\"",
		"mtime": "2026-05-10T09:04:44.224Z",
		"size": 32090,
		"path": "../public/assets/preload-helper-mv2i1dUS.js"
	},
	"/assets/stores._storeId-Bo_VK1An.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"745-AoK/iqDXGCOcsJNlXUntY4Au9jg\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 1861,
		"path": "../public/assets/stores._storeId-Bo_VK1An.js"
	},
	"/assets/stores._storeId.product._productId-D-WdUvge.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"7ac-4qdHPryR54rLK9phLYzNJtgn7zE\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 1964,
		"path": "../public/assets/stores._storeId.product._productId-D-WdUvge.js"
	},
	"/assets/ticket-DHIzx079.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"141-UaXP/hFeSQwU/Lc4R7IzSciMdWY\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 321,
		"path": "../public/assets/ticket-DHIzx079.js"
	},
	"/assets/trash-2-B2Qxo_rV.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"165-SsQT7yPWjBwV+UfWu/ZvoSl1IOA\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 357,
		"path": "../public/assets/trash-2-B2Qxo_rV.js"
	},
	"/assets/trpc-client-QrVjRqP1.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"b681-VrGx2aUlTuN5KIAm3wLEAgWVb9o\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 46721,
		"path": "../public/assets/trpc-client-QrVjRqP1.js"
	},
	"/assets/styles-DWsgI6YW.css": {
		"type": "text/css; charset=utf-8",
		"etag": "\"675a-jAYI694quIM6LbG8I73hsDJ6APU\"",
		"mtime": "2026-05-10T09:04:44.226Z",
		"size": 26458,
		"path": "../public/assets/styles-DWsgI6YW.css"
	},
	"/assets/truck-DbJZ8T2i.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"196-gh86FkO9YALqNGuLygi2bT86lLY\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 406,
		"path": "../public/assets/truck-DbJZ8T2i.js"
	},
	"/assets/zap-CufcM84a.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"106-NxP9Ve2CxLOkAXFe8ktdl8JL18Y\"",
		"mtime": "2026-05-10T09:04:44.226Z",
		"size": 262,
		"path": "../public/assets/zap-CufcM84a.js"
	},
	"/assets/useMutation-DvG2_Fq3.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"7245-w+muayaKJuwV10H34Ry3atYruik\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 29253,
		"path": "../public/assets/useMutation-DvG2_Fq3.js"
	},
	"/assets/useNavigate-VRicZWJI.js": {
		"type": "text/javascript; charset=utf-8",
		"etag": "\"316-MO+BJgSwaCXANB1MRdakSVb3++k\"",
		"mtime": "2026-05-10T09:04:44.225Z",
		"size": 790,
		"path": "../public/assets/useNavigate-VRicZWJI.js"
	}
};
//#endregion
//#region #nitro/virtual/public-assets-node
function readAsset(id) {
	const serverDir = dirname(fileURLToPath(globalThis.__nitro_main__));
	return promises.readFile(resolve(serverDir, public_assets_data_default[id].path));
}
//#endregion
//#region #nitro/virtual/public-assets
var publicAssetBases = {};
function isPublicAssetURL(id = "") {
	if (public_assets_data_default[id]) return true;
	for (const base in publicAssetBases) if (id.startsWith(base)) return true;
	return false;
}
function getAsset(id) {
	return public_assets_data_default[id];
}
//#endregion
//#region node_modules/nitro/dist/runtime/internal/static.mjs
var METHODS = new Set(["HEAD", "GET"]);
var EncodingMap = {
	gzip: ".gz",
	br: ".br",
	zstd: ".zst"
};
var static_default = defineHandler((event) => {
	if (event.req.method && !METHODS.has(event.req.method)) return;
	let id = decodePath(withLeadingSlash(withoutTrailingSlash(event.url.pathname)));
	let asset;
	const encodings = [...(event.req.headers.get("accept-encoding") || "").split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(), ""];
	for (const encoding of encodings) for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
		const _asset = getAsset(_id);
		if (_asset) {
			asset = _asset;
			id = _id;
			break;
		}
	}
	if (!asset) {
		if (isPublicAssetURL(id)) {
			event.res.headers.delete("Cache-Control");
			throw new HTTPError({ status: 404 });
		}
		return;
	}
	if (encodings.length > 1) event.res.headers.append("Vary", "Accept-Encoding");
	if (event.req.headers.get("if-none-match") === asset.etag) {
		event.res.status = 304;
		event.res.statusText = "Not Modified";
		return "";
	}
	const ifModifiedSinceH = event.req.headers.get("if-modified-since");
	const mtimeDate = new Date(asset.mtime);
	if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) {
		event.res.status = 304;
		event.res.statusText = "Not Modified";
		return "";
	}
	if (asset.type) event.res.headers.set("Content-Type", asset.type);
	if (asset.etag && !event.res.headers.has("ETag")) event.res.headers.set("ETag", asset.etag);
	if (asset.mtime && !event.res.headers.has("Last-Modified")) event.res.headers.set("Last-Modified", mtimeDate.toUTCString());
	if (asset.encoding && !event.res.headers.has("Content-Encoding")) event.res.headers.set("Content-Encoding", asset.encoding);
	if (asset.size > 0 && !event.res.headers.has("Content-Length")) event.res.headers.set("Content-Length", asset.size.toString());
	return readAsset(id);
});
//#endregion
//#region #nitro/virtual/routing
var findRouteRules = /* @__PURE__ */ (() => {
	const $0 = [{
		name: "headers",
		route: "/assets/**",
		handler: headers,
		options: { "cache-control": "public, max-age=31536000, immutable" }
	}];
	return (m, p) => {
		let r = [];
		if (p.charCodeAt(p.length - 1) === 47) p = p.slice(0, -1) || "/";
		let s = p.split("/");
		if (s.length > 1) {
			if (s[1] === "assets") r.unshift({
				data: $0,
				params: { "_": s.slice(2).join("/") }
			});
		}
		return r;
	};
})();
var _lazy_rv75MM = defineLazyEventHandler(() => import("./_chunks/ssr-renderer.mjs"));
var findRoute = /* @__PURE__ */ (() => {
	const data = {
		route: "/**",
		handler: _lazy_rv75MM
	};
	return ((_m, p) => {
		return {
			data,
			params: { "_": p.slice(1) }
		};
	});
})();
var globalMiddleware = [toEventHandler(static_default)].filter(Boolean);
//#endregion
//#region node_modules/nitro/dist/runtime/internal/error/prod.mjs
var errorHandler = (error, event) => {
	const res = defaultHandler(error, event);
	return new NodeResponse(typeof res.body === "string" ? res.body : JSON.stringify(res.body, null, 2), res);
};
function defaultHandler(error, event) {
	const unhandled = error.unhandled ?? !HTTPError.isError(error);
	const { status = 500, statusText = "" } = unhandled ? {} : error;
	if (status === 404) {
		const url = event.url || new URL(event.req.url);
		const baseURL = "/";
		if (/^\/[^/]/.test(baseURL) && !url.pathname.startsWith(baseURL)) return {
			status: 302,
			headers: new Headers({ location: `${baseURL}${url.pathname.slice(1)}${url.search}` })
		};
	}
	const headers = new Headers(unhandled ? {} : error.headers);
	headers.set("content-type", "application/json; charset=utf-8");
	return {
		status,
		statusText,
		headers,
		body: {
			error: true,
			...unhandled ? {
				status,
				unhandled: true
			} : typeof error.toJSON === "function" ? error.toJSON() : {
				status,
				statusText,
				message: error.message
			}
		}
	};
}
//#endregion
//#region #nitro/virtual/error-handler
var errorHandlers = [errorHandler];
async function error_handler_default(error, event) {
	for (const handler of errorHandlers) try {
		const response = await handler(error, event, { defaultHandler });
		if (response) return response;
	} catch (error) {
		console.error(error);
	}
}
//#endregion
//#region #nitro/virtual/app
function createNitroApp() {
	const captureError = (error, errorCtx) => {
		if (errorCtx?.event) {
			const errors = errorCtx.event.req.context?.nitro?.errors;
			if (errors) errors.push({
				error,
				context: errorCtx
			});
		}
	};
	const h3App = createH3App({ onError(error, event) {
		return error_handler_default(error, event);
	} });
	let appHandler = (req) => {
		req.context ||= {};
		req.context.nitro = req.context.nitro || { errors: [] };
		return h3App.fetch(req);
	};
	return {
		fetch: appHandler,
		h3: h3App,
		hooks: void 0,
		captureError
	};
}
function createH3App(config) {
	const h3App = new H3Core(config);
	h3App["~findRoute"] = (event) => findRoute(event.req.method, event.url.pathname);
	h3App["~middleware"].push(...globalMiddleware);
	h3App["~getMiddleware"] = (event, route) => {
		const pathname = event.url.pathname;
		const method = event.req.method;
		const middleware = [];
		const routeRules = getRouteRules(method, pathname);
		event.context.routeRules = routeRules?.routeRules;
		if (routeRules?.routeRuleMiddleware.length) middleware.push(...routeRules.routeRuleMiddleware);
		middleware.push(...h3App["~middleware"]);
		if (route?.data?.middleware?.length) middleware.push(...route.data.middleware);
		return middleware;
	};
	return h3App;
}
//#endregion
//#region node_modules/nitro/dist/runtime/internal/app.mjs
var APP_ID = "default";
function useNitroApp() {
	let instance = useNitroApp._instance;
	if (instance) return instance;
	instance = useNitroApp._instance = createNitroApp();
	globalThis.__nitro__ = globalThis.__nitro__ || {};
	globalThis.__nitro__[APP_ID] = instance;
	return instance;
}
function getRouteRules(method, pathname) {
	const m = findRouteRules(method, pathname);
	if (!m?.length) return { routeRuleMiddleware: [] };
	const routeRules = {};
	for (const layer of m) for (const rule of layer.data) {
		const currentRule = routeRules[rule.name];
		if (currentRule) {
			if (rule.options === false) {
				delete routeRules[rule.name];
				continue;
			}
			if (typeof currentRule.options === "object" && typeof rule.options === "object") currentRule.options = {
				...currentRule.options,
				...rule.options
			};
			else currentRule.options = rule.options;
			currentRule.route = rule.route;
			currentRule.params = {
				...currentRule.params,
				...layer.params
			};
		} else if (rule.options !== false) routeRules[rule.name] = {
			...rule,
			params: layer.params
		};
	}
	const middleware = [];
	const orderedRules = Object.values(routeRules).sort((a, b) => (a.handler?.order || 0) - (b.handler?.order || 0));
	for (const rule of orderedRules) {
		if (rule.options === false || !rule.handler) continue;
		middleware.push(rule.handler(rule));
	}
	return {
		routeRules,
		routeRuleMiddleware: middleware
	};
}
//#endregion
//#region node_modules/nitro/dist/runtime/internal/error/hooks.mjs
function _captureError(error, type) {
	console.error(`[${type}]`, error);
	useNitroApp().captureError?.(error, { tags: [type] });
}
function trapUnhandledErrors() {
	process.on("unhandledRejection", (error) => _captureError(error, "unhandledRejection"));
	process.on("uncaughtException", (error) => _captureError(error, "uncaughtException"));
}
//#endregion
//#region #nitro/virtual/tracing
var tracingSrvxPlugins = [];
//#endregion
//#region node_modules/nitro/dist/presets/node/runtime/node-server.mjs
var _parsedPort = Number.parseInt(process.env.NITRO_PORT ?? process.env.PORT ?? "");
var port = Number.isNaN(_parsedPort) ? 3e3 : _parsedPort;
var host = process.env.NITRO_HOST || process.env.HOST;
var cert = process.env.NITRO_SSL_CERT;
var key = process.env.NITRO_SSL_KEY;
var nitroApp = useNitroApp();
serve({
	port,
	hostname: host,
	tls: cert && key ? {
		cert,
		key
	} : void 0,
	fetch: nitroApp.fetch,
	plugins: [...tracingSrvxPlugins]
});
trapUnhandledErrors();
var node_server_default = {};
//#endregion
export { node_server_default as default };
