import { a as usePage, i as useForm, l as __exportAll, o as vue_exports } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { t as InputLabel_default } from "./InputLabel-snijZdaZ.js";
import { t as PrimaryButton_default } from "./PrimaryButton-DxHqcA0d.js";
//#region resources/js/Pages/Profile/Partials/DigestPreferenceForm.vue?vue&type=script&setup=true&lang.ts
var DigestPreferenceForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "DigestPreferenceForm",
	__ssrInlineRender: true,
	setup(__props) {
		const u = usePage().props.auth?.user ?? {};
		const form = useForm({
			digest_frequency: u.digest_frequency ?? "weekly",
			notify_email: u.notify_email ?? true
		});
		const options = [
			{
				value: "off",
				label: t("Off"),
				hint: t("No digest emails.")
			},
			{
				value: "daily",
				label: t("Daily"),
				hint: t("A summary every morning.")
			},
			{
				value: "weekly",
				label: t("Weekly"),
				hint: t("A summary once a week.")
			}
		];
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<section${(0, server_renderer_exports.ssrRenderAttrs)(_attrs)}><header><h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Email digest"))}</h2><p class="mt-1 text-sm text-gray-600 dark:text-gray-400">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Choose how often we email you a summary of new topics and unread notifications."))}</p></header><form class="mt-6 space-y-6"><div>`);
			_push((0, server_renderer_exports.ssrRenderComponent)(InputLabel_default, { value: (0, vue_exports.unref)(t)("Frequency") }, null, _parent));
			_push(`<div class="mt-2 space-y-2"><!--[-->`);
			(0, server_renderer_exports.ssrRenderList)(options, (o) => {
				_push(`<label class="${(0, server_renderer_exports.ssrRenderClass)([(0, vue_exports.unref)(form).digest_frequency === o.value ? "border-indigo-500 ring-1 ring-indigo-500" : "", "flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700"])}"><input type="radio" class="mt-0.5 text-indigo-600 focus:ring-indigo-500"${(0, server_renderer_exports.ssrRenderAttr)("value", o.value)}${(0, server_renderer_exports.ssrIncludeBooleanAttr)((0, server_renderer_exports.ssrLooseEqual)((0, vue_exports.unref)(form).digest_frequency, o.value)) ? " checked" : ""}><span><span class="block text-sm font-medium text-gray-900 dark:text-gray-100">${(0, server_renderer_exports.ssrInterpolate)(o.label)}</span><span class="block text-sm text-gray-500 dark:text-gray-400">${(0, server_renderer_exports.ssrInterpolate)(o.hint)}</span></span></label>`);
			});
			_push(`<!--]--></div></div><label class="flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700"><input type="checkbox" class="mt-0.5 rounded text-indigo-600 focus:ring-indigo-500"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray((0, vue_exports.unref)(form).notify_email) ? (0, server_renderer_exports.ssrLooseContain)((0, vue_exports.unref)(form).notify_email, null) : (0, vue_exports.unref)(form).notify_email) ? " checked" : ""}><span><span class="block text-sm font-medium text-gray-900 dark:text-gray-100">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Instant email notifications"))}</span><span class="block text-sm text-gray-500 dark:text-gray-400">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Email me when someone replies to me, mentions me, posts on my profile, or sends a message."))}</span></span></label><div class="flex items-center gap-4">`);
			_push((0, server_renderer_exports.ssrRenderComponent)(PrimaryButton_default, { disabled: (0, vue_exports.unref)(form).processing }, {
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Save"))}`);
					else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Save")), 1)];
				}),
				_: 1
			}, _parent));
			if ((0, vue_exports.unref)(form).recentlySuccessful) _push(`<p class="text-sm text-gray-600 dark:text-gray-400">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Saved."))}</p>`);
			else _push(`<!---->`);
			_push(`</div></form></section>`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Profile/Partials/DigestPreferenceForm.vue
var DigestPreferenceForm_exports = /* @__PURE__ */ __exportAll({ default: () => DigestPreferenceForm_default });
var _sfc_setup = DigestPreferenceForm_vue_vue_type_script_setup_true_lang_default.setup;
DigestPreferenceForm_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/Profile/Partials/DigestPreferenceForm.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var DigestPreferenceForm_default = DigestPreferenceForm_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { DigestPreferenceForm_exports as n, DigestPreferenceForm_default as t };
