globalThis.process ??= {};
globalThis.process.env ??= {};
import { a as __toESM, t as __commonJSMin } from "./rolldown-runtime_-UtK6b3T.mjs";
import { a as Fragment, c as renderSlot, d as renderTemplate, f as maybeRenderHead, i as renderComponent, m as addAttribute, w as createAstro, x as unescapeHTML, y as clsx } from "./server_DAChoow1.mjs";
import { t as require_react } from "./react_BkIQlPcV.mjs";
import { t as createComponent } from "./compiler_CLrjY88v.mjs";
import { i as THEME_REGISTRY_META, n as DEFAULT_THEME_ID } from "./theme_BaEzwWHZ.mjs";
import { t as sanitizeContentBody } from "./sanitize_CLHlWQbC.mjs";
import { n as guestAuthorParts, t as commentIndentStyle } from "./comments-render_CpH3cHYd.mjs";
//#region ../../node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react-jsx-runtime.production.js
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((exports) => {
	var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
	var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
	function jsxProd(type, config, maybeKey) {
		var key = null;
		void 0 !== maybeKey && (key = "" + maybeKey);
		void 0 !== config.key && (key = "" + config.key);
		if ("key" in config) {
			maybeKey = {};
			for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
		} else maybeKey = config;
		config = maybeKey.ref;
		return {
			$$typeof: REACT_ELEMENT_TYPE,
			type,
			key,
			ref: void 0 !== config ? config : null,
			props: maybeKey
		};
	}
	exports.Fragment = REACT_FRAGMENT_TYPE;
	exports.jsx = jsxProd;
	exports.jsxs = jsxProd;
}));
//#endregion
//#region ../../node_modules/.pnpm/react@19.2.8/node_modules/react/jsx-runtime.js
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = require_react_jsx_runtime_production();
}));
//#endregion
//#region src/lib/theme-contract.ts
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
var import_jsx_runtime = require_jsx_runtime();
/**
* Screens ACTUALLY wired to `resolveScreen` in pages (§7). A theme override on a
* screen NOT in this set is a SILENT NO-OP — the contract would lie about what it
* honors (the agent-legibility defect the north-star forbids; SP4's make-theme skill
* authors against this contract and would emit silently-failing themes). SP2 wires
* exactly `post`. GROW THIS SET IN THE SAME WAVE that wires a new screen's page to
* `resolveScreen` — never ahead of the wiring.
*/
var WIRED_SCREENS = /* @__PURE__ */ new Set([
	"post",
	"index",
	"search",
	"not-found"
]);
/** The shell is always the active theme's. */
function resolveShell(theme) {
	return theme.Shell;
}
/** override-template → else host default. The whole SP2 fallback contract. */
function resolveScreen(theme, screen, hostDefault) {
	return theme.overrides[screen] ?? hostDefault;
}
/**
* Override keys that are NOT wired (would silently no-op). Pure → the registry test
* (W3) asserts this returns [] for EVERY registered theme, so the contract can never
* advertise capability the wiring doesn't honor. SP4-generated themes inherit the test.
*/
function findUnwiredOverrides(theme) {
	return Object.keys(theme.overrides).filter((screen) => !WIRED_SCREENS.has(screen));
}
//#endregion
//#region src/themes/default/DefaultShell.astro
createAstro("https://astro.build");
var $$DefaultShell = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$DefaultShell;
	const { siteName, logoUrl, hideModeToggle, navLinks } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<header class="site-header"><div class="site-header__inner"><a class="site-title" href="/">${logoUrl ? renderTemplate`<img${addAttribute(logoUrl, "src")}${addAttribute(siteName, "alt")} class="site-logo" height="28">` : siteName}</a><nav class="site-nav" aria-label="Main"><form class="site-search" action="/search" method="get" role="search"><label class="visually-hidden" for="header-search-q">Search</label><input id="header-search-q" class="site-search__input" type="search" name="q" autocomplete="off" placeholder="Search…"><button type="submit" class="site-search__submit">Search</button></form>${navLinks.map((l) => renderTemplate`<a${addAttribute(l.href, "href")}>${l.label}</a>`)}${!hideModeToggle ? renderTemplate`<button type="button" class="theme-toggle" id="theme-toggle" aria-label="Toggle light/dark theme">Theme</button>` : null}</nav></div></header>${renderSlot($$result, $$slots["default"])}<footer class="site-footer">${siteName} — a content distribution built on the platform</footer>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/default/DefaultShell.astro", void 0);
