import { a as usePage, n as head_default, o as vue_exports, s as router } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { t as AdminLayout_default } from "./AdminLayout-DJaJT5Cr.js";
//#region resources/js/Pages/Admin/Backups.vue?vue&type=script&setup=true&lang.ts
var field = "mt-1 w-full rounded-lg border-line bg-appbg text-ink focus:border-primary focus:ring-primary text-sm";
var Backups_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "Backups",
	__ssrInlineRender: true,
	props: {
		available: { type: Boolean },
		reason: {},
		driver: {},
		offsiteConfigured: { type: Boolean },
		running: { type: Boolean },
		status: {},
		last: {},
		backups: {},
		settings: {}
	},
	setup(__props) {
		const props = __props;
		const page = usePage();
		const flash = (0, vue_exports.computed)(() => page.props.flash?.status);
		const live = (0, vue_exports.reactive)({
			running: props.running,
			status: props.status,
			last: props.last,
			backups: props.backups
		});
		const settings = (0, vue_exports.reactive)({ ...props.settings });
		const uploadFile = (0, vue_exports.ref)(null);
		let timer = null;
		async function poll() {
			if (timer) return;
			const tick = async () => {
				try {
					const d = await (await fetch("/admin/backups/status", { headers: { Accept: "application/json" } })).json();
					live.running = d.running;
					live.status = d.status;
					live.last = d.last;
					live.backups = d.backups;
					if (!d.running) stop();
				} catch {}
			};
			await tick();
			timer = window.setInterval(tick, 2500);
		}
		function stop() {
			if (timer) {
				clearInterval(timer);
				timer = null;
			}
		}
		(0, vue_exports.onBeforeUnmount)(stop);
		if (props.running) poll();
		function backupNow() {
			router.post("/admin/backups/run", {}, {
				preserveScroll: true,
				onSuccess: () => {
					live.running = true;
					poll();
				}
			});
		}
		function confirmRestore() {
			return window.prompt(t("Restoring REPLACES your entire database with this backup. A safety snapshot of the current database is taken first. Type RESTORE to continue.")) === "RESTORE" ? "RESTORE" : null;
		}
		function restoreNamed(name) {
			const confirm = confirmRestore();
			if (!confirm) return;
			router.post("/admin/backups/restore", {
				name,
				confirm
			}, {
				preserveScroll: true,
				onSuccess: () => {
					live.running = true;
					poll();
				}
			});
		}
		function restoreUpload() {
			if (!uploadFile.value) return;
			const confirm = confirmRestore();
			if (!confirm) return;
			router.post("/admin/backups/restore", {
				file: uploadFile.value,
				confirm
			}, {
				forceFormData: true,
				preserveScroll: true,
				onSuccess: () => {
					live.running = true;
					uploadFile.value = null;
					poll();
				}
			});
		}
		function destroy(name) {
			if (!window.confirm(t("Delete this backup? This cannot be undone."))) return;
			router.delete(`/admin/backups/${encodeURIComponent(name)}`, { preserveScroll: true });
		}
		function saveSettings() {
			router.post("/admin/backups/settings", { ...settings }, { preserveScroll: true });
		}
		function fmtSize(b) {
			if (b < 1024) return `${b} B`;
			if (b < 1024 * 1024) return `${(b / 1024).toFixed(1)} KB`;
			return `${(b / 1024 / 1024).toFixed(1)} MB`;
		}
		function fmtDate(iso) {
			try {
				return new Date(iso).toLocaleString();
			} catch {
				return iso;
			}
		}
		const onFile = (e) => {
			uploadFile.value = e.target.files?.[0] ?? null;
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(head_default), { title: (0, vue_exports.unref)(t)("Admin · Backups") }, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(AdminLayout_default, null, {
				title: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Backups"))}`);
					else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Backups")), 1)];
				}),
				subtitle: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Download, restore, and schedule database backups"))}`);
					else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Download, restore, and schedule database backups")), 1)];
				}),
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) {
						if (flash.value) _push(`<div class="mb-5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-300"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(flash.value)}</div>`);
						else _push(`<!---->`);
						if (!__props.available) {
							_push(`<div class="mb-5 rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-300"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Backups are not available on this host."))}`);
							if (__props.reason) _push(`<span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(__props.reason)}</span>`);
							else _push(`<!---->`);
							_push(`</div>`);
						} else _push(`<!---->`);
						_push(`<div class="grid gap-6 lg:grid-cols-2"${_scopeId}><section class="rounded-2xl border border-line bg-surface p-5"${_scopeId}><div class="flex items-center justify-between gap-3"${_scopeId}><div${_scopeId}><h3 class="text-sm font-bold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Database backups"))}</h3><p class="mt-0.5 text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Engine: {driver}", { driver: __props.driver }))}</p></div><button type="button"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(!__props.available || live.running) ? " disabled" : ""} class="rounded-lg bg-primary px-3 py-2 text-sm font-bold text-white disabled:opacity-50"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(live.running ? (0, vue_exports.unref)(t)("Working…") : (0, vue_exports.unref)(t)("Back up now"))}</button></div>`);
						if (live.running) _push(`<div class="mt-3 flex items-center gap-2 text-sm text-ink-2"${_scopeId}><span class="h-2 w-2 animate-pulse rounded-full bg-primary"${_scopeId}></span>${(0, server_renderer_exports.ssrInterpolate)(live.status || (0, vue_exports.unref)(t)("Working…"))}</div>`);
						else if (live.last) _push(`<div class="${(0, server_renderer_exports.ssrRenderClass)([live.last.ok ? "text-emerald-400" : "text-rose-400", "mt-3 text-sm"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(live.last.message)}</div>`);
						else _push(`<!---->`);
						_push(`<ul class="mt-4 divide-y divide-line"${_scopeId}><!--[-->`);
						(0, server_renderer_exports.ssrRenderList)(live.backups, (b) => {
							_push(`<li class="flex items-center gap-3 py-2.5"${_scopeId}><div class="min-w-0 flex-1"${_scopeId}><div class="flex items-center gap-2"${_scopeId}><span class="truncate text-sm font-medium text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(b.name)}</span>`);
							if (b.kind === "safety") _push(`<span class="rounded-full bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-bold uppercase text-amber-400"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("safety"))}</span>`);
							else _push(`<!---->`);
							if (b.offsite) _push(`<span class="rounded-full bg-sky-500/15 px-1.5 py-0.5 text-[10px] font-bold uppercase text-sky-400"${(0, server_renderer_exports.ssrRenderAttr)("title", (0, vue_exports.unref)(t)("Mirrored offsite"))}${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("offsite"))}</span>`);
							else _push(`<!---->`);
							_push(`</div><div class="text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(fmtSize(b.size))} · ${(0, server_renderer_exports.ssrInterpolate)(fmtDate(b.created_at))}</div></div><a${(0, server_renderer_exports.ssrRenderAttr)("href", `/admin/backups/${encodeURIComponent(b.name)}/download`)} class="rounded-lg border border-line px-2.5 py-1.5 text-xs font-bold text-ink-2 hover:border-primary/50"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Download"))}</a><button type="button"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(!__props.available || live.running) ? " disabled" : ""} class="rounded-lg border border-line px-2.5 py-1.5 text-xs font-bold text-ink-2 hover:border-primary/50 disabled:opacity-50"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Restore"))}</button><button type="button" class="rounded-lg border border-rose-500/30 px-2.5 py-1.5 text-xs font-bold text-rose-400 hover:bg-rose-500/10"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Delete"))}</button></li>`);
						});
						_push(`<!--]-->`);
						if (!live.backups.length) _push(`<li class="py-6 text-center text-sm text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("No backups yet."))}</li>`);
						else _push(`<!---->`);
						_push(`</ul></section><div class="flex flex-col gap-6"${_scopeId}><section class="rounded-2xl border border-line bg-surface p-5"${_scopeId}><h3 class="text-sm font-bold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Restore from a file"))}</h3><p class="mt-1 text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Upload a .gz backup created by Convoro. This replaces your database — a safety snapshot is taken first."))}</p><input type="file" accept=".gz" class="${(0, server_renderer_exports.ssrRenderClass)(field)}"${_scopeId}><button type="button"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(!__props.available || live.running || !uploadFile.value) ? " disabled" : ""} class="mt-3 rounded-lg border border-rose-500/40 px-3 py-2 text-sm font-bold text-rose-300 hover:bg-rose-500/10 disabled:opacity-50"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Restore from upload"))}</button></section><section class="rounded-2xl border border-line bg-surface p-5"${_scopeId}><h3 class="text-sm font-bold text-ink"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Scheduled backups"))}</h3><label class="mt-3 flex items-center gap-2 text-sm text-ink-2"${_scopeId}><input type="checkbox"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray(settings.enabled) ? (0, server_renderer_exports.ssrLooseContain)(settings.enabled, null) : settings.enabled) ? " checked" : ""} class="rounded border-line text-primary focus:ring-primary"${_scopeId}> ${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Automatically back up on a schedule"))}</label><div class="mt-3 grid grid-cols-2 gap-3"${_scopeId}><label class="text-sm text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Frequency"))} <select class="${(0, server_renderer_exports.ssrRenderClass)(field)}"${_scopeId}><option value="daily"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray(settings.frequency) ? (0, server_renderer_exports.ssrLooseContain)(settings.frequency, "daily") : (0, server_renderer_exports.ssrLooseEqual)(settings.frequency, "daily")) ? " selected" : ""}${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Daily"))}</option><option value="weekly"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray(settings.frequency) ? (0, server_renderer_exports.ssrLooseContain)(settings.frequency, "weekly") : (0, server_renderer_exports.ssrLooseEqual)(settings.frequency, "weekly")) ? " selected" : ""}${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Weekly"))}</option></select></label><label class="text-sm text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Keep last"))} <input type="number" min="1" max="365"${(0, server_renderer_exports.ssrRenderAttr)("value", settings.retention)} class="${(0, server_renderer_exports.ssrRenderClass)(field)}"${_scopeId}></label></div><label class="${(0, server_renderer_exports.ssrRenderClass)([__props.offsiteConfigured ? "text-ink-2" : "text-ink-muted", "mt-3 flex items-center gap-2 text-sm"])}"${_scopeId}><input type="checkbox"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray(settings.offsite) ? (0, server_renderer_exports.ssrLooseContain)(settings.offsite, null) : settings.offsite) ? " checked" : ""}${(0, server_renderer_exports.ssrIncludeBooleanAttr)(!__props.offsiteConfigured) ? " disabled" : ""} class="rounded border-line text-primary focus:ring-primary disabled:opacity-50"${_scopeId}> ${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Also store backups offsite (S3)"))}</label>`);
						if (!__props.offsiteConfigured) _push(`<p class="mt-1 text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Configure an S3-compatible bucket (AWS_* in your environment) to enable offsite backups."))}</p>`);
						else _push(`<!---->`);
						_push(`<button type="button" class="mt-4 rounded-lg bg-primary px-3 py-2 text-sm font-bold text-white"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Save"))}</button></section></div></div>`);
					} else return [
						flash.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 0,
							class: "mb-5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-300"
						}, (0, vue_exports.toDisplayString)(flash.value), 1)) : (0, vue_exports.createCommentVNode)("", true),
						!__props.available ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
							key: 1,
							class: "mb-5 rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-300"
						}, [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Backups are not available on this host.")), 1), __props.reason ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", { key: 0 }, (0, vue_exports.toDisplayString)(__props.reason), 1)) : (0, vue_exports.createCommentVNode)("", true)])) : (0, vue_exports.createCommentVNode)("", true),
						(0, vue_exports.createVNode)("div", { class: "grid gap-6 lg:grid-cols-2" }, [(0, vue_exports.createVNode)("section", { class: "rounded-2xl border border-line bg-surface p-5" }, [
							(0, vue_exports.createVNode)("div", { class: "flex items-center justify-between gap-3" }, [(0, vue_exports.createVNode)("div", null, [(0, vue_exports.createVNode)("h3", { class: "text-sm font-bold text-ink" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Database backups")), 1), (0, vue_exports.createVNode)("p", { class: "mt-0.5 text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Engine: {driver}", { driver: __props.driver })), 1)]), (0, vue_exports.createVNode)("button", {
								type: "button",
								disabled: !__props.available || live.running,
								onClick: backupNow,
								class: "rounded-lg bg-primary px-3 py-2 text-sm font-bold text-white disabled:opacity-50"
							}, (0, vue_exports.toDisplayString)(live.running ? (0, vue_exports.unref)(t)("Working…") : (0, vue_exports.unref)(t)("Back up now")), 9, ["disabled"])]),
							live.running ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
								key: 0,
								class: "mt-3 flex items-center gap-2 text-sm text-ink-2"
							}, [(0, vue_exports.createVNode)("span", { class: "h-2 w-2 animate-pulse rounded-full bg-primary" }), (0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)(live.status || (0, vue_exports.unref)(t)("Working…")), 1)])) : live.last ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
								key: 1,
								class: ["mt-3 text-sm", live.last.ok ? "text-emerald-400" : "text-rose-400"]
							}, (0, vue_exports.toDisplayString)(live.last.message), 3)) : (0, vue_exports.createCommentVNode)("", true),
							(0, vue_exports.createVNode)("ul", { class: "mt-4 divide-y divide-line" }, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(live.backups, (b) => {
								return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("li", {
									key: b.name,
									class: "flex items-center gap-3 py-2.5"
								}, [
									(0, vue_exports.createVNode)("div", { class: "min-w-0 flex-1" }, [(0, vue_exports.createVNode)("div", { class: "flex items-center gap-2" }, [
										(0, vue_exports.createVNode)("span", { class: "truncate text-sm font-medium text-ink" }, (0, vue_exports.toDisplayString)(b.name), 1),
										b.kind === "safety" ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
											key: 0,
											class: "rounded-full bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-bold uppercase text-amber-400"
										}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("safety")), 1)) : (0, vue_exports.createCommentVNode)("", true),
										b.offsite ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
											key: 1,
											class: "rounded-full bg-sky-500/15 px-1.5 py-0.5 text-[10px] font-bold uppercase text-sky-400",
											title: (0, vue_exports.unref)(t)("Mirrored offsite")
										}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("offsite")), 9, ["title"])) : (0, vue_exports.createCommentVNode)("", true)
									]), (0, vue_exports.createVNode)("div", { class: "text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)(fmtSize(b.size)) + " · " + (0, vue_exports.toDisplayString)(fmtDate(b.created_at)), 1)]),
									(0, vue_exports.createVNode)("a", {
										href: `/admin/backups/${encodeURIComponent(b.name)}/download`,
										class: "rounded-lg border border-line px-2.5 py-1.5 text-xs font-bold text-ink-2 hover:border-primary/50"
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Download")), 9, ["href"]),
									(0, vue_exports.createVNode)("button", {
										type: "button",
										disabled: !__props.available || live.running,
										onClick: ($event) => restoreNamed(b.name),
										class: "rounded-lg border border-line px-2.5 py-1.5 text-xs font-bold text-ink-2 hover:border-primary/50 disabled:opacity-50"
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Restore")), 9, ["disabled", "onClick"]),
									(0, vue_exports.createVNode)("button", {
										type: "button",
										onClick: ($event) => destroy(b.name),
										class: "rounded-lg border border-rose-500/30 px-2.5 py-1.5 text-xs font-bold text-rose-400 hover:bg-rose-500/10"
									}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Delete")), 9, ["onClick"])
								]);
							}), 128)), !live.backups.length ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("li", {
								key: 0,
								class: "py-6 text-center text-sm text-ink-muted"
							}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("No backups yet.")), 1)) : (0, vue_exports.createCommentVNode)("", true)])
						]), (0, vue_exports.createVNode)("div", { class: "flex flex-col gap-6" }, [(0, vue_exports.createVNode)("section", { class: "rounded-2xl border border-line bg-surface p-5" }, [
							(0, vue_exports.createVNode)("h3", { class: "text-sm font-bold text-ink" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Restore from a file")), 1),
							(0, vue_exports.createVNode)("p", { class: "mt-1 text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Upload a .gz backup created by Convoro. This replaces your database — a safety snapshot is taken first.")), 1),
							(0, vue_exports.createVNode)("input", {
								type: "file",
								accept: ".gz",
								onChange: onFile,
								class: field
							}, null, 32),
							(0, vue_exports.createVNode)("button", {
								type: "button",
								disabled: !__props.available || live.running || !uploadFile.value,
								onClick: restoreUpload,
								class: "mt-3 rounded-lg border border-rose-500/40 px-3 py-2 text-sm font-bold text-rose-300 hover:bg-rose-500/10 disabled:opacity-50"
							}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Restore from upload")), 9, ["disabled"])
						]), (0, vue_exports.createVNode)("section", { class: "rounded-2xl border border-line bg-surface p-5" }, [
							(0, vue_exports.createVNode)("h3", { class: "text-sm font-bold text-ink" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Scheduled backups")), 1),
							(0, vue_exports.createVNode)("label", { class: "mt-3 flex items-center gap-2 text-sm text-ink-2" }, [(0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
								type: "checkbox",
								"onUpdate:modelValue": ($event) => settings.enabled = $event,
								class: "rounded border-line text-primary focus:ring-primary"
							}, null, 8, ["onUpdate:modelValue"]), [[vue_exports.vModelCheckbox, settings.enabled]]), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Automatically back up on a schedule")), 1)]),
							(0, vue_exports.createVNode)("div", { class: "mt-3 grid grid-cols-2 gap-3" }, [(0, vue_exports.createVNode)("label", { class: "text-sm text-ink-2" }, [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Frequency")) + " ", 1), (0, vue_exports.withDirectives)((0, vue_exports.createVNode)("select", {
								"onUpdate:modelValue": ($event) => settings.frequency = $event,
								class: field
							}, [(0, vue_exports.createVNode)("option", { value: "daily" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Daily")), 1), (0, vue_exports.createVNode)("option", { value: "weekly" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Weekly")), 1)], 8, ["onUpdate:modelValue"]), [[vue_exports.vModelSelect, settings.frequency]])]), (0, vue_exports.createVNode)("label", { class: "text-sm text-ink-2" }, [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Keep last")) + " ", 1), (0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
								type: "number",
								min: "1",
								max: "365",
								"onUpdate:modelValue": ($event) => settings.retention = $event,
								class: field
							}, null, 8, ["onUpdate:modelValue"]), [[
								vue_exports.vModelText,
								settings.retention,
								void 0,
								{ number: true }
							]])])]),
							(0, vue_exports.createVNode)("label", { class: ["mt-3 flex items-center gap-2 text-sm", __props.offsiteConfigured ? "text-ink-2" : "text-ink-muted"] }, [(0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
								type: "checkbox",
								"onUpdate:modelValue": ($event) => settings.offsite = $event,
								disabled: !__props.offsiteConfigured,
								class: "rounded border-line text-primary focus:ring-primary disabled:opacity-50"
							}, null, 8, ["onUpdate:modelValue", "disabled"]), [[vue_exports.vModelCheckbox, settings.offsite]]), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Also store backups offsite (S3)")), 1)], 2),
							!__props.offsiteConfigured ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
								key: 0,
								class: "mt-1 text-xs text-ink-muted"
							}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Configure an S3-compatible bucket (AWS_* in your environment) to enable offsite backups.")), 1)) : (0, vue_exports.createCommentVNode)("", true),
							(0, vue_exports.createVNode)("button", {
								type: "button",
								onClick: saveSettings,
								class: "mt-4 rounded-lg bg-primary px-3 py-2 text-sm font-bold text-white"
							}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Save")), 1)
						])])])
					];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Admin/Backups.vue
var _sfc_setup = Backups_vue_vue_type_script_setup_true_lang_default.setup;
Backups_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
	const ssrContext = (0, vue_exports.useSSRContext)();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Admin/Backups.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Backups_default = Backups_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Backups_default as default };
