import { t as AdminLayout_default } from "./AdminLayout-CFTJa237.js";
import { Head, Link, router, useForm } from "@inertiajs/vue3";
import { Fragment, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelCheckbox, vModelSelect, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderClass, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { AlertCircle, Coffee, Edit2, FileText, Plus, Search, Sliders, Trash2, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Products/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: {
		products: {},
		ingredients: {},
		outlets: {},
		suppliers: {},
		filters: {}
	},
	setup(__props) {
		const props = __props;
		const search = ref(props.filters.search || "");
		const categoryFilter = ref(props.filters.category || "");
		let timeoutId = null;
		const applyFilters = () => {
			if (timeoutId) clearTimeout(timeoutId);
			timeoutId = setTimeout(() => {
				router.get(route("products.index"), {
					search: search.value,
					category: categoryFilter.value
				}, {
					preserveState: true,
					replace: true
				});
			}, 400);
		};
		watch(search, applyFilters);
		watch(categoryFilter, applyFilters);
		const categories = [
			"Coffee",
			"Non-Coffee",
			"Food",
			"Bakery",
			"Retail",
			"Other"
		];
		const isFormModalOpen = ref(false);
		const isDeleteModalOpen = ref(false);
		const isRecipeModalOpen = ref(false);
		const isStockModalOpen = ref(false);
		const editingProduct = ref(null);
		const productToDelete = ref(null);
		const recipeProduct = ref(null);
		const stockProduct = ref(null);
		const form = useForm({
			name: "",
			price: 0,
			category: "Coffee",
			description: "",
			image: null,
			is_active: true
		});
		const recipeForm = useForm({ recipes: [] });
		const stockForm = useForm({
			outlet_id: "",
			product_id: "",
			stock_qty: 0,
			threshold_qty: 0,
			action_type: "add",
			supplier_id: "",
			notes: ""
		});
		const imagePreview = ref(null);
		const handleImageChange = (e) => {
			const target = e.target;
			if (target.files && target.files[0]) {
				const file = target.files[0];
				form.image = file;
				imagePreview.value = URL.createObjectURL(file);
			}
		};
		const openCreateModal = () => {
			editingProduct.value = null;
			imagePreview.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const openEditModal = (product) => {
			editingProduct.value = product;
			imagePreview.value = product.image_path;
			form.clearErrors();
			form.name = product.name;
			form.price = Number(product.price);
			form.category = product.category;
			form.description = product.description || "";
			form.image = null;
			form.is_active = product.is_active;
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			if (editingProduct.value) router.post(route("products.update", editingProduct.value.id), {
				_method: "PUT",
				name: form.name,
				price: form.price,
				category: form.category,
				description: form.description,
				image: form.image,
				is_active: form.is_active ? 1 : 0
			}, { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else form.post(route("products.store"), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const openDeleteModal = (product) => {
			productToDelete.value = product;
			isDeleteModalOpen.value = true;
		};
		const deleteProduct = () => {
			if (!productToDelete.value) return;
			router.delete(route("products.destroy", productToDelete.value.id), { onSuccess: () => {
				isDeleteModalOpen.value = false;
				productToDelete.value = null;
			} });
		};
		const openRecipeModal = (product) => {
			recipeProduct.value = product;
			recipeForm.clearErrors();
			recipeForm.recipes = product.recipes.map((r) => ({
				ingredient_id: r.ingredient_id,
				usage_qty: Number(r.usage_qty),
				variant: r.variant
			}));
			isRecipeModalOpen.value = true;
		};
		const addRecipeRow = () => {
			recipeForm.recipes.push({
				ingredient_id: props.ingredients[0] ? props.ingredients[0].id : 0,
				usage_qty: 1,
				variant: null
			});
		};
		const removeRecipeRow = (idx) => {
			recipeForm.recipes.splice(idx, 1);
		};
		const submitRecipeForm = () => {
			if (!recipeProduct.value) return;
			recipeForm.post(route("products.recipe.save", recipeProduct.value.id), { onSuccess: () => {
				isRecipeModalOpen.value = false;
				recipeForm.reset();
			} });
		};
		const openStockModal = (product, stockRecord) => {
			stockProduct.value = product;
			stockForm.clearErrors();
			stockForm.product_id = String(product.id);
			stockForm.supplier_id = stockRecord && stockRecord.last_supplier_id ? String(stockRecord.last_supplier_id) : "";
			stockForm.notes = "";
			if (stockRecord) {
				stockForm.outlet_id = String(stockRecord.outlet_id);
				stockForm.stock_qty = 0;
				stockForm.threshold_qty = Number(stockRecord.threshold_qty);
				stockForm.action_type = "add";
			} else {
				stockForm.outlet_id = props.outlets[0] ? String(props.outlets[0].id) : "";
				stockForm.stock_qty = 0;
				stockForm.threshold_qty = 0;
				stockForm.action_type = "add";
			}
			isStockModalOpen.value = true;
		};
		const submitStockForm = () => {
			stockForm.post(route("products.adjust"), { onSuccess: () => {
				isStockModalOpen.value = false;
				stockForm.reset();
			} });
		};
		const getIngredientUnit = (id) => {
			const ing = props.ingredients.find((i) => i.id === id);
			return ing ? ing.unit : "";
		};
		const getProductInitials = (name) => {
			return name.slice(0, 2).toUpperCase();
		};
		const isLowStock = (stock, threshold) => {
			return Number(stock) <= Number(threshold);
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Product Catalog" }, 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 gap-4 md:flex-row md:items-center md:justify-between"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50"${_scopeId}>Product Catalog</h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Manage beverage recipes (BOM), snacks retail inventory, pricing, and active menu items. </p></div><button class="inline-flex items-center justify-center gap-2 px-4 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 transition-all cursor-pointer"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Plus), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Create Product</span></button></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden"${_scopeId}><div class="p-5 border-b border-slate-200 dark:border-slate-800 flex flex-col md:flex-row items-center gap-4"${_scopeId}><div class="relative flex-1 w-full"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
						_push(`<input${ssrRenderAttr("value", search.value)} type="text" placeholder="Search products name or description..." class="w-full pl-9 pr-4 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}></div><select class="w-full md:w-48 px-3 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(categoryFilter.value) ? ssrLooseContain(categoryFilter.value, "") : ssrLooseEqual(categoryFilter.value, "")) ? " selected" : ""}${_scopeId}>All Categories</option><!--[-->`);
						ssrRenderList(categories, (cat) => {
							_push(`<option${ssrRenderAttr("value", cat)}${ssrIncludeBooleanAttr(Array.isArray(categoryFilter.value) ? ssrLooseContain(categoryFilter.value, cat) : ssrLooseEqual(categoryFilter.value, cat)) ? " selected" : ""}${_scopeId}>${ssrInterpolate(cat)}</option>`);
						});
						_push(`<!--]--></select></div><div class="overflow-x-auto"${_scopeId}><table class="w-full border-collapse text-left"${_scopeId}><thead${_scopeId}><tr class="border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/30"${_scopeId}><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Product</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Price</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Stock Type</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Recipe / Stock Info</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Status</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-right"${_scopeId}>Actions</th></tr></thead><tbody class="divide-y divide-slate-200 dark:divide-slate-800"${_scopeId}>`);
						if (__props.products.data.length === 0) _push(`<tr${_scopeId}><td colspan="6" class="p-8 text-center text-sm text-slate-500 dark:text-slate-400"${_scopeId}> No products found in the catalog. </td></tr>`);
						else _push(`<!---->`);
						_push(`<!--[-->`);
						ssrRenderList(__props.products.data, (product) => {
							_push(`<tr class="hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors align-top"${_scopeId}><td class="p-4"${_scopeId}><div class="flex items-center gap-3"${_scopeId}>`);
							if (product.image_path) _push(`<div class="h-12 w-12 rounded-lg overflow-hidden border border-slate-200 dark:border-slate-800 flex-shrink-0"${_scopeId}><img${ssrRenderAttr("src", product.image_path)} alt="Product Thumbnail" class="h-full w-full object-cover"${_scopeId}></div>`);
							else _push(`<div class="h-12 w-12 rounded-lg bg-gradient-to-br from-red-500/20 to-orange-500/20 text-red-600 dark:text-red-400 flex items-center justify-center font-bold text-sm flex-shrink-0"${_scopeId}>${ssrInterpolate(getProductInitials(product.name))}</div>`);
							_push(`<div${_scopeId}><p class="text-sm font-semibold text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(product.name)}</p><span class="inline-flex px-1.5 py-0.5 rounded text-[10px] font-medium bg-slate-100 dark:bg-slate-900 text-slate-600 dark:text-slate-400 mt-1"${_scopeId}>${ssrInterpolate(product.category)}</span></div></div></td><td class="p-4 text-sm font-semibold text-slate-900 dark:text-slate-100"${_scopeId}> Rp ${ssrInterpolate(Number(product.price).toLocaleString("id-ID"))}</td><td class="p-4 text-sm text-slate-600 dark:text-slate-400 font-medium"${_scopeId}>`);
							if (product.recipes.length > 0) {
								_push(`<span class="inline-flex items-center gap-1.5 text-xs text-indigo-600 dark:text-indigo-400"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Sliders), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
								_push(` Recipe (BOM) </span>`);
							} else {
								_push(`<span class="inline-flex items-center gap-1.5 text-xs text-amber-600 dark:text-amber-400"${_scopeId}>`);
								_push(ssrRenderComponent(unref(FileText), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
								_push(` Retail Stock </span>`);
							}
							_push(`</td><td class="p-4 text-xs text-slate-600 dark:text-slate-400"${_scopeId}>`);
							if (product.recipes.length > 0) {
								_push(`<div class="space-y-1"${_scopeId}><!--[-->`);
								ssrRenderList(product.recipes, (rec) => {
									_push(`<div class="flex items-center gap-1"${_scopeId}><span class="font-medium text-slate-700 dark:text-slate-300"${_scopeId}>- ${ssrInterpolate(rec.ingredient?.name)}:</span><span${_scopeId}>${ssrInterpolate(Number(rec.usage_qty))}${ssrInterpolate(rec.ingredient?.unit)}</span>`);
									if (rec.variant) _push(`<span class="px-1 bg-red-100 dark:bg-red-950/40 text-red-600 dark:text-red-400 text-[9px] rounded font-bold uppercase"${_scopeId}>${ssrInterpolate(rec.variant)}</span>`);
									else _push(`<!---->`);
									_push(`</div>`);
								});
								_push(`<!--]--></div>`);
							} else {
								_push(`<div class="space-y-1.5"${_scopeId}>`);
								if (product.outlet_products.length === 0) _push(`<div class="text-slate-400 italic"${_scopeId}>No outlet stock levels.</div>`);
								else _push(`<!---->`);
								_push(`<div class="grid grid-cols-1 gap-1"${_scopeId}><!--[-->`);
								ssrRenderList(product.outlet_products, (st) => {
									_push(`<div class="flex items-center gap-2 px-2 py-1 rounded bg-slate-50 dark:bg-slate-900 border border-slate-100 dark:border-slate-800 hover:border-red-500/40 transition-colors cursor-pointer w-fit"${_scopeId}><span class="font-medium text-[10px]"${_scopeId}>${ssrInterpolate(st.outlet.name)}:</span><span class="${ssrRenderClass([isLowStock(Number(st.stock_qty), Number(st.threshold_qty)) ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-slate-100", "font-bold"])}"${_scopeId}>${ssrInterpolate(Number(st.stock_qty))}</span>`);
									if (isLowStock(Number(st.stock_qty), Number(st.threshold_qty))) _push(`<span class="text-[8px] font-bold text-amber-500 uppercase"${_scopeId}>Low</span>`);
									else _push(`<!---->`);
									_push(`</div>`);
								});
								_push(`<!--]--></div></div>`);
							}
							_push(`</td><td class="p-4 text-sm"${_scopeId}><span class="${ssrRenderClass(["inline-flex px-2 py-0.5 rounded-full text-xs font-semibold", product.is_active ? "bg-emerald-50 dark:bg-emerald-95/30 text-emerald-700 dark:text-emerald-400" : "bg-slate-100 dark:bg-slate-900 text-slate-500 dark:text-slate-400"])}"${_scopeId}>${ssrInterpolate(product.is_active ? "Active" : "Inactive")}</span></td><td class="p-4 text-right"${_scopeId}><div class="flex items-center justify-end gap-1"${_scopeId}><button class="p-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-950 text-indigo-500 dark:text-indigo-400 hover:text-indigo-700 cursor-pointer" title="Configure BOM Recipe"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Sliders), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button><button class="p-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-900 text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-100 cursor-pointer" title="Edit Info"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Edit2), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button>`);
							if (product.is_active) {
								_push(`<button class="p-1.5 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-950/20 text-rose-500 hover:text-rose-600 cursor-pointer" title="Delete Product"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Trash2), { class: "h-4 w-4" }, null, _parent, _scopeId));
								_push(`</button>`);
							} else _push(`<!---->`);
							_push(`</div></td></tr>`);
						});
						_push(`<!--]--></tbody></table></div>`);
						if (__props.products.last_page > 1) {
							_push(`<div class="p-4 border-t border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><p class="text-xs text-slate-500"${_scopeId}>Showing ${ssrInterpolate(__props.products.data.length)} of ${ssrInterpolate(__props.products.total)} products</p><div class="flex gap-2"${_scopeId}>`);
							if (__props.products.prev_page_url) _push(ssrRenderComponent(unref(Link), {
								href: __props.products.prev_page_url,
								class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
							}, {
								default: withCtx((_, _push, _parent, _scopeId) => {
									if (_push) _push(` Previous `);
									else return [createTextVNode(" Previous ")];
								}),
								_: 1
							}, _parent, _scopeId));
							else _push(`<!---->`);
							if (__props.products.next_page_url) _push(ssrRenderComponent(unref(Link), {
								href: __props.products.next_page_url,
								class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
							}, {
								default: withCtx((_, _push, _parent, _scopeId) => {
									if (_push) _push(` Next `);
									else return [createTextVNode(" Next ")];
								}),
								_: 1
							}, _parent, _scopeId));
							else _push(`<!---->`);
							_push(`</div></div>`);
						} else _push(`<!---->`);
						_push(`</div></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="w-full max-w-lg bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200"${_scopeId}><div class="p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><h3 class="text-lg font-bold text-slate-900 dark:text-slate-50"${_scopeId}>${ssrInterpolate(editingProduct.value ? "Edit Product Catalog" : "Add Product to Catalog")}</h3><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</button></div><form class="p-6 space-y-4"${_scopeId}><div class="grid grid-cols-1 sm:grid-cols-2 gap-4"${_scopeId}><div class="space-y-1"${_scopeId}><label for="name" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Product Name</label><input id="name"${ssrRenderAttr("value", unref(form).name)} type="text" required placeholder="e.g. Es Kopi Susu Aren" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}></div><div class="space-y-1"${_scopeId}><label for="price" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Price (IDR)</label><input id="price"${ssrRenderAttr("value", unref(form).price)} type="number" required min="0" placeholder="e.g. 25000" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}></div><div class="space-y-1"${_scopeId}><label for="category" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Category</label><select id="category" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}><!--[-->`);
							ssrRenderList(categories, (cat) => {
								_push(`<option${ssrRenderAttr("value", cat)}${ssrIncludeBooleanAttr(Array.isArray(unref(form).category) ? ssrLooseContain(unref(form).category, cat) : ssrLooseEqual(unref(form).category, cat)) ? " selected" : ""}${_scopeId}>${ssrInterpolate(cat)}</option>`);
							});
							_push(`<!--]--></select></div><div class="space-y-1 flex items-center pt-4 pl-1"${_scopeId}><input id="is_active"${ssrIncludeBooleanAttr(Array.isArray(unref(form).is_active) ? ssrLooseContain(unref(form).is_active, null) : unref(form).is_active) ? " checked" : ""} type="checkbox" class="rounded border-slate-350 dark:border-slate-800 text-red-600 focus:ring-red-500"${_scopeId}><label for="is_active" class="ml-2 text-sm font-semibold text-slate-700 dark:text-slate-300 cursor-pointer"${_scopeId}> Active (Show in POS Catalog) </label></div></div><div class="space-y-1"${_scopeId}><label for="description" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Product Description</label><textarea id="description" rows="2" placeholder="Optional product description..." class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100 resize-none"${_scopeId}>${ssrInterpolate(unref(form).description)}</textarea></div><div class="space-y-2"${_scopeId}><label class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block"${_scopeId}>Product Image</label><div class="flex items-center gap-4"${_scopeId}><div class="h-20 w-20 rounded-lg border border-dashed border-slate-200 dark:border-slate-800 overflow-hidden flex items-center justify-center bg-slate-50/50 dark:bg-slate-900/30"${_scopeId}>`);
							if (imagePreview.value) _push(`<img${ssrRenderAttr("src", imagePreview.value)} alt="Preview" class="h-full w-full object-cover"${_scopeId}>`);
							else _push(ssrRenderComponent(unref(Coffee), { class: "h-8 w-8 text-slate-300" }, null, _parent, _scopeId));
							_push(`</div><div class="flex-1"${_scopeId}><input type="file" id="image" accept="image/*" class="hidden"${_scopeId}><label for="image" class="px-3.5 py-2 rounded-lg border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 text-xs font-semibold text-slate-700 dark:text-slate-300 transition-colors cursor-pointer inline-block"${_scopeId}> Upload Photo </label><p class="text-[10px] text-slate-400 mt-1"${_scopeId}>PNG, JPG, JPEG, or WEBP up to 2MB.</p></div></div></div><div class="flex items-center justify-end gap-3 pt-4 border-t border-slate-200 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-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(form).processing) ? " disabled" : ""} class="px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"${_scopeId}>${ssrInterpolate(unref(form).processing ? "Saving..." : "Save Product")}</button></div></form></div></div>`);
						} else _push(`<!---->`);
						if (isRecipeModalOpen.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="w-full max-w-2xl bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200"${_scopeId}><div class="p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><div${_scopeId}><h3 class="text-lg font-bold text-slate-900 dark:text-slate-50"${_scopeId}>Bill of Materials (BOM) Recipe</h3><p class="text-xs text-slate-400 mt-0.5"${_scopeId}>Configure ingredient requirements for: <span class="font-bold text-slate-700 dark:text-slate-200"${_scopeId}>${ssrInterpolate(recipeProduct.value?.name)}</span></p></div><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</button></div><form class="p-6 space-y-6"${_scopeId}><div class="space-y-4"${_scopeId}><div class="flex items-center justify-between"${_scopeId}><span class="text-xs font-bold uppercase text-slate-400"${_scopeId}>Recipe Composition</span><button type="button" class="inline-flex items-center gap-1 text-xs font-semibold text-red-600 dark:text-red-400 hover:text-red-500 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Plus), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
							_push(` Add Ingredient Row </button></div>`);
							if (unref(recipeForm).recipes.length === 0) _push(`<div class="p-8 text-center border border-dashed border-slate-200 dark:border-slate-800 rounded-xl text-slate-400 text-xs"${_scopeId}> No recipe configured. This item will use manual retail stock mapping. </div>`);
							else {
								_push(`<div class="max-h-60 overflow-y-auto space-y-3 pr-2"${_scopeId}><!--[-->`);
								ssrRenderList(unref(recipeForm).recipes, (row, idx) => {
									_push(`<div class="flex items-end gap-3 p-3 bg-slate-50 dark:bg-slate-900/30 rounded-xl border border-slate-100 dark:border-slate-800"${_scopeId}><div class="flex-1 min-w-0"${_scopeId}><label class="text-[10px] font-semibold text-slate-400 uppercase"${_scopeId}>Ingredient</label><select required class="w-full px-2 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 text-slate-900 dark:text-slate-100 mt-1"${_scopeId}><!--[-->`);
									ssrRenderList(__props.ingredients, (ing) => {
										_push(`<option${ssrRenderAttr("value", ing.id)}${ssrIncludeBooleanAttr(Array.isArray(row.ingredient_id) ? ssrLooseContain(row.ingredient_id, ing.id) : ssrLooseEqual(row.ingredient_id, ing.id)) ? " selected" : ""}${_scopeId}>${ssrInterpolate(ing.name)} (${ssrInterpolate(ing.unit)})</option>`);
									});
									_push(`<!--]--></select></div><div class="w-32"${_scopeId}><label class="text-[10px] font-semibold text-slate-400 uppercase"${_scopeId}>Usage Qty (${ssrInterpolate(getIngredientUnit(row.ingredient_id))})</label><input${ssrRenderAttr("value", row.usage_qty)} type="number" step="0.0001" required min="0.0001" class="w-full px-2 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 text-slate-900 dark:text-slate-100 mt-1"${_scopeId}></div><div class="w-32"${_scopeId}><label class="text-[10px] font-semibold text-slate-400 uppercase"${_scopeId}>Variant Option</label><select class="w-full px-2 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 text-slate-900 dark:text-slate-100 mt-1"${_scopeId}><option${ssrRenderAttr("value", null)}${ssrIncludeBooleanAttr(Array.isArray(row.variant) ? ssrLooseContain(row.variant, null) : ssrLooseEqual(row.variant, null)) ? " selected" : ""}${_scopeId}>Base (All)</option><option value="hot"${ssrIncludeBooleanAttr(Array.isArray(row.variant) ? ssrLooseContain(row.variant, "hot") : ssrLooseEqual(row.variant, "hot")) ? " selected" : ""}${_scopeId}>Hot Only</option><option value="ice"${ssrIncludeBooleanAttr(Array.isArray(row.variant) ? ssrLooseContain(row.variant, "ice") : ssrLooseEqual(row.variant, "ice")) ? " selected" : ""}${_scopeId}>Ice Only</option></select></div><button type="button" class="p-2 text-rose-500 hover:bg-rose-50 dark:hover:bg-rose-905/20 rounded-lg flex-shrink-0 cursor-pointer"${_scopeId}>`);
									_push(ssrRenderComponent(unref(Trash2), { class: "h-4 w-4" }, null, _parent, _scopeId));
									_push(`</button></div>`);
								});
								_push(`<!--]--></div>`);
							}
							_push(`</div><div class="flex items-center justify-end gap-3 pt-4 border-t border-slate-200 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-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(recipeForm).processing) ? " disabled" : ""} class="px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"${_scopeId}>${ssrInterpolate(unref(recipeForm).processing ? "Saving..." : "Save Recipe BOM")}</button></div></form></div></div>`);
						} else _push(`<!---->`);
						if (isStockModalOpen.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="w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200"${_scopeId}><div class="p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><div${_scopeId}><h3 class="text-lg font-bold text-slate-900 dark:text-slate-50"${_scopeId}>Retail Stock Adjustment</h3>`);
							if (stockProduct.value) _push(`<p class="text-xs text-slate-400 mt-0.5"${_scopeId}> Setting manual inventory for: <span class="font-bold text-slate-700 dark:text-slate-200"${_scopeId}>${ssrInterpolate(stockProduct.value.name)}</span></p>`);
							else _push(`<!---->`);
							_push(`</div><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</button></div><form class="p-6 space-y-4"${_scopeId}><div class="space-y-1"${_scopeId}><label for="stock_outlet" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Target Outlet</label><select id="stock_outlet" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(unref(stockForm).outlet_id) ? ssrLooseContain(unref(stockForm).outlet_id, "") : ssrLooseEqual(unref(stockForm).outlet_id, "")) ? " selected" : ""}${_scopeId}>Select Outlet</option><!--[-->`);
							ssrRenderList(__props.outlets, (ot) => {
								_push(`<option${ssrRenderAttr("value", String(ot.id))}${ssrIncludeBooleanAttr(Array.isArray(unref(stockForm).outlet_id) ? ssrLooseContain(unref(stockForm).outlet_id, String(ot.id)) : ssrLooseEqual(unref(stockForm).outlet_id, String(ot.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(ot.name)}</option>`);
							});
							_push(`<!--]--></select>`);
							if (unref(stockForm).errors.outlet_id) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(stockForm).errors.outlet_id)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block mb-1"${_scopeId}>Adjustment Action</label><div class="grid grid-cols-2 gap-2"${_scopeId}><button type="button" class="${ssrRenderClass(["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(stockForm).action_type === "add" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"])}"${_scopeId}> Add Stock (+Qty) </button><button type="button" class="${ssrRenderClass(["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(stockForm).action_type === "set" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"])}"${_scopeId}> Set Absolute Stock (=Qty) </button></div></div><div class="space-y-1"${_scopeId}><label for="stock_qty" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Quantity (pcs)</label><input id="stock_qty"${ssrRenderAttr("value", unref(stockForm).stock_qty)} type="number" min="0" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>`);
							if (unref(stockForm).errors.stock_qty) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(stockForm).errors.stock_qty)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="stock_threshold" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Safety Threshold (Minimum Stock Alert)</label><input id="stock_threshold"${ssrRenderAttr("value", unref(stockForm).threshold_qty)} type="number" min="0" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>`);
							if (unref(stockForm).errors.threshold_qty) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(stockForm).errors.threshold_qty)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="stock_supplier" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Supplier</label><select id="stock_supplier" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(unref(stockForm).supplier_id) ? ssrLooseContain(unref(stockForm).supplier_id, "") : ssrLooseEqual(unref(stockForm).supplier_id, "")) ? " selected" : ""}${_scopeId}>Select Supplier</option><!--[-->`);
							ssrRenderList(__props.suppliers, (sp) => {
								_push(`<option${ssrRenderAttr("value", String(sp.id))}${ssrIncludeBooleanAttr(Array.isArray(unref(stockForm).supplier_id) ? ssrLooseContain(unref(stockForm).supplier_id, String(sp.id)) : ssrLooseEqual(unref(stockForm).supplier_id, String(sp.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(sp.name)}</option>`);
							});
							_push(`<!--]--></select>`);
							if (unref(stockForm).errors.supplier_id) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(stockForm).errors.supplier_id)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="stock_notes" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Adjustment Notes</label><textarea id="stock_notes" rows="2" placeholder="e.g. Purchase order invoice number, batch code, expiry notes..." class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(unref(stockForm).notes)}</textarea>`);
							if (unref(stockForm).errors.notes) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(stockForm).errors.notes)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="flex items-center justify-end gap-3 pt-4 border-t border-slate-200 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-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(stockForm).processing) ? " disabled" : ""} class="px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"${_scopeId}>${ssrInterpolate(unref(stockForm).processing ? "Saving..." : "Save Stock")}</button></div></form></div></div>`);
						} else _push(`<!---->`);
						if (isDeleteModalOpen.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="w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6"${_scopeId}><div class="flex items-center gap-3 text-rose-600 dark:text-rose-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }, null, _parent, _scopeId));
							_push(`<h3 class="text-lg font-bold"${_scopeId}>Delete Product?</h3></div><p class="text-sm text-slate-500 dark:text-slate-400"${_scopeId}> Are you sure you want to delete product <span class="font-bold text-slate-900 dark:text-slate-100"${_scopeId}>&quot;${ssrInterpolate(productToDelete.value?.name)}&quot;</span>? This will permanently delete this product, its recipes, and stock records across all outlets. This action is irreversible. </p><div class="flex items-center justify-end gap-3"${_scopeId}><button class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button class="px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Confirm Delete </button></div></div></div>`);
						} else _push(`<!---->`);
					} else return [
						createVNode("div", { class: "space-y-6" }, [createVNode("div", { class: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50" }, "Product Catalog"), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Manage beverage recipes (BOM), snacks retail inventory, pricing, and active menu items. ")]), createVNode("button", {
							onClick: openCreateModal,
							class: "inline-flex items-center justify-center gap-2 px-4 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 transition-all cursor-pointer"
						}, [createVNode(unref(Plus), { class: "h-4 w-4" }), createVNode("span", null, "Create Product")])]), createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden" }, [
							createVNode("div", { class: "p-5 border-b border-slate-200 dark:border-slate-800 flex flex-col md:flex-row items-center gap-4" }, [createVNode("div", { class: "relative flex-1 w-full" }, [createVNode(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }), withDirectives(createVNode("input", {
								"onUpdate:modelValue": ($event) => search.value = $event,
								type: "text",
								placeholder: "Search products name or description...",
								class: "w-full pl-9 pr-4 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, search.value]])]), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => categoryFilter.value = $event,
								class: "w-full md:w-48 px-3 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
							}, [createVNode("option", { value: "" }, "All Categories"), (openBlock(), createBlock(Fragment, null, renderList(categories, (cat) => {
								return createVNode("option", {
									key: cat,
									value: cat
								}, toDisplayString(cat), 9, ["value"]);
							}), 64))], 8, ["onUpdate:modelValue"]), [[vModelSelect, categoryFilter.value]])]),
							createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full border-collapse text-left" }, [createVNode("thead", null, [createVNode("tr", { class: "border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/30" }, [
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Product"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Price"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Stock Type"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Recipe / Stock Info"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Status"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-right" }, "Actions")
							])]), createVNode("tbody", { class: "divide-y divide-slate-200 dark:divide-slate-800" }, [__props.products.data.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
								colspan: "6",
								class: "p-8 text-center text-sm text-slate-500 dark:text-slate-400"
							}, " No products found in the catalog. ")])) : createCommentVNode("", true), (openBlock(true), createBlock(Fragment, null, renderList(__props.products.data, (product) => {
								return openBlock(), createBlock("tr", {
									key: product.id,
									class: "hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors align-top"
								}, [
									createVNode("td", { class: "p-4" }, [createVNode("div", { class: "flex items-center gap-3" }, [product.image_path ? (openBlock(), createBlock("div", {
										key: 0,
										class: "h-12 w-12 rounded-lg overflow-hidden border border-slate-200 dark:border-slate-800 flex-shrink-0"
									}, [createVNode("img", {
										src: product.image_path,
										alt: "Product Thumbnail",
										class: "h-full w-full object-cover"
									}, null, 8, ["src"])])) : (openBlock(), createBlock("div", {
										key: 1,
										class: "h-12 w-12 rounded-lg bg-gradient-to-br from-red-500/20 to-orange-500/20 text-red-600 dark:text-red-400 flex items-center justify-center font-bold text-sm flex-shrink-0"
									}, toDisplayString(getProductInitials(product.name)), 1)), createVNode("div", null, [createVNode("p", { class: "text-sm font-semibold text-slate-900 dark:text-slate-100" }, toDisplayString(product.name), 1), createVNode("span", { class: "inline-flex px-1.5 py-0.5 rounded text-[10px] font-medium bg-slate-100 dark:bg-slate-900 text-slate-600 dark:text-slate-400 mt-1" }, toDisplayString(product.category), 1)])])]),
									createVNode("td", { class: "p-4 text-sm font-semibold text-slate-900 dark:text-slate-100" }, " Rp " + toDisplayString(Number(product.price).toLocaleString("id-ID")), 1),
									createVNode("td", { class: "p-4 text-sm text-slate-600 dark:text-slate-400 font-medium" }, [product.recipes.length > 0 ? (openBlock(), createBlock("span", {
										key: 0,
										class: "inline-flex items-center gap-1.5 text-xs text-indigo-600 dark:text-indigo-400"
									}, [createVNode(unref(Sliders), { class: "h-3.5 w-3.5" }), createTextVNode(" Recipe (BOM) ")])) : (openBlock(), createBlock("span", {
										key: 1,
										class: "inline-flex items-center gap-1.5 text-xs text-amber-600 dark:text-amber-400"
									}, [createVNode(unref(FileText), { class: "h-3.5 w-3.5" }), createTextVNode(" Retail Stock ")]))]),
									createVNode("td", { class: "p-4 text-xs text-slate-600 dark:text-slate-400" }, [product.recipes.length > 0 ? (openBlock(), createBlock("div", {
										key: 0,
										class: "space-y-1"
									}, [(openBlock(true), createBlock(Fragment, null, renderList(product.recipes, (rec) => {
										return openBlock(), createBlock("div", {
											key: rec.id,
											class: "flex items-center gap-1"
										}, [
											createVNode("span", { class: "font-medium text-slate-700 dark:text-slate-300" }, "- " + toDisplayString(rec.ingredient?.name) + ":", 1),
											createVNode("span", null, toDisplayString(Number(rec.usage_qty)) + toDisplayString(rec.ingredient?.unit), 1),
											rec.variant ? (openBlock(), createBlock("span", {
												key: 0,
												class: "px-1 bg-red-100 dark:bg-red-950/40 text-red-600 dark:text-red-400 text-[9px] rounded font-bold uppercase"
											}, toDisplayString(rec.variant), 1)) : createCommentVNode("", true)
										]);
									}), 128))])) : (openBlock(), createBlock("div", {
										key: 1,
										class: "space-y-1.5"
									}, [product.outlet_products.length === 0 ? (openBlock(), createBlock("div", {
										key: 0,
										class: "text-slate-400 italic"
									}, "No outlet stock levels.")) : createCommentVNode("", true), createVNode("div", { class: "grid grid-cols-1 gap-1" }, [(openBlock(true), createBlock(Fragment, null, renderList(product.outlet_products, (st) => {
										return openBlock(), createBlock("div", {
											key: st.id,
											onClick: ($event) => openStockModal(product, st),
											class: "flex items-center gap-2 px-2 py-1 rounded bg-slate-50 dark:bg-slate-900 border border-slate-100 dark:border-slate-800 hover:border-red-500/40 transition-colors cursor-pointer w-fit"
										}, [
											createVNode("span", { class: "font-medium text-[10px]" }, toDisplayString(st.outlet.name) + ":", 1),
											createVNode("span", { class: ["font-bold", isLowStock(Number(st.stock_qty), Number(st.threshold_qty)) ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-slate-100"] }, toDisplayString(Number(st.stock_qty)), 3),
											isLowStock(Number(st.stock_qty), Number(st.threshold_qty)) ? (openBlock(), createBlock("span", {
												key: 0,
												class: "text-[8px] font-bold text-amber-500 uppercase"
											}, "Low")) : createCommentVNode("", true)
										], 8, ["onClick"]);
									}), 128))])]))]),
									createVNode("td", { class: "p-4 text-sm" }, [createVNode("span", { class: ["inline-flex px-2 py-0.5 rounded-full text-xs font-semibold", product.is_active ? "bg-emerald-50 dark:bg-emerald-95/30 text-emerald-700 dark:text-emerald-400" : "bg-slate-100 dark:bg-slate-900 text-slate-500 dark:text-slate-400"] }, toDisplayString(product.is_active ? "Active" : "Inactive"), 3)]),
									createVNode("td", { class: "p-4 text-right" }, [createVNode("div", { class: "flex items-center justify-end gap-1" }, [
										createVNode("button", {
											onClick: ($event) => openRecipeModal(product),
											class: "p-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-950 text-indigo-500 dark:text-indigo-400 hover:text-indigo-700 cursor-pointer",
											title: "Configure BOM Recipe"
										}, [createVNode(unref(Sliders), { class: "h-4 w-4" })], 8, ["onClick"]),
										createVNode("button", {
											onClick: ($event) => openEditModal(product),
											class: "p-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-900 text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-100 cursor-pointer",
											title: "Edit Info"
										}, [createVNode(unref(Edit2), { class: "h-4 w-4" })], 8, ["onClick"]),
										product.is_active ? (openBlock(), createBlock("button", {
											key: 0,
											onClick: ($event) => openDeleteModal(product),
											class: "p-1.5 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-950/20 text-rose-500 hover:text-rose-600 cursor-pointer",
											title: "Delete Product"
										}, [createVNode(unref(Trash2), { class: "h-4 w-4" })], 8, ["onClick"])) : createCommentVNode("", true)
									])])
								]);
							}), 128))])])]),
							__props.products.last_page > 1 ? (openBlock(), createBlock("div", {
								key: 0,
								class: "p-4 border-t border-slate-200 dark:border-slate-800 flex items-center justify-between"
							}, [createVNode("p", { class: "text-xs text-slate-500" }, "Showing " + toDisplayString(__props.products.data.length) + " of " + toDisplayString(__props.products.total) + " products", 1), createVNode("div", { class: "flex gap-2" }, [__props.products.prev_page_url ? (openBlock(), createBlock(unref(Link), {
								key: 0,
								href: __props.products.prev_page_url,
								class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
							}, {
								default: withCtx(() => [createTextVNode(" Previous ")]),
								_: 1
							}, 8, ["href"])) : createCommentVNode("", true), __props.products.next_page_url ? (openBlock(), createBlock(unref(Link), {
								key: 1,
								href: __props.products.next_page_url,
								class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
							}, {
								default: withCtx(() => [createTextVNode(" Next ")]),
								_: 1
							}, 8, ["href"])) : createCommentVNode("", true)])])) : createCommentVNode("", true)
						])]),
						isFormModalOpen.value ? (openBlock(), createBlock("div", {
							key: 0,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "w-full max-w-lg bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200" }, [createVNode("div", { class: "p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("h3", { class: "text-lg font-bold text-slate-900 dark:text-slate-50" }, toDisplayString(editingProduct.value ? "Edit Product Catalog" : "Add Product to Catalog"), 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-500 cursor-pointer"
						}, [createVNode(unref(X), { class: "h-5 w-5" })], 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitForm, ["prevent"]),
							class: "p-6 space-y-4"
						}, [
							createVNode("div", { class: "grid grid-cols-1 sm:grid-cols-2 gap-4" }, [
								createVNode("div", { class: "space-y-1" }, [createVNode("label", {
									for: "name",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Product Name"), withDirectives(createVNode("input", {
									id: "name",
									"onUpdate:modelValue": ($event) => unref(form).name = $event,
									type: "text",
									required: "",
									placeholder: "e.g. Es Kopi Susu Aren",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).name]])]),
								createVNode("div", { class: "space-y-1" }, [createVNode("label", {
									for: "price",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Price (IDR)"), withDirectives(createVNode("input", {
									id: "price",
									"onUpdate:modelValue": ($event) => unref(form).price = $event,
									type: "number",
									required: "",
									min: "0",
									placeholder: "e.g. 25000",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[
									vModelText,
									unref(form).price,
									void 0,
									{ number: true }
								]])]),
								createVNode("div", { class: "space-y-1" }, [createVNode("label", {
									for: "category",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Category"), withDirectives(createVNode("select", {
									id: "category",
									"onUpdate:modelValue": ($event) => unref(form).category = $event,
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, [(openBlock(), createBlock(Fragment, null, renderList(categories, (cat) => {
									return createVNode("option", {
										key: cat,
										value: cat
									}, toDisplayString(cat), 9, ["value"]);
								}), 64))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(form).category]])]),
								createVNode("div", { class: "space-y-1 flex items-center pt-4 pl-1" }, [withDirectives(createVNode("input", {
									id: "is_active",
									"onUpdate:modelValue": ($event) => unref(form).is_active = $event,
									type: "checkbox",
									class: "rounded border-slate-350 dark:border-slate-800 text-red-600 focus:ring-red-500"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelCheckbox, unref(form).is_active]]), createVNode("label", {
									for: "is_active",
									class: "ml-2 text-sm font-semibold text-slate-700 dark:text-slate-300 cursor-pointer"
								}, " Active (Show in POS Catalog) ")])
							]),
							createVNode("div", { class: "space-y-1" }, [createVNode("label", {
								for: "description",
								class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
							}, "Product Description"), withDirectives(createVNode("textarea", {
								id: "description",
								"onUpdate:modelValue": ($event) => unref(form).description = $event,
								rows: "2",
								placeholder: "Optional product description...",
								class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100 resize-none"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).description]])]),
							createVNode("div", { class: "space-y-2" }, [createVNode("label", { class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block" }, "Product Image"), createVNode("div", { class: "flex items-center gap-4" }, [createVNode("div", { class: "h-20 w-20 rounded-lg border border-dashed border-slate-200 dark:border-slate-800 overflow-hidden flex items-center justify-center bg-slate-50/50 dark:bg-slate-900/30" }, [imagePreview.value ? (openBlock(), createBlock("img", {
								key: 0,
								src: imagePreview.value,
								alt: "Preview",
								class: "h-full w-full object-cover"
							}, null, 8, ["src"])) : (openBlock(), createBlock(unref(Coffee), {
								key: 1,
								class: "h-8 w-8 text-slate-300"
							}))]), createVNode("div", { class: "flex-1" }, [
								createVNode("input", {
									type: "file",
									id: "image",
									accept: "image/*",
									class: "hidden",
									onChange: handleImageChange
								}, null, 32),
								createVNode("label", {
									for: "image",
									class: "px-3.5 py-2 rounded-lg border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 text-xs font-semibold text-slate-700 dark:text-slate-300 transition-colors cursor-pointer inline-block"
								}, " Upload Photo "),
								createVNode("p", { class: "text-[10px] text-slate-400 mt-1" }, "PNG, JPG, JPEG, or WEBP up to 2MB.")
							])])]),
							createVNode("div", { class: "flex items-center justify-end gap-3 pt-4 border-t border-slate-200 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-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								type: "submit",
								disabled: unref(form).processing,
								class: "px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"
							}, toDisplayString(unref(form).processing ? "Saving..." : "Save Product"), 9, ["disabled"])])
						], 32)])])) : createCommentVNode("", true),
						isRecipeModalOpen.value ? (openBlock(), createBlock("div", {
							key: 1,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "w-full max-w-2xl bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200" }, [createVNode("div", { class: "p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("div", null, [createVNode("h3", { class: "text-lg font-bold text-slate-900 dark:text-slate-50" }, "Bill of Materials (BOM) Recipe"), createVNode("p", { class: "text-xs text-slate-400 mt-0.5" }, [createTextVNode("Configure ingredient requirements for: "), createVNode("span", { class: "font-bold text-slate-700 dark:text-slate-200" }, toDisplayString(recipeProduct.value?.name), 1)])]), createVNode("button", {
							onClick: ($event) => isRecipeModalOpen.value = false,
							class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"
						}, [createVNode(unref(X), { class: "h-5 w-5" })], 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitRecipeForm, ["prevent"]),
							class: "p-6 space-y-6"
						}, [createVNode("div", { class: "space-y-4" }, [createVNode("div", { class: "flex items-center justify-between" }, [createVNode("span", { class: "text-xs font-bold uppercase text-slate-400" }, "Recipe Composition"), createVNode("button", {
							type: "button",
							onClick: addRecipeRow,
							class: "inline-flex items-center gap-1 text-xs font-semibold text-red-600 dark:text-red-400 hover:text-red-500 cursor-pointer"
						}, [createVNode(unref(Plus), { class: "h-3.5 w-3.5" }), createTextVNode(" Add Ingredient Row ")])]), unref(recipeForm).recipes.length === 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "p-8 text-center border border-dashed border-slate-200 dark:border-slate-800 rounded-xl text-slate-400 text-xs"
						}, " No recipe configured. This item will use manual retail stock mapping. ")) : (openBlock(), createBlock("div", {
							key: 1,
							class: "max-h-60 overflow-y-auto space-y-3 pr-2"
						}, [(openBlock(true), createBlock(Fragment, null, renderList(unref(recipeForm).recipes, (row, idx) => {
							return openBlock(), createBlock("div", {
								key: idx,
								class: "flex items-end gap-3 p-3 bg-slate-50 dark:bg-slate-900/30 rounded-xl border border-slate-100 dark:border-slate-800"
							}, [
								createVNode("div", { class: "flex-1 min-w-0" }, [createVNode("label", { class: "text-[10px] font-semibold text-slate-400 uppercase" }, "Ingredient"), withDirectives(createVNode("select", {
									"onUpdate:modelValue": ($event) => row.ingredient_id = $event,
									required: "",
									class: "w-full px-2 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 text-slate-900 dark:text-slate-100 mt-1"
								}, [(openBlock(true), createBlock(Fragment, null, renderList(__props.ingredients, (ing) => {
									return openBlock(), createBlock("option", {
										key: ing.id,
										value: ing.id
									}, toDisplayString(ing.name) + " (" + toDisplayString(ing.unit) + ")", 9, ["value"]);
								}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, row.ingredient_id]])]),
								createVNode("div", { class: "w-32" }, [createVNode("label", { class: "text-[10px] font-semibold text-slate-400 uppercase" }, "Usage Qty (" + toDisplayString(getIngredientUnit(row.ingredient_id)) + ")", 1), withDirectives(createVNode("input", {
									"onUpdate:modelValue": ($event) => row.usage_qty = $event,
									type: "number",
									step: "0.0001",
									required: "",
									min: "0.0001",
									class: "w-full px-2 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 text-slate-900 dark:text-slate-100 mt-1"
								}, null, 8, ["onUpdate:modelValue"]), [[
									vModelText,
									row.usage_qty,
									void 0,
									{ number: true }
								]])]),
								createVNode("div", { class: "w-32" }, [createVNode("label", { class: "text-[10px] font-semibold text-slate-400 uppercase" }, "Variant Option"), withDirectives(createVNode("select", {
									"onUpdate:modelValue": ($event) => row.variant = $event,
									class: "w-full px-2 py-1.5 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 text-slate-900 dark:text-slate-100 mt-1"
								}, [
									createVNode("option", { value: null }, "Base (All)"),
									createVNode("option", { value: "hot" }, "Hot Only"),
									createVNode("option", { value: "ice" }, "Ice Only")
								], 8, ["onUpdate:modelValue"]), [[vModelSelect, row.variant]])]),
								createVNode("button", {
									type: "button",
									onClick: ($event) => removeRecipeRow(idx),
									class: "p-2 text-rose-500 hover:bg-rose-50 dark:hover:bg-rose-905/20 rounded-lg flex-shrink-0 cursor-pointer"
								}, [createVNode(unref(Trash2), { class: "h-4 w-4" })], 8, ["onClick"])
							]);
						}), 128))]))]), createVNode("div", { class: "flex items-center justify-end gap-3 pt-4 border-t border-slate-200 dark:border-slate-800" }, [createVNode("button", {
							type: "button",
							onClick: ($event) => isRecipeModalOpen.value = false,
							class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
						}, " Cancel ", 8, ["onClick"]), createVNode("button", {
							type: "submit",
							disabled: unref(recipeForm).processing,
							class: "px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"
						}, toDisplayString(unref(recipeForm).processing ? "Saving..." : "Save Recipe BOM"), 9, ["disabled"])])], 32)])])) : createCommentVNode("", true),
						isStockModalOpen.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: "w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200" }, [createVNode("div", { class: "p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("div", null, [createVNode("h3", { class: "text-lg font-bold text-slate-900 dark:text-slate-50" }, "Retail Stock Adjustment"), stockProduct.value ? (openBlock(), createBlock("p", {
							key: 0,
							class: "text-xs text-slate-400 mt-0.5"
						}, [createTextVNode(" Setting manual inventory for: "), createVNode("span", { class: "font-bold text-slate-700 dark:text-slate-200" }, toDisplayString(stockProduct.value.name), 1)])) : createCommentVNode("", true)]), createVNode("button", {
							onClick: ($event) => isStockModalOpen.value = false,
							class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"
						}, [createVNode(unref(X), { class: "h-5 w-5" })], 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitStockForm, ["prevent"]),
							class: "p-6 space-y-4"
						}, [
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "stock_outlet",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Target Outlet"),
								withDirectives(createVNode("select", {
									id: "stock_outlet",
									"onUpdate:modelValue": ($event) => unref(stockForm).outlet_id = $event,
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, [createVNode("option", { value: "" }, "Select Outlet"), (openBlock(true), createBlock(Fragment, null, renderList(__props.outlets, (ot) => {
									return openBlock(), createBlock("option", {
										key: ot.id,
										value: String(ot.id)
									}, toDisplayString(ot.name), 9, ["value"]);
								}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(stockForm).outlet_id]]),
								unref(stockForm).errors.outlet_id ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(stockForm).errors.outlet_id), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [createVNode("label", { class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block mb-1" }, "Adjustment Action"), createVNode("div", { class: "grid grid-cols-2 gap-2" }, [createVNode("button", {
								type: "button",
								onClick: ($event) => unref(stockForm).action_type = "add",
								class: ["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(stockForm).action_type === "add" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"]
							}, " Add Stock (+Qty) ", 10, ["onClick"]), createVNode("button", {
								type: "button",
								onClick: ($event) => unref(stockForm).action_type = "set",
								class: ["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(stockForm).action_type === "set" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"]
							}, " Set Absolute Stock (=Qty) ", 10, ["onClick"])])]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "stock_qty",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Quantity (pcs)"),
								withDirectives(createVNode("input", {
									id: "stock_qty",
									"onUpdate:modelValue": ($event) => unref(stockForm).stock_qty = $event,
									type: "number",
									min: "0",
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[
									vModelText,
									unref(stockForm).stock_qty,
									void 0,
									{ number: true }
								]]),
								unref(stockForm).errors.stock_qty ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(stockForm).errors.stock_qty), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "stock_threshold",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Safety Threshold (Minimum Stock Alert)"),
								withDirectives(createVNode("input", {
									id: "stock_threshold",
									"onUpdate:modelValue": ($event) => unref(stockForm).threshold_qty = $event,
									type: "number",
									min: "0",
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[
									vModelText,
									unref(stockForm).threshold_qty,
									void 0,
									{ number: true }
								]]),
								unref(stockForm).errors.threshold_qty ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(stockForm).errors.threshold_qty), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "stock_supplier",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Supplier"),
								withDirectives(createVNode("select", {
									id: "stock_supplier",
									"onUpdate:modelValue": ($event) => unref(stockForm).supplier_id = $event,
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, [createVNode("option", { value: "" }, "Select Supplier"), (openBlock(true), createBlock(Fragment, null, renderList(__props.suppliers, (sp) => {
									return openBlock(), createBlock("option", {
										key: sp.id,
										value: String(sp.id)
									}, toDisplayString(sp.name), 9, ["value"]);
								}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(stockForm).supplier_id]]),
								unref(stockForm).errors.supplier_id ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(stockForm).errors.supplier_id), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "stock_notes",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Adjustment Notes"),
								withDirectives(createVNode("textarea", {
									id: "stock_notes",
									"onUpdate:modelValue": ($event) => unref(stockForm).notes = $event,
									rows: "2",
									placeholder: "e.g. Purchase order invoice number, batch code, expiry notes...",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(stockForm).notes]]),
								unref(stockForm).errors.notes ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(stockForm).errors.notes), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "flex items-center justify-end gap-3 pt-4 border-t border-slate-200 dark:border-slate-800" }, [createVNode("button", {
								type: "button",
								onClick: ($event) => isStockModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								type: "submit",
								disabled: unref(stockForm).processing,
								class: "px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"
							}, toDisplayString(unref(stockForm).processing ? "Saving..." : "Save Stock"), 9, ["disabled"])])
						], 32)])])) : createCommentVNode("", true),
						isDeleteModalOpen.value ? (openBlock(), createBlock("div", {
							key: 3,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6" }, [
							createVNode("div", { class: "flex items-center gap-3 text-rose-600 dark:text-rose-400" }, [createVNode(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }), createVNode("h3", { class: "text-lg font-bold" }, "Delete Product?")]),
							createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400" }, [
								createTextVNode(" Are you sure you want to delete product "),
								createVNode("span", { class: "font-bold text-slate-900 dark:text-slate-100" }, "\"" + toDisplayString(productToDelete.value?.name) + "\"", 1),
								createTextVNode("? This will permanently delete this product, its recipes, and stock records across all outlets. This action is irreversible. ")
							]),
							createVNode("div", { class: "flex items-center justify-end gap-3" }, [createVNode("button", {
								onClick: ($event) => isDeleteModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								onClick: deleteProduct,
								class: "px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Confirm Delete ")])
						])])) : createCommentVNode("", true)
					];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Products/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/Products/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 };