//#endregion
//#region ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
/**
* Copyright 2022 Joe Bell. All rights reserved.
*
* This file is licensed to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/ var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
var cx = clsx;
var cva = (base, config) => (props) => {
	var _config_compoundVariants;
	if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
	const { variants, defaultVariants } = config;
	const getVariantClassNames = Object.keys(variants).map((variant) => {
		const variantProp = props === null || props === void 0 ? void 0 : props[variant];
		const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
		if (variantProp === null) return null;
		const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
		return variants[variant][variantKey];
	});
	const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
		let [key, value] = param;
		if (value === void 0) return acc;
		acc[key] = value;
		return acc;
	}, {});
	return cx(base, getVariantClassNames, config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
		let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
		return Object.entries(compoundVariantOptions).every((param) => {
			let [key, value] = param;
			return Array.isArray(value) ? value.includes({
				...defaultVariants,
				...propsWithoutUndefined
			}[key]) : {
				...defaultVariants,
				...propsWithoutUndefined
			}[key] === value;
		}) ? [
			...acc,
			cvClass,
			cvClassName
		] : acc;
	}, []), props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
};
//#endregion
//#region ../../packages/ui-primitives/dist/cva.js
function cn(...inputs) {
	return inputs.filter(Boolean).join(" ");
}
/** Token-driven surface variants. Classes resolve via the ui-tokens v4 @theme adapter
* (e.g. `bg-accent` → var(--mod-color-accent)). No raw color/length literals. */
var surface = cva("", {
	variants: {
		tone: {
			fg: "text-fg",
			"fg-muted": "text-fg-muted",
			accent: "bg-accent text-accent-fg",
			surface: "bg-surface text-fg",
			danger: "bg-danger text-accent-fg"
		},
		radius: {
			none: "rounded-none",
			sm: "rounded-sm",
			md: "rounded-md",
			lg: "rounded-lg",
			xl: "rounded-xl",
			full: "rounded-full"
		},
		size: {
			sm: "text-sm",
			base: "text-base",
			lg: "text-lg"
		}
	},
	defaultVariants: {
		tone: "surface",
		radius: "md",
		size: "base"
	}
});
//#endregion
//#region ../../packages/ui-primitives/dist/Field.js
var FieldContext = import_react.createContext(null);
function useFieldControl() {
	return import_react.useContext(FieldContext);
}
function Field({ label, htmlFor, hint, error, required, children }) {
	const generatedId = import_react.useId();
	const controlId = htmlFor ?? generatedId;
	const hintId = hint ? `${controlId}-hint` : void 0;
	const errorId = error ? `${controlId}-error` : void 0;
	const describedBy = [hintId, errorId].filter(Boolean).join(" ") || void 0;
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldContext.Provider, {
		value: {
			id: controlId,
			invalid: Boolean(error),
			required,
			describedBy
		},
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
			className: "flex flex-col gap-1",
			children: [
				/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
					htmlFor: controlId,
					className: "text-sm font-medium text-fg",
					children: [label, required ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
						"aria-hidden": "true",
						children: " *"
					}) : null]
				}),
				children,
				hint ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
					id: hintId,
					className: "text-sm text-fg-muted",
					children: hint
				}) : null,
				error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
					id: errorId,
					role: "alert",
					className: "text-sm text-danger",
					children: error
				}) : null
			]
		})
	});
}
//#endregion
//#region ../../packages/ui-primitives/dist/Input.js
var inputVariants = cva("w-full rounded-md border border-border bg-surface text-fg focus-visible:outline-[var(--mod-focus-ring-width)] focus-visible:outline-[var(--mod-focus-ring-color)] focus-visible:outline-offset-[var(--mod-focus-ring-offset)] disabled:cursor-not-allowed disabled:opacity-[var(--mod-opacity-disabled)] read-only:bg-[var(--mod-color-neutral-2)]", {
	variants: {
		size: {
			sm: "text-sm px-2 py-1",
			md: "text-base px-3 py-2",
			lg: "text-lg px-4 py-3"
		},
		invalid: {
			true: "border-[var(--mod-color-danger-9)] aria-invalid:border-[var(--mod-color-danger-9)] aria-invalid:focus-visible:outline-[var(--mod-color-danger-9)]",
			false: ""
		}
	},
	defaultVariants: {
		size: "md",
		invalid: false
	}
});
var Input = import_react.forwardRef(({ className, size, invalid, type = "text", id, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, ...props }, ref) => {
	const field = useFieldControl();
	const resolvedInvalid = invalid ?? field?.invalid ?? false;
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
		ref,
		type,
		id: id ?? field?.id,
		"aria-invalid": ariaInvalid ?? (resolvedInvalid ? true : void 0),
		"aria-describedby": ariaDescribedBy ?? field?.describedBy,
		"aria-required": props.required ?? field?.required,
		className: cn(inputVariants({
			size,
			invalid: resolvedInvalid
		}), className),
		...props
	});
});
Input.displayName = "Input";
//#endregion
//#region ../../packages/ui-primitives/dist/Textarea.js
var textareaVariants = cva("w-full border border-border bg-surface text-fg rounded-md focus-visible:outline focus-visible:outline-accent disabled:opacity-50 disabled:cursor-not-allowed px-3 py-2 text-base", {
	variants: { invalid: {
		true: "border-danger",
		false: ""
	} },
	defaultVariants: { invalid: false }
});
var Textarea = import_react.forwardRef(({ className, invalid, id, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, ...props }, ref) => {
	const field = useFieldControl();
	const resolvedInvalid = invalid ?? field?.invalid ?? false;
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
		ref,
		id: id ?? field?.id,
		"aria-invalid": ariaInvalid ?? (resolvedInvalid ? true : void 0),
		"aria-describedby": ariaDescribedBy ?? field?.describedBy,
		"aria-required": props.required ?? field?.required,
		className: cn(textareaVariants({ invalid: resolvedInvalid }), className),
		...props
	});
});
Textarea.displayName = "Textarea";
//#endregion
//#region src/components/islands/CommentFormFields.tsx
function CommentFormFields() {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
			label: "Name",
			htmlFor: "comment-name",
			required: true,
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
				id: "comment-name",
				name: "name",
				type: "text",
				required: true,
				maxLength: 80
			})
		}),
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
			label: "Email",
			htmlFor: "comment-email",
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
				id: "comment-email",
				name: "email",
				type: "email",
				maxLength: 254
			})
		}),
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
			label: "Website",
			htmlFor: "comment-url",
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
				id: "comment-url",
				name: "url",
				type: "url"
			})
		}),
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
			label: "Comment",
			htmlFor: "comment-body",
			required: true,
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Textarea, {
				id: "comment-body",
				name: "body",
				rows: 5,
				required: true
			})
		})
	] });
}
//#endregion
//#region src/themes/default/DefaultPostBody.astro
createAstro("https://astro.build");
var $$DefaultPostBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$DefaultPostBody;
	const { post, comments, commentTotal, fields } = Astro.props;
	const commentLabel = commentTotal === 1 ? "1 comment" : `${commentTotal} comments`;
	const DATE_FMT = new Intl.DateTimeFormat("en-GB", {
		day: "numeric",
		month: "long",
		year: "numeric"
	});
	function displayDate(iso) {
		const ms = Date.parse(iso);
		return Number.isNaN(ms) ? "" : DATE_FMT.format(new Date(ms));
	}
	function mediaImgMarkup(value) {
		const url = value?.url?.trim();
		if (!url) return null;
		return `<img src="${url}" alt="" />`;
	}
	return renderTemplate`${maybeRenderHead($$result)}<p data-astro-cid-v33br7yn><a href="/" data-astro-cid-v33br7yn>← All posts</a></p><h1 data-astro-cid-v33br7yn>${post.title}</h1><div class="post-body" data-astro-cid-v33br7yn>${unescapeHTML(sanitizeContentBody(post.body))}</div>${fields.length > 0 ? renderTemplate`<dl class="content-fields" data-astro-cid-v33br7yn>${fields.map((field) => renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`<dt data-astro-cid-v33br7yn>${field.label}</dt><dd data-astro-cid-v33br7yn>${field.type === "media" ? (() => {
		const markup = mediaImgMarkup(field.value);
		return markup ? renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`${unescapeHTML(sanitizeContentBody(markup))}` })}` : null;
	})() : typeof field.value === "string" || typeof field.value === "number" || typeof field.value === "boolean" ? field.value : null}</dd>` })}`)}</dl>` : null}<section class="comments-section" aria-labelledby="comments-heading" data-astro-cid-v33br7yn><h2 id="comments-heading" class="comments-heading" data-astro-cid-v33br7yn>${commentLabel}</h2>${comments.length === 0 ? renderTemplate`<p class="comments-empty" data-astro-cid-v33br7yn>Be the first to comment.</p>` : renderTemplate`<ol class="comments-list" data-astro-cid-v33br7yn>${comments.map((comment) => {
		const author = guestAuthorParts(comment.author);
		return renderTemplate`<li class="comment"${addAttribute(commentIndentStyle(comment.depth), "style")}${addAttribute(comment.depth, "data-depth")} data-astro-cid-v33br7yn><header class="comment__meta" data-astro-cid-v33br7yn>${author.href ? renderTemplate`<a class="comment-author"${addAttribute(author.href, "href")} data-astro-cid-v33br7yn>${author.label}</a>` : renderTemplate`<span class="comment-author" data-astro-cid-v33br7yn>${author.label}</span>`}<time class="comment__time"${addAttribute(comment.createdAt, "datetime")} data-astro-cid-v33br7yn>${displayDate(comment.createdAt)}</time></header><div class="comment__body" data-astro-cid-v33br7yn>${unescapeHTML(sanitizeContentBody(comment.bodyHtml))}</div></li>`;
	})}</ol>`}<form class="comment-form" method="post" action="/api/comments" data-astro-cid-v33br7yn><input type="hidden" name="target_type" value="content_entry" data-astro-cid-v33br7yn><input type="hidden" name="target_id"${addAttribute(post.id, "value")} data-astro-cid-v33br7yn><div class="comment-form__hp" aria-hidden="true" data-astro-cid-v33br7yn><label for="website" data-astro-cid-v33br7yn>Website</label><input id="website" name="website" type="text" tabindex="-1" autocomplete="off" data-astro-cid-v33br7yn></div>${renderComponent($$result, "CommentFormFields", CommentFormFields, {
		"client:load": true,
		"data-astro-cid-v33br7yn": true,
		"client:component-hydration": "load",
		"client:component-path": "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/components/islands/CommentFormFields.tsx",
		"client:component-export": "default"
	})}<button type="submit" class="action action--primary" data-astro-cid-v33br7yn>Post comment</button></form></section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/default/DefaultPostBody.astro", void 0);
//#endregion
//#region src/themes/default/DefaultIndexBody.astro
createAstro("https://astro.build");
var $$DefaultIndexBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$DefaultIndexBody;
	const { siteName, heroHtml, posts, modCards } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<section class="hero" data-astro-cid-lzhuy6vc><h1 data-astro-cid-lzhuy6vc>${siteName}</h1><p class="hero__eyebrow" data-astro-cid-lzhuy6vc>Content distribution</p><div class="cms-body" data-astro-cid-lzhuy6vc>${unescapeHTML(sanitizeContentBody(heroHtml))}</div></section><section class="section" id="modules" data-astro-cid-lzhuy6vc><h2 data-astro-cid-lzhuy6vc>Modules</h2><p class="section__lead" data-astro-cid-lzhuy6vc>Five platform modules power this distribution — each with its own page and dependency graph.</p><div class="card-grid" data-astro-cid-lzhuy6vc>${modCards.map((mod) => renderTemplate`<a class="card"${addAttribute(`/module/${mod.id}`, "href")} data-astro-cid-lzhuy6vc><div class="card__name" data-astro-cid-lzhuy6vc>${mod.name}</div><p class="card__tagline" data-astro-cid-lzhuy6vc>${mod.tagline}</p><span class="card__layer" data-astro-cid-lzhuy6vc>${mod.layer}</span></a>`)}</div></section><section class="section" data-astro-cid-lzhuy6vc><h2 data-astro-cid-lzhuy6vc>Blueprint</h2><p class="section__lead" data-astro-cid-lzhuy6vc>See how the CMS blueprint assembles presets, plugins, and modules into a complete product.</p><div class="link-row" data-astro-cid-lzhuy6vc><a href="/blueprint/cms" data-astro-cid-lzhuy6vc>CMS blueprint →</a><a href="/ui-kit" data-astro-cid-lzhuy6vc>UI Kit (coming soon)</a></div></section>${posts.length > 0 ? renderTemplate`<section class="section" id="latest" data-astro-cid-lzhuy6vc><h2 data-astro-cid-lzhuy6vc>Latest</h2><ul class="post-list" data-astro-cid-lzhuy6vc>${posts.map((post) => renderTemplate`<li data-astro-cid-lzhuy6vc><a${addAttribute(`/post/${post.slug}`, "href")} data-astro-cid-lzhuy6vc>${post.title}</a></li>`)}</ul></section>` : renderTemplate`<p class="home__empty" data-astro-cid-lzhuy6vc>No posts yet.</p>`}`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/default/DefaultIndexBody.astro", void 0);
