import { t as useAuth } from "./useAuth-CmhDlqZz.js";
import { Head } from "@inertiajs/vue3";
import { computed, defineComponent, unref, useSSRContext } from "vue";
import { ssrInterpolate, ssrRenderClass, ssrRenderComponent, ssrRenderList, ssrRenderStyle } from "vue/server-renderer";
import { AlertTriangle, Building, Calendar, DollarSign, FileText, Printer, ShoppingBag, TrendingUp, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Reports/Print.vue?vue&type=script&setup=true&lang.ts
var Print_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
	__name: "Print",
	__ssrInlineRender: true,
	props: {
		metrics: {},
		lowStockAlerts: {},
		salesTrend: {},
		topProducts: {},
		outlets: {},
		filters: {},
		waiterPerformance: {},
		tableTurnover: {},
		peakHours: {}
	},
	setup(__props) {
		const { settings } = useAuth();
		const props = __props;
		const activeOutletName = computed(() => {
			if (!props.filters.outlet_id) return "Semua Outlet";
			const found = props.outlets.find((o) => o.id === Number(props.filters.outlet_id));
			return found ? found.name : "Semua Outlet";
		});
		const formatDate = (dateStr) => {
			if (!dateStr) return "-";
			return new Date(dateStr).toLocaleDateString("id-ID", {
				day: "numeric",
				month: "long",
				year: "numeric"
			});
		};
		const printDate = computed(() => {
			const d = /* @__PURE__ */ new Date();
			return d.toLocaleDateString("id-ID", {
				day: "numeric",
				month: "long",
				year: "numeric"
			}) + " " + d.toLocaleTimeString("id-ID", {
				hour: "2-digit",
				minute: "2-digit"
			});
		});
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Cetak Laporan - " + (unref(settings)().site_name || "CafePOS") }, null, _parent));
			_push(`<div class="min-h-screen bg-slate-100 dark:bg-slate-900 print:bg-white text-slate-800 print:text-black font-sans antialiased"><div class="sticky top-0 bg-white dark:bg-slate-950 border-b border-slate-200 dark:border-slate-800 px-6 py-4 flex items-center justify-between shadow-sm z-50 print:hidden select-none"><div class="flex items-center gap-2">`);
			_push(ssrRenderComponent(unref(FileText), { class: "h-5 w-5 text-red-600" }, null, _parent));
			_push(`<div><h1 class="text-sm font-bold text-slate-900 dark:text-slate-100">Pratinjau Cetak Laporan</h1><p class="text-[10px] text-slate-500">Sesuaikan tata letak cetak di jendela browser Anda.</p></div></div><div class="flex items-center gap-3"><button class="px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-xs font-bold transition-colors cursor-pointer flex items-center gap-2 shadow-sm">`);
			_push(ssrRenderComponent(unref(Printer), { class: "h-4 w-4" }, null, _parent));
			_push(`<span>Cetak Laporan</span></button><button class="px-4 py-2 border border-slate-200 dark:border-slate-850 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-xs font-bold transition-colors cursor-pointer flex items-center gap-2 text-slate-700 dark:text-slate-300 bg-white dark:bg-transparent">`);
			_push(ssrRenderComponent(unref(X), { class: "h-4 w-4" }, null, _parent));
			_push(`<span>Tutup</span></button></div></div><main class="max-w-4xl mx-auto my-6 p-8 md:p-12 bg-white border border-slate-200 dark:border-slate-800 print:border-0 rounded-xl shadow-md print:shadow-none print:my-0 print:p-0"><div class="flex flex-col sm:flex-row justify-between items-start gap-4 pb-6 border-b-2 border-slate-900 print:border-slate-800"><div class="space-y-1"><span class="text-xs font-bold uppercase tracking-widest text-red-600">${ssrInterpolate(unref(settings)().site_name)}</span><h2 class="text-2xl font-black text-slate-900 tracking-tight">LAPORAN AKTIVITAS KEUANGAN</h2><div class="flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-slate-500 font-medium"><span class="flex items-center gap-1">`);
			_push(ssrRenderComponent(unref(Building), { class: "h-3.5 w-3.5" }, null, _parent));
			_push(` Outlet: <strong class="text-slate-800">${ssrInterpolate(activeOutletName.value)}</strong></span><span class="flex items-center gap-1">`);
			_push(ssrRenderComponent(unref(Calendar), { class: "h-3.5 w-3.5" }, null, _parent));
			_push(` Periode: <strong class="text-slate-800">${ssrInterpolate(formatDate(__props.filters.start_date))} - ${ssrInterpolate(formatDate(__props.filters.end_date))}</strong></span></div></div><div class="text-right sm:text-right text-xs text-slate-500 space-y-1"><p>Dicetak pada: <strong class="text-slate-800">${ssrInterpolate(printDate.value)}</strong></p><p>Status Laporan: <span class="px-1.5 py-0.5 bg-emerald-50 text-emerald-800 font-bold rounded text-[9px] uppercase border border-emerald-200">Finalized</span></p></div></div><div class="grid grid-cols-3 md:grid-cols-6 gap-4 py-8"><div class="border border-slate-200 rounded-xl p-4 flex flex-col justify-between"><span class="text-[9px] font-bold text-slate-400 uppercase tracking-wider">Total Pendapatan</span><h4 class="text-base font-extrabold text-slate-900 mt-1"> Rp ${ssrInterpolate(Number(__props.metrics.total_revenue).toLocaleString("id-ID"))}</h4><span class="text-[9px] text-slate-400 mt-2 flex items-center gap-1 font-medium">`);
			_push(ssrRenderComponent(unref(DollarSign), { class: "h-3 w-3 text-red-600" }, null, _parent));
			_push(` Sales Revenue </span></div><div class="border border-slate-200 rounded-xl p-4 flex flex-col justify-between"><span class="text-[9px] font-bold text-slate-400 uppercase tracking-wider">Total Transaksi</span><h4 class="text-base font-extrabold text-slate-900 mt-1">${ssrInterpolate(__props.metrics.total_transactions)} Orders </h4><span class="text-[9px] text-slate-400 mt-2 flex items-center gap-1 font-medium">`);
			_push(ssrRenderComponent(unref(ShoppingBag), { class: "h-3 w-3 text-red-600" }, null, _parent));
			_push(` Completed Tickets </span></div><div class="border border-slate-200 rounded-xl p-4 flex flex-col justify-between"><span class="text-[9px] font-bold text-slate-400 uppercase tracking-wider">Rata-Rata Transaksi</span><h4 class="text-base font-extrabold text-slate-900 mt-1"> Rp ${ssrInterpolate(Number(__props.metrics.average_ticket).toLocaleString("id-ID"))}</h4><span class="text-[9px] text-slate-400 mt-2 flex items-center gap-1 font-medium">`);
			_push(ssrRenderComponent(unref(TrendingUp), { class: "h-3 w-3 text-red-600" }, null, _parent));
			_push(` Average Spend </span></div><div class="border border-slate-200 rounded-xl p-4 flex flex-col justify-between"><span class="text-[9px] font-bold text-slate-400 uppercase tracking-wider">Total HPP</span><h4 class="text-base font-extrabold text-slate-900 mt-1"> Rp ${ssrInterpolate(Number(__props.metrics.total_cogs).toLocaleString("id-ID"))}</h4><span class="text-[9px] text-slate-400 mt-2 flex items-center gap-1 font-medium">`);
			_push(ssrRenderComponent(unref(DollarSign), { class: "h-3 w-3 text-red-600" }, null, _parent));
			_push(` Cost of Goods </span></div><div class="border border-slate-200 rounded-xl p-4 flex flex-col justify-between"><span class="text-[9px] font-bold text-slate-400 uppercase tracking-wider">Rasio Food Cost</span><h4 class="text-base font-extrabold text-slate-900 mt-1">${ssrInterpolate(Number(__props.metrics.food_cost_percentage).toFixed(1))}% </h4><span class="text-[9px] text-slate-400 mt-2 flex items-center gap-1 font-medium">`);
			_push(ssrRenderComponent(unref(TrendingUp), { class: "h-3 w-3 text-red-600" }, null, _parent));
			_push(` Cost Ratio </span></div><div class="${ssrRenderClass([__props.metrics.low_stock_count > 0 ? "border-amber-300 bg-amber-50/20" : "border-slate-200", "border rounded-xl p-4 flex flex-col justify-between"])}"><span class="text-[9px] font-bold text-slate-400 uppercase tracking-wider">Peringatan Inventori</span><h4 class="${ssrRenderClass([__props.metrics.low_stock_count > 0 ? "text-amber-700" : "text-slate-900", "text-base font-extrabold mt-1"])}">${ssrInterpolate(__props.metrics.low_stock_count)} Items </h4><span class="text-[9px] text-slate-400 mt-2 flex items-center gap-1 font-medium">`);
			_push(ssrRenderComponent(unref(AlertTriangle), { class: "h-3 w-3 text-amber-500" }, null, _parent));
			_push(` Safety Level </span></div></div><div class="space-y-8"><div class="space-y-3"><h3 class="text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-1.5 pb-1.5 border-b border-slate-200"><span class="h-1.5 w-1.5 bg-slate-800 rounded-full"></span> Daftar Menu Terlaris (Top 5) </h3><div class="overflow-x-auto"><table class="w-full border-collapse text-left text-xs border border-slate-200"><thead><tr class="bg-slate-50 font-bold border-b border-slate-200 text-slate-600"><th class="p-2.5 w-16 text-center">Rank</th><th class="p-2.5">Nama Menu</th><th class="p-2.5">Kategori</th><th class="p-2.5 text-center">Porsi Terjual</th><th class="p-2.5 text-right pr-4">Total Omzet</th></tr></thead><tbody class="divide-y divide-slate-100">`);
			if (__props.topProducts.length === 0) _push(`<tr><td colspan="5" class="p-4 text-center text-slate-400 italic">Belum ada pesanan yang tercatat.</td></tr>`);
			else _push(`<!---->`);
			_push(`<!--[-->`);
			ssrRenderList(__props.topProducts, (item, idx) => {
				_push(`<tr class="hover:bg-slate-50/50"><td class="p-2.5 text-center font-bold text-slate-500">#${ssrInterpolate(idx + 1)}</td><td class="p-2.5 font-bold text-slate-900">${ssrInterpolate(item.name)}</td><td class="p-2.5 text-slate-500">${ssrInterpolate(item.category)}</td><td class="p-2.5 text-center font-semibold">${ssrInterpolate(item.qty)} porsi</td><td class="p-2.5 text-right font-mono pr-4 font-bold">Rp ${ssrInterpolate(Number(item.sales).toLocaleString("id-ID"))}</td></tr>`);
			});
			_push(`<!--]--></tbody></table></div></div><div class="space-y-3"><h3 class="text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-1.5 pb-1.5 border-b border-slate-200"><span class="h-1.5 w-1.5 bg-slate-800 rounded-full"></span> Tren Pendapatan Harian </h3><div class="overflow-x-auto"><table class="w-full border-collapse text-left text-xs border border-slate-200"><thead><tr class="bg-slate-50 font-bold border-b border-slate-200 text-slate-600"><th class="p-2.5">Tanggal</th><th class="p-2.5 text-center">Jumlah Transaksi</th><th class="p-2.5 text-right pr-4">Omzet Harian</th></tr></thead><tbody class="divide-y divide-slate-100">`);
			if (__props.salesTrend.length === 0) _push(`<tr><td colspan="3" class="p-4 text-center text-slate-400 italic">Tidak ada data penjualan untuk rentang waktu ini.</td></tr>`);
			else _push(`<!---->`);
			_push(`<!--[-->`);
			ssrRenderList(__props.salesTrend, (p, idx) => {
				_push(`<tr class="hover:bg-slate-50/50"><td class="p-2.5 font-medium text-slate-800">${ssrInterpolate(formatDate(p.date))}</td><td class="p-2.5 text-center font-semibold">${ssrInterpolate(p.count)} kali</td><td class="p-2.5 text-right font-mono pr-4 font-bold text-slate-900">Rp ${ssrInterpolate(Number(p.total).toLocaleString("id-ID"))}</td></tr>`);
			});
			_push(`<!--]--></tbody></table></div></div><div class="grid grid-cols-1 md:grid-cols-2 gap-6 avoid-page-break"><div class="space-y-3"><h3 class="text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-1.5 pb-1.5 border-b border-slate-200"><span class="h-1.5 w-1.5 bg-slate-800 rounded-full"></span> Performa Pelayan </h3><table class="w-full border-collapse text-left text-xs border border-slate-200"><thead><tr class="bg-slate-50 font-bold border-b border-slate-200 text-slate-600"><th class="p-2.5">Nama Pelayan</th><th class="p-2.5 text-center">Transaksi</th><th class="p-2.5 text-right pr-4">Total Penjualan</th></tr></thead><tbody class="divide-y divide-slate-100">`);
			if (__props.waiterPerformance.length === 0) _push(`<tr><td colspan="3" class="p-4 text-center text-slate-400 italic">Belum ada data.</td></tr>`);
			else _push(`<!---->`);
			_push(`<!--[-->`);
			ssrRenderList(__props.waiterPerformance, (w) => {
				_push(`<tr class="hover:bg-slate-50/50"><td class="p-2.5 font-bold text-slate-900">${ssrInterpolate(w.name)}</td><td class="p-2.5 text-center font-semibold">${ssrInterpolate(w.transactions)}</td><td class="p-2.5 text-right font-mono pr-4 font-bold">Rp ${ssrInterpolate(Number(w.sales).toLocaleString("id-ID"))}</td></tr>`);
			});
			_push(`<!--]--></tbody></table></div><div class="space-y-3"><h3 class="text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-1.5 pb-1.5 border-b border-slate-200"><span class="h-1.5 w-1.5 bg-slate-800 rounded-full"></span> Okupansi Meja </h3><table class="w-full border-collapse text-left text-xs border border-slate-200"><thead><tr class="bg-slate-50 font-bold border-b border-slate-200 text-slate-600"><th class="p-2.5">No. Meja</th><th class="p-2.5 text-center">Frekuensi</th><th class="p-2.5 text-right pr-4">Total Transaksi</th></tr></thead><tbody class="divide-y divide-slate-100">`);
			if (__props.tableTurnover.length === 0) _push(`<tr><td colspan="3" class="p-4 text-center text-slate-400 italic">Belum ada data.</td></tr>`);
			else _push(`<!---->`);
			_push(`<!--[-->`);
			ssrRenderList(__props.tableTurnover, (t) => {
				_push(`<tr class="hover:bg-slate-50/50"><td class="p-2.5 font-bold text-slate-900">Meja ${ssrInterpolate(t.number)}</td><td class="p-2.5 text-center font-semibold">${ssrInterpolate(t.transactions)}x</td><td class="p-2.5 text-right font-mono pr-4 font-bold">Rp ${ssrInterpolate(Number(t.sales).toLocaleString("id-ID"))}</td></tr>`);
			});
			_push(`<!--]--></tbody></table></div></div><div class="space-y-3 avoid-page-break"><h3 class="text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-1.5 pb-1.5 border-b border-slate-200"><span class="h-1.5 w-1.5 bg-slate-800 rounded-full"></span> Jam Sibuk Operasional (Peak Hours) </h3><table class="w-full border-collapse text-left text-xs border border-slate-200"><thead><tr class="bg-slate-50 font-bold border-b border-slate-200 text-slate-600"><th class="p-2.5">Jam Operasional</th><th class="p-2.5 text-center">Frekuensi Transaksi</th><th class="p-2.5 text-right pr-4">Total Penjualan</th></tr></thead><tbody class="divide-y divide-slate-100">`);
			if (__props.peakHours.length === 0) _push(`<tr><td colspan="3" class="p-4 text-center text-slate-400 italic">Belum ada data.</td></tr>`);
			else _push(`<!---->`);
			_push(`<!--[-->`);
			ssrRenderList(__props.peakHours, (h) => {
				_push(`<tr class="hover:bg-slate-50/50"><td class="p-2.5 font-medium text-slate-800">${ssrInterpolate(h.hour)}</td><td class="p-2.5 text-center font-semibold">${ssrInterpolate(h.transactions)} Transaksi</td><td class="p-2.5 text-right font-mono pr-4 font-bold">Rp ${ssrInterpolate(Number(h.sales).toLocaleString("id-ID"))}</td></tr>`);
			});
			_push(`<!--]--></tbody></table></div><div class="space-y-3"><h3 class="text-xs font-bold text-slate-900 uppercase tracking-widest flex items-center gap-1.5 pb-1.5 border-b border-slate-200"><span class="h-1.5 w-1.5 bg-slate-800 rounded-full"></span> Peringatan Stok Bahan &amp; Produk Menipis </h3><div class="overflow-x-auto"><table class="w-full border-collapse text-left text-xs border border-slate-200"><thead><tr class="bg-slate-50 font-bold border-b border-slate-200 text-slate-600"><th class="p-2.5">Nama Item</th><th class="p-2.5">Tipe Stok</th><th class="p-2.5">Lokasi Outlet</th><th class="p-2.5 text-center">Stok Saat Ini</th><th class="p-2.5 text-right pr-4">Batas Aman Minimum</th></tr></thead><tbody class="divide-y divide-slate-100">`);
			if (__props.lowStockAlerts.length === 0) _push(`<tr><td colspan="5" class="p-4 text-center text-slate-400 italic">Semua persediaan bahan baku dan retail product di outlet aman.</td></tr>`);
			else _push(`<!---->`);
			_push(`<!--[-->`);
			ssrRenderList(__props.lowStockAlerts, (warn, idx) => {
				_push(`<tr class="hover:bg-slate-50/50 text-slate-700"><td class="p-2.5 font-bold text-slate-900">${ssrInterpolate(warn.name)}</td><td class="p-2.5"><span class="px-1.5 py-0.5 rounded bg-slate-100 text-[10px] font-semibold border border-slate-200">${ssrInterpolate(warn.type)}</span></td><td class="p-2.5">${ssrInterpolate(warn.outlet_name)}</td><td class="p-2.5 text-center text-red-600 font-bold">${ssrInterpolate(Number(warn.stock_qty).toLocaleString("id-ID"))} ${ssrInterpolate(warn.unit)}</td><td class="p-2.5 text-right pr-4 font-mono">${ssrInterpolate(Number(warn.threshold_qty).toLocaleString("id-ID"))} ${ssrInterpolate(warn.unit)}</td></tr>`);
			});
			_push(`<!--]--></tbody></table></div></div></div><div class="mt-16 pt-8 border-t border-slate-200 flex justify-between gap-12 text-xs avoid-page-break" style="${ssrRenderStyle({
				"page-break-inside": "avoid",
				"break-inside": "avoid"
			})}"><div class="flex flex-col space-y-16 w-48 text-center"><div><p class="text-slate-450 uppercase tracking-widest text-[9px] font-bold">Prepared By</p><p class="font-semibold text-slate-800 mt-1">Manajer Keuangan</p></div><div class="border-b border-slate-400 w-full"></div><p class="text-slate-450 font-medium">Tanggal: _______________</p></div><div class="flex flex-col space-y-16 w-48 text-center"><div><p class="text-slate-455 uppercase tracking-widest text-[9px] font-bold">Approved By</p><p class="font-semibold text-slate-800 mt-1">Pemilik (Owner)</p></div><div class="border-b border-slate-400 w-full"></div><p class="text-slate-455 font-medium">Tanggal: _______________</p></div></div><div class="hidden print:flex justify-between items-center mt-12 pt-4 border-t border-slate-100 text-[9px] text-slate-400 font-medium"><span>Dokumen rahasia - Khusus penggunaan internal CafePOS.</span><span>Halaman 1 dari 1</span></div></main></div><!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Reports/Print.vue
var _sfc_setup = Print_vue_vue_type_script_setup_true_lang_default.setup;
Print_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/Reports/Print.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Print_default = Print_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Print_default as default };
