import { d as defineEventHandler } from '../../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'events';
import 'http';
import 'stream';
import 'crypto';
import 'buffer';
import 'zlib';
import 'https';
import 'net';
import 'tls';
import 'url';
import 'node:fs';
import 'node:path';
import 'chokidar';
import 'anymatch';
import 'node:url';

var type = "module";
var version = "0.15.4";
var scripts = {
	build: "nuxi build",
	dev: "nuxi dev",
	"dev:pwa": "VITE_PLUGIN_PWA=true nuxi dev",
	release: "yarn run lint && yarn run typecheck && yarn run build && changelogen --release --push",
	generate: "nuxi generate",
	preview: "nuxi preview",
	postinstall: "nuxi prepare",
	lint: "eslint . --fix",
	typecheck: "nuxi typecheck",
	prepare: "husky install",
	"docs:dev": "vitepress dev docs",
	"docs:build": "vitepress build docs",
	"docs:preview": "vitepress preview docs"
};
var dependencies = {
	"@network-utils/tcp-ping": "^1.2.3",
	"@vueuse/nuxt": "^10.11.0",
	consola: "^3.2.3",
	defu: "^6.1.4",
	"h3-zod": "^0.5.3",
	rollup: "npm:@rollup/wasm-node",
	yaml: "^2.4.5",
	zod: "^3.23.8"
};
var devDependencies = {
	"@antfu/eslint-config": "^2.22.0",
	"@commitlint/cli": "^19.3.0",
	"@commitlint/config-conventional": "^19.2.2",
	"@hywax/vitepress-yandex-metrika": "^0.4.0",
	"@nuxt/devtools": "latest",
	"@nuxtjs/color-mode": "^3.4.2",
	"@nuxtjs/i18n": "^8.3.1",
	"@nuxtjs/tailwindcss": "^6.12.1",
	"@types/node": "^20.14.10",
	"@vite-pwa/nuxt": "^0.9.1",
	changelogen: "^0.5.5",
	eslint: "^9.6.0",
	husky: "^9.0.11",
	"lint-staged": "^15.2.7",
	nuxt: "^3.12.3",
	"nuxt-icon": "^0.6.10",
	typescript: "^5.5.3",
	vitepress: "^1.3.0",
	"vue-tsc": "^2.0.26"
};
var resolutions = {
	rollup: "npm:@rollup/wasm-node"
};
const currentPackage = {
	type: type,
	version: version,
	"private": true,
	scripts: scripts,
	dependencies: dependencies,
	devDependencies: devDependencies,
	resolutions: resolutions,
	"lint-staged": {
	"*.ts": "yarn run lint"
}
};

const update = defineEventHandler(async () => {
  const latestReleases = await $fetch("https://api.github.com/repos/hywax/mafl/releases/latest", {
    parseResponse: (json) => JSON.parse(json)
  });
  const latestVersion = latestReleases.tag_name.replace("v", "");
  const parseVersion = (version) => Number.parseInt(version.replace(/\./g, ""), 10);
  const difference = parseVersion(latestVersion) - parseVersion(currentPackage.version);
  return {
    available: difference > 0,
    version: latestVersion
  };
});

export { update as default };
//# sourceMappingURL=update.mjs.map