//#endregion
//#region src/themes/default/DefaultSearchBody.astro
createAstro("https://astro.build");
var $$DefaultSearchBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$DefaultSearchBody;
	const { q, hasQuery, hits, nextHref } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<section class="section search-page"><h1>Search</h1><form class="search-form" action="/search" method="get" role="search"><label class="search-form__label" for="site-search-q">Search</label><div class="search-form__row"><input id="site-search-q" class="search-form__input" type="search" name="q"${addAttribute(q, "value")} autocomplete="off"><button type="submit" class="search-form__submit">Search</button></div></form>${hasQuery ? hits.length > 0 ? renderTemplate`<ol class="search-results">${hits.map((hit) => renderTemplate`<li class="search-result"><a class="search-result__title"${addAttribute(`/post/${hit.slug}`, "href")}>${hit.title}</a>${hit.snippetHtml ? renderTemplate`<span class="cms-body search-result__snippet">${unescapeHTML(sanitizeContentBody(hit.snippetHtml))}</span>` : null}</li>`)}</ol>` : renderTemplate`<p class="search-empty">No matches for that query.</p>` : null}${nextHref ? renderTemplate`<p class="search-pagination"><a${addAttribute(nextHref, "href")}>Next page</a></p>` : null}</section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/default/DefaultSearchBody.astro", void 0);
//#endregion
//#region src/themes/default/DefaultNotFoundBody.astro
var $$DefaultNotFoundBody = createComponent(($$result, $$props, $$slots) => {
	return renderTemplate`${maybeRenderHead($$result)}<section class="default-notfound" data-astro-cid-gcatzvcj><h1 class="default-notfound__title" data-astro-cid-gcatzvcj>Page not found</h1><p class="default-notfound__message" data-astro-cid-gcatzvcj>The page you are looking for does not exist.</p><p class="default-notfound__action" data-astro-cid-gcatzvcj><a href="/" data-astro-cid-gcatzvcj>Return to homepage</a></p></section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/default/DefaultNotFoundBody.astro", void 0);
//#endregion
//#region src/themes/editorial/EditorialShell.astro
createAstro("https://astro.build");
var $$EditorialShell = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$EditorialShell;
	const { siteName, logoUrl, hideModeToggle, navLinks } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<div class="editorial-shell" data-astro-cid-cj2kn6eq><header class="editorial-shell__header" data-astro-cid-cj2kn6eq><div class="editorial-shell__masthead" data-astro-cid-cj2kn6eq><a class="editorial-shell__title" href="/" data-astro-cid-cj2kn6eq>${logoUrl ? renderTemplate`<img${addAttribute(logoUrl, "src")}${addAttribute(siteName, "alt")} class="editorial-shell__logo" height="32" data-astro-cid-cj2kn6eq>` : siteName}</a></div><hr class="editorial-shell__rule" data-astro-cid-cj2kn6eq><nav class="editorial-shell__nav" aria-label="Main" data-astro-cid-cj2kn6eq><form class="editorial-shell__search" action="/search" method="get" role="search" data-astro-cid-cj2kn6eq><label class="visually-hidden" for="editorial-header-search-q" data-astro-cid-cj2kn6eq>Search</label><input id="editorial-header-search-q" class="editorial-shell__search-input" type="search" name="q" autocomplete="off" placeholder="Search…" data-astro-cid-cj2kn6eq><button type="submit" class="editorial-shell__search-submit" data-astro-cid-cj2kn6eq>Search</button></form>${navLinks.map((l) => renderTemplate`<a${addAttribute(l.href, "href")} data-astro-cid-cj2kn6eq>${l.label}</a>`)}${!hideModeToggle ? renderTemplate`<button type="button" class="editorial-shell__theme-toggle" id="theme-toggle" aria-label="Toggle light/dark theme" data-astro-cid-cj2kn6eq>Theme</button>` : null}</nav></header>${renderSlot($$result, $$slots["default"])}<footer class="editorial-shell__footer" data-astro-cid-cj2kn6eq>${siteName} — a content distribution built on the platform</footer></div>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/editorial/EditorialShell.astro", void 0);
//#endregion
//#region src/themes/editorial/EditorialPostBody.astro
createAstro("https://astro.build");
var $$EditorialPostBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$EditorialPostBody;
	const { post, comments, commentTotal, fields } = Astro.props;
	const commentLabel = commentTotal === 1 ? "1 comment" : `${commentTotal} comments`;
	const DATE_FMT = new Intl.DateTimeFormat("en-GB", {
		day: "numeric",
		month: "long",
		year: "numeric"
	});
	function displayDate(iso) {
		const ms = Date.parse(iso);
		return Number.isNaN(ms) ? "" : DATE_FMT.format(new Date(ms));
	}
	function mediaImgMarkup(value) {
		const url = value?.url?.trim();
		if (!url) return null;
		return `<img src="${url}" alt="" />`;
	}
	return renderTemplate`${maybeRenderHead($$result)}<article class="editorial-post" data-astro-cid-3kih344j><p class="editorial-post__back" data-astro-cid-3kih344j><a href="/" data-astro-cid-3kih344j>← All posts</a></p><h1 class="editorial-post__title" data-astro-cid-3kih344j>${post.title}</h1><div class="editorial-post__body" data-astro-cid-3kih344j>${unescapeHTML(sanitizeContentBody(post.body))}</div>${fields.length > 0 ? renderTemplate`<dl class="editorial-post__content-fields" data-astro-cid-3kih344j>${fields.map((field) => renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`<dt data-astro-cid-3kih344j>${field.label}</dt><dd data-astro-cid-3kih344j>${field.type === "media" ? (() => {
		const markup = mediaImgMarkup(field.value);
		return markup ? renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`${unescapeHTML(sanitizeContentBody(markup))}` })}` : null;
	})() : typeof field.value === "string" || typeof field.value === "number" || typeof field.value === "boolean" ? field.value : null}</dd>` })}`)}</dl>` : null}<section class="editorial-post__comments" aria-labelledby="editorial-comments-heading" data-astro-cid-3kih344j><h2 id="editorial-comments-heading" class="editorial-post__comments-heading" data-astro-cid-3kih344j>${commentLabel}</h2>${comments.length === 0 ? renderTemplate`<p class="editorial-post__comments-empty" data-astro-cid-3kih344j>Be the first to comment.</p>` : renderTemplate`<ol class="editorial-post__comments-list" data-astro-cid-3kih344j>${comments.map((comment) => {
		const author = guestAuthorParts(comment.author);
		return renderTemplate`<li class="editorial-post__comment"${addAttribute(commentIndentStyle(comment.depth), "style")}${addAttribute(comment.depth, "data-depth")} data-astro-cid-3kih344j><header class="editorial-post__comment-meta" data-astro-cid-3kih344j>${author.href ? renderTemplate`<a class="editorial-post__comment-author"${addAttribute(author.href, "href")} data-astro-cid-3kih344j>${author.label}</a>` : renderTemplate`<span class="editorial-post__comment-author" data-astro-cid-3kih344j>${author.label}</span>`}<time class="editorial-post__comment-time"${addAttribute(comment.createdAt, "datetime")} data-astro-cid-3kih344j>${displayDate(comment.createdAt)}</time></header><div class="editorial-post__comment-body" data-astro-cid-3kih344j>${unescapeHTML(sanitizeContentBody(comment.bodyHtml))}</div></li>`;
	})}</ol>`}<form class="editorial-post__comment-form" method="post" action="/api/comments" data-astro-cid-3kih344j><input type="hidden" name="target_type" value="content_entry" data-astro-cid-3kih344j><input type="hidden" name="target_id"${addAttribute(post.id, "value")} data-astro-cid-3kih344j><div class="editorial-post__comment-form-hp" aria-hidden="true" data-astro-cid-3kih344j><label for="editorial-website" data-astro-cid-3kih344j>Website</label><input id="editorial-website" name="website" type="text" tabindex="-1" autocomplete="off" data-astro-cid-3kih344j></div>${renderComponent($$result, "CommentFormFields", CommentFormFields, {
		"client:load": true,
		"data-astro-cid-3kih344j": true,
		"client:component-hydration": "load",
		"client:component-path": "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/components/islands/CommentFormFields.tsx",
		"client:component-export": "default"
	})}<button type="submit" class="editorial-post__action editorial-post__action--primary" data-astro-cid-3kih344j>Post comment</button></form></section></article>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/editorial/EditorialPostBody.astro", void 0);
//#endregion
//#region src/themes/editorial/EditorialIndexBody.astro
createAstro("https://astro.build");
var $$EditorialIndexBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$EditorialIndexBody;
	const { siteName, heroHtml, posts, modCards } = Astro.props;
	const DATE_FMT = new Intl.DateTimeFormat("en-GB", {
		day: "numeric",
		month: "long",
		year: "numeric"
	});
	function displayDate(iso) {
		const ms = Date.parse(iso);
		return Number.isNaN(ms) ? "" : DATE_FMT.format(new Date(ms));
	}
	const featuredPost = posts.length > 0 ? posts[0] : null;
	const remainingPosts = posts.length > 1 ? posts.slice(1) : [];
	return renderTemplate`${maybeRenderHead($$result)}<section class="editorial-home" data-astro-cid-2ljxwo5f><h1 class="editorial-home__site-title" data-astro-cid-2ljxwo5f>${siteName}</h1>${heroHtml ? renderTemplate`<section class="editorial-home__hero" data-astro-cid-2ljxwo5f><div class="cms-body editorial-home__hero-body" data-astro-cid-2ljxwo5f>${unescapeHTML(sanitizeContentBody(heroHtml))}</div></section>` : null}${posts.length > 0 ? renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`${featuredPost ? renderTemplate`<section class="editorial-home__featured" data-astro-cid-2ljxwo5f><h2 class="editorial-home__featured-title" data-astro-cid-2ljxwo5f><a${addAttribute(`/post/${featuredPost.slug}`, "href")} data-astro-cid-2ljxwo5f>${featuredPost.title}</a></h2><p class="editorial-home__featured-more" data-astro-cid-2ljxwo5f><a${addAttribute(`/post/${featuredPost.slug}`, "href")} data-astro-cid-2ljxwo5f>Read more →</a></p></section>` : null}${remainingPosts.length > 0 ? renderTemplate`<section class="editorial-home__list-section" data-astro-cid-2ljxwo5f><h2 class="editorial-home__list-heading" data-astro-cid-2ljxwo5f>More posts</h2><ol class="editorial-home__list" data-astro-cid-2ljxwo5f>${remainingPosts.map((post) => renderTemplate`<li class="editorial-home__list-item" data-astro-cid-2ljxwo5f><a${addAttribute(`/post/${post.slug}`, "href")} data-astro-cid-2ljxwo5f>${post.title}</a>${post.createdAt ? renderTemplate`<time class="editorial-home__post-date"${addAttribute(post.createdAt, "datetime")} data-astro-cid-2ljxwo5f>${displayDate(post.createdAt)}</time>` : null}</li>`)}</ol></section>` : null}` })}` : renderTemplate`<p class="editorial-home__empty" data-astro-cid-2ljxwo5f>No posts yet.</p>`}${modCards.length > 0 ? renderTemplate`<section class="editorial-home__modules" data-astro-cid-2ljxwo5f><h2 class="editorial-home__modules-heading" data-astro-cid-2ljxwo5f>Modules</h2><ul class="editorial-home__modules-list" data-astro-cid-2ljxwo5f>${modCards.map((mod) => renderTemplate`<li class="editorial-home__modules-item" data-astro-cid-2ljxwo5f><a${addAttribute(`/module/${mod.id}`, "href")} data-astro-cid-2ljxwo5f>${mod.name}</a><span class="editorial-home__modules-tagline" data-astro-cid-2ljxwo5f>${mod.tagline}</span></li>`)}</ul></section>` : null}</section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/editorial/EditorialIndexBody.astro", void 0);
//#endregion
//#region src/themes/editorial/EditorialSearchBody.astro
createAstro("https://astro.build");
var $$EditorialSearchBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$EditorialSearchBody;
	const { q, hasQuery, hits, nextHref } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<section class="editorial-search" data-astro-cid-7twxz5b4><h1 class="editorial-search__title" data-astro-cid-7twxz5b4>${hasQuery ? `Search results for '${q}'` : "Search"}</h1><form class="editorial-search__form" action="/search" method="get" role="search" data-astro-cid-7twxz5b4><label class="editorial-search__label" for="editorial-search-q" data-astro-cid-7twxz5b4>Search</label><div class="editorial-search__row" data-astro-cid-7twxz5b4><input id="editorial-search-q" class="editorial-search__input" type="search" name="q"${addAttribute(q, "value")} autocomplete="off" data-astro-cid-7twxz5b4><button type="submit" class="editorial-search__submit" data-astro-cid-7twxz5b4>Search</button></div></form>${hasQuery ? hits.length > 0 ? renderTemplate`<ol class="editorial-search__results" data-astro-cid-7twxz5b4>${hits.map((hit) => renderTemplate`<li class="editorial-search__result" data-astro-cid-7twxz5b4><a class="editorial-search__result-title"${addAttribute(`/post/${hit.slug}`, "href")} data-astro-cid-7twxz5b4>${hit.title}</a>${hit.snippetHtml ? renderTemplate`<div class="cms-body editorial-search__snippet" data-astro-cid-7twxz5b4>${unescapeHTML(sanitizeContentBody(hit.snippetHtml))}</div>` : null}</li>`)}</ol>` : renderTemplate`<p class="editorial-search__empty" data-astro-cid-7twxz5b4>No results for that query.</p>` : null}${nextHref ? renderTemplate`<p class="editorial-search__more" data-astro-cid-7twxz5b4><a${addAttribute(nextHref, "href")} data-astro-cid-7twxz5b4>Load more →</a></p>` : null}</section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/editorial/EditorialSearchBody.astro", void 0);
//#endregion
//#region src/themes/editorial/EditorialNotFoundBody.astro
var $$EditorialNotFoundBody = createComponent(($$result, $$props, $$slots) => {
	return renderTemplate`${maybeRenderHead($$result)}<section class="editorial-notfound" data-astro-cid-o5a2wagy><h1 class="editorial-notfound__title" data-astro-cid-o5a2wagy>Page not found</h1><p class="editorial-notfound__message" data-astro-cid-o5a2wagy>The page you’re looking for doesn’t exist.</p><p class="editorial-notfound__action" data-astro-cid-o5a2wagy><a href="/" data-astro-cid-o5a2wagy>← Home</a></p></section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/editorial/EditorialNotFoundBody.astro", void 0);
//#endregion
//#region src/themes/magazine/MagazineShell.astro
createAstro("https://astro.build");
var $$MagazineShell = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$MagazineShell;
	const { siteName, logoUrl, hideModeToggle, navLinks } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<div class="magazine-shell" data-astro-cid-fn6eprsj><div class="magazine-shell__topbar" data-astro-cid-fn6eprsj><span class="magazine-shell__edition" data-astro-cid-fn6eprsj>${siteName}</span>${!hideModeToggle ? renderTemplate`<button type="button" class="magazine-shell__theme-toggle" id="theme-toggle" aria-label="Toggle light/dark theme" data-astro-cid-fn6eprsj>Theme</button>` : null}</div><header class="magazine-shell__header" data-astro-cid-fn6eprsj><a class="magazine-shell__title" href="/" data-astro-cid-fn6eprsj>${logoUrl ? renderTemplate`<img${addAttribute(logoUrl, "src")}${addAttribute(siteName, "alt")} class="magazine-shell__logo" height="36" data-astro-cid-fn6eprsj>` : siteName}</a><nav class="magazine-shell__nav" aria-label="Main" data-astro-cid-fn6eprsj><form class="magazine-shell__search" action="/search" method="get" role="search" data-astro-cid-fn6eprsj><label class="visually-hidden" for="magazine-header-search-q" data-astro-cid-fn6eprsj>Search</label><input id="magazine-header-search-q" class="magazine-shell__search-input" type="search" name="q" autocomplete="off" placeholder="Search…" data-astro-cid-fn6eprsj><button type="submit" class="magazine-shell__search-submit" data-astro-cid-fn6eprsj>Search</button></form>${navLinks.map((l) => renderTemplate`<a${addAttribute(l.href, "href")} data-astro-cid-fn6eprsj>${l.label}</a>`)}</nav></header>${renderSlot($$result, $$slots["default"])}<footer class="magazine-shell__footer" data-astro-cid-fn6eprsj>${siteName} — a content distribution built on the platform</footer></div>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/magazine/MagazineShell.astro", void 0);
//#endregion
//#region src/themes/magazine/MagazinePostBody.astro
createAstro("https://astro.build");
var $$MagazinePostBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$MagazinePostBody;
	const { post, comments, commentTotal, fields } = Astro.props;
	const commentLabel = commentTotal === 1 ? "1 comment" : `${commentTotal} comments`;
	const DATE_FMT = new Intl.DateTimeFormat("en-GB", {
		day: "numeric",
		month: "long",
		year: "numeric"
	});
	function displayDate(iso) {
		const ms = Date.parse(iso);
		return Number.isNaN(ms) ? "" : DATE_FMT.format(new Date(ms));
	}
	function mediaImgMarkup(value) {
		const url = value?.url?.trim();
		if (!url) return null;
		return `<img src="${url}" alt="" />`;
	}
	return renderTemplate`${maybeRenderHead($$result)}<article class="magazine-post" data-astro-cid-52cpqjps><p class="magazine-post__back" data-astro-cid-52cpqjps><a href="/" data-astro-cid-52cpqjps>← All posts</a></p><div class="magazine-post__layout" data-astro-cid-52cpqjps><div class="magazine-post__main" data-astro-cid-52cpqjps><h1 class="magazine-post__title" data-astro-cid-52cpqjps>${post.title}</h1><div class="magazine-post__body" data-astro-cid-52cpqjps>${unescapeHTML(sanitizeContentBody(post.body))}</div></div>${fields.length > 0 ? renderTemplate`<aside class="magazine-post__sidebar" aria-label="Post metadata" data-astro-cid-52cpqjps><h2 class="magazine-post__sidebar-heading" data-astro-cid-52cpqjps>Details</h2><dl class="magazine-post__content-fields" data-astro-cid-52cpqjps>${fields.map((field) => renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`<dt data-astro-cid-52cpqjps>${field.label}</dt><dd data-astro-cid-52cpqjps>${field.type === "media" ? (() => {
		const markup = mediaImgMarkup(field.value);
		return markup ? renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`${unescapeHTML(sanitizeContentBody(markup))}` })}` : null;
	})() : typeof field.value === "string" || typeof field.value === "number" || typeof field.value === "boolean" ? field.value : null}</dd>` })}`)}</dl></aside>` : null}</div><section class="magazine-post__comments" aria-labelledby="magazine-comments-heading" data-astro-cid-52cpqjps><h2 id="magazine-comments-heading" class="magazine-post__comments-heading" data-astro-cid-52cpqjps>${commentLabel}</h2>${comments.length === 0 ? renderTemplate`<p class="magazine-post__comments-empty" data-astro-cid-52cpqjps>Be the first to comment.</p>` : renderTemplate`<ol class="magazine-post__comments-list" data-astro-cid-52cpqjps>${comments.map((comment) => {
		const author = guestAuthorParts(comment.author);
		return renderTemplate`<li class="magazine-post__comment"${addAttribute(commentIndentStyle(comment.depth), "style")}${addAttribute(comment.depth, "data-depth")} data-astro-cid-52cpqjps><header class="magazine-post__comment-meta" data-astro-cid-52cpqjps>${author.href ? renderTemplate`<a class="magazine-post__comment-author"${addAttribute(author.href, "href")} data-astro-cid-52cpqjps>${author.label}</a>` : renderTemplate`<span class="magazine-post__comment-author" data-astro-cid-52cpqjps>${author.label}</span>`}<time class="magazine-post__comment-time"${addAttribute(comment.createdAt, "datetime")} data-astro-cid-52cpqjps>${displayDate(comment.createdAt)}</time></header><div class="magazine-post__comment-body" data-astro-cid-52cpqjps>${unescapeHTML(sanitizeContentBody(comment.bodyHtml))}</div></li>`;
	})}</ol>`}<form class="magazine-post__comment-form" method="post" action="/api/comments" data-astro-cid-52cpqjps><input type="hidden" name="target_type" value="content_entry" data-astro-cid-52cpqjps><input type="hidden" name="target_id"${addAttribute(post.id, "value")} data-astro-cid-52cpqjps><div class="magazine-post__comment-form-hp" aria-hidden="true" data-astro-cid-52cpqjps><label for="magazine-website" data-astro-cid-52cpqjps>Website</label><input id="magazine-website" name="website" type="text" tabindex="-1" autocomplete="off" data-astro-cid-52cpqjps></div>${renderComponent($$result, "CommentFormFields", CommentFormFields, {
		"client:load": true,
		"data-astro-cid-52cpqjps": true,
		"client:component-hydration": "load",
		"client:component-path": "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/components/islands/CommentFormFields.tsx",
		"client:component-export": "default"
	})}<button type="submit" class="magazine-post__action magazine-post__action--primary" data-astro-cid-52cpqjps>Post comment</button></form></section></article>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/magazine/MagazinePostBody.astro", void 0);
