import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
import { GlobalConfig } from "../../global.js";
import { forgejo_exports } from "../forgejo/index.js";
import { gitea_exports } from "../gitea/index.js";
import { github_exports } from "../github/index.js";
import { gitlab_exports } from "../gitlab/index.js";
import { common_exports } from "./common.js";

//#region lib/config/presets/local/index.ts
var local_exports = /* @__PURE__ */ __exportAll({ getPreset: () => getPreset });
const resolvers = {
	azure: common_exports,
	bitbucket: common_exports,
	"bitbucket-server": common_exports,
	codecommit: null,
	forgejo: forgejo_exports,
	gerrit: common_exports,
	gitea: gitea_exports,
	github: github_exports,
	gitlab: gitlab_exports,
	local: null,
	"scm-manager": null
};
function getPreset({ repo, presetName = "default", presetPath, tag }) {
	const platform = GlobalConfig.get("platform");
	if (!platform) throw new Error(`Missing platform config for local preset.`);
	const resolver = resolvers[platform];
	if (!resolver) throw new Error(`The platform you're using (${platform}) does not support local presets.`);
	const endpoint = GlobalConfig.get("endpoint");
	return resolver.getPresetFromEndpoint(repo, presetName, presetPath, endpoint, tag);
}

//#endregion
export { getPreset, local_exports };
//# sourceMappingURL=index.js.map