import { x as head, c as escape_html, e as ensure_array_like, b as attr_class, a as attr, d as attr_style, g as derived, f as stringify } from './dev-BNpEUZI3.js';
import { g as goto } from './client-CW9E6S_J.js';
import { H as HeroHeader } from './HeroHeader-v4Q9vaGr.js';
import { a as Breadcrumb, B as Badge, C as Card } from './Tabs-DzG6Bn9a.js';
import { B as Button } from './ui-DR8zOSpC.js';
import { a as StatusBadge, f as formatTime, g as gatesFromJson, P as PriorityBadge, S as SvgRenderer } from './tasks2-DtLXCqqM.js';
import './internal-DYSVC9SL.js';
import 'node:module';
import '@sveltejs/kit/internal';
import './index-server-DocJvixA.js';
import './chunk-DDP5xfzh.js';
import '@sveltejs/kit/internal/server';
import './tasks-CnwUAUXf.js';
import './paths-2M_UxD_H.js';
import 'node:fs';
import 'node:path';
import 'node:os';
import 'node:events';
import 'node:diagnostics_channel';
import 'fs';
import 'events';
import 'util';
import 'path';
import 'assert';
import 'worker_threads';
import 'module';
import 'node:url';
import 'url';
import 'buffer';
import 'node:child_process';
import 'node:crypto';
import 'node:process';
import 'node:async_hooks';
import './data-accessor-CVbz8X_7.js';
import './conduit-Ca_OFWR_.js';
import './indexes-aYlULWG3.js';
import './utils-BvHPJOVk.js';
import './unique-constraint-BM-Apx1H.js';
import './sqlite-Dsbe0wec.js';
import './dual-scope-db-ATrwq0LH.js';
import './memory-schema-Bi7cChwo.js';
import './agent-registry-BtE5uhMO.js';
import './nexus-sqlite2-DgTuv9BQ.js';
import './nexus-schema2-BEd-ol6e.js';
import './logger-ChCwlV5k.js';
import 'node:sqlite';
import './lock-BoHF25mx.js';
import './index-IVoIz4D5.js';
import 'constants';
import 'stream';
import 'node:fs/promises';
import 'jsonc-parser';
import '@cleocode/cant';
import 'node:util';
import 'node:buffer';
import 'child_process';
import './branch-lock-qP1EkZ7p.js';
import './src2-DK8DKufK.js';
import 'llmtxt/identity';
import './sessions-j73dkbCI.js';
import './registry2-BSyCTA3q.js';
import './index-Ca4C2M45.js';
import './mvi-helpers-BNsJ8ZpQ.js';
import './session-store-OwQWMSf_.js';
import './session-manifest-ZHrj54LR.js';
import './storage-B9UA3BHR.js';
import './config-B0nEjgSh.js';
import './json-DXl7iDYg.js';
import './data-safety-central-vmfu_Y4J.js';
import './sqlite-data-accessor-C59wZ0zp.js';
import './cross-db-cleanup-C_FLyd-6.js';
import './StatBlock-DHJMmOCx.js';
import './no-face-up-DcejJLy-.js';
import 'd3';