//#endregion
//#region src/themes/magazine/MagazineIndexBody.astro
createAstro("https://astro.build");
var $$MagazineIndexBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$MagazineIndexBody;
	const { siteName, heroHtml, posts } = Astro.props;
	const leadPrimary = posts.length > 0 ? posts[0] : null;
	const leadSecondary = posts.length > 1 ? posts[1] : null;
	const feedPosts = posts.length > 2 ? posts.slice(2) : [];
	return renderTemplate`${maybeRenderHead($$result)}<section class="magazine-home" data-astro-cid-fiakd4dj><h1 class="magazine-home__site-title" data-astro-cid-fiakd4dj>${siteName}</h1>${heroHtml ? renderTemplate`<div class="cms-body magazine-home__intro" data-astro-cid-fiakd4dj>${unescapeHTML(sanitizeContentBody(heroHtml))}</div>` : null}${posts.length > 0 ? renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`${leadPrimary ? renderTemplate`<section class="magazine-home__lead" aria-label="Featured posts" data-astro-cid-fiakd4dj><div class="magazine-home__lead-primary" data-astro-cid-fiakd4dj><h2 class="magazine-home__lead-title" data-astro-cid-fiakd4dj><a${addAttribute(`/post/${leadPrimary.slug}`, "href")} data-astro-cid-fiakd4dj>${leadPrimary.title}</a></h2><p class="magazine-home__lead-more" data-astro-cid-fiakd4dj><a${addAttribute(`/post/${leadPrimary.slug}`, "href")} data-astro-cid-fiakd4dj>Read →</a></p></div>${leadSecondary ? renderTemplate`<div class="magazine-home__lead-secondary" data-astro-cid-fiakd4dj><h3 class="magazine-home__lead-secondary-title" data-astro-cid-fiakd4dj><a${addAttribute(`/post/${leadSecondary.slug}`, "href")} data-astro-cid-fiakd4dj>${leadSecondary.title}</a></h3></div>` : null}</section>` : null}${feedPosts.length > 0 ? renderTemplate`<section class="magazine-home__feed" aria-label="More posts" data-astro-cid-fiakd4dj><ol class="magazine-home__feed-list" data-astro-cid-fiakd4dj>${feedPosts.map((post) => renderTemplate`<li class="magazine-home__feed-item" data-astro-cid-fiakd4dj><a class="magazine-home__feed-link"${addAttribute(`/post/${post.slug}`, "href")} data-astro-cid-fiakd4dj><span class="magazine-home__feed-title" data-astro-cid-fiakd4dj>${post.title}</span><span class="magazine-home__feed-arrow" aria-hidden="true" data-astro-cid-fiakd4dj>→</span></a></li>`)}</ol></section>` : null}` })}` : renderTemplate`<p class="magazine-home__empty" data-astro-cid-fiakd4dj>No posts yet.</p>`}</section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/magazine/MagazineIndexBody.astro", void 0);
//#endregion
//#region src/themes/magazine/MagazineSearchBody.astro
createAstro("https://astro.build");
var $$MagazineSearchBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$MagazineSearchBody;
	const { q, hasQuery, hits, nextHref } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<section class="magazine-search" data-astro-cid-2jga6fdp><h1 class="magazine-search__title" data-astro-cid-2jga6fdp>${hasQuery ? `Search results for '${q}'` : "Search"}</h1><form class="magazine-search__form" action="/search" method="get" role="search" data-astro-cid-2jga6fdp><label class="magazine-search__label" for="magazine-search-q" data-astro-cid-2jga6fdp>Search</label><div class="magazine-search__row" data-astro-cid-2jga6fdp><input id="magazine-search-q" class="magazine-search__input" type="search" name="q"${addAttribute(q, "value")} autocomplete="off" data-astro-cid-2jga6fdp><button type="submit" class="magazine-search__submit" data-astro-cid-2jga6fdp>Search</button></div></form>${hasQuery ? hits.length > 0 ? renderTemplate`<ol class="magazine-search__results" data-astro-cid-2jga6fdp>${hits.map((hit) => renderTemplate`<li class="magazine-search__result" data-astro-cid-2jga6fdp><a class="magazine-search__result-title"${addAttribute(`/post/${hit.slug}`, "href")} data-astro-cid-2jga6fdp>${hit.title}</a></li>`)}</ol>` : renderTemplate`<p class="magazine-search__empty" data-astro-cid-2jga6fdp>No results.</p>` : null}${nextHref ? renderTemplate`<p class="magazine-search__more" data-astro-cid-2jga6fdp><a${addAttribute(nextHref, "href")} data-astro-cid-2jga6fdp>Load more →</a></p>` : null}</section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/magazine/MagazineSearchBody.astro", void 0);
