import { j as json } from './exports-D1quPX8S.js';
import { am as isSetupComplete, aZ as resolveStackDir, p as checkDocker } from './src-CidJbygh.js';
import { g as getState } from './state-fxN45gBp.js';
import { g as getDeployState, s as startDeploy } from './setup-deploy-B--th9ts.js';
import './utils-BSRjJDrZ.js';
import './chunk-CLZ62Ad-.js';
import 'node:module';
import './provider-constants-DPrj3yBX.js';
import './dist-DOFcG0Zp.js';
import 'node:fs';
import 'node:path';
import 'buffer';
import 'fs';
import 'path';
import 'node:child_process';
import 'node:url';
import 'node:crypto';
import 'events';
import 'node:events';
import 'node:stream';
import 'node:string_decoder';
import 'assert';
import 'zlib';
import 'node:assert';
import 'node:fs/promises';
import 'node:os';

//#region src/routes/api/setup/retry-deploy/+server.ts
var POST = async () => {
	if (isSetupComplete(resolveStackDir())) return json({
		ok: false,
		error: "setup_complete",
		message: "Setup is already complete."
	}, { status: 409 });
	if (!(await checkDocker()).ok) return json({
		ok: false,
		error: "docker_unavailable",
		message: "Docker isn't running. Start Docker, then retry deploy."
	}, { status: 503 });
	if (getDeployState(getState()).deploying) return json({
		ok: false,
		error: "install_in_progress",
		message: "A deploy is already running."
	}, { status: 409 });
	startDeploy(getState());
	return json({ ok: true });
};

export { POST };
//# sourceMappingURL=_server.ts-Bs20Z2x5.js.map
