globalThis.process ??= {};
globalThis.process.env ??= {};
import { r as __exportAll } from "./rolldown-runtime_-UtK6b3T.mjs";
import { d as renderTemplate, f as maybeRenderHead, h as createRenderInstruction, i as renderComponent, m as addAttribute, w as createAstro } from "./server_DAChoow1.mjs";
import { t as createComponent } from "./compiler_CLrjY88v.mjs";
import { c as Field, h as require_jsx_runtime, s as Input } from "./registry_CB_IcduS.mjs";
import { t as $$Base } from "./Base_AuO_PBeT.mjs";
import { a as paletteOptions, i as THEME_REGISTRY_META, n as DEFAULT_THEME_ID, r as MOD_CMS_PALETTE_SET, t as DEFAULT_SELECTION } from "./theme_BaEzwWHZ.mjs";
import { n as isSupportedLocale, t as SUPPORTED_LOCALES } from "./locales_CSRGAxBp.mjs";
//#region ../../node_modules/.pnpm/astro@7.2.4_@emnapi+core@1.11.1_@emnapi+runtime@1.11.3_@types+node@22.20.1_aws4fetch@1._45c66d168988609cd42fada4fd277eb7/node_modules/astro/dist/runtime/server/render/script.js
async function renderScript(result, id) {
	const inlined = result.inlinedScripts.get(id);
	let content = "";
	if (inlined != null) {
		if (inlined) content = `<script type="module">${inlined}<\/script>`;
	} else {
		const resolved = await result.resolve(id);
		content = `<script type="module" src="${result.userAssetsBase ? (result.base === "/" ? "" : result.base) + result.userAssetsBase : ""}${resolved}"><\/script>`;
	}
	return createRenderInstruction({
		type: "script",
		id,
		content
	});
}
//#endregion
//#region src/components/islands/InstallSiteFields.tsx
var import_jsx_runtime = require_jsx_runtime();
function InstallSiteFields() {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
		label: "Site title",
		htmlFor: "siteTitle",
		required: true,
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
			id: "siteTitle",
			name: "siteTitle",
			type: "text",
			required: true,
			maxLength: 100,
			autoComplete: "organization"
		})
	}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
		label: "Tagline",
		htmlFor: "tagline",
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
			id: "tagline",
			name: "tagline",
			type: "text",
			maxLength: 200
		})
	})] });
}
//#endregion
//#region src/components/islands/InstallCredentialFields.tsx
function InstallCredentialFields() {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
		label: "Admin email",
		htmlFor: "adminEmail",
		required: true,
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
			id: "adminEmail",
			name: "adminEmail",
			type: "email",
			required: true,
			autoComplete: "username"
		})
	}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
		label: "Admin password",
		htmlFor: "adminPassword",
		required: true,
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
			id: "adminPassword",
			name: "adminPassword",
			type: "password",
			required: true,
			minLength: 12,
			autoComplete: "new-password"
		})
	})] });
}
//#endregion
//#region src/pages/install.astro
var install_exports = /* @__PURE__ */ __exportAll({
	default: () => $$Install,
	file: () => $$file,
	prerender: () => false,
	url: () => $$url
});
createAstro("https://astro.build");
var $$Install = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$Install;
	const csrf = Astro.cookies.get("install_csrf")?.value ?? crypto.randomUUID();
	const _csrfSecure = new URL(Astro.request.url).protocol === "https:";
	Astro.cookies.set("install_csrf", csrf, {
		httpOnly: true,
		secure: _csrfSecure,
		sameSite: "lax",
		path: "/",
		maxAge: 900
	});
	const rawLang = (Astro.request.headers.get("accept-language") ?? "").split(",")[0]?.split(";")[0]?.trim() ?? "";
	const defaultLocale = isSupportedLocale(rawLang) ? rawLang : "en";
	const paletteChoicesLight = paletteOptions("light");
	const paletteChoicesDark = paletteOptions("dark");
	const paletteChoices = paletteChoicesLight;
	const appearanceOptions = {
		palettes: paletteChoicesLight.map((light, i) => {
			const dark = paletteChoicesDark[i];
			return {
				id: light.id,
				name: light.label,
				colors: {
					light: light.preview,
					dark: dark.preview
				}
			};
		}),
		themes: THEME_REGISTRY_META.map((t) => ({ ...t })),
		defaults: {
			paletteId: MOD_CMS_PALETTE_SET.defaultPaletteId,
			themeId: DEFAULT_THEME_ID,
			mode: DEFAULT_SELECTION.mode
		}
	};
	return renderTemplate`${renderComponent($$result, "Base", $$Base, {
		"title": "Set up your site",
		"description": "First-run site setup.",
		"noindex": true,
		"minimal": true,
		"data-astro-cid-w4jyjhvv": true
	}, { "default": async ($$result) => renderTemplate`${maybeRenderHead($$result)}<div class="install-shell" data-astro-cid-w4jyjhvv><div class="install-panel" data-astro-cid-w4jyjhvv><header class="install-header" data-astro-cid-w4jyjhvv><p class="install-eyebrow" id="install-step-label" data-astro-cid-w4jyjhvv>Step 1 of 6</p><h1 class="install-title" id="install-step-title" tabindex="-1" data-astro-cid-w4jyjhvv>Choose your language</h1><p class="install-lead" id="install-step-lead" data-astro-cid-w4jyjhvv>Optional. You can change this later in site settings.</p></header><form id="install-form" class="install-form" novalidate data-astro-cid-w4jyjhvv><input type="hidden" name="csrf"${addAttribute(csrf, "value")} data-astro-cid-w4jyjhvv><section class="install-step" data-step="1" data-astro-cid-w4jyjhvv><div class="install-field" data-astro-cid-w4jyjhvv><label class="install-label" for="locale" data-astro-cid-w4jyjhvv>Language</label><select class="install-input" id="locale" name="locale" autocomplete="language" data-astro-cid-w4jyjhvv>${SUPPORTED_LOCALES.map(({ code, label }) => renderTemplate`<option${addAttribute(code, "value")}${addAttribute(code === defaultLocale, "selected")} data-astro-cid-w4jyjhvv>${label}</option>`)}</select><p class="install-error" id="locale-error" hidden data-astro-cid-w4jyjhvv></p></div></section><section class="install-step" data-step="2" hidden data-astro-cid-w4jyjhvv>${renderComponent($$result, "InstallSiteFields", InstallSiteFields, {
		"client:load": true,
		"data-astro-cid-w4jyjhvv": true,
		"client:component-hydration": "load",
		"client:component-path": "/home/user/runs/run-20260823T175424Z-2fpke4/repo/apps/mod-cms/src/components/islands/InstallSiteFields.tsx",
		"client:component-export": "default"
	})}<p class="install-error" id="siteTitle-error" hidden data-astro-cid-w4jyjhvv></p><p class="install-error" id="tagline-error" hidden data-astro-cid-w4jyjhvv></p></section><section class="install-step" data-step="3" hidden data-astro-cid-w4jyjhvv>${renderComponent($$result, "InstallCredentialFields", InstallCredentialFields, {
		"client:load": true,
		"data-astro-cid-w4jyjhvv": true,
		"client:component-hydration": "load",
		"client:component-path": "/home/user/runs/run-20260823T175424Z-2fpke4/repo/apps/mod-cms/src/components/islands/InstallCredentialFields.tsx",
		"client:component-export": "default"
	})}<p class="install-error" id="adminEmail-error" hidden data-astro-cid-w4jyjhvv></p><p class="install-error" id="adminPassword-error" hidden data-astro-cid-w4jyjhvv></p></section><section class="install-step" data-step="4" hidden data-astro-cid-w4jyjhvv><fieldset class="install-fieldset" data-astro-cid-w4jyjhvv><legend class="install-label" data-astro-cid-w4jyjhvv>Palette</legend><div class="install-palette-options" data-astro-cid-w4jyjhvv>${paletteChoices.map((option) => renderTemplate`<label class="install-radio install-palette-option" data-astro-cid-w4jyjhvv><input type="radio" name="paletteId"${addAttribute(option.id, "value")}${addAttribute(option.id === MOD_CMS_PALETTE_SET.defaultPaletteId, "checked")} data-astro-cid-w4jyjhvv><span class="install-palette-chip" aria-hidden="true" data-astro-cid-w4jyjhvv>${option.swatches.map((color) => renderTemplate`<span class="install-palette-chip-swatch"${addAttribute(`--swatch: ${color}`, "style")} data-astro-cid-w4jyjhvv></span>`)}</span><span data-astro-cid-w4jyjhvv>${option.label}</span></label>`)}</div></fieldset><fieldset class="install-fieldset" data-astro-cid-w4jyjhvv><legend class="install-label" data-astro-cid-w4jyjhvv>Mode</legend><div class="install-mode-options" data-astro-cid-w4jyjhvv><label class="install-radio" data-astro-cid-w4jyjhvv><input type="radio" name="mode" value="light"${addAttribute(DEFAULT_SELECTION.mode === "light", "checked")} data-astro-cid-w4jyjhvv><span data-astro-cid-w4jyjhvv>Light</span></label><label class="install-radio" data-astro-cid-w4jyjhvv><input type="radio" name="mode" value="dark"${addAttribute(DEFAULT_SELECTION.mode === "dark", "checked")} data-astro-cid-w4jyjhvv><span data-astro-cid-w4jyjhvv>Dark</span></label><label class="install-radio" data-astro-cid-w4jyjhvv><input type="radio" name="mode" value="system"${addAttribute(DEFAULT_SELECTION.mode === "system", "checked")} data-astro-cid-w4jyjhvv><span data-astro-cid-w4jyjhvv>System</span></label></div></fieldset><fieldset class="install-fieldset" data-astro-cid-w4jyjhvv><legend class="install-label" data-astro-cid-w4jyjhvv>Theme</legend><div class="install-theme-cards" data-astro-cid-w4jyjhvv>${THEME_REGISTRY_META.map((t) => renderTemplate`<label class="install-theme-card" data-astro-cid-w4jyjhvv><input type="radio" name="themeId"${addAttribute(t.id, "value")} class="sr-only"${addAttribute(t.id === DEFAULT_THEME_ID, "checked")} data-astro-cid-w4jyjhvv><div${addAttribute(`install-theme-thumb thumb-${t.id}`, "class")} aria-hidden="true" data-astro-cid-w4jyjhvv><div class="thumb-bar" data-astro-cid-w4jyjhvv></div><div class="thumb-body" data-astro-cid-w4jyjhvv><div class="thumb-hero" data-astro-cid-w4jyjhvv></div><div class="thumb-grid" data-astro-cid-w4jyjhvv><div class="thumb-col" data-astro-cid-w4jyjhvv></div><div class="thumb-col" data-astro-cid-w4jyjhvv></div></div></div></div><div class="install-theme-card__body" data-astro-cid-w4jyjhvv><span class="install-theme-card__name" data-astro-cid-w4jyjhvv>${t.name}</span><span class="install-theme-card__desc" data-astro-cid-w4jyjhvv>${t.desc}</span></div></label>`)}</div></fieldset></section><section class="install-step" data-step="5" hidden data-astro-cid-w4jyjhvv><fieldset class="install-fieldset" data-astro-cid-w4jyjhvv><legend class="install-label" data-astro-cid-w4jyjhvv>How do you want to set up your site?</legend><div class="install-setup-options" data-astro-cid-w4jyjhvv><div class="install-setup-choice" data-astro-cid-w4jyjhvv><label class="install-radio" data-astro-cid-w4jyjhvv><input type="radio" name="setupMethod" value="manual" checked data-astro-cid-w4jyjhvv><span data-astro-cid-w4jyjhvv>Manually<span class="install-recommended" data-astro-cid-w4jyjhvv>Recommended</span></span></label><p class="install-option-lead" data-astro-cid-w4jyjhvv>Configure pages, content, and settings yourself in the admin.</p></div><div class="install-setup-choice" data-astro-cid-w4jyjhvv><label class="install-radio" data-astro-cid-w4jyjhvv><input type="radio" name="setupMethod" value="agent" id="setup-method-agent" aria-controls="agent-panel" aria-expanded="false" data-astro-cid-w4jyjhvv><span data-astro-cid-w4jyjhvv>By Agent</span></label><p class="install-option-lead" data-astro-cid-w4jyjhvv>Let an AI coding agent drive setup over the mod admin API.</p></div></div></fieldset><div id="agent-panel" class="install-agent-panel" hidden data-astro-cid-w4jyjhvv><h2 class="install-agent-title" data-astro-cid-w4jyjhvv>Set up mod with an AI coding agent</h2><p data-astro-cid-w4jyjhvv>mod exposes an admin HTTP API your agent can drive (create pages, posts, apply a theme). Today: authenticate with a service token; point your agent at this site's /api/admin/* endpoints. Example task to give your agent:</p><p class="install-agent-example" data-astro-cid-w4jyjhvv>"Create an About page, a 3-post blog, and apply the Editorial theme."</p><p class="install-agent-coming-soon" data-astro-cid-w4jyjhvv>Coming soon — one-click MCP: install a mod MCP server in your agent (claude mcp add …) for a turnkey control surface. (Phase 2 — see docs.)</p></div></section><section class="install-step" data-step="6" hidden data-astro-cid-w4jyjhvv><p class="install-summary" data-astro-cid-w4jyjhvv>Review your choices, then finish setup. This creates your admin account and opens the dashboard.</p><dl class="install-review" id="install-review" data-astro-cid-w4jyjhvv></dl></section><p class="install-error install-error--form" id="form-error" hidden data-astro-cid-w4jyjhvv></p><div class="install-actions" data-astro-cid-w4jyjhvv><button type="button" class="install-back" id="install-back" hidden data-astro-cid-w4jyjhvv>Back</button><button type="button" class="install-primary" id="install-next" data-astro-cid-w4jyjhvv>Continue</button></div></form></div><div class="install-preview-panel" aria-hidden="true" data-astro-cid-w4jyjhvv><div class="browser-frame" data-astro-cid-w4jyjhvv><div class="browser-frame__bar" data-astro-cid-w4jyjhvv><span class="browser-frame__dot" data-astro-cid-w4jyjhvv></span><span class="browser-frame__dot" data-astro-cid-w4jyjhvv></span><span class="browser-frame__dot" data-astro-cid-w4jyjhvv></span><span class="browser-frame__url" id="browser-frame-url" data-astro-cid-w4jyjhvv>yoursite.com</span></div><iframe id="theme-preview-iframe" title="Theme preview" src="/install/preview?theme=default&palette=default&mode=light&name=Your+site" class="install-preview-iframe" tabindex="-1" sandbox="allow-same-origin" data-astro-cid-w4jyjhvv></iframe></div></div></div><div id="appearance-options" hidden${addAttribute(JSON.stringify(appearanceOptions), "data-options")} data-astro-cid-w4jyjhvv></div>${renderScript($$result, "/home/user/runs/run-20260823T175424Z-2fpke4/repo/apps/mod-cms/src/pages/install.astro?astro&type=script&index=0&lang.ts")}` })}`;
}, "/home/user/runs/run-20260823T175424Z-2fpke4/repo/apps/mod-cms/src/pages/install.astro", void 0);
var $$file = "/home/user/runs/run-20260823T175424Z-2fpke4/repo/apps/mod-cms/src/pages/install.astro";
var $$url = "/install";
//#endregion
//#region \0virtual:astro:page:src/pages/install@_@astro
var page = () => install_exports;
//#endregion
export { page };