//#endregion
//#region src/themes/magazine/MagazineNotFoundBody.astro
var $$MagazineNotFoundBody = createComponent(($$result, $$props, $$slots) => {
	return renderTemplate`${maybeRenderHead($$result)}<section class="magazine-notfound" data-astro-cid-xzwnmpt2><p class="magazine-notfound__code" aria-hidden="true" data-astro-cid-xzwnmpt2>404</p><h1 class="magazine-notfound__title" data-astro-cid-xzwnmpt2>Page not found</h1><p class="magazine-notfound__message" data-astro-cid-xzwnmpt2>The page you’re looking for doesn’t exist.</p><p class="magazine-notfound__action" data-astro-cid-xzwnmpt2><a href="/" data-astro-cid-xzwnmpt2>Return to homepage →</a></p></section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/magazine/MagazineNotFoundBody.astro", void 0);
//#endregion
//#region src/themes/blog/BlogShell.astro
createAstro("https://astro.build");
var $$BlogShell = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$BlogShell;
	const { siteName, logoUrl, hideModeToggle, navLinks } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<header class="blog-header" data-astro-cid-f55mokoc><div class="blog-header__inner" data-astro-cid-f55mokoc><a class="blog-header__logo" href="/" data-astro-cid-f55mokoc>${logoUrl ? renderTemplate`<img${addAttribute(logoUrl, "src")}${addAttribute(siteName, "alt")} class="blog-header__logo-img" height="28" data-astro-cid-f55mokoc>` : siteName}</a><nav class="blog-header__nav" aria-label="Main" data-astro-cid-f55mokoc><ul class="blog-header__nav-list" data-astro-cid-f55mokoc>${navLinks.map((link) => renderTemplate`<li class="blog-header__nav-item" data-astro-cid-f55mokoc><a${addAttribute(link.href, "href")} data-astro-cid-f55mokoc>${link.label}</a></li>`)}</ul>${!hideModeToggle ? renderTemplate`<button type="button" class="blog-header__theme-toggle" id="theme-toggle" aria-label="Toggle light/dark theme" data-astro-cid-f55mokoc>Theme</button>` : null}</nav></div></header><div class="blog-main" data-astro-cid-f55mokoc>${renderSlot($$result, $$slots["default"])}</div><footer class="blog-footer" data-astro-cid-f55mokoc>${siteName} — a content distribution built on the platform</footer>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/blog/BlogShell.astro", void 0);
//#endregion
//#region src/themes/blog/BlogPostBody.astro
createAstro("https://astro.build");
var $$BlogPostBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$BlogPostBody;
	const { post, comments, commentTotal, fields } = Astro.props;
	const commentLabel = commentTotal === 1 ? "1 comment" : `${commentTotal} comments`;
	const DATE_FMT = new Intl.DateTimeFormat("en-GB", {
		day: "numeric",
		month: "long",
		year: "numeric"
	});
	function displayDate(iso) {
		const ms = Date.parse(iso);
		return Number.isNaN(ms) ? "" : DATE_FMT.format(new Date(ms));
	}
	function mediaImgMarkup(value) {
		const url = value?.url?.trim();
		if (!url) return null;
		return `<img src="${url}" alt="" />`;
	}
	return renderTemplate`${maybeRenderHead($$result)}<article class="blog-post" data-astro-cid-nncj4kbm><h1 class="blog-post__title" data-astro-cid-nncj4kbm>${post.title}</h1><div class="blog-post__body cms-body" data-astro-cid-nncj4kbm>${unescapeHTML(sanitizeContentBody(post.body))}</div>${fields.length > 0 ? renderTemplate`<dl class="blog-post__content-fields" data-astro-cid-nncj4kbm>${fields.map((field) => renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`<dt data-astro-cid-nncj4kbm>${field.label}</dt><dd data-astro-cid-nncj4kbm>${field.type === "media" ? (() => {
		const markup = mediaImgMarkup(field.value);
		return markup ? renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result) => renderTemplate`${unescapeHTML(sanitizeContentBody(markup))}` })}` : null;
	})() : typeof field.value === "string" || typeof field.value === "number" || typeof field.value === "boolean" ? field.value : null}</dd>` })}`)}</dl>` : null}<section class="blog-post__comments" aria-labelledby="blog-comments-heading" data-astro-cid-nncj4kbm><h2 id="blog-comments-heading" class="blog-post__comments-heading" data-astro-cid-nncj4kbm>${commentLabel}</h2>${comments.length === 0 ? renderTemplate`<p class="blog-post__comments-empty" data-astro-cid-nncj4kbm>Be the first to comment.</p>` : renderTemplate`<ol class="blog-post__comments-list" data-astro-cid-nncj4kbm>${comments.map((comment) => {
		const author = guestAuthorParts(comment.author);
		return renderTemplate`<li class="blog-post__comment"${addAttribute(commentIndentStyle(comment.depth), "style")}${addAttribute(comment.depth, "data-depth")} data-astro-cid-nncj4kbm><header class="blog-post__comment-meta" data-astro-cid-nncj4kbm>${author.href ? renderTemplate`<a class="blog-post__comment-author"${addAttribute(author.href, "href")} data-astro-cid-nncj4kbm>${author.label}</a>` : renderTemplate`<span class="blog-post__comment-author" data-astro-cid-nncj4kbm>${author.label}</span>`}<time class="blog-post__comment-time"${addAttribute(comment.createdAt, "datetime")} data-astro-cid-nncj4kbm>${displayDate(comment.createdAt)}</time></header><div class="comment__body" data-astro-cid-nncj4kbm>${unescapeHTML(sanitizeContentBody(comment.bodyHtml))}</div></li>`;
	})}</ol>`}<form class="blog-post__comment-form" method="post" action="/api/comments" data-astro-cid-nncj4kbm><input type="hidden" name="target_type" value="content_entry" data-astro-cid-nncj4kbm><input type="hidden" name="target_id"${addAttribute(post.id, "value")} data-astro-cid-nncj4kbm><div class="blog-post__comment-form-hp" aria-hidden="true" data-astro-cid-nncj4kbm><label for="blog-website" data-astro-cid-nncj4kbm>Website</label><input id="blog-website" name="website" type="text" tabindex="-1" autocomplete="off" data-astro-cid-nncj4kbm></div>${renderComponent($$result, "CommentFormFields", CommentFormFields, {
		"client:load": true,
		"data-astro-cid-nncj4kbm": true,
		"client:component-hydration": "load",
		"client:component-path": "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/components/islands/CommentFormFields.tsx",
		"client:component-export": "default"
	})}<button type="submit" class="blog-post__action blog-post__action--primary" data-astro-cid-nncj4kbm>Post comment</button></form></section></article><a href="/" class="blog-post__back" data-astro-cid-nncj4kbm>← Back to posts</a>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/blog/BlogPostBody.astro", void 0);