//#region src/lib/components/TaskDepGraph.svelte
function TaskDepGraph($$renderer, $$props) {
	$$renderer.component(($$renderer) => {
		/**
		* Legacy node shape accepted by this component.  Preserved so callers
		* don't have to migrate at the same time as the renderer swap.
		*/
		/**
		* Legacy edge shape.  Assumed directional from `source → target`.
		*/
		/** Panel height. Defaults to `260px` to match the previous layout. */
		let { nodes, edges, height = "260px" } = $$props;
		/**
		* Project the legacy inputs into the shared graph kit shape.  The
		* focal node is tagged via `meta.focal` so {@link SvgRenderer} applies
		* the accent halo.
		*/
		const kitNodes = derived(() => nodes.map((n) => ({
			id: n.id,
			substrate: "tasks",
			kind: n.type || "task",
			label: n.title,
			category: null,
			weight: n.isFocus ? 1 : .6,
			meta: {
				status: n.status,
				priority: n.priority,
				focal: n.isFocus
			}
		})));
		const kitEdges = derived(() => edges.filter((e) => e.source !== e.target).map((e, idx) => ({
			id: `dep-${idx}:${e.source}->${e.target}`,
			source: e.source,
			target: e.target,
			kind: "depends",
			directional: true,
			weight: .6
		})));
		function onNodeClick(n) {
			goto(`/tasks/${n.id}`);
		}
		$$renderer.push(`<div class="dep-graph-wrap svelte-1ytw5n2"${attr_style(`--dep-graph-height: ${stringify(height)};`)}>`);
		if (nodes.length === 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<div class="dep-graph-empty svelte-1ytw5n2">No dependencies</div>`);
		} else {
			$$renderer.push("<!--[-1-->");
			SvgRenderer($$renderer, {
				nodes: kitNodes(),
				edges: kitEdges(),
				showLabels: "full",
				nodeRenderer: "circle",
				onNodeClick,
				ariaLabel: "Task dependency neighbourhood"
			});
		}
		$$renderer.push(`<!--]--></div>`);
	});
}
//#endregion
//#region src/routes/tasks/[id]/+page.svelte
function _page($$renderer, $$props) {
	$$renderer.component(($$renderer) => {
		const KNOWN_STATUSES = new Set([
			"pending",
			"active",
			"blocked",
			"done",
			"cancelled",
			"archived",
			"proposed"
		]);
		const KNOWN_PRIORITIES = new Set([
			"low",
			"medium",
			"high",
			"critical"
		]);
		function toStatus(value) {
			return KNOWN_STATUSES.has(value) ? value : "pending";
		}
		function toPriority(value) {
			return KNOWN_PRIORITIES.has(value) ? value : "medium";
		}
		let { data } = $$props;
		const task = derived(() => data.task);
		const subtasks = derived(() => data.subtasks);
		const parent = derived(() => data.parent);
		const manifestEntries = derived(() => data.manifestEntries);
		const linkedCommits = derived(() => data.linkedCommits);
		const breadcrumbs = derived(() => [
			{
				label: "Tasks",
				href: "/tasks"
			},
			...parent() ? [{
				label: parent().id,
				href: `/tasks/${parent().id}`
			}] : [],
			{ label: task().id }
		]);
		function formatDate(iso) {
			if (!iso) return "—";
			try {
				return new Date(iso).toLocaleString("en-US", {
					month: "short",
					day: "numeric",
					hour: "2-digit",
					minute: "2-digit"
				});
			} catch {
				return iso;
			}
		}
		function formatDateShort(iso) {
			if (!iso) return "—";
			try {
				return new Date(iso).toLocaleDateString("en-US", {
					month: "short",
					day: "numeric",
					year: "numeric"
				});
			} catch {
				return iso;
			}
		}
		function truncate(s, max) {
			if (!s) return "";
			if (s.length <= max) return s;
			return `${s.slice(0, max)}…`;
		}
		function basename(p) {
			return p.split("/").pop() ?? p;
		}
		const sixGates = derived(() => [
			{
				key: "I",
				label: "Implemented",
				passed: task().verification?.gates.implemented ?? false
			},
			{
				key: "T",
				label: "Tests",
				passed: task().verification?.gates.testsPassed ?? false
			},
			{
				key: "Q",
				label: "QA",
				passed: task().verification?.gates.qaPassed ?? false
			},
			{
				key: "D",
				label: "Documented",
				passed: false
			},
			{
				key: "S",
				label: "Security",
				passed: false
			},
			{
				key: "C",
				label: "Cleanup",
				passed: false
			}
		]);
		const gatesPassed = derived(() => sixGates().filter((g) => g.passed).length);
		function subtaskGates(row) {
			return gatesFromJson(row.verification_json);
		}
		const doneSubtasks = derived(() => subtasks().filter((s) => s.status === "done").length);
		const subtaskPct = derived(() => subtasks().length > 0 ? Math.round(doneSubtasks() / subtasks().length * 100) : 0);
		const heroMeta = derived(() => [
			task().pipeline_stage ? `stage: ${task().pipeline_stage}` : null,
			task().size ? `size: ${task().size}` : null,
			task().assignee ? `assigned: ${task().assignee}` : null,
			`updated ${formatTime(task().updated_at)}`
		].filter((x) => x !== null).join(" · "));
		function priorityTone(p) {
			if (p === "critical" || p === "high") return "danger";
			if (p === "medium") return "warning";
			if (p === "low") return "neutral";
			return "info";
		}
		function manifestTone(status) {
			if (status === "complete") return "success";
			if (status === "partial") return "warning";
			if (status === "blocked") return "danger";
			return "neutral";
		}
		/**
		* Build the node list for the 1-hop ego graph centred on this task.
		* Includes this task (marked focal) + every upstream + every
		* downstream task.
		*/
		function buildDepNodes() {
			const nodes = [{
				id: task().id,
				title: task().title,
				status: task().status,
				priority: task().priority,
				type: task().type,
				isFocus: true
			}];
			for (const u of task().upstream) nodes.push({
				id: u.id,
				title: u.title,
				status: u.status,
				priority: u.priority,
				type: "task",
				isFocus: false
			});
			for (const d of task().downstream) nodes.push({
				id: d.id,
				title: d.title,
				status: d.status,
				priority: d.priority,
				type: "task",
				isFocus: false
			});
			return nodes;
		}
		/**
		* Edges flow `source → target` where `source` is the dependent and
		* `target` is the blocker. Upstream blockers point INTO the focal;
		* downstream dependents have the focal pointing INTO them.
		*/
		function buildDepEdges() {
			const edges = [];
			for (const u of task().upstream) edges.push({
				source: task().id,
				target: u.id
			});
			for (const d of task().downstream) edges.push({
				source: d.id,
				target: task().id
			});
			return edges;
		}
		function depRow($$renderer, dep) {
			$$renderer.push(`<span class="dep-row svelte-13zy71l">`);
			StatusBadge($$renderer, {
				status: toStatus(dep.status),
				compact: true
			});
			$$renderer.push(`<!----> <span class="dep-id svelte-13zy71l">${escape_html(dep.id)}</span> <span class="dep-title svelte-13zy71l">${escape_html(dep.title)}</span> `);
			Badge($$renderer, {
				tone: priorityTone(dep.priority),
				size: "sm",
				subtle: true,
				children: ($$renderer) => {
					$$renderer.push(`<!---->${escape_html(dep.priority)}`);
				}});
			$$renderer.push(`<!----></span>`);
		}
		head("13zy71l", $$renderer, ($$renderer) => {
			$$renderer.title(($$renderer) => {
				$$renderer.push(`<title>${escape_html(task().id)} — ${escape_html(task().title)} — CLEO Studio</title>`);
			});
		});
		$$renderer.push(`<div class="task-detail svelte-13zy71l">`);
		Breadcrumb($$renderer, { items: breadcrumbs() });
		$$renderer.push(`<!----> `);
		{
			function actions($$renderer) {
				StatusBadge($$renderer, { status: toStatus(task().status) });
				$$renderer.push(`<!----> `);
				PriorityBadge($$renderer, { priority: toPriority(task().priority) });
				$$renderer.push(`<!----> `);
				if (task().size) {
					$$renderer.push("<!--[0-->");
					Badge($$renderer, {
						tone: "neutral",
						size: "sm",
						children: ($$renderer) => {
							$$renderer.push(`<!---->${escape_html(task().size)}`);
						}});
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]-->`);
			}
			HeroHeader($$renderer, {
				eyebrow: task().type.toUpperCase(),
				title: task().title,
				meta: heroMeta(),
				actions});
		}
		$$renderer.push(`<!----> <div class="detail-layout svelte-13zy71l"><div class="detail-main svelte-13zy71l"><section class="gate-section svelte-13zy71l"><div class="gate-head svelte-13zy71l"><span class="section-label svelte-13zy71l">Verification gates</span> <span class="gate-counter svelte-13zy71l">${escape_html(gatesPassed())}/${escape_html(sixGates().length)}</span> `);
		if (task().verification?.passed) {
			$$renderer.push("<!--[0-->");
			Badge($$renderer, {
				tone: "success",
				size: "sm",
				children: ($$renderer) => {
					$$renderer.push(`<!---->ALL PASSED`);
				}});
		} else if (task().verification) {
			$$renderer.push("<!--[1-->");
			Badge($$renderer, {
				tone: "warning",
				size: "sm",
				children: ($$renderer) => {
					$$renderer.push(`<!---->Round ${escape_html(task().verification.round)}`);
				}});
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--></div> <div class="gate-strip svelte-13zy71l"><!--[-->`);
		const each_array = ensure_array_like(sixGates());
		for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
			let gate = each_array[$$index];
			$$renderer.push(`<div${attr_class("gate svelte-13zy71l", void 0, { "passed": gate.passed })}${attr("title", gate.label)}><span class="gate-key svelte-13zy71l">${escape_html(gate.key)}</span> <span class="gate-label svelte-13zy71l">${escape_html(gate.label)}</span> <span class="gate-icon svelte-13zy71l" aria-hidden="true">${escape_html(gate.passed ? "✓" : "·")}</span></div>`);
		}
		$$renderer.push(`<!--]--></div></section> `);
		if (task().description) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="prose-section svelte-13zy71l"><span class="section-label svelte-13zy71l">Description</span> <div class="prose svelte-13zy71l">${escape_html(task().description)}</div></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--> `);
		if (task().acceptance && task().acceptance.length > 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="ac-section svelte-13zy71l"><span class="section-label svelte-13zy71l">Acceptance criteria <span class="section-meta svelte-13zy71l">${escape_html(task().acceptance.length)} criteria</span></span> <ul class="ac-list svelte-13zy71l"><!--[-->`);
			const each_array_1 = ensure_array_like(task().acceptance);
			for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
				let criterion = each_array_1[$$index_1];
				const passed = task().verification?.passed ?? false;
				$$renderer.push(`<li${attr_class("ac-item svelte-13zy71l", void 0, { "passed": passed })}><span class="ac-check svelte-13zy71l" aria-hidden="true">${escape_html(passed ? "✓" : "○")}</span> <span class="ac-text svelte-13zy71l">${escape_html(criterion)}</span></li>`);
			}
			$$renderer.push(`<!--]--></ul></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--> `);
		if (task().notes && task().notes.length > 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="prose-section svelte-13zy71l"><span class="section-label svelte-13zy71l">Notes <span class="section-meta svelte-13zy71l">${escape_html(task().notes.length)} entries</span></span> <ol class="notes-list svelte-13zy71l"><!--[-->`);
			const each_array_2 = ensure_array_like(task().notes);
			for (let i = 0, $$length = each_array_2.length; i < $$length; i++) {
				let note = each_array_2[i];
				$$renderer.push(`<li class="note-item svelte-13zy71l"><span class="note-index svelte-13zy71l">#${escape_html(i + 1)}</span> <span class="note-text svelte-13zy71l">${escape_html(note)}</span></li>`);
			}
			$$renderer.push(`<!--]--></ol></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--> `);
		if (manifestEntries() && manifestEntries().length > 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="artifacts-section svelte-13zy71l"><span class="section-label svelte-13zy71l">Agent artifacts <span class="section-meta svelte-13zy71l">${escape_html(manifestEntries().length)}</span></span> <div class="artifact-list svelte-13zy71l"><!--[-->`);
			const each_array_3 = ensure_array_like(manifestEntries());
			for (let $$index_4 = 0, $$length = each_array_3.length; $$index_4 < $$length; $$index_4++) {
				let entry = each_array_3[$$index_4];
				$$renderer.push(`<article class="artifact svelte-13zy71l"${attr("data-status", entry.status)}><header class="artifact-head svelte-13zy71l">`);
				Badge($$renderer, {
					tone: "accent",
					size: "sm",
					children: ($$renderer) => {
						$$renderer.push(`<!---->${escape_html(entry.type)}`);
					}});
				$$renderer.push(`<!----> `);
				Badge($$renderer, {
					tone: manifestTone(entry.status),
					size: "sm",
					children: ($$renderer) => {
						$$renderer.push(`<!---->${escape_html(entry.status)}`);
					}});
				$$renderer.push(`<!----> `);
				if (entry.date) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<time class="artifact-date svelte-13zy71l">${escape_html(formatDateShort(entry.date))}</time>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--> <code class="artifact-id svelte-13zy71l">${escape_html(entry.id)}</code></header> `);
				if (entry.title) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<h3 class="artifact-title svelte-13zy71l">${escape_html(entry.title)}</h3>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--> `);
				if (entry.summary) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<p class="artifact-summary svelte-13zy71l">${escape_html(truncate(entry.summary, 300))}</p>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--> `);
				if (entry.output) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<div class="artifact-output svelte-13zy71l"><span class="artifact-output-label svelte-13zy71l">output:</span> <code class="artifact-output-path svelte-13zy71l">${escape_html(entry.output)}</code></div>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--> `);
				if (entry.files && entry.files.length > 0) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<div class="artifact-files svelte-13zy71l"><!--[-->`);
					const each_array_4 = ensure_array_like(entry.files);
					for (let $$index_3 = 0, $$length = each_array_4.length; $$index_3 < $$length; $$index_3++) {
						let f = each_array_4[$$index_3];
						$$renderer.push(`<code class="artifact-file svelte-13zy71l">${escape_html(basename(f))}</code>`);
					}
					$$renderer.push(`<!--]--></div>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--></article>`);
			}
			$$renderer.push(`<!--]--></div></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--> `);
		if (linkedCommits() && linkedCommits().length > 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="commits-section"><span class="section-label svelte-13zy71l">Git commits <span class="section-meta svelte-13zy71l">${escape_html(linkedCommits().length)}</span></span> <ol class="commits-list svelte-13zy71l"><!--[-->`);
			const each_array_5 = ensure_array_like(linkedCommits());
			for (let $$index_6 = 0, $$length = each_array_5.length; $$index_6 < $$length; $$index_6++) {
				let commit = each_array_5[$$index_6];
				$$renderer.push(`<li class="commit-item svelte-13zy71l"><code class="commit-sha svelte-13zy71l">${escape_html(commit.sha)}</code> <span class="commit-subject svelte-13zy71l">${escape_html(commit.subject)}</span> `);
				if (commit.date) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<time class="commit-date svelte-13zy71l">${escape_html(formatDateShort(commit.date))}</time>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--> `);
				if (commit.files && commit.files.length > 0) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<div class="commit-files svelte-13zy71l"><!--[-->`);
					const each_array_6 = ensure_array_like(commit.files.slice(0, 6));
					for (let $$index_5 = 0, $$length = each_array_6.length; $$index_5 < $$length; $$index_5++) {
						let f = each_array_6[$$index_5];
						$$renderer.push(`<code class="commit-file svelte-13zy71l">${escape_html(f)}</code>`);
					}
					$$renderer.push(`<!--]--> `);
					if (commit.files.length > 6) {
						$$renderer.push("<!--[0-->");
						$$renderer.push(`<span class="commit-files-more svelte-13zy71l">+${escape_html(commit.files.length - 6)}</span>`);
					} else $$renderer.push("<!--[-1-->");
					$$renderer.push(`<!--]--></div>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--></li>`);
			}
			$$renderer.push(`<!--]--></ol></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--></div> <aside class="detail-side svelte-13zy71l">`);
		if (task().upstream.length > 0 || task().downstream.length > 0) {
			$$renderer.push("<!--[0-->");
			const depNodes = buildDepNodes();
			const depEdges = buildDepEdges();
			$$renderer.push(`<section class="side-section svelte-13zy71l"><span class="section-label svelte-13zy71l">Dependency graph</span> `);
			Card($$renderer, {
				padding: "cozy",
				elevation: 0,
				children: ($$renderer) => {
					TaskDepGraph($$renderer, {
						nodes: depNodes,
						edges: depEdges,
						height: "260px"
					});
				}});
			$$renderer.push(`<!----></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--> `);
		if (task().upstream.length > 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="side-section svelte-13zy71l"><span class="section-label dep-label dep-blocked svelte-13zy71l">↑ Blocked by <span class="section-meta svelte-13zy71l">${escape_html(task().upstream.length)}</span></span> <ul class="dep-list svelte-13zy71l"><!--[-->`);
			const each_array_7 = ensure_array_like(task().upstream);
			for (let $$index_7 = 0, $$length = each_array_7.length; $$index_7 < $$length; $$index_7++) {
				let dep = each_array_7[$$index_7];
				$$renderer.push(`<li><a class="dep svelte-13zy71l"${attr("href", `/tasks/${dep.id}`)}>${escape_html(depRow(dep))}</a></li>`);
			}
			$$renderer.push(`<!--]--></ul></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--> `);
		if (task().downstream.length > 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="side-section svelte-13zy71l"><span class="section-label dep-label dep-blocking svelte-13zy71l">↓ Blocking <span class="section-meta svelte-13zy71l">${escape_html(task().downstream.length)}</span></span> <ul class="dep-list svelte-13zy71l"><!--[-->`);
			const each_array_8 = ensure_array_like(task().downstream);
			for (let $$index_8 = 0, $$length = each_array_8.length; $$index_8 < $$length; $$index_8++) {
				let dep = each_array_8[$$index_8];
				$$renderer.push(`<li><a class="dep svelte-13zy71l"${attr("href", `/tasks/${dep.id}`)}>${escape_html(depRow(dep))}</a></li>`);
			}
			$$renderer.push(`<!--]--></ul></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]-->  `);
		if (subtasks().length > 0) {
			$$renderer.push("<!--[0-->");
			$$renderer.push(`<section class="side-section svelte-13zy71l"><span class="section-label svelte-13zy71l">${escape_html(task().type === "epic" ? "Children" : "Subtasks")} <span class="section-meta svelte-13zy71l">${escape_html(doneSubtasks())}/${escape_html(subtasks().length)} · ${escape_html(subtaskPct())}%</span></span> <div class="subtask-progress svelte-13zy71l" aria-hidden="true"><div class="subtask-progress-fill svelte-13zy71l"${attr_style(`width: ${subtaskPct()}%`)}></div></div> <ul class="subtask-list svelte-13zy71l"><!--[-->`);
			const each_array_9 = ensure_array_like(subtasks());
			for (let $$index_9 = 0, $$length = each_array_9.length; $$index_9 < $$length; $$index_9++) {
				let sub = each_array_9[$$index_9];
				const gates = subtaskGates(sub);
				$$renderer.push(`<li><a class="subtask svelte-13zy71l"${attr("href", `/tasks/${sub.id}`)}>`);
				StatusBadge($$renderer, {
					status: toStatus(sub.status),
					compact: true
				});
				$$renderer.push(`<!----> <span class="subtask-id svelte-13zy71l">${escape_html(sub.id)}</span> <span class="subtask-title svelte-13zy71l">${escape_html(sub.title)}</span> <span class="subtask-gates svelte-13zy71l" aria-hidden="true"><span${attr_class("g-dot svelte-13zy71l", void 0, { "g-pass": gates.implemented })}>I</span> <span${attr_class("g-dot svelte-13zy71l", void 0, { "g-pass": gates.testsPassed })}>T</span> <span${attr_class("g-dot svelte-13zy71l", void 0, { "g-pass": gates.qaPassed })}>Q</span></span></a></li>`);
			}
			$$renderer.push(`<!--]--></ul></section>`);
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--> `);
		Card($$renderer, {
			padding: "cozy",
			elevation: 1,
			children: ($$renderer) => {
				$$renderer.push(`<dl class="meta-list svelte-13zy71l"><div class="meta-row svelte-13zy71l"><dt class="svelte-13zy71l">Created</dt> <dd class="svelte-13zy71l">${escape_html(formatDate(task().created_at))}</dd></div> <div class="meta-row svelte-13zy71l"><dt class="svelte-13zy71l">Updated</dt> <dd class="svelte-13zy71l">${escape_html(formatDate(task().updated_at))}</dd></div> `);
				if (task().completed_at) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<div class="meta-row svelte-13zy71l"><dt class="svelte-13zy71l">Completed</dt> <dd class="svelte-13zy71l">${escape_html(formatDate(task().completed_at))}</dd></div>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--> `);
				if (task().phase) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<div class="meta-row svelte-13zy71l"><dt class="svelte-13zy71l">Phase</dt> <dd class="svelte-13zy71l">${escape_html(task().phase)}</dd></div>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--> `);
				if (task().labels && task().labels.length > 0) {
					$$renderer.push("<!--[0-->");
					$$renderer.push(`<div class="meta-row svelte-13zy71l"><dt class="svelte-13zy71l">Labels</dt> <dd class="svelte-13zy71l"><div class="label-chips svelte-13zy71l"><!--[-->`);
					const each_array_10 = ensure_array_like(task().labels);
					for (let $$index_10 = 0, $$length = each_array_10.length; $$index_10 < $$length; $$index_10++) {
						let lbl = each_array_10[$$index_10];
						Badge($$renderer, {
							tone: "neutral",
							size: "sm",
							children: ($$renderer) => {
								$$renderer.push(`<!---->${escape_html(lbl)}`);
							}});
					}
					$$renderer.push(`<!--]--></div></dd></div>`);
				} else $$renderer.push("<!--[-1-->");
				$$renderer.push(`<!--]--></dl>`);
			}});
		$$renderer.push(`<!----> <div class="sidebar-nav svelte-13zy71l">`);
		Button($$renderer, {
			variant: "ghost",
			size: "sm",
			href: "/tasks",
			block: true,
			children: ($$renderer) => {
				$$renderer.push(`<!---->← All Tasks`);
			}});
		$$renderer.push(`<!----> `);
		if (task().type === "epic") {
			$$renderer.push("<!--[0-->");
			Button($$renderer, {
				variant: "ghost",
				size: "sm",
				href: `/tasks?hierarchy=${task().id}`,
				block: true,
				children: ($$renderer) => {
					$$renderer.push(`<!---->View as tree`);
				}});
		} else $$renderer.push("<!--[-1-->");
		$$renderer.push(`<!--]--></div></aside></div></div>`);
	});
}

export { _page as default };
//# sourceMappingURL=_page.svelte-DUs_3y9B.js.map
