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, resolveComponent, toDisplayString, unref, useSSRContext, vModelCheckbox, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrRenderAttr, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { Award, Calendar, Edit2, Mail, Phone, Plus, Search, Trash2, Users, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Customers/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: {
		customers: {},
		filters: {}
	},
	setup(__props) {
		const search = ref(__props.filters.search || "");
		let timeoutId = null;
		watch(search, () => {
			if (timeoutId) clearTimeout(timeoutId);
			timeoutId = setTimeout(() => {
				router.get(route("customers.index"), { search: search.value }, {
					preserveState: true,
					replace: true
				});
			}, 400);
		});
		const isFormModalOpen = ref(false);
		const editingCustomer = ref(null);
		const form = useForm({
			name: "",
			phone: "",
			email: "",
			is_member: false,
			loyalty_points: 0
		});
		const openCreateModal = () => {
			editingCustomer.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const openEditModal = (customer) => {
			editingCustomer.value = customer;
			form.clearErrors();
			form.name = customer.name;
			form.phone = customer.phone || "";
			form.email = customer.email || "";
			form.is_member = customer.is_member;
			form.loyalty_points = customer.loyalty_points;
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			if (editingCustomer.value) form.put(route("customers.update", editingCustomer.value.id), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else form.post(route("customers.store"), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const deleteCustomer = (customer) => {
			if (confirm(`Apakah Anda yakin ingin menghapus pelanggan ${customer.name}?`)) router.delete(route("customers.destroy", customer.id));
		};
		return (_ctx, _push, _parent, _attrs) => {
			const _component_Link = resolveComponent("Link");
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Pelanggan & Membership" }, 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-55 tracking-tight"${_scopeId}> CRM &amp; Membership </h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Kelola data loyalty program, poin member, dan basis data customer walk-in. </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 Pelanggan </button></div><div class="flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-4 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl px-5 py-4 shadow-sm"${_scopeId}><div class="relative flex-1 max-w-md"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
						_push(`<input type="text"${ssrRenderAttr("value", search.value)} placeholder="Cari nama, nomor HP, email..." class="w-full h-9 pl-9 pr-4 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] text-slate-900 dark:text-slate-100"${_scopeId}></div></div>`);
						if (__props.customers.data.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-105 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 Pelanggan</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Kontak</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Status Member</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Poin Loyalty</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Tgl Terdaftar</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.customers.data, (cust) => {
								_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-3"${_scopeId}><div class="h-8 w-8 rounded-full bg-[#8c5a3c]/10 text-[#8c5a3c] flex items-center justify-center font-bold text-xs uppercase"${_scopeId}>${ssrInterpolate(cust.name.slice(0, 2))}</div><span class="font-extrabold text-xs text-slate-850 dark:text-slate-100"${_scopeId}>${ssrInterpolate(cust.name)}</span></div></td><td class="px-6 py-4"${_scopeId}><div class="flex flex-col gap-1 text-[11px] text-slate-500"${_scopeId}>`);
								if (cust.phone) {
									_push(`<span class="flex items-center gap-1.5"${_scopeId}>`);
									_push(ssrRenderComponent(unref(Phone), { class: "h-3.5 w-3.5 text-slate-400" }, null, _parent, _scopeId));
									_push(` ${ssrInterpolate(cust.phone)}</span>`);
								} else _push(`<!---->`);
								if (cust.email) {
									_push(`<span class="flex items-center gap-1.5"${_scopeId}>`);
									_push(ssrRenderComponent(unref(Mail), { class: "h-3.5 w-3.5 text-slate-400" }, null, _parent, _scopeId));
									_push(` ${ssrInterpolate(cust.email)}</span>`);
								} else _push(`<!---->`);
								if (!cust.phone && !cust.email) _push(`<span class="text-slate-400 italic"${_scopeId}>Tidak ada kontak</span>`);
								else _push(`<!---->`);
								_push(`</div></td><td class="px-6 py-4"${_scopeId}>`);
								if (cust.is_member) _push(`<span class="px-2.5 py-0.5 border border-[#8c5a3c]/20 bg-[#8c5a3c]/10 text-[#8c5a3c] rounded-full text-[9px] font-extrabold uppercase tracking-wider"${_scopeId}> Member </span>`);
								else _push(`<span class="px-2.5 py-0.5 border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-800 text-slate-400 rounded-full text-[9px] font-bold uppercase tracking-wider"${_scopeId}> Walk-In </span>`);
								_push(`</td><td class="px-6 py-4"${_scopeId}><div class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Award), { class: "h-4 w-4 text-amber-500" }, null, _parent, _scopeId));
								_push(`<span class="font-bold text-xs text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(cust.loyalty_points)} pts</span></div></td><td class="px-6 py-4 text-[11px] text-slate-400"${_scopeId}><span class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Calendar), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
								_push(` ${ssrInterpolate(new Date(cust.created_at).toLocaleDateString("id-ID"))}</span></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>`);
								if (cust.id !== 1) {
									_push(`<button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-500 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>`);
								} else _push(`<!---->`);
								_push(`</div></td></tr>`);
							});
							_push(`<!--]--></tbody></table></div>`);
							if (__props.customers.last_page > 1) {
								_push(`<div class="px-6 py-4 border-t border-slate-100 dark:border-slate-800 flex items-center justify-between gap-4"${_scopeId}><span class="text-xs text-slate-500"${_scopeId}>Total ${ssrInterpolate(__props.customers.total)} pelanggan</span><div class="flex items-center gap-2"${_scopeId}><!--[-->`);
								ssrRenderList(__props.customers.links, (link) => {
									_push(ssrRenderComponent(_component_Link, {
										key: link.label,
										href: link.url || "#",
										class: [
											"px-3 py-1.5 border rounded-lg text-xs font-semibold cursor-pointer",
											link.active ? "bg-[#8c5a3c] text-white border-[#8c5a3c]" : "border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-350",
											!link.url ? "opacity-50 pointer-events-none" : ""
										]
									}, null, _parent, _scopeId));
								});
								_push(`<!--]--></div></div>`);
							} else _push(`<!---->`);
							_push(`</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(Users), { class: "h-10 w-10 text-slate-355 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 data customer</h3><p class="text-xs text-slate-400 mt-1"${_scopeId}>Gunakan tombol di atas untuk mendaftarkan pelanggan pertama.</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(editingCustomer.value ? "Edit Data Pelanggan" : "Daftar Pelanggan 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 Lengkap</label><input type="text"${ssrRenderAttr("value", unref(form).name)} required placeholder="Masukkan nama pelanggan..." 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}>Nomor HP / Whatsapp</label><input type="text"${ssrRenderAttr("value", unref(form).phone)} placeholder="Contoh: 081234567xxx" 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}>Email</label><input type="email"${ssrRenderAttr("value", unref(form).email)} placeholder="Contoh: nama@domain.com" 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="flex items-center justify-between border-y border-slate-100 dark:border-slate-800 py-3.5"${_scopeId}><div${_scopeId}><span class="block text-xs font-extrabold text-slate-800 dark:text-slate-200"${_scopeId}>Gabung Membership</span><span class="block text-[10px] text-slate-450 mt-0.5"${_scopeId}>Aktifkan untuk mengumpulkan poin belanja.</span></div><input type="checkbox"${ssrIncludeBooleanAttr(Array.isArray(unref(form).is_member) ? ssrLooseContain(unref(form).is_member, null) : unref(form).is_member) ? " checked" : ""} class="h-4.5 w-4.5 accent-[#8c5a3c] rounded border-slate-300 cursor-pointer"${_scopeId}></div>`);
							if (unref(form).is_member) _push(`<div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Poin Loyalty Awal</label><input type="number"${ssrRenderAttr("value", unref(form).loyalty_points)} 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>`);
							else _push(`<!---->`);
							_push(`<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-55 tracking-tight" }, " CRM & Membership "), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Kelola data loyalty program, poin member, dan basis data customer walk-in. ")]), 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 Pelanggan ")])]),
						createVNode("div", { class: "flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-4 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl px-5 py-4 shadow-sm" }, [createVNode("div", { class: "relative flex-1 max-w-md" }, [createVNode(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }), withDirectives(createVNode("input", {
							type: "text",
							"onUpdate:modelValue": ($event) => search.value = $event,
							placeholder: "Cari nama, nomor HP, email...",
							class: "w-full h-9 pl-9 pr-4 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] text-slate-900 dark:text-slate-100"
						}, null, 8, ["onUpdate:modelValue"]), [[vModelText, search.value]])])]),
						__props.customers.data.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-105 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 Pelanggan"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Kontak"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Status Member"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Poin Loyalty"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Tgl Terdaftar"),
							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.customers.data, (cust) => {
							return openBlock(), createBlock("tr", {
								key: cust.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-3" }, [createVNode("div", { class: "h-8 w-8 rounded-full bg-[#8c5a3c]/10 text-[#8c5a3c] flex items-center justify-center font-bold text-xs uppercase" }, toDisplayString(cust.name.slice(0, 2)), 1), createVNode("span", { class: "font-extrabold text-xs text-slate-850 dark:text-slate-100" }, toDisplayString(cust.name), 1)])]),
								createVNode("td", { class: "px-6 py-4" }, [createVNode("div", { class: "flex flex-col gap-1 text-[11px] text-slate-500" }, [
									cust.phone ? (openBlock(), createBlock("span", {
										key: 0,
										class: "flex items-center gap-1.5"
									}, [createVNode(unref(Phone), { class: "h-3.5 w-3.5 text-slate-400" }), createTextVNode(" " + toDisplayString(cust.phone), 1)])) : createCommentVNode("", true),
									cust.email ? (openBlock(), createBlock("span", {
										key: 1,
										class: "flex items-center gap-1.5"
									}, [createVNode(unref(Mail), { class: "h-3.5 w-3.5 text-slate-400" }), createTextVNode(" " + toDisplayString(cust.email), 1)])) : createCommentVNode("", true),
									!cust.phone && !cust.email ? (openBlock(), createBlock("span", {
										key: 2,
										class: "text-slate-400 italic"
									}, "Tidak ada kontak")) : createCommentVNode("", true)
								])]),
								createVNode("td", { class: "px-6 py-4" }, [cust.is_member ? (openBlock(), createBlock("span", {
									key: 0,
									class: "px-2.5 py-0.5 border border-[#8c5a3c]/20 bg-[#8c5a3c]/10 text-[#8c5a3c] rounded-full text-[9px] font-extrabold uppercase tracking-wider"
								}, " Member ")) : (openBlock(), createBlock("span", {
									key: 1,
									class: "px-2.5 py-0.5 border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-800 text-slate-400 rounded-full text-[9px] font-bold uppercase tracking-wider"
								}, " Walk-In "))]),
								createVNode("td", { class: "px-6 py-4" }, [createVNode("div", { class: "flex items-center gap-1.5" }, [createVNode(unref(Award), { class: "h-4 w-4 text-amber-500" }), createVNode("span", { class: "font-bold text-xs text-slate-800 dark:text-slate-200" }, toDisplayString(cust.loyalty_points) + " pts", 1)])]),
								createVNode("td", { class: "px-6 py-4 text-[11px] text-slate-400" }, [createVNode("span", { class: "flex items-center gap-1.5" }, [createVNode(unref(Calendar), { class: "h-3.5 w-3.5" }), createTextVNode(" " + toDisplayString(new Date(cust.created_at).toLocaleDateString("id-ID")), 1)])]),
								createVNode("td", { class: "px-6 py-4 text-right" }, [createVNode("div", { class: "flex items-center justify-end gap-2" }, [createVNode("button", {
									onClick: ($event) => openEditModal(cust),
									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"]), cust.id !== 1 ? (openBlock(), createBlock("button", {
									key: 0,
									onClick: ($event) => deleteCustomer(cust),
									class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-500 hover:text-rose-600 rounded-lg cursor-pointer"
								}, [createVNode(unref(Trash2), { class: "h-3.5 w-3.5" })], 8, ["onClick"])) : createCommentVNode("", true)])])
							]);
						}), 128))])])]), __props.customers.last_page > 1 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "px-6 py-4 border-t border-slate-100 dark:border-slate-800 flex items-center justify-between gap-4"
						}, [createVNode("span", { class: "text-xs text-slate-500" }, "Total " + toDisplayString(__props.customers.total) + " pelanggan", 1), createVNode("div", { class: "flex items-center gap-2" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.customers.links, (link) => {
							return openBlock(), createBlock(_component_Link, {
								key: link.label,
								href: link.url || "#",
								class: [
									"px-3 py-1.5 border rounded-lg text-xs font-semibold cursor-pointer",
									link.active ? "bg-[#8c5a3c] text-white border-[#8c5a3c]" : "border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-350",
									!link.url ? "opacity-50 pointer-events-none" : ""
								],
								innerHTML: link.label
							}, null, 8, [
								"href",
								"class",
								"innerHTML"
							]);
						}), 128))])])) : createCommentVNode("", true)])) : (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(Users), { class: "h-10 w-10 text-slate-355 dark:text-slate-600 mx-auto mb-3" }),
							createVNode("h3", { class: "text-sm font-bold text-slate-800 dark:text-slate-200" }, "Belum ada data customer"),
							createVNode("p", { class: "text-xs text-slate-400 mt-1" }, "Gunakan tombol di atas untuk mendaftarkan pelanggan pertama.")
						])),
						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(editingCustomer.value ? "Edit Data Pelanggan" : "Daftar Pelanggan 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 Lengkap"), withDirectives(createVNode("input", {
								type: "text",
								"onUpdate:modelValue": ($event) => unref(form).name = $event,
								required: "",
								placeholder: "Masukkan nama pelanggan...",
								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", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Nomor HP / Whatsapp"), withDirectives(createVNode("input", {
								type: "text",
								"onUpdate:modelValue": ($event) => unref(form).phone = $event,
								placeholder: "Contoh: 081234567xxx",
								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).phone]])]),
							createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Email"), withDirectives(createVNode("input", {
								type: "email",
								"onUpdate:modelValue": ($event) => unref(form).email = $event,
								placeholder: "Contoh: nama@domain.com",
								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).email]])]),
							createVNode("div", { class: "flex items-center justify-between border-y border-slate-100 dark:border-slate-800 py-3.5" }, [createVNode("div", null, [createVNode("span", { class: "block text-xs font-extrabold text-slate-800 dark:text-slate-200" }, "Gabung Membership"), createVNode("span", { class: "block text-[10px] text-slate-450 mt-0.5" }, "Aktifkan untuk mengumpulkan poin belanja.")]), withDirectives(createVNode("input", {
								type: "checkbox",
								"onUpdate:modelValue": ($event) => unref(form).is_member = $event,
								class: "h-4.5 w-4.5 accent-[#8c5a3c] rounded border-slate-300 cursor-pointer"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelCheckbox, unref(form).is_member]])]),
							unref(form).is_member ? (openBlock(), createBlock("div", { key: 0 }, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Poin Loyalty Awal"), withDirectives(createVNode("input", {
								type: "number",
								"onUpdate:modelValue": ($event) => unref(form).loyalty_points = $event,
								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).loyalty_points]])])) : createCommentVNode("", true),
							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/Customers/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/Customers/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 };