//#endregion
//#region src/themes/blog/BlogIndexBody.astro
createAstro("https://astro.build");
var $$BlogIndexBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$BlogIndexBody;
	const { siteName, heroHtml, posts } = Astro.props;
	const DATE_FMT = new Intl.DateTimeFormat("en-GB", {
		day: "numeric",
		month: "long",
		year: "numeric"
	});
	function displayDate(iso) {
		const ms = Date.parse(iso);
		return Number.isNaN(ms) ? "" : DATE_FMT.format(new Date(ms));
	}
	return renderTemplate`${maybeRenderHead($$result)}<h1 class="blog-home__site-title" data-astro-cid-ool34mna>${siteName}</h1>${heroHtml ? renderTemplate`<div class="cms-body blog-home__intro" data-astro-cid-ool34mna>${unescapeHTML(sanitizeContentBody(heroHtml))}</div>` : null}${posts.length > 0 ? renderTemplate`<ul class="blog-home__feed" data-astro-cid-ool34mna>${posts.map((post, index) => renderTemplate`<li class="blog-home__item" data-astro-cid-ool34mna><div class="blog-home__row" data-astro-cid-ool34mna>${post.createdAt ? renderTemplate`<time class="blog-home__date"${addAttribute(post.createdAt, "datetime")} data-astro-cid-ool34mna>${displayDate(post.createdAt)}</time>` : null}<a${addAttribute(`/post/${post.slug}`, "href")} class="blog-home__title" data-astro-cid-ool34mna>${post.title}</a></div>${index < posts.length - 1 ? renderTemplate`<hr class="blog-home__divider" data-astro-cid-ool34mna>` : null}</li>`)}</ul>` : renderTemplate`<p class="blog-home__empty" data-astro-cid-ool34mna>No posts yet.</p>`}`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/blog/BlogIndexBody.astro", void 0);
//#endregion
//#region src/themes/blog/BlogSearchBody.astro
createAstro("https://astro.build");
var $$BlogSearchBody = createComponent(($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$BlogSearchBody;
	const { q, hasQuery, hits, nextHref } = Astro.props;
	return renderTemplate`${maybeRenderHead($$result)}<section class="blog-search" data-astro-cid-fguhxg7b><h1 class="blog-search__title" data-astro-cid-fguhxg7b>Search</h1><form class="blog-search__form" action="/search" method="get" role="search" data-astro-cid-fguhxg7b><label class="blog-search__label" for="blog-search-q" data-astro-cid-fguhxg7b>Search</label><div class="blog-search__row" data-astro-cid-fguhxg7b><input id="blog-search-q" class="blog-search__input" type="search" name="q"${addAttribute(q, "value")} autocomplete="off" data-astro-cid-fguhxg7b><button type="submit" class="blog-search__submit" data-astro-cid-fguhxg7b>Search</button></div></form>${hasQuery ? hits.length > 0 ? renderTemplate`<ul class="blog-search__results" data-astro-cid-fguhxg7b>${hits.map((hit) => renderTemplate`<li class="blog-search__result" data-astro-cid-fguhxg7b><a class="blog-search__result-title"${addAttribute(`/post/${hit.slug}`, "href")} data-astro-cid-fguhxg7b>${hit.title}</a></li>`)}</ul>` : renderTemplate`<p class="blog-search__empty" data-astro-cid-fguhxg7b>No results.</p>` : null}${nextHref ? renderTemplate`<p class="blog-search__more" data-astro-cid-fguhxg7b><a${addAttribute(nextHref, "href")} data-astro-cid-fguhxg7b>Load more →</a></p>` : null}</section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/blog/BlogSearchBody.astro", void 0);
//#endregion
//#region src/themes/blog/BlogNotFoundBody.astro
var $$BlogNotFoundBody = createComponent(($$result, $$props, $$slots) => {
	return renderTemplate`${maybeRenderHead($$result)}<section class="blog-notfound" data-astro-cid-f23c7cmc><h1 class="blog-notfound__title" data-astro-cid-f23c7cmc>Not found</h1><p class="blog-notfound__message" data-astro-cid-f23c7cmc>The page you’re looking for doesn’t exist.</p><p class="blog-notfound__action" data-astro-cid-f23c7cmc><a href="/" data-astro-cid-f23c7cmc>← Home</a></p></section>`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/themes/blog/BlogNotFoundBody.astro", void 0);
//#endregion
//#region src/themes/registry.ts
var THEMES = {
	default: {
		id: "default",
		name: "Default",
		Shell: $$DefaultShell,
		overrides: {
			index: $$DefaultIndexBody,
			search: $$DefaultSearchBody,
			"not-found": $$DefaultNotFoundBody
		}
	},
	editorial: {
		id: "editorial",
		name: "Editorial",
		Shell: $$EditorialShell,
		overrides: {
			post: $$EditorialPostBody,
			index: $$EditorialIndexBody,
			search: $$EditorialSearchBody,
			"not-found": $$EditorialNotFoundBody
		}
	},
	magazine: {
		id: "magazine",
		name: "Magazine",
		Shell: $$MagazineShell,
		overrides: {
			post: $$MagazinePostBody,
			index: $$MagazineIndexBody,
			search: $$MagazineSearchBody,
			"not-found": $$MagazineNotFoundBody
		}
	},
	blog: {
		id: "blog",
		name: "Blog",
		Shell: $$BlogShell,
		overrides: {
			post: $$BlogPostBody,
			index: $$BlogIndexBody,
			search: $$BlogSearchBody,
			"not-found": $$BlogNotFoundBody
		}
	}
};
var metaIds = new Set(THEME_REGISTRY_META.map((t) => t.id));
var keyIds = new Set(Object.keys(THEMES));
if (metaIds.size !== keyIds.size || [...metaIds].some((id) => !keyIds.has(id))) throw new Error(`theme registry/meta mismatch: meta=[${[...metaIds].sort()}] registry=[${[...keyIds].sort()}]`);
for (const theme of Object.values(THEMES)) {
	const unwired = findUnwiredOverrides(theme);
	if (unwired.length > 0) throw new Error(`theme "${theme.id}" overrides unwired screen(s) [${unwired}] — wire the screen to resolveScreen and add it to WIRED_SCREENS, or remove the override`);
}
var MOD_CMS_THEMES = THEMES;
/** Total theme lookup — unknown ids fall back to DEFAULT_THEME_ID (registry guard proves it exists). */
function resolveModTheme(themeId) {
	const theme = MOD_CMS_THEMES[themeId] ?? MOD_CMS_THEMES["default"];
	if (!theme) throw new Error(`theme registry invariant violated: missing default theme "${DEFAULT_THEME_ID}"`);
	return theme;
}
//#endregion
export { $$DefaultPostBody as a, Field as c, surface as d, cva as f, require_jsx_runtime as h, $$DefaultIndexBody as i, useFieldControl as l, resolveShell as m, $$DefaultNotFoundBody as n, Textarea as o, resolveScreen as p, $$DefaultSearchBody as r, Input as s, resolveModTheme as t, cn as u };
