import { t as AdminLayout_default } from "./AdminLayout-DcKfAlG1.js";
import { Head, router, useForm } from "@inertiajs/vue3";
import { Fragment, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelSelect, vModelText, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { Calendar, Edit2, Plus, Tag, ToggleLeft, ToggleRight, Trash2, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Vouchers/Index.vue?vue&type=script&setup=true&lang.ts
var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
	__name: "Index",
	__ssrInlineRender: true,
	props: { vouchers: {} },
	setup(__props) {
		const isFormModalOpen = ref(false);
		const editingVoucher = ref(null);
		const form = useForm({
			code: "",
			type: "percent",
			value: 0,
			max_discount: "",
			min_purchase: 0,
			expires_at: "",
			usage_limit: "",
			is_active: true
		});
		const openCreateModal = () => {
			editingVoucher.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const openEditModal = (voucher) => {
			editingVoucher.value = voucher;
			form.clearErrors();
			form.code = voucher.code;
			form.type = voucher.type;
			form.value = voucher.value;
			form.max_discount = voucher.max_discount !== null ? String(voucher.max_discount) : "";
			form.min_purchase = voucher.min_purchase;
			form.expires_at = voucher.expires_at ? voucher.expires_at.substring(0, 10) : "";
			form.usage_limit = voucher.usage_limit !== null ? String(voucher.usage_limit) : "";
			form.is_active = voucher.is_active;
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			const payload = {
				...form.data(),
				code: form.code.toUpperCase(),
				max_discount: form.max_discount ? Number(form.max_discount) : null,
				usage_limit: form.usage_limit ? Number(form.usage_limit) : null,
				expires_at: form.expires_at || null
			};
			if (editingVoucher.value) router.put(route("vouchers.update", editingVoucher.value.id), payload, { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else router.post(route("vouchers.store"), payload, { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const toggleVoucherStatus = (voucher) => {
			router.put(route("vouchers.update", voucher.id), {
				code: voucher.code,
				type: voucher.type,
				value: voucher.value,
				max_discount: voucher.max_discount,
				min_purchase: voucher.min_purchase,
				expires_at: voucher.expires_at ? voucher.expires_at.substring(0, 10) : null,
				usage_limit: voucher.usage_limit,
				is_active: !voucher.is_active
			});
		};
		const deleteVoucher = (voucher) => {
			if (confirm(`Apakah Anda yakin ingin menghapus voucher ${voucher.code}?`)) router.delete(route("vouchers.destroy", voucher.id));
		};
		const formatValue = (voucher) => {
			if (voucher.type === "percent") return `${Number(voucher.value)}%`;
			return `Rp ${Number(voucher.value).toLocaleString("id-ID")}`;
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Manajemen Voucher" }, null, _parent));
			_push(ssrRenderComponent(AdminLayout_default, null, {
				default: withCtx((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(`<div class="space-y-6"${_scopeId}><div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-extrabold text-slate-900 dark:text-slate-50 tracking-tight"${_scopeId}> Manajemen Voucher Belanja </h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Buat kupon promosi kustom dengan batasan kuota, minimal transaksi, dan masa berlaku. </p></div><button class="flex items-center justify-center gap-2 px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white text-sm font-bold rounded-xl transition-all cursor-pointer shadow-lg shadow-[#8c5a3c]/10"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Plus), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(` Tambah Voucher </button></div>`);
						if (__props.vouchers.length > 0) {
							_push(`<div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden"${_scopeId}><div class="overflow-x-auto"${_scopeId}><table class="w-full text-left border-collapse"${_scopeId}><thead${_scopeId}><tr class="border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50"${_scopeId}><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Kode Voucher</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Tipe</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Potongan</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Min. Belanja</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Penggunaan</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Berlaku S/D</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Status</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right"${_scopeId}>Aksi</th></tr></thead><tbody class="divide-y divide-slate-100 dark:divide-slate-800"${_scopeId}><!--[-->`);
							ssrRenderList(__props.vouchers, (voucher) => {
								_push(`<tr class="hover:bg-slate-50/30 dark:hover:bg-slate-800/10"${_scopeId}><td class="px-6 py-4"${_scopeId}><div class="flex items-center gap-2.5"${_scopeId}><div class="h-8 w-8 rounded-xl bg-[#8c5a3c]/10 text-[#8c5a3c] flex items-center justify-center"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Tag), { class: "h-4 w-4" }, null, _parent, _scopeId));
								_push(`</div><div${_scopeId}><span class="font-extrabold text-xs text-[#8c5a3c] uppercase block"${_scopeId}>${ssrInterpolate(voucher.code)}</span></div></div></td><td class="px-6 py-4 text-xs font-semibold text-slate-600 dark:text-slate-400"${_scopeId}>`);
								if (voucher.type === "percent") _push(`<span${_scopeId}>Persentase (%)</span>`);
								else if (voucher.type === "nominal") _push(`<span${_scopeId}>Nominal (Rp)</span>`);
								else _push(`<!---->`);
								_push(`</td><td class="px-6 py-4 text-xs font-bold text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(formatValue(voucher))}</td><td class="px-6 py-4 text-xs text-slate-550 dark:text-slate-350"${_scopeId}> Rp ${ssrInterpolate(Number(voucher.min_purchase).toLocaleString("id-ID"))}</td><td class="px-6 py-4 text-xs text-slate-550 dark:text-slate-350 font-semibold"${_scopeId}>${ssrInterpolate(voucher.usage_count)} / ${ssrInterpolate(voucher.usage_limit ? voucher.usage_limit : "∞")}</td><td class="px-6 py-4 text-[10px] text-slate-550 dark:text-slate-350"${_scopeId}><div class="flex items-center gap-1"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Calendar), { class: "h-3 w-3 text-slate-400" }, null, _parent, _scopeId));
								_push(`<span${_scopeId}>${ssrInterpolate(voucher.expires_at ? voucher.expires_at.substring(0, 10) : "Selamanya")}</span></div></td><td class="px-6 py-4"${_scopeId}><button class="cursor-pointer transition-colors"${_scopeId}>`);
								if (voucher.is_active) _push(ssrRenderComponent(unref(ToggleRight), { class: "h-6 w-6 text-[#8c5a3c]" }, null, _parent, _scopeId));
								else _push(ssrRenderComponent(unref(ToggleLeft), { class: "h-6 w-6 text-slate-300 dark:text-slate-600" }, null, _parent, _scopeId));
								_push(`</button></td><td class="px-6 py-4 text-right"${_scopeId}><div class="flex items-center justify-end gap-2"${_scopeId}><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-500 hover:text-slate-800 dark:hover:text-slate-200 rounded-lg cursor-pointer"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Edit2), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
								_push(`</button><button class="p-1.5 hover:bg-slate-105 dark:hover:bg-slate-800 text-slate-550 hover:text-rose-600 rounded-lg cursor-pointer"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Trash2), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
								_push(`</button></div></td></tr>`);
							});
							_push(`<!--]--></tbody></table></div></div>`);
						} else {
							_push(`<div class="text-center py-16 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Tag), { class: "h-10 w-10 text-slate-350 dark:text-slate-600 mx-auto mb-3" }, null, _parent, _scopeId));
							_push(`<h3 class="text-sm font-bold text-slate-800 dark:text-slate-200"${_scopeId}>Belum ada kupon voucher</h3><p class="text-xs text-slate-400 mt-1"${_scopeId}>Gunakan tombol di atas untuk membuat voucher diskon pertama Anda.</p></div>`);
						}
						if (isFormModalOpen.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"${_scopeId}><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl w-full max-w-md overflow-hidden transform transition-all"${_scopeId}><div class="px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><h3 class="text-sm font-extrabold text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(editingVoucher.value ? "Edit Voucher" : "Buat Voucher Baru")}</h3><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-400 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button></div><form class="p-6 space-y-4"${_scopeId}><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Kode Voucher</label><input type="text"${ssrRenderAttr("value", unref(form).code)} required placeholder="Contoh: MERDEKA50" class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] uppercase"${_scopeId}></div><div class="grid grid-cols-2 gap-4"${_scopeId}><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Tipe Potongan</label><select required class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"${_scopeId}><option value="percent"${ssrIncludeBooleanAttr(Array.isArray(unref(form).type) ? ssrLooseContain(unref(form).type, "percent") : ssrLooseEqual(unref(form).type, "percent")) ? " selected" : ""}${_scopeId}>Persentase (%)</option><option value="nominal"${ssrIncludeBooleanAttr(Array.isArray(unref(form).type) ? ssrLooseContain(unref(form).type, "nominal") : ssrLooseEqual(unref(form).type, "nominal")) ? " selected" : ""}${_scopeId}>Nominal (Rp)</option></select></div><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Nilai Diskon</label><input type="number"${ssrRenderAttr("value", unref(form).value)} required min="0" class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"${_scopeId}></div></div><div class="grid grid-cols-2 gap-4"${_scopeId}><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Maks. Potongan (Rp)</label><input type="number"${ssrRenderAttr("value", unref(form).max_discount)} placeholder="Tidak terbatas" min="0" class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"${_scopeId}></div><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-550 uppercase tracking-wider mb-1.5"${_scopeId}>Min. Belanja (Rp)</label><input type="number"${ssrRenderAttr("value", unref(form).min_purchase)} required min="0" class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"${_scopeId}></div></div><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-550 uppercase tracking-wider mb-1.5"${_scopeId}>Tanggal Kadaluarsa</label><input type="date"${ssrRenderAttr("value", unref(form).expires_at)} class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"${_scopeId}></div><div class="grid grid-cols-2 gap-4"${_scopeId}><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Kuota Limit</label><input type="number"${ssrRenderAttr("value", unref(form).usage_limit)} placeholder="Tidak terbatas" min="1" class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"${_scopeId}></div><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Status Aktif</label><select required class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"${_scopeId}><option${ssrRenderAttr("value", true)}${ssrIncludeBooleanAttr(Array.isArray(unref(form).is_active) ? ssrLooseContain(unref(form).is_active, true) : ssrLooseEqual(unref(form).is_active, true)) ? " selected" : ""}${_scopeId}>Aktif</option><option${ssrRenderAttr("value", false)}${ssrIncludeBooleanAttr(Array.isArray(unref(form).is_active) ? ssrLooseContain(unref(form).is_active, false) : ssrLooseEqual(unref(form).is_active, false)) ? " selected" : ""}${_scopeId}>Tidak Aktif</option></select></div></div><div class="pt-4 border-t border-slate-100 dark:border-slate-800 flex justify-end gap-3"${_scopeId}><button type="button" class="px-4 py-2 border border-slate-200 dark:border-slate-700 hover:bg-slate-50 dark:hover:bg-slate-800 text-slate-500 rounded-xl text-xs font-bold transition-all cursor-pointer"${_scopeId}> Batal </button><button type="submit"${ssrIncludeBooleanAttr(unref(form).processing) ? " disabled" : ""} class="px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white rounded-xl text-xs font-bold shadow-lg shadow-[#8c5a3c]/10 transition-all cursor-pointer"${_scopeId}>${ssrInterpolate(editingVoucher.value ? "Simpan Perubahan" : "Buat Voucher")}</button></div></form></div></div>`);
						} else _push(`<!---->`);
						_push(`</div>`);
					} else return [createVNode("div", { class: "space-y-6" }, [
						createVNode("div", { class: "flex flex-col sm:flex-row sm:items-center justify-between gap-4" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-extrabold text-slate-900 dark:text-slate-50 tracking-tight" }, " Manajemen Voucher Belanja "), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Buat kupon promosi kustom dengan batasan kuota, minimal transaksi, dan masa berlaku. ")]), createVNode("button", {
							onClick: openCreateModal,
							class: "flex items-center justify-center gap-2 px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white text-sm font-bold rounded-xl transition-all cursor-pointer shadow-lg shadow-[#8c5a3c]/10"
						}, [createVNode(unref(Plus), { class: "h-4 w-4" }), createTextVNode(" Tambah Voucher ")])]),
						__props.vouchers.length > 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden"
						}, [createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full text-left border-collapse" }, [createVNode("thead", null, [createVNode("tr", { class: "border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50" }, [
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Kode Voucher"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Tipe"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Potongan"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Min. Belanja"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Penggunaan"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Berlaku S/D"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Status"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right" }, "Aksi")
						])]), createVNode("tbody", { class: "divide-y divide-slate-100 dark:divide-slate-800" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.vouchers, (voucher) => {
							return openBlock(), createBlock("tr", {
								key: voucher.id,
								class: "hover:bg-slate-50/30 dark:hover:bg-slate-800/10"
							}, [
								createVNode("td", { class: "px-6 py-4" }, [createVNode("div", { class: "flex items-center gap-2.5" }, [createVNode("div", { class: "h-8 w-8 rounded-xl bg-[#8c5a3c]/10 text-[#8c5a3c] flex items-center justify-center" }, [createVNode(unref(Tag), { class: "h-4 w-4" })]), createVNode("div", null, [createVNode("span", { class: "font-extrabold text-xs text-[#8c5a3c] uppercase block" }, toDisplayString(voucher.code), 1)])])]),
								createVNode("td", { class: "px-6 py-4 text-xs font-semibold text-slate-600 dark:text-slate-400" }, [voucher.type === "percent" ? (openBlock(), createBlock("span", { key: 0 }, "Persentase (%)")) : voucher.type === "nominal" ? (openBlock(), createBlock("span", { key: 1 }, "Nominal (Rp)")) : createCommentVNode("", true)]),
								createVNode("td", { class: "px-6 py-4 text-xs font-bold text-slate-800 dark:text-slate-200" }, toDisplayString(formatValue(voucher)), 1),
								createVNode("td", { class: "px-6 py-4 text-xs text-slate-550 dark:text-slate-350" }, " Rp " + toDisplayString(Number(voucher.min_purchase).toLocaleString("id-ID")), 1),
								createVNode("td", { class: "px-6 py-4 text-xs text-slate-550 dark:text-slate-350 font-semibold" }, toDisplayString(voucher.usage_count) + " / " + toDisplayString(voucher.usage_limit ? voucher.usage_limit : "∞"), 1),
								createVNode("td", { class: "px-6 py-4 text-[10px] text-slate-550 dark:text-slate-350" }, [createVNode("div", { class: "flex items-center gap-1" }, [createVNode(unref(Calendar), { class: "h-3 w-3 text-slate-400" }), createVNode("span", null, toDisplayString(voucher.expires_at ? voucher.expires_at.substring(0, 10) : "Selamanya"), 1)])]),
								createVNode("td", { class: "px-6 py-4" }, [createVNode("button", {
									onClick: ($event) => toggleVoucherStatus(voucher),
									class: "cursor-pointer transition-colors"
								}, [voucher.is_active ? (openBlock(), createBlock(unref(ToggleRight), {
									key: 0,
									class: "h-6 w-6 text-[#8c5a3c]"
								})) : (openBlock(), createBlock(unref(ToggleLeft), {
									key: 1,
									class: "h-6 w-6 text-slate-300 dark:text-slate-600"
								}))], 8, ["onClick"])]),
								createVNode("td", { class: "px-6 py-4 text-right" }, [createVNode("div", { class: "flex items-center justify-end gap-2" }, [createVNode("button", {
									onClick: ($event) => openEditModal(voucher),
									class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-500 hover:text-slate-800 dark:hover:text-slate-200 rounded-lg cursor-pointer"
								}, [createVNode(unref(Edit2), { class: "h-3.5 w-3.5" })], 8, ["onClick"]), createVNode("button", {
									onClick: ($event) => deleteVoucher(voucher),
									class: "p-1.5 hover:bg-slate-105 dark:hover:bg-slate-800 text-slate-550 hover:text-rose-600 rounded-lg cursor-pointer"
								}, [createVNode(unref(Trash2), { class: "h-3.5 w-3.5" })], 8, ["onClick"])])])
							]);
						}), 128))])])])])) : (openBlock(), createBlock("div", {
							key: 1,
							class: "text-center py-16 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm"
						}, [
							createVNode(unref(Tag), { class: "h-10 w-10 text-slate-350 dark:text-slate-600 mx-auto mb-3" }),
							createVNode("h3", { class: "text-sm font-bold text-slate-800 dark:text-slate-200" }, "Belum ada kupon voucher"),
							createVNode("p", { class: "text-xs text-slate-400 mt-1" }, "Gunakan tombol di atas untuk membuat voucher diskon pertama Anda.")
						])),
						isFormModalOpen.value ? (openBlock(), createBlock("div", {
							key: 2,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl w-full max-w-md overflow-hidden transform transition-all" }, [createVNode("div", { class: "px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("h3", { class: "text-sm font-extrabold text-slate-900 dark:text-slate-100" }, toDisplayString(editingVoucher.value ? "Edit Voucher" : "Buat Voucher Baru"), 1), createVNode("button", {
							onClick: ($event) => isFormModalOpen.value = false,
							class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-400 cursor-pointer"
						}, [createVNode(unref(X), { class: "h-4 w-4" })], 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitForm, ["prevent"]),
							class: "p-6 space-y-4"
						}, [
							createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Kode Voucher"), withDirectives(createVNode("input", {
								type: "text",
								"onUpdate:modelValue": ($event) => unref(form).code = $event,
								required: "",
								placeholder: "Contoh: MERDEKA50",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] uppercase"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).code]])]),
							createVNode("div", { class: "grid grid-cols-2 gap-4" }, [createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Tipe Potongan"), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => unref(form).type = $event,
								required: "",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"
							}, [createVNode("option", { value: "percent" }, "Persentase (%)"), createVNode("option", { value: "nominal" }, "Nominal (Rp)")], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(form).type]])]), createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Nilai Diskon"), withDirectives(createVNode("input", {
								type: "number",
								"onUpdate:modelValue": ($event) => unref(form).value = $event,
								required: "",
								min: "0",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).value]])])]),
							createVNode("div", { class: "grid grid-cols-2 gap-4" }, [createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Maks. Potongan (Rp)"), withDirectives(createVNode("input", {
								type: "number",
								"onUpdate:modelValue": ($event) => unref(form).max_discount = $event,
								placeholder: "Tidak terbatas",
								min: "0",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).max_discount]])]), createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-550 uppercase tracking-wider mb-1.5" }, "Min. Belanja (Rp)"), withDirectives(createVNode("input", {
								type: "number",
								"onUpdate:modelValue": ($event) => unref(form).min_purchase = $event,
								required: "",
								min: "0",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).min_purchase]])])]),
							createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-550 uppercase tracking-wider mb-1.5" }, "Tanggal Kadaluarsa"), withDirectives(createVNode("input", {
								type: "date",
								"onUpdate:modelValue": ($event) => unref(form).expires_at = $event,
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).expires_at]])]),
							createVNode("div", { class: "grid grid-cols-2 gap-4" }, [createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Kuota Limit"), withDirectives(createVNode("input", {
								type: "number",
								"onUpdate:modelValue": ($event) => unref(form).usage_limit = $event,
								placeholder: "Tidak terbatas",
								min: "1",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).usage_limit]])]), createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Status Aktif"), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => unref(form).is_active = $event,
								required: "",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"
							}, [createVNode("option", { value: true }, "Aktif"), createVNode("option", { value: false }, "Tidak Aktif")], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(form).is_active]])])]),
							createVNode("div", { class: "pt-4 border-t border-slate-100 dark:border-slate-800 flex justify-end gap-3" }, [createVNode("button", {
								type: "button",
								onClick: ($event) => isFormModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-700 hover:bg-slate-50 dark:hover:bg-slate-800 text-slate-500 rounded-xl text-xs font-bold transition-all cursor-pointer"
							}, " Batal ", 8, ["onClick"]), createVNode("button", {
								type: "submit",
								disabled: unref(form).processing,
								class: "px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white rounded-xl text-xs font-bold shadow-lg shadow-[#8c5a3c]/10 transition-all cursor-pointer"
							}, toDisplayString(editingVoucher.value ? "Simpan Perubahan" : "Buat Voucher"), 9, ["disabled"])])
						], 32)])])) : createCommentVNode("", true)
					])];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Vouchers/Index.vue
var _sfc_setup = Index_vue_vue_type_script_setup_true_lang_default.setup;
Index_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
	const ssrContext = useSSRContext();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/CafePOS/Vouchers/Index.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Index_default = Index_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Index_default as default };
