import { t as AdminLayout_default } from "./AdminLayout-CFTJa237.js";
import { Head, router, useForm } from "@inertiajs/vue3";
import { Fragment, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelCheckbox, vModelSelect, vModelText, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { Edit2, Plus, ShoppingBag, Tag, ToggleLeft, ToggleRight, Trash2, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Promos/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: {
		promos: {},
		products: {}
	},
	setup(__props) {
		const isFormModalOpen = ref(false);
		const editingPromo = ref(null);
		const form = useForm({
			name: "",
			type: "percent",
			value: 0,
			min_purchase: 0,
			product_id: "",
			is_active: true
		});
		const openCreateModal = () => {
			editingPromo.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const openEditModal = (promo) => {
			editingPromo.value = promo;
			form.clearErrors();
			form.name = promo.name;
			form.type = promo.type;
			form.value = promo.value;
			form.min_purchase = promo.min_purchase;
			form.product_id = promo.product_id ? String(promo.product_id) : "";
			form.is_active = promo.is_active;
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			const payload = {
				...form.data(),
				product_id: form.product_id ? Number(form.product_id) : null
			};
			if (editingPromo.value) router.put(route("promos.update", editingPromo.value.id), payload, { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else router.post(route("promos.store"), payload, { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const togglePromoStatus = (promo) => {
			router.put(route("promos.update", promo.id), {
				name: promo.name,
				type: promo.type,
				value: promo.value,
				min_purchase: promo.min_purchase,
				product_id: promo.product_id,
				is_active: !promo.is_active
			});
		};
		const deletePromo = (promo) => {
			if (confirm(`Apakah Anda yakin ingin menghapus promo ${promo.name}?`)) router.delete(route("promos.destroy", promo.id));
		};
		const formatValue = (promo) => {
			if (promo.type === "percent") return `${Number(promo.value)}%`;
			return `Rp ${Number(promo.value).toLocaleString("id-ID")}`;
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Promo Engine" }, 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}> Promo Engine </h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Buat dan atur program diskon nominal, persentase belanja, atau Buy One Get One (BOGO). </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 Promo </button></div>`);
						if (__props.promos.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}>Nama Promo</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Tipe Promo</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Nilai 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}>Berlaku Produk</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Status Aktif</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.promos, (promo) => {
								_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><span class="font-extrabold text-xs text-slate-850 dark:text-slate-100"${_scopeId}>${ssrInterpolate(promo.name)}</span></div></td><td class="px-6 py-4 text-xs font-semibold text-slate-600 dark:text-slate-400"${_scopeId}>`);
								if (promo.type === "percent") _push(`<span${_scopeId}>Persentase (%)</span>`);
								else if (promo.type === "nominal") _push(`<span${_scopeId}>Nominal (Rp)</span>`);
								else if (promo.type === "bogo") _push(`<span${_scopeId}>BOGO (Buy 1 Get 1)</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(promo))}</td><td class="px-6 py-4 text-xs text-slate-550 dark:text-slate-350"${_scopeId}> Rp ${ssrInterpolate(Number(promo.min_purchase).toLocaleString("id-ID"))}</td><td class="px-6 py-4"${_scopeId}>`);
								if (promo.product) {
									_push(`<div class="flex items-center gap-1.5 text-xs text-slate-600 dark:text-slate-400"${_scopeId}>`);
									_push(ssrRenderComponent(unref(ShoppingBag), { class: "h-3.5 w-3.5 text-[#8c5a3c]" }, null, _parent, _scopeId));
									_push(`<span${_scopeId}>${ssrInterpolate(promo.product.name)}</span></div>`);
								} else _push(`<span class="text-xs text-slate-400 italic"${_scopeId}>Semua Produk</span>`);
								_push(`</td><td class="px-6 py-4"${_scopeId}><button class="cursor-pointer transition-colors"${_scopeId}>`);
								if (promo.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 promo</h3><p class="text-xs text-slate-400 mt-1"${_scopeId}>Gunakan tombol di atas untuk membuat promosi 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(editingPromo.value ? "Edit Program Promo" : "Buat Program Promo 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}>Nama Kampanye Promo</label><input type="text"${ssrRenderAttr("value", unref(form).name)} required placeholder="Contoh: Diskon Kopi Akhir Pekan" 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}>Tipe Promo</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><option value="bogo"${ssrIncludeBooleanAttr(Array.isArray(unref(form).type) ? ssrLooseContain(unref(form).type, "bogo") : ssrLooseEqual(unref(form).type, "bogo")) ? " selected" : ""}${_scopeId}>BOGO (Buy 1 Get 1)</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 Potongan</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${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Minimal Pembelian (Rupiah)</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${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Berlaku Khusus Produk (Opsional)</label><select 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=""${ssrIncludeBooleanAttr(Array.isArray(unref(form).product_id) ? ssrLooseContain(unref(form).product_id, "") : ssrLooseEqual(unref(form).product_id, "")) ? " selected" : ""}${_scopeId}>Semua menu / produk</option><!--[-->`);
							ssrRenderList(__props.products, (p) => {
								_push(`<option${ssrRenderAttr("value", String(p.id))}${ssrIncludeBooleanAttr(Array.isArray(unref(form).product_id) ? ssrLooseContain(unref(form).product_id, String(p.id)) : ssrLooseEqual(unref(form).product_id, String(p.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(p.name)}</option>`);
							});
							_push(`<!--]--></select></div><div class="flex items-center justify-between border-t border-slate-100 dark:border-slate-800 pt-4 mt-2"${_scopeId}><div${_scopeId}><span class="block text-xs font-extrabold text-slate-800 dark:text-slate-200"${_scopeId}>Aktifkan Langsung</span><span class="block text-[10px] text-slate-450 mt-0.5"${_scopeId}>Promo ini akan otomatis dapat dihitung/diterapkan di POS cashier.</span></div><input type="checkbox"${ssrIncludeBooleanAttr(Array.isArray(unref(form).is_active) ? ssrLooseContain(unref(form).is_active, null) : unref(form).is_active) ? " checked" : ""} class="h-4.5 w-4.5 accent-[#8c5a3c] rounded cursor-pointer"${_scopeId}></div><div class="flex items-center justify-end gap-3 pt-4 border-t border-slate-100 dark:border-slate-800"${_scopeId}><button type="button" class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-350 text-xs font-bold rounded-xl hover:bg-slate-50 dark:hover:bg-slate-800 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 text-xs font-bold rounded-xl cursor-pointer disabled:opacity-50"${_scopeId}>${ssrInterpolate(unref(form).processing ? "Menyimpan..." : "Simpan")}</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" }, " Promo Engine "), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Buat dan atur program diskon nominal, persentase belanja, atau Buy One Get One (BOGO). ")]), 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 Promo ")])]),
						__props.promos.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" }, "Nama Promo"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Tipe Promo"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Nilai 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" }, "Berlaku Produk"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Status Aktif"),
							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.promos, (promo) => {
							return openBlock(), createBlock("tr", {
								key: promo.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("span", { class: "font-extrabold text-xs text-slate-850 dark:text-slate-100" }, toDisplayString(promo.name), 1)])]),
								createVNode("td", { class: "px-6 py-4 text-xs font-semibold text-slate-600 dark:text-slate-400" }, [promo.type === "percent" ? (openBlock(), createBlock("span", { key: 0 }, "Persentase (%)")) : promo.type === "nominal" ? (openBlock(), createBlock("span", { key: 1 }, "Nominal (Rp)")) : promo.type === "bogo" ? (openBlock(), createBlock("span", { key: 2 }, "BOGO (Buy 1 Get 1)")) : createCommentVNode("", true)]),
								createVNode("td", { class: "px-6 py-4 text-xs font-bold text-slate-800 dark:text-slate-200" }, toDisplayString(formatValue(promo)), 1),
								createVNode("td", { class: "px-6 py-4 text-xs text-slate-550 dark:text-slate-350" }, " Rp " + toDisplayString(Number(promo.min_purchase).toLocaleString("id-ID")), 1),
								createVNode("td", { class: "px-6 py-4" }, [promo.product ? (openBlock(), createBlock("div", {
									key: 0,
									class: "flex items-center gap-1.5 text-xs text-slate-600 dark:text-slate-400"
								}, [createVNode(unref(ShoppingBag), { class: "h-3.5 w-3.5 text-[#8c5a3c]" }), createVNode("span", null, toDisplayString(promo.product.name), 1)])) : (openBlock(), createBlock("span", {
									key: 1,
									class: "text-xs text-slate-400 italic"
								}, "Semua Produk"))]),
								createVNode("td", { class: "px-6 py-4" }, [createVNode("button", {
									onClick: ($event) => togglePromoStatus(promo),
									class: "cursor-pointer transition-colors"
								}, [promo.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(promo),
									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) => deletePromo(promo),
									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 promo"),
							createVNode("p", { class: "text-xs text-slate-400 mt-1" }, "Gunakan tombol di atas untuk membuat promosi 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(editingPromo.value ? "Edit Program Promo" : "Buat Program Promo 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" }, "Nama Kampanye Promo"), withDirectives(createVNode("input", {
								type: "text",
								"onUpdate:modelValue": ($event) => unref(form).name = $event,
								required: "",
								placeholder: "Contoh: Diskon Kopi Akhir Pekan",
								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).name]])]),
							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 Promo"), 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)"),
								createVNode("option", { value: "bogo" }, "BOGO (Buy 1 Get 1)")
							], 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 Potongan"), 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", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Minimal Pembelian (Rupiah)"), 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-500 uppercase tracking-wider mb-1.5" }, "Berlaku Khusus Produk (Opsional)"), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => unref(form).product_id = $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] cursor-pointer"
							}, [createVNode("option", { value: "" }, "Semua menu / produk"), (openBlock(true), createBlock(Fragment, null, renderList(__props.products, (p) => {
								return openBlock(), createBlock("option", {
									key: p.id,
									value: String(p.id)
								}, toDisplayString(p.name), 9, ["value"]);
							}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(form).product_id]])]),
							createVNode("div", { class: "flex items-center justify-between border-t border-slate-100 dark:border-slate-800 pt-4 mt-2" }, [createVNode("div", null, [createVNode("span", { class: "block text-xs font-extrabold text-slate-800 dark:text-slate-200" }, "Aktifkan Langsung"), createVNode("span", { class: "block text-[10px] text-slate-450 mt-0.5" }, "Promo ini akan otomatis dapat dihitung/diterapkan di POS cashier.")]), withDirectives(createVNode("input", {
								type: "checkbox",
								"onUpdate:modelValue": ($event) => unref(form).is_active = $event,
								class: "h-4.5 w-4.5 accent-[#8c5a3c] rounded cursor-pointer"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelCheckbox, unref(form).is_active]])]),
							createVNode("div", { class: "flex items-center justify-end gap-3 pt-4 border-t border-slate-100 dark:border-slate-800" }, [createVNode("button", {
								type: "button",
								onClick: ($event) => isFormModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-350 text-xs font-bold rounded-xl hover:bg-slate-50 dark:hover:bg-slate-800 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 text-xs font-bold rounded-xl cursor-pointer disabled:opacity-50"
							}, toDisplayString(unref(form).processing ? "Menyimpan..." : "Simpan"), 9, ["disabled"])])
						], 32)])])) : createCommentVNode("", true)
					])];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Promos/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/Promos/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 };
