import { t as AdminLayout_default } from "./AdminLayout-DcKfAlG1.js";
import { Head, router, useForm } from "@inertiajs/vue3";
import { Fragment, Transition, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, onBeforeUnmount, onMounted, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelSelect, vModelText, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderClass, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { Activity, AlertTriangle, CheckCircle2, Database, Download, Info, Key, Printer, RefreshCw, Server, Shield, Trash2, XCircle } from "lucide-vue-next";
//#region resources/js/Pages/Settings/QzTray.vue?vue&type=script&setup=true&lang.ts
var QzTray_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
	__name: "QzTray",
	__ssrInlineRender: true,
	props: {
		certificate: {},
		status: {},
		isOpenSslAvailable: { type: Boolean },
		recentLogs: {},
		paginatedLogs: {},
		config: {}
	},
	setup(__props) {
		const props = __props;
		const showGenerateModal = ref(false);
		const showDeleteModal = ref(false);
		const showLogsModal = ref(false);
		const showWarningRegenerate = ref(false);
		const qzLoaded = ref(false);
		const qzInstance = ref(null);
		const isWsConnected = ref(false);
		const printersList = ref([]);
		const selectedPrinter = ref("");
		const connectionLog = ref([]);
		const testStatus = ref("idle");
		const isPrinting = ref(false);
		const showToast = ref(false);
		const toastMessage = ref("");
		const toastType = ref("success");
		const triggerToast = (msg, type = "success") => {
			toastMessage.value = msg;
			toastType.value = type;
			showToast.value = true;
			setTimeout(() => {
				showToast.value = false;
			}, 5e3);
		};
		const certForm = useForm({
			name: props.certificate?.name || "CafePOS QZ Client",
			country: props.config.dn.country,
			state: props.config.dn.state,
			locality: props.config.dn.locality,
			organization: props.config.dn.organization,
			organizational_unit: props.config.dn.organizational_unit,
			common_name: props.config.dn.common_name,
			email: props.config.dn.email
		});
		const formatDate = (dateStr) => {
			if (!dateStr) return "Never";
			return new Date(dateStr).toLocaleString("id-ID", {
				dateStyle: "medium",
				timeStyle: "short"
			});
		};
		const initializeQz = () => {
			if (!qzInstance.value || !props.certificate) return;
			const csrfToken = document.querySelector("meta[name=\"csrf-token\"]")?.getAttribute("content") || "";
			if (props.config?.signature_algorithm) qzInstance.value.security.setSignatureAlgorithm(props.config.signature_algorithm.toUpperCase());
			qzInstance.value.security.setCertificatePromise((resolve) => {
				resolve(props.certificate?.public_certificate);
			});
			qzInstance.value.security.setSignaturePromise((toSign) => {
				return (resolve, reject) => {
					fetch(route("qz-tray.sign"), {
						method: "POST",
						headers: {
							"Content-Type": "application/json",
							"X-CSRF-TOKEN": csrfToken,
							"Accept": "application/json"
						},
						body: JSON.stringify({ payload: toSign })
					}).then(async (res) => {
						if (!res.ok) {
							const errData = await res.json();
							throw new Error(errData.message || "Signature endpoint failed.");
						}
						return res.json();
					}).then((data) => {
						if (data.success) resolve(data.signature);
						else reject(data.message || "Signing failed");
					}).catch((err) => {
						reject(err.message || err);
					});
				};
			});
		};
		const toggleQzConnection = async () => {
			if (!qzInstance.value) return;
			connectionLog.value = [];
			testStatus.value = "testing";
			if (qzInstance.value.websocket.isActive()) {
				connectionLog.value.push("Disconnecting from WebSocket...");
				try {
					await qzInstance.value.websocket.disconnect();
					isWsConnected.value = false;
					printersList.value = [];
					connectionLog.value.push("WebSocket disconnected.");
					testStatus.value = "idle";
				} catch (e) {
					connectionLog.value.push(`Disconnect error: ${e.message || e}`);
					testStatus.value = "failed";
				}
				return;
			}
			connectionLog.value.push("Checking QZ Tray WebSocket...");
			try {
				await qzInstance.value.websocket.connect();
				isWsConnected.value = true;
				connectionLog.value.push("WebSocket connected to QZ Tray.");
				if (props.certificate) {
					connectionLog.value.push("Certificate loaded in frontend. Verifying signature API...");
					const defaultPrinter = await qzInstance.value.printers.getDefault();
					connectionLog.value.push(`Signature valid. Default printer: ${defaultPrinter || "None"}`);
				} else connectionLog.value.push("Warning: No public certificate active. Client will prompt for security.");
				await loadPrinters();
				testStatus.value = "success";
			} catch (e) {
				connectionLog.value.push(`Connection failed: ${e.message || e}`);
				connectionLog.value.push("Please check if QZ Tray is installed and running.");
				testStatus.value = "failed";
				isWsConnected.value = false;
			}
		};
		const loadPrinters = async () => {
			if (!qzInstance.value || !qzInstance.value.websocket.isActive()) return;
			try {
				const list = await qzInstance.value.printers.find();
				printersList.value = list;
				if (list.length > 0) selectedPrinter.value = list[0];
			} catch (e) {
				console.error("Failed to load printers", e);
			}
		};
		const printTestReceipt = async () => {
			if (!qzInstance.value || !selectedPrinter.value) return;
			isPrinting.value = true;
			try {
				const config = qzInstance.value.configs.create(selectedPrinter.value);
				const printData = [{
					type: "html",
					format: "plain",
					data: `
                    <div style="font-family: 'Courier New', Courier, monospace; font-size: 11px; width: 280px; padding: 12px; color: #000; background: #fff;">
                        <div style="text-align: center; font-weight: bold; font-size: 14px; margin-bottom: 2px;">CAFEPOS</div>
                        <div style="text-align: center; font-size: 9px; text-transform: uppercase;">Enterprise Print System</div>
                        <div style="text-align: center; margin: 6px 0;">================================</div>
                        
                        <div style="margin-bottom: 6px;">
                            <div style="display: flex; justify-content: space-between;">
                                <span>DATE:</span>
                                <span>${(/* @__PURE__ */ new Date()).toLocaleString()}</span>
                            </div>
                            <div style="display: flex; justify-content: space-between;">
                                <span>SESS:</span>
                                <span>MOCK-TEST-9920</span>
                            </div>
                        </div>
 
                        <div style="margin-bottom: 6px;">
                            <div style="display: flex; justify-content: space-between; font-weight: bold;">
                                <span>ITEM</span>
                                <span>QTY &nbsp; PRICE</span>
                            </div>
                            <div style="text-align: center; margin: 2px 0;">--------------------------------</div>
                            <div style="display: flex; justify-content: space-between;">
                                <span>Printer Connection Test</span>
                                <span>1x &nbsp;&nbsp; $0.00</span>
                            </div>
                            <div style="display: flex; justify-content: space-between;">
                                <span>Signature Autopass</span>
                                <span>1x &nbsp;&nbsp; $0.00</span>
                            </div>
                        </div>

                        <div style="text-align: center; margin: 4px 0;">--------------------------------</div>
                        <div style="display: flex; justify-content: space-between; font-weight: bold; font-size: 12px;">
                            <span>TOTAL PAID:</span>
                            <span>$0.00</span>
                        </div>
                        <div style="text-align: center; margin: 6px 0;">================================</div>
                        
                        <div style="text-align: center; font-size: 9px; font-weight: bold;">
                            STATUS: SIGNED SECURELY
                        </div>
                        <div style="text-align: center; font-size: 8px; color: #555; margin-top: 4px; word-break: break-all;">
                            FPR: ${props.certificate?.fingerprint || "N/A"}
                        </div>
                    </div>
                `
				}];
				await qzInstance.value.print(config, printData);
				triggerToast("Test receipt sent to printer successfully!", "success");
			} catch (e) {
				triggerToast(`Print failed: ${e.message || e}`, "error");
			} finally {
				isPrinting.value = false;
			}
		};
		const submitGenerate = () => {
			const isRegen = !!props.certificate;
			const url = isRegen ? route("settings.qz-tray.regenerate") : route("settings.qz-tray.generate");
			certForm.post(url, {
				onSuccess: () => {
					showGenerateModal.value = false;
					showWarningRegenerate.value = false;
					initializeQz();
					triggerToast(isRegen ? "Certificate regenerated successfully." : "Certificate generated successfully.", "success");
				},
				onError: (errors) => {
					const firstErr = Object.values(errors)[0];
					triggerToast(firstErr || "Failed to generate certificate", "error");
				}
			});
		};
		const submitDelete = () => {
			router.delete(route("settings.qz-tray.destroy"), {
				onSuccess: () => {
					showDeleteModal.value = false;
					printersList.value = [];
					isWsConnected.value = false;
					triggerToast("QZ Tray certificate deleted successfully.", "success");
				},
				onError: () => {
					triggerToast("Failed to delete certificate.", "error");
				}
			});
		};
		onMounted(async () => {
			if (typeof window !== "undefined") try {
				qzInstance.value = (await import("qz-tray")).default;
				qzLoaded.value = true;
				initializeQz();
				if (qzInstance.value.websocket.isActive()) {
					isWsConnected.value = true;
					await loadPrinters();
				}
			} catch (e) {
				console.error("Failed to load qz-tray", e);
			}
		});
		onBeforeUnmount(async () => {
			if (qzInstance.value && qzInstance.value.websocket.isActive()) try {
				await qzInstance.value.websocket.disconnect();
			} catch (e) {}
		});
		return (_ctx, _push, _parent, _attrs) => {
			_push(ssrRenderComponent(AdminLayout_default, _attrs, {
				default: withCtx((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(ssrRenderComponent(unref(Head), { title: "QZ Tray Settings" }, null, _parent, _scopeId));
						_push(``);
						if (showToast.value) {
							_push(`<div class="${ssrRenderClass(["fixed top-4 right-4 z-50 max-w-md w-full border rounded-xl shadow-xl p-4 flex items-start gap-3", toastType.value === "success" ? "bg-white dark:bg-slate-900 border-emerald-200 dark:border-emerald-950/30" : "bg-white dark:bg-slate-900 border-rose-200 dark:border-rose-950/30"])}"${_scopeId}>`);
							if (toastType.value === "success") _push(ssrRenderComponent(unref(CheckCircle2), { class: "h-5 w-5 text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-0.5" }, null, _parent, _scopeId));
							else _push(ssrRenderComponent(unref(XCircle), { class: "h-5 w-5 text-rose-600 dark:text-rose-400 flex-shrink-0 mt-0.5" }, null, _parent, _scopeId));
							_push(`<div class="flex-1 min-w-0"${_scopeId}><p class="text-sm font-semibold text-slate-950 dark:text-slate-50"${_scopeId}>${ssrInterpolate(toastType.value === "success" ? "Success" : "Error")}</p><p class="text-xs text-slate-500 dark:text-slate-400 mt-0.5"${_scopeId}>${ssrInterpolate(toastMessage.value)}</p></div></div>`);
						} else _push(`<!---->`);
						_push(`<div class="w-full space-y-6"${_scopeId}><div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-100 flex items-center gap-2"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Printer), { class: "h-6 w-6 text-blue-600" }, null, _parent, _scopeId));
						_push(` QZ Tray Integration </h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Configure self-signed certificates to authorize silent printing operations from your POS terminals. </p></div><div class="flex gap-2"${_scopeId}><button class="inline-flex items-center gap-1.5 px-3 py-2 bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 text-slate-700 dark:text-slate-200 rounded-lg text-sm font-semibold transition-colors cursor-pointer"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Activity), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>View All Logs</span></button></div></div>`);
						if (!__props.isOpenSslAvailable) {
							_push(`<div class="bg-rose-50 dark:bg-rose-950/20 border border-rose-200 dark:border-rose-900/40 rounded-xl p-5 flex items-start gap-4"${_scopeId}>`);
							_push(ssrRenderComponent(unref(AlertTriangle), { class: "h-6 w-6 text-rose-600 dark:text-rose-400 flex-shrink-0 mt-0.5" }, null, _parent, _scopeId));
							_push(`<div${_scopeId}><h3 class="text-sm font-bold text-rose-800 dark:text-rose-300"${_scopeId}>OpenSSL PHP Extension Missing</h3><p class="text-xs text-rose-700 dark:text-rose-400 mt-1 leading-relaxed"${_scopeId}> The \`openssl\` extension is not loaded on this PHP server. Certificate generation requires OpenSSL. Please enable it in your server&#39;s \`php.ini\` file. </p></div></div>`);
						} else _push(`<!---->`);
						_push(`<div class="grid grid-cols-1 lg:grid-cols-3 gap-6"${_scopeId}><div class="lg:col-span-2 space-y-6"${_scopeId}><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6"${_scopeId}><div class="flex items-center justify-between border-b border-slate-100 dark:border-slate-900 pb-4"${_scopeId}><h2 class="text-base font-semibold text-slate-900 dark:text-slate-100 flex items-center gap-2"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Shield), { class: "h-5 w-5 text-blue-600" }, null, _parent, _scopeId));
						_push(` Certificate Details </h2><span class="${ssrRenderClass([
							"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold uppercase tracking-wide",
							__props.status === "active" ? "bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-400 border border-emerald-200 dark:border-emerald-900/30" : "",
							__props.status === "expired" ? "bg-rose-50 dark:bg-rose-950/30 text-rose-700 dark:text-rose-400 border border-rose-200 dark:border-rose-900/30" : "",
							__props.status === "invalid" ? "bg-amber-50 dark:bg-amber-950/30 text-amber-700 dark:text-amber-400 border border-amber-200 dark:border-amber-900/30" : "",
							__props.status === "not_generated" ? "bg-slate-100 dark:bg-slate-900 text-slate-500 dark:text-slate-400 border border-slate-200 dark:border-slate-850" : ""
						])}"${_scopeId}><span class="h-1.5 w-1.5 rounded-full bg-current"${_scopeId}></span> ${ssrInterpolate(__props.status.replace("_", " "))}</span></div>`);
						if (__props.certificate) _push(`<div class="grid grid-cols-1 md:grid-cols-2 gap-y-4 gap-x-6 text-sm"${_scopeId}><div class="space-y-1"${_scopeId}><span class="text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium"${_scopeId}>Certificate Name</span><span class="font-semibold text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(__props.certificate.name)}</span></div><div class="space-y-1"${_scopeId}><span class="text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium"${_scopeId}>Key Pair Type / Algorithm</span><span class="font-semibold text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(__props.certificate.algorithm)}</span></div><div class="space-y-1 md:col-span-2"${_scopeId}><span class="text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium font-mono"${_scopeId}>Fingerprint (SHA-256)</span><span class="font-mono text-xs font-semibold break-all bg-slate-50 dark:bg-slate-900/50 p-2 rounded border border-slate-100 dark:border-slate-900 block text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(__props.certificate.fingerprint)}</span></div><div class="space-y-1"${_scopeId}><span class="text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium"${_scopeId}>Created Date</span><span class="font-semibold text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(formatDate(__props.certificate.created_at))}</span></div><div class="space-y-1"${_scopeId}><span class="text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium"${_scopeId}>Expiration Date</span><span class="font-semibold text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(formatDate(__props.certificate.expires_at))}</span></div><div class="space-y-1"${_scopeId}><span class="text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium"${_scopeId}>Last Used</span><span class="font-semibold text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(formatDate(__props.certificate.last_used_at))}</span></div></div>`);
						else {
							_push(`<div class="text-center py-10 bg-slate-50/50 dark:bg-slate-900/20 rounded-xl border border-dashed border-slate-200 dark:border-slate-800"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Key), { class: "h-10 w-10 text-slate-400 mx-auto stroke-1" }, null, _parent, _scopeId));
							_push(`<h3 class="text-sm font-semibold text-slate-800 dark:text-slate-300 mt-3"${_scopeId}>No Certificate Generated</h3><p class="text-xs text-slate-400 max-w-sm mx-auto mt-1 leading-relaxed"${_scopeId}> Generate an application-wide self-signed certificate to begin automatic handshake validation with local QZ Tray clients. </p></div>`);
						}
						_push(`</div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6"${_scopeId}><h2 class="text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4"${_scopeId}> Certificate Actions </h2><div class="flex flex-wrap gap-4"${_scopeId}>`);
						if (!__props.certificate) {
							_push(`<button${ssrIncludeBooleanAttr(!__props.isOpenSslAvailable) ? " disabled" : ""} class="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-500 disabled:opacity-50 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 transition-all cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Key), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>Generate Certificate</span></button>`);
						} else _push(`<!---->`);
						if (__props.certificate) {
							_push(`<button class="inline-flex items-center gap-2 px-4 py-2 bg-amber-600 hover:bg-amber-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-amber-500/20 transition-all cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(RefreshCw), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>Regenerate Certificate</span></button>`);
						} else _push(`<!---->`);
						if (__props.certificate) {
							_push(`<a${ssrRenderAttr("href", _ctx.route("settings.qz-tray.download"))} class="inline-flex items-center gap-2 px-4 py-2 bg-slate-100 dark:bg-slate-850 hover:bg-slate-200 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-200 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Download), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>Download Public Cert</span></a>`);
						} else _push(`<!---->`);
						if (__props.certificate) {
							_push(`<button class="inline-flex items-center gap-2 px-4 py-2 bg-rose-50 dark:bg-rose-950/20 hover:bg-rose-100 dark:hover:bg-rose-950/40 text-rose-600 dark:text-rose-400 rounded-lg text-sm font-semibold border border-rose-200/50 dark:border-rose-900/30 transition-all cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Trash2), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>Delete Certificate</span></button>`);
						} else _push(`<!---->`);
						_push(`</div></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-4"${_scopeId}><h2 class="text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4 flex items-center gap-2"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Info), { class: "h-5 w-5 text-blue-600" }, null, _parent, _scopeId));
						_push(` Panduan Setup &amp; Sertifikat QZ Tray (Silent Printing) </h2><div class="text-xs text-slate-600 dark:text-slate-400 space-y-4 leading-relaxed font-medium"${_scopeId}><p${_scopeId}> Agar sistem dapat melakukan pencetakan struk secara otomatis tanpa memunculkan jendela dialog konfirmasi keamanan (silent printing), ikuti langkah-langkah setup berikut: </p><div class="grid grid-cols-1 md:grid-cols-3 gap-4"${_scopeId}><div class="border border-slate-100 dark:border-slate-850 p-4 rounded-xl bg-slate-50/50 dark:bg-slate-900/20 space-y-2 flex flex-col justify-between"${_scopeId}><div${_scopeId}><span class="h-6 w-6 rounded-full bg-blue-600/10 text-blue-650 dark:text-blue-400 flex items-center justify-center text-xs font-bold mb-2"${_scopeId}>1</span><h4 class="font-bold text-slate-850 dark:text-slate-200 text-xs"${_scopeId}>Generate Sertifikat</h4><p class="text-[11px] text-slate-505 dark:text-slate-400 leading-normal mt-1"${_scopeId}> Klik tombol <strong${_scopeId}>&quot;Generate Certificate&quot;</strong> di atas. Sistem akan membuat pasangan kunci privat &amp; publik OpenSSL baru secara otomatis di database backend. </p></div></div><div class="border border-slate-100 dark:border-slate-850 p-4 rounded-xl bg-slate-50/50 dark:bg-slate-900/20 space-y-2 flex flex-col justify-between"${_scopeId}><div${_scopeId}><span class="h-6 w-6 rounded-full bg-blue-600/10 text-blue-650 dark:text-blue-400 flex items-center justify-center text-xs font-bold mb-2"${_scopeId}>2</span><h4 class="font-bold text-slate-850 dark:text-slate-200 text-xs"${_scopeId}>Unduh Public Cert</h4><p class="text-[11px] text-slate-505 dark:text-slate-400 leading-normal mt-1"${_scopeId}> Klik tombol <strong${_scopeId}>&quot;Download Public Cert&quot;</strong> untuk mengunduh file sertifikat publik <code${_scopeId}>digital-certificate.txt</code> aplikasi Anda ke komputer. </p></div></div><div class="border border-slate-100 dark:border-slate-850 p-4 rounded-xl bg-slate-50/50 dark:bg-slate-900/20 space-y-2 flex flex-col justify-between"${_scopeId}><div${_scopeId}><span class="h-6 w-6 rounded-full bg-blue-600/10 text-blue-650 dark:text-blue-400 flex items-center justify-center text-xs font-bold mb-2"${_scopeId}>3</span><h4 class="font-bold text-slate-850 dark:text-slate-200 text-xs"${_scopeId}>Salin &amp; Trust Certificate</h4><p class="text-[11px] text-slate-505 dark:text-slate-400 leading-normal mt-1"${_scopeId}> Pindahkan atau salin file <code${_scopeId}>digital-certificate.txt</code> tersebut ke dalam folder instalasi QZ Tray di komputer kasir Anda agar terverifikasi otomatis. </p></div></div></div><div class="bg-slate-50 dark:bg-slate-900/50 border border-slate-200 dark:border-slate-800/80 p-4 rounded-xl font-mono text-[11px] text-slate-700 dark:text-slate-350 space-y-2"${_scopeId}><div class="font-bold text-slate-850 dark:text-slate-200 uppercase tracking-wider text-[10px]"${_scopeId}>Lokasi Folder Instalasi QZ Tray:</div><ul class="list-disc list-inside space-y-1"${_scopeId}><li${_scopeId}><strong${_scopeId}>Windows:</strong> <code${_scopeId}>C:\\Program Files\\QZ Tray\\digital-certificate.txt</code></li><li${_scopeId}><strong${_scopeId}>macOS:</strong> <code${_scopeId}>/Applications/QZ Tray.app/Contents/Resources/digital-certificate.txt</code></li><li${_scopeId}><strong${_scopeId}>Linux:</strong> <code${_scopeId}>/opt/qz-tray/digital-certificate.txt</code></li></ul><div class="text-[10px] text-amber-600 dark:text-amber-400 mt-2 font-sans font-semibold"${_scopeId}> *PENTING: Tutup (Close) QZ Tray dari system tray dan buka kembali aplikasinya setelah Anda menaruh file sertifikat agar QZ me-load sertifikat baru. </div></div></div></div></div><div class="space-y-6"${_scopeId}><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6"${_scopeId}><h2 class="text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4"${_scopeId}> Connection Testing </h2><div class="flex items-center gap-3"${_scopeId}><div class="${ssrRenderClass(["h-3 w-3 rounded-full", isWsConnected.value ? "bg-emerald-500 animate-pulse shadow shadow-emerald-500" : "bg-rose-500"])}"${_scopeId}></div><div${_scopeId}><span class="text-sm font-semibold block text-slate-800 dark:text-slate-200"${_scopeId}>${ssrInterpolate(isWsConnected.value ? "Connected to QZ Tray" : "Disconnected")}</span><span class="text-xs text-slate-400 dark:text-slate-500 block"${_scopeId}>${ssrInterpolate(isWsConnected.value ? "Local WebSocket active" : "Check if QZ Tray app is running locally")}</span></div></div><button class="${ssrRenderClass(["w-full inline-flex items-center justify-center gap-2 px-4 py-2 text-sm font-semibold rounded-lg shadow-sm transition-all cursor-pointer", isWsConnected.value ? "bg-slate-100 dark:bg-slate-855 hover:bg-slate-200 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-200" : "bg-blue-600 hover:bg-blue-500 text-white focus:ring-2 focus:ring-blue-500/20"])}"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Server), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>${ssrInterpolate(isWsConnected.value ? "Disconnect" : "Connect & Test HANDSHAKE")}</span></button>`);
						if (connectionLog.value.length > 0) {
							_push(`<div class="space-y-2"${_scopeId}><span class="text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider block"${_scopeId}>Diagnostics</span><div class="h-40 overflow-y-auto bg-slate-950 text-[11px] font-mono p-3 rounded-lg border border-slate-900 text-slate-300 leading-normal space-y-1"${_scopeId}><!--[-->`);
							ssrRenderList(connectionLog.value, (log, idx) => {
								_push(`<div class="whitespace-pre-wrap"${_scopeId}>${ssrInterpolate(log)}</div>`);
							});
							_push(`<!--]--></div></div>`);
						} else _push(`<!---->`);
						_push(`</div>`);
						if (isWsConnected.value) {
							_push(`<div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6"${_scopeId}><h2 class="text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4"${_scopeId}> Local Printers </h2><div class="space-y-4"${_scopeId}><div class="space-y-2"${_scopeId}><label for="printers" class="text-xs font-medium text-slate-500 uppercase block"${_scopeId}>Available Printers</label><select id="printers" class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all dark:bg-slate-950"${_scopeId}><!--[-->`);
							ssrRenderList(printersList.value, (printer) => {
								_push(`<option${ssrRenderAttr("value", printer)}${ssrIncludeBooleanAttr(Array.isArray(selectedPrinter.value) ? ssrLooseContain(selectedPrinter.value, printer) : ssrLooseEqual(selectedPrinter.value, printer)) ? " selected" : ""}${_scopeId}>${ssrInterpolate(printer)}</option>`);
							});
							_push(`<!--]-->`);
							if (printersList.value.length === 0) _push(`<option value=""${ssrIncludeBooleanAttr(Array.isArray(selectedPrinter.value) ? ssrLooseContain(selectedPrinter.value, "") : ssrLooseEqual(selectedPrinter.value, "")) ? " selected" : ""}${_scopeId}>No Printers Detected</option>`);
							else _push(`<!---->`);
							_push(`</select></div><button${ssrIncludeBooleanAttr(!selectedPrinter.value || isPrinting.value) ? " disabled" : ""} class="w-full inline-flex items-center justify-center gap-2 px-4 py-2 bg-emerald-600 hover:bg-emerald-500 disabled:opacity-50 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-emerald-500/20 transition-all cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Printer), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>${ssrInterpolate(isPrinting.value ? "Printing Receipt..." : "Print Test Receipt")}</span></button></div></div>`);
						} else _push(`<!---->`);
						_push(`</div></div><div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-4"${_scopeId}><h2 class="text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4"${_scopeId}> Recent Logs </h2><div class="overflow-x-auto"${_scopeId}><table class="w-full border-collapse text-left text-sm text-slate-500 dark:text-slate-400"${_scopeId}><thead class="bg-slate-50/50 dark:bg-slate-900/50 text-xs font-semibold text-slate-700 dark:text-slate-300 uppercase"${_scopeId}><tr${_scopeId}><th class="px-4 py-3"${_scopeId}>Timestamp</th><th class="px-4 py-3"${_scopeId}>User</th><th class="px-4 py-3"${_scopeId}>IP Address</th><th class="px-4 py-3"${_scopeId}>Action</th><th class="px-4 py-3"${_scopeId}>Result</th><th class="px-4 py-3"${_scopeId}>Details</th></tr></thead><tbody class="divide-y divide-slate-100 dark:divide-slate-900"${_scopeId}><!--[-->`);
						ssrRenderList(__props.recentLogs, (log) => {
							_push(`<tr class="hover:bg-slate-50/30 dark:hover:bg-slate-900/20"${_scopeId}><td class="px-4 py-3 whitespace-nowrap font-medium text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(formatDate(log.created_at))}</td><td class="px-4 py-3 whitespace-nowrap"${_scopeId}>${ssrInterpolate(log.user_name)}</td><td class="px-4 py-3 whitespace-nowrap font-mono text-xs"${_scopeId}>${ssrInterpolate(log.ip_address)}</td><td class="px-4 py-3 whitespace-nowrap"${_scopeId}>${ssrInterpolate(log.action)}</td><td class="px-4 py-3 whitespace-nowrap"${_scopeId}><span class="${ssrRenderClass(["inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium", log.result === "Success" ? "bg-emerald-50 dark:bg-emerald-950/20 text-emerald-700 dark:text-emerald-400" : "bg-rose-50 dark:bg-rose-950/20 text-rose-700 dark:text-rose-400"])}"${_scopeId}>${ssrInterpolate(log.result)}</span></td><td class="px-4 py-3 truncate max-w-xs"${ssrRenderAttr("title", log.details || "")}${_scopeId}>${ssrInterpolate(log.details)}</td></tr>`);
						});
						_push(`<!--]-->`);
						if (__props.recentLogs.length === 0) _push(`<tr${_scopeId}><td colspan="6" class="px-4 py-8 text-center text-slate-400"${_scopeId}> No logged events found. </td></tr>`);
						else _push(`<!---->`);
						_push(`</tbody></table></div></div></div>`);
						if (showGenerateModal.value) _push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4"${_scopeId}><div class="fixed inset-0 bg-slate-950/60 backdrop-blur-sm"${_scopeId}></div><div class="relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-lg w-full p-6 shadow-2xl space-y-6 overflow-y-auto max-h-[90vh]"${_scopeId}><div${_scopeId}><h3 class="text-lg font-bold text-slate-900 dark:text-slate-100"${_scopeId}>Generate QZ Tray Certificate</h3><p class="text-xs text-slate-400 mt-1"${_scopeId}> Generate an X509 digital signature certificate mapping with local clients. </p></div><form class="space-y-4"${_scopeId}><div class="grid grid-cols-1 sm:grid-cols-2 gap-4"${_scopeId}><div class="space-y-1.5 sm:col-span-2"${_scopeId}><label for="name" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>Certificate Name</label><input type="text" id="name"${ssrRenderAttr("value", unref(certForm).name)} class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" required${_scopeId}></div><div class="space-y-1.5"${_scopeId}><label for="country" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>Country (2 letters)</label><input type="text" id="country"${ssrRenderAttr("value", unref(certForm).country)} maxlength="2" class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all uppercase" required${_scopeId}></div><div class="space-y-1.5"${_scopeId}><label for="state" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>State/Province</label><input type="text" id="state"${ssrRenderAttr("value", unref(certForm).state)} class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" required${_scopeId}></div><div class="space-y-1.5"${_scopeId}><label for="locality" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>Locality/City</label><input type="text" id="locality"${ssrRenderAttr("value", unref(certForm).locality)} class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" required${_scopeId}></div><div class="space-y-1.5"${_scopeId}><label for="organization" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>Organization</label><input type="text" id="organization"${ssrRenderAttr("value", unref(certForm).organization)} class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" required${_scopeId}></div><div class="space-y-1.5"${_scopeId}><label for="ou" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>Organizational Unit</label><input type="text" id="ou"${ssrRenderAttr("value", unref(certForm).organizational_unit)} class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" required${_scopeId}></div><div class="space-y-1.5"${_scopeId}><label for="cn" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>Common Name</label><input type="text" id="cn"${ssrRenderAttr("value", unref(certForm).common_name)} class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" required${_scopeId}></div><div class="space-y-1.5 sm:col-span-2"${_scopeId}><label for="email" class="text-xs font-semibold text-slate-500 uppercase"${_scopeId}>Email Address</label><input type="email" id="email"${ssrRenderAttr("value", unref(certForm).email)} class="w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" required${_scopeId}></div></div><div class="flex items-center justify-end gap-3 border-t border-slate-100 dark:border-slate-900 pt-4"${_scopeId}><button type="button" class="px-4 py-2 border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-colors cursor-pointer text-slate-700 dark:text-slate-350"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(certForm).processing) ? " disabled" : ""} class="px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg text-sm font-semibold shadow-sm transition-colors cursor-pointer disabled:opacity-50"${_scopeId}><span${_scopeId}>${ssrInterpolate(unref(certForm).processing ? "Generating..." : "Generate")}</span></button></div></form></div></div>`);
						else _push(`<!---->`);
						if (showWarningRegenerate.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4"${_scopeId}><div class="fixed inset-0 bg-slate-950/60 backdrop-blur-sm"${_scopeId}></div><div class="relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-6"${_scopeId}><div class="flex items-start gap-4"${_scopeId}><div class="h-10 w-10 bg-amber-50 dark:bg-amber-950/30 rounded-lg flex items-center justify-center border border-amber-200/50 dark:border-amber-900/30 flex-shrink-0 text-amber-600 dark:text-amber-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(AlertTriangle), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</div><div${_scopeId}><h3 class="text-base font-bold text-slate-900 dark:text-slate-100"${_scopeId}>Regenerate Signing Certificate?</h3><p class="text-xs text-slate-500 dark:text-slate-400 mt-2 leading-relaxed"${_scopeId}> Regenerating the certificate will permanently delete the current keypair. </p><div class="bg-amber-50/50 dark:bg-amber-950/10 border border-amber-200/40 dark:border-amber-900/25 p-3 rounded-lg text-[11px] text-amber-800 dark:text-amber-400 mt-3 leading-relaxed"${_scopeId}><strong${_scopeId}>WARNING:</strong> This will invalidate all previous signatures instantly. You will need to download the new public certificate and configure your local QZ Tray clients with it. </div></div></div><div class="flex items-center justify-end gap-3"${_scopeId}><button class="px-4 py-2 border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-colors cursor-pointer text-slate-700 dark:text-slate-350"${_scopeId}> Cancel </button><button class="px-4 py-2 bg-amber-600 hover:bg-amber-500 text-white rounded-lg text-sm font-semibold transition-colors cursor-pointer shadow-sm"${_scopeId}> Proceed to Regenerate </button></div></div></div>`);
						} else _push(`<!---->`);
						if (showDeleteModal.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4"${_scopeId}><div class="fixed inset-0 bg-slate-950/60 backdrop-blur-sm"${_scopeId}></div><div class="relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-6"${_scopeId}><div class="flex items-start gap-4"${_scopeId}><div class="h-10 w-10 bg-rose-50 dark:bg-rose-950/30 rounded-lg flex items-center justify-center border border-rose-200/50 dark:border-rose-900/30 flex-shrink-0 text-rose-600 dark:text-rose-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Trash2), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</div><div${_scopeId}><h3 class="text-base font-bold text-slate-900 dark:text-slate-100"${_scopeId}>Delete Signing Certificate?</h3><p class="text-xs text-slate-500 dark:text-slate-400 mt-2 leading-relaxed font-medium"${_scopeId}> Are you absolutely sure you want to delete the QZ Tray certificate? </p><p class="text-xs text-slate-400 dark:text-slate-500 mt-1 leading-relaxed"${_scopeId}> This will remove the private key and public certificate record. Silent POS printing handshakes will fail until a new certificate is generated. </p></div></div><div class="flex items-center justify-end gap-3"${_scopeId}><button class="px-4 py-2 border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-colors cursor-pointer text-slate-700 dark:text-slate-350"${_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-colors cursor-pointer shadow-sm"${_scopeId}> Yes, Delete Certificate </button></div></div></div>`);
						} else _push(`<!---->`);
						if (showLogsModal.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4"${_scopeId}><div class="fixed inset-0 bg-slate-950/60 backdrop-blur-sm"${_scopeId}></div><div class="relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-4xl w-full p-6 shadow-2xl space-y-6 overflow-y-auto max-h-[85vh]"${_scopeId}><div class="flex items-center justify-between border-b border-slate-100 dark:border-slate-900 pb-3"${_scopeId}><h3 class="text-lg font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Database), { class: "h-5 w-5 text-blue-600" }, null, _parent, _scopeId));
							_push(` QZ Tray Audit Logs </h3><button class="text-xs font-semibold text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"${_scopeId}> Close </button></div><div class="overflow-x-auto border border-slate-100 dark:border-slate-900 rounded-lg"${_scopeId}><table class="w-full text-left text-sm text-slate-500 dark:text-slate-400"${_scopeId}><thead class="bg-slate-50/50 dark:bg-slate-900/50 text-xs font-semibold text-slate-700 dark:text-slate-300 uppercase"${_scopeId}><tr${_scopeId}><th class="px-4 py-3"${_scopeId}>Timestamp</th><th class="px-4 py-3"${_scopeId}>User</th><th class="px-4 py-3"${_scopeId}>IP Address</th><th class="px-4 py-3"${_scopeId}>Action</th><th class="px-4 py-3"${_scopeId}>Result</th><th class="px-4 py-3"${_scopeId}>Details</th></tr></thead><tbody class="divide-y divide-slate-100 dark:divide-slate-900"${_scopeId}><!--[-->`);
							ssrRenderList(__props.paginatedLogs.data, (log) => {
								_push(`<tr class="hover:bg-slate-50/30 dark:hover:bg-slate-900/20"${_scopeId}><td class="px-4 py-3 whitespace-nowrap font-medium text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(formatDate(log.created_at))}</td><td class="px-4 py-3 whitespace-nowrap"${_scopeId}>${ssrInterpolate(log.user_name || "System")}</td><td class="px-4 py-3 whitespace-nowrap font-mono text-xs"${_scopeId}>${ssrInterpolate(log.ip_address)}</td><td class="px-4 py-3 whitespace-nowrap"${_scopeId}>${ssrInterpolate(log.action)}</td><td class="px-4 py-3 whitespace-nowrap"${_scopeId}><span class="${ssrRenderClass(["inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium", log.result === "Success" ? "bg-emerald-50 dark:bg-emerald-950/20 text-emerald-700 dark:text-emerald-400" : "bg-rose-50 dark:bg-rose-950/20 text-rose-700 dark:text-rose-400"])}"${_scopeId}>${ssrInterpolate(log.result)}</span></td><td class="px-4 py-3 truncate max-w-xs"${ssrRenderAttr("title", log.details || "")}${_scopeId}>${ssrInterpolate(log.details)}</td></tr>`);
							});
							_push(`<!--]-->`);
							if (__props.paginatedLogs.data?.length === 0) _push(`<tr${_scopeId}><td colspan="6" class="px-4 py-8 text-center text-slate-400"${_scopeId}> No logs found. </td></tr>`);
							else _push(`<!---->`);
							_push(`</tbody></table></div><div class="flex items-center justify-between border-t border-slate-100 dark:border-slate-900 pt-4"${_scopeId}><span class="text-xs text-slate-400"${_scopeId}> Showing ${ssrInterpolate(__props.paginatedLogs.from || 0)} to ${ssrInterpolate(__props.paginatedLogs.to || 0)} of ${ssrInterpolate(__props.paginatedLogs.total || 0)} logs </span><div class="flex gap-2"${_scopeId}><button${ssrIncludeBooleanAttr(!__props.paginatedLogs.prev_page_url) ? " disabled" : ""} class="px-3 py-1 text-xs border border-slate-200 dark:border-slate-800 disabled:opacity-40 rounded cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-900 font-semibold"${_scopeId}> Previous </button><button${ssrIncludeBooleanAttr(!__props.paginatedLogs.next_page_url) ? " disabled" : ""} class="px-3 py-1 text-xs border border-slate-200 dark:border-slate-800 disabled:opacity-40 rounded cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-900 font-semibold"${_scopeId}> Next </button></div></div></div></div>`);
						} else _push(`<!---->`);
					} else return [
						createVNode(unref(Head), { title: "QZ Tray Settings" }),
						createVNode(Transition, {
							"enter-active-class": "transform ease-out duration-300 transition",
							"enter-from-class": "translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",
							"enter-to-class": "translate-y-0 opacity-100 sm:translate-x-0",
							"leave-active-class": "transition ease-in duration-200",
							"leave-from-class": "opacity-100",
							"leave-to-class": "opacity-0"
						}, {
							default: withCtx(() => [showToast.value ? (openBlock(), createBlock("div", {
								key: 0,
								class: ["fixed top-4 right-4 z-50 max-w-md w-full border rounded-xl shadow-xl p-4 flex items-start gap-3", toastType.value === "success" ? "bg-white dark:bg-slate-900 border-emerald-200 dark:border-emerald-950/30" : "bg-white dark:bg-slate-900 border-rose-200 dark:border-rose-950/30"]
							}, [toastType.value === "success" ? (openBlock(), createBlock(unref(CheckCircle2), {
								key: 0,
								class: "h-5 w-5 text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-0.5"
							})) : (openBlock(), createBlock(unref(XCircle), {
								key: 1,
								class: "h-5 w-5 text-rose-600 dark:text-rose-400 flex-shrink-0 mt-0.5"
							})), createVNode("div", { class: "flex-1 min-w-0" }, [createVNode("p", { class: "text-sm font-semibold text-slate-950 dark:text-slate-50" }, toDisplayString(toastType.value === "success" ? "Success" : "Error"), 1), createVNode("p", { class: "text-xs text-slate-500 dark:text-slate-400 mt-0.5" }, toDisplayString(toastMessage.value), 1)])], 2)) : createCommentVNode("", true)]),
							_: 1
						}),
						createVNode("div", { class: "w-full space-y-6" }, [
							createVNode("div", { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-100 flex items-center gap-2" }, [createVNode(unref(Printer), { class: "h-6 w-6 text-blue-600" }), createTextVNode(" QZ Tray Integration ")]), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Configure self-signed certificates to authorize silent printing operations from your POS terminals. ")]), createVNode("div", { class: "flex gap-2" }, [createVNode("button", {
								onClick: ($event) => showLogsModal.value = true,
								class: "inline-flex items-center gap-1.5 px-3 py-2 bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 text-slate-700 dark:text-slate-200 rounded-lg text-sm font-semibold transition-colors cursor-pointer"
							}, [createVNode(unref(Activity), { class: "h-4 w-4" }), createVNode("span", null, "View All Logs")], 8, ["onClick"])])]),
							!__props.isOpenSslAvailable ? (openBlock(), createBlock("div", {
								key: 0,
								class: "bg-rose-50 dark:bg-rose-950/20 border border-rose-200 dark:border-rose-900/40 rounded-xl p-5 flex items-start gap-4"
							}, [createVNode(unref(AlertTriangle), { class: "h-6 w-6 text-rose-600 dark:text-rose-400 flex-shrink-0 mt-0.5" }), createVNode("div", null, [createVNode("h3", { class: "text-sm font-bold text-rose-800 dark:text-rose-300" }, "OpenSSL PHP Extension Missing"), createVNode("p", { class: "text-xs text-rose-700 dark:text-rose-400 mt-1 leading-relaxed" }, " The `openssl` extension is not loaded on this PHP server. Certificate generation requires OpenSSL. Please enable it in your server's `php.ini` file. ")])])) : createCommentVNode("", true),
							createVNode("div", { class: "grid grid-cols-1 lg:grid-cols-3 gap-6" }, [createVNode("div", { class: "lg:col-span-2 space-y-6" }, [
								createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6" }, [createVNode("div", { class: "flex items-center justify-between border-b border-slate-100 dark:border-slate-900 pb-4" }, [createVNode("h2", { class: "text-base font-semibold text-slate-900 dark:text-slate-100 flex items-center gap-2" }, [createVNode(unref(Shield), { class: "h-5 w-5 text-blue-600" }), createTextVNode(" Certificate Details ")]), createVNode("span", { class: [
									"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold uppercase tracking-wide",
									__props.status === "active" ? "bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-400 border border-emerald-200 dark:border-emerald-900/30" : "",
									__props.status === "expired" ? "bg-rose-50 dark:bg-rose-950/30 text-rose-700 dark:text-rose-400 border border-rose-200 dark:border-rose-900/30" : "",
									__props.status === "invalid" ? "bg-amber-50 dark:bg-amber-950/30 text-amber-700 dark:text-amber-400 border border-amber-200 dark:border-amber-900/30" : "",
									__props.status === "not_generated" ? "bg-slate-100 dark:bg-slate-900 text-slate-500 dark:text-slate-400 border border-slate-200 dark:border-slate-850" : ""
								] }, [createVNode("span", { class: "h-1.5 w-1.5 rounded-full bg-current" }), createTextVNode(" " + toDisplayString(__props.status.replace("_", " ")), 1)], 2)]), __props.certificate ? (openBlock(), createBlock("div", {
									key: 0,
									class: "grid grid-cols-1 md:grid-cols-2 gap-y-4 gap-x-6 text-sm"
								}, [
									createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium" }, "Certificate Name"), createVNode("span", { class: "font-semibold text-slate-800 dark:text-slate-200" }, toDisplayString(__props.certificate.name), 1)]),
									createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium" }, "Key Pair Type / Algorithm"), createVNode("span", { class: "font-semibold text-slate-800 dark:text-slate-200" }, toDisplayString(__props.certificate.algorithm), 1)]),
									createVNode("div", { class: "space-y-1 md:col-span-2" }, [createVNode("span", { class: "text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium font-mono" }, "Fingerprint (SHA-256)"), createVNode("span", { class: "font-mono text-xs font-semibold break-all bg-slate-50 dark:bg-slate-900/50 p-2 rounded border border-slate-100 dark:border-slate-900 block text-slate-800 dark:text-slate-200" }, toDisplayString(__props.certificate.fingerprint), 1)]),
									createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium" }, "Created Date"), createVNode("span", { class: "font-semibold text-slate-800 dark:text-slate-200" }, toDisplayString(formatDate(__props.certificate.created_at)), 1)]),
									createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium" }, "Expiration Date"), createVNode("span", { class: "font-semibold text-slate-800 dark:text-slate-200" }, toDisplayString(formatDate(__props.certificate.expires_at)), 1)]),
									createVNode("div", { class: "space-y-1" }, [createVNode("span", { class: "text-xs text-slate-400 dark:text-slate-500 block uppercase tracking-wide font-medium" }, "Last Used"), createVNode("span", { class: "font-semibold text-slate-800 dark:text-slate-200" }, toDisplayString(formatDate(__props.certificate.last_used_at)), 1)])
								])) : (openBlock(), createBlock("div", {
									key: 1,
									class: "text-center py-10 bg-slate-50/50 dark:bg-slate-900/20 rounded-xl border border-dashed border-slate-200 dark:border-slate-800"
								}, [
									createVNode(unref(Key), { class: "h-10 w-10 text-slate-400 mx-auto stroke-1" }),
									createVNode("h3", { class: "text-sm font-semibold text-slate-800 dark:text-slate-300 mt-3" }, "No Certificate Generated"),
									createVNode("p", { class: "text-xs text-slate-400 max-w-sm mx-auto mt-1 leading-relaxed" }, " Generate an application-wide self-signed certificate to begin automatic handshake validation with local QZ Tray clients. ")
								]))]),
								createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6" }, [createVNode("h2", { class: "text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4" }, " Certificate Actions "), createVNode("div", { class: "flex flex-wrap gap-4" }, [
									!__props.certificate ? (openBlock(), createBlock("button", {
										key: 0,
										disabled: !__props.isOpenSslAvailable,
										onClick: ($event) => showGenerateModal.value = true,
										class: "inline-flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-500 disabled:opacity-50 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 transition-all cursor-pointer"
									}, [createVNode(unref(Key), { class: "h-4 w-4" }), createVNode("span", null, "Generate Certificate")], 8, ["disabled", "onClick"])) : createCommentVNode("", true),
									__props.certificate ? (openBlock(), createBlock("button", {
										key: 1,
										onClick: ($event) => showWarningRegenerate.value = true,
										class: "inline-flex items-center gap-2 px-4 py-2 bg-amber-600 hover:bg-amber-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-amber-500/20 transition-all cursor-pointer"
									}, [createVNode(unref(RefreshCw), { class: "h-4 w-4" }), createVNode("span", null, "Regenerate Certificate")], 8, ["onClick"])) : createCommentVNode("", true),
									__props.certificate ? (openBlock(), createBlock("a", {
										key: 2,
										href: _ctx.route("settings.qz-tray.download"),
										class: "inline-flex items-center gap-2 px-4 py-2 bg-slate-100 dark:bg-slate-850 hover:bg-slate-200 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-200 rounded-lg text-sm font-semibold transition-all cursor-pointer"
									}, [createVNode(unref(Download), { class: "h-4 w-4" }), createVNode("span", null, "Download Public Cert")], 8, ["href"])) : createCommentVNode("", true),
									__props.certificate ? (openBlock(), createBlock("button", {
										key: 3,
										onClick: ($event) => showDeleteModal.value = true,
										class: "inline-flex items-center gap-2 px-4 py-2 bg-rose-50 dark:bg-rose-950/20 hover:bg-rose-100 dark:hover:bg-rose-950/40 text-rose-600 dark:text-rose-400 rounded-lg text-sm font-semibold border border-rose-200/50 dark:border-rose-900/30 transition-all cursor-pointer"
									}, [createVNode(unref(Trash2), { class: "h-4 w-4" }), createVNode("span", null, "Delete Certificate")], 8, ["onClick"])) : createCommentVNode("", true)
								])]),
								createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-4" }, [createVNode("h2", { class: "text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4 flex items-center gap-2" }, [createVNode(unref(Info), { class: "h-5 w-5 text-blue-600" }), createTextVNode(" Panduan Setup & Sertifikat QZ Tray (Silent Printing) ")]), createVNode("div", { class: "text-xs text-slate-600 dark:text-slate-400 space-y-4 leading-relaxed font-medium" }, [
									createVNode("p", null, " Agar sistem dapat melakukan pencetakan struk secara otomatis tanpa memunculkan jendela dialog konfirmasi keamanan (silent printing), ikuti langkah-langkah setup berikut: "),
									createVNode("div", { class: "grid grid-cols-1 md:grid-cols-3 gap-4" }, [
										createVNode("div", { class: "border border-slate-100 dark:border-slate-850 p-4 rounded-xl bg-slate-50/50 dark:bg-slate-900/20 space-y-2 flex flex-col justify-between" }, [createVNode("div", null, [
											createVNode("span", { class: "h-6 w-6 rounded-full bg-blue-600/10 text-blue-650 dark:text-blue-400 flex items-center justify-center text-xs font-bold mb-2" }, "1"),
											createVNode("h4", { class: "font-bold text-slate-850 dark:text-slate-200 text-xs" }, "Generate Sertifikat"),
											createVNode("p", { class: "text-[11px] text-slate-505 dark:text-slate-400 leading-normal mt-1" }, [
												createTextVNode(" Klik tombol "),
												createVNode("strong", null, "\"Generate Certificate\""),
												createTextVNode(" di atas. Sistem akan membuat pasangan kunci privat & publik OpenSSL baru secara otomatis di database backend. ")
											])
										])]),
										createVNode("div", { class: "border border-slate-100 dark:border-slate-850 p-4 rounded-xl bg-slate-50/50 dark:bg-slate-900/20 space-y-2 flex flex-col justify-between" }, [createVNode("div", null, [
											createVNode("span", { class: "h-6 w-6 rounded-full bg-blue-600/10 text-blue-650 dark:text-blue-400 flex items-center justify-center text-xs font-bold mb-2" }, "2"),
											createVNode("h4", { class: "font-bold text-slate-850 dark:text-slate-200 text-xs" }, "Unduh Public Cert"),
											createVNode("p", { class: "text-[11px] text-slate-505 dark:text-slate-400 leading-normal mt-1" }, [
												createTextVNode(" Klik tombol "),
												createVNode("strong", null, "\"Download Public Cert\""),
												createTextVNode(" untuk mengunduh file sertifikat publik "),
												createVNode("code", null, "digital-certificate.txt"),
												createTextVNode(" aplikasi Anda ke komputer. ")
											])
										])]),
										createVNode("div", { class: "border border-slate-100 dark:border-slate-850 p-4 rounded-xl bg-slate-50/50 dark:bg-slate-900/20 space-y-2 flex flex-col justify-between" }, [createVNode("div", null, [
											createVNode("span", { class: "h-6 w-6 rounded-full bg-blue-600/10 text-blue-650 dark:text-blue-400 flex items-center justify-center text-xs font-bold mb-2" }, "3"),
											createVNode("h4", { class: "font-bold text-slate-850 dark:text-slate-200 text-xs" }, "Salin & Trust Certificate"),
											createVNode("p", { class: "text-[11px] text-slate-505 dark:text-slate-400 leading-normal mt-1" }, [
												createTextVNode(" Pindahkan atau salin file "),
												createVNode("code", null, "digital-certificate.txt"),
												createTextVNode(" tersebut ke dalam folder instalasi QZ Tray di komputer kasir Anda agar terverifikasi otomatis. ")
											])
										])])
									]),
									createVNode("div", { class: "bg-slate-50 dark:bg-slate-900/50 border border-slate-200 dark:border-slate-800/80 p-4 rounded-xl font-mono text-[11px] text-slate-700 dark:text-slate-350 space-y-2" }, [
										createVNode("div", { class: "font-bold text-slate-850 dark:text-slate-200 uppercase tracking-wider text-[10px]" }, "Lokasi Folder Instalasi QZ Tray:"),
										createVNode("ul", { class: "list-disc list-inside space-y-1" }, [
											createVNode("li", null, [
												createVNode("strong", null, "Windows:"),
												createTextVNode(),
												createVNode("code", null, "C:\\Program Files\\QZ Tray\\digital-certificate.txt")
											]),
											createVNode("li", null, [
												createVNode("strong", null, "macOS:"),
												createTextVNode(),
												createVNode("code", null, "/Applications/QZ Tray.app/Contents/Resources/digital-certificate.txt")
											]),
											createVNode("li", null, [
												createVNode("strong", null, "Linux:"),
												createTextVNode(),
												createVNode("code", null, "/opt/qz-tray/digital-certificate.txt")
											])
										]),
										createVNode("div", { class: "text-[10px] text-amber-600 dark:text-amber-400 mt-2 font-sans font-semibold" }, " *PENTING: Tutup (Close) QZ Tray dari system tray dan buka kembali aplikasinya setelah Anda menaruh file sertifikat agar QZ me-load sertifikat baru. ")
									])
								])])
							]), createVNode("div", { class: "space-y-6" }, [createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6" }, [
								createVNode("h2", { class: "text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4" }, " Connection Testing "),
								createVNode("div", { class: "flex items-center gap-3" }, [createVNode("div", { class: ["h-3 w-3 rounded-full", isWsConnected.value ? "bg-emerald-500 animate-pulse shadow shadow-emerald-500" : "bg-rose-500"] }, null, 2), createVNode("div", null, [createVNode("span", { class: "text-sm font-semibold block text-slate-800 dark:text-slate-200" }, toDisplayString(isWsConnected.value ? "Connected to QZ Tray" : "Disconnected"), 1), createVNode("span", { class: "text-xs text-slate-400 dark:text-slate-500 block" }, toDisplayString(isWsConnected.value ? "Local WebSocket active" : "Check if QZ Tray app is running locally"), 1)])]),
								createVNode("button", {
									onClick: toggleQzConnection,
									class: ["w-full inline-flex items-center justify-center gap-2 px-4 py-2 text-sm font-semibold rounded-lg shadow-sm transition-all cursor-pointer", isWsConnected.value ? "bg-slate-100 dark:bg-slate-855 hover:bg-slate-200 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-200" : "bg-blue-600 hover:bg-blue-500 text-white focus:ring-2 focus:ring-blue-500/20"]
								}, [createVNode(unref(Server), { class: "h-4 w-4" }), createVNode("span", null, toDisplayString(isWsConnected.value ? "Disconnect" : "Connect & Test HANDSHAKE"), 1)], 2),
								connectionLog.value.length > 0 ? (openBlock(), createBlock("div", {
									key: 0,
									class: "space-y-2"
								}, [createVNode("span", { class: "text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider block" }, "Diagnostics"), createVNode("div", { class: "h-40 overflow-y-auto bg-slate-950 text-[11px] font-mono p-3 rounded-lg border border-slate-900 text-slate-300 leading-normal space-y-1" }, [(openBlock(true), createBlock(Fragment, null, renderList(connectionLog.value, (log, idx) => {
									return openBlock(), createBlock("div", {
										key: idx,
										class: "whitespace-pre-wrap"
									}, toDisplayString(log), 1);
								}), 128))])])) : createCommentVNode("", true)
							]), isWsConnected.value ? (openBlock(), createBlock("div", {
								key: 0,
								class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-6"
							}, [createVNode("h2", { class: "text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4" }, " Local Printers "), createVNode("div", { class: "space-y-4" }, [createVNode("div", { class: "space-y-2" }, [createVNode("label", {
								for: "printers",
								class: "text-xs font-medium text-slate-500 uppercase block"
							}, "Available Printers"), withDirectives(createVNode("select", {
								id: "printers",
								"onUpdate:modelValue": ($event) => selectedPrinter.value = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all dark:bg-slate-950"
							}, [(openBlock(true), createBlock(Fragment, null, renderList(printersList.value, (printer) => {
								return openBlock(), createBlock("option", {
									key: printer,
									value: printer
								}, toDisplayString(printer), 9, ["value"]);
							}), 128)), printersList.value.length === 0 ? (openBlock(), createBlock("option", {
								key: 0,
								value: ""
							}, "No Printers Detected")) : createCommentVNode("", true)], 8, ["onUpdate:modelValue"]), [[vModelSelect, selectedPrinter.value]])]), createVNode("button", {
								onClick: printTestReceipt,
								disabled: !selectedPrinter.value || isPrinting.value,
								class: "w-full inline-flex items-center justify-center gap-2 px-4 py-2 bg-emerald-600 hover:bg-emerald-500 disabled:opacity-50 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-emerald-500/20 transition-all cursor-pointer"
							}, [createVNode(unref(Printer), { class: "h-4 w-4" }), createVNode("span", null, toDisplayString(isPrinting.value ? "Printing Receipt..." : "Print Test Receipt"), 1)], 8, ["disabled"])])])) : createCommentVNode("", true)])]),
							createVNode("div", { class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl p-6 shadow-sm space-y-4" }, [createVNode("h2", { class: "text-base font-semibold text-slate-900 dark:text-slate-100 border-b border-slate-100 dark:border-slate-900 pb-4" }, " Recent Logs "), createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full border-collapse text-left text-sm text-slate-500 dark:text-slate-400" }, [createVNode("thead", { class: "bg-slate-50/50 dark:bg-slate-900/50 text-xs font-semibold text-slate-700 dark:text-slate-300 uppercase" }, [createVNode("tr", null, [
								createVNode("th", { class: "px-4 py-3" }, "Timestamp"),
								createVNode("th", { class: "px-4 py-3" }, "User"),
								createVNode("th", { class: "px-4 py-3" }, "IP Address"),
								createVNode("th", { class: "px-4 py-3" }, "Action"),
								createVNode("th", { class: "px-4 py-3" }, "Result"),
								createVNode("th", { class: "px-4 py-3" }, "Details")
							])]), createVNode("tbody", { class: "divide-y divide-slate-100 dark:divide-slate-900" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.recentLogs, (log) => {
								return openBlock(), createBlock("tr", {
									key: log.id,
									class: "hover:bg-slate-50/30 dark:hover:bg-slate-900/20"
								}, [
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap font-medium text-slate-900 dark:text-slate-100" }, toDisplayString(formatDate(log.created_at)), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap" }, toDisplayString(log.user_name), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap font-mono text-xs" }, toDisplayString(log.ip_address), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap" }, toDisplayString(log.action), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap" }, [createVNode("span", { class: ["inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium", log.result === "Success" ? "bg-emerald-50 dark:bg-emerald-950/20 text-emerald-700 dark:text-emerald-400" : "bg-rose-50 dark:bg-rose-950/20 text-rose-700 dark:text-rose-400"] }, toDisplayString(log.result), 3)]),
									createVNode("td", {
										class: "px-4 py-3 truncate max-w-xs",
										title: log.details || ""
									}, toDisplayString(log.details), 9, ["title"])
								]);
							}), 128)), __props.recentLogs.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
								colspan: "6",
								class: "px-4 py-8 text-center text-slate-400"
							}, " No logged events found. ")])) : createCommentVNode("", true)])])])])
						]),
						showGenerateModal.value ? (openBlock(), createBlock("div", {
							key: 0,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4"
						}, [createVNode("div", {
							class: "fixed inset-0 bg-slate-950/60 backdrop-blur-sm",
							onClick: ($event) => showGenerateModal.value = false
						}, null, 8, ["onClick"]), createVNode("div", { class: "relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-lg w-full p-6 shadow-2xl space-y-6 overflow-y-auto max-h-[90vh]" }, [createVNode("div", null, [createVNode("h3", { class: "text-lg font-bold text-slate-900 dark:text-slate-100" }, "Generate QZ Tray Certificate"), createVNode("p", { class: "text-xs text-slate-400 mt-1" }, " Generate an X509 digital signature certificate mapping with local clients. ")]), createVNode("form", {
							onSubmit: withModifiers(submitGenerate, ["prevent"]),
							class: "space-y-4"
						}, [createVNode("div", { class: "grid grid-cols-1 sm:grid-cols-2 gap-4" }, [
							createVNode("div", { class: "space-y-1.5 sm:col-span-2" }, [createVNode("label", {
								for: "name",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "Certificate Name"), withDirectives(createVNode("input", {
								type: "text",
								id: "name",
								"onUpdate:modelValue": ($event) => unref(certForm).name = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).name]])]),
							createVNode("div", { class: "space-y-1.5" }, [createVNode("label", {
								for: "country",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "Country (2 letters)"), withDirectives(createVNode("input", {
								type: "text",
								id: "country",
								"onUpdate:modelValue": ($event) => unref(certForm).country = $event,
								maxlength: "2",
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all uppercase",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).country]])]),
							createVNode("div", { class: "space-y-1.5" }, [createVNode("label", {
								for: "state",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "State/Province"), withDirectives(createVNode("input", {
								type: "text",
								id: "state",
								"onUpdate:modelValue": ($event) => unref(certForm).state = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).state]])]),
							createVNode("div", { class: "space-y-1.5" }, [createVNode("label", {
								for: "locality",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "Locality/City"), withDirectives(createVNode("input", {
								type: "text",
								id: "locality",
								"onUpdate:modelValue": ($event) => unref(certForm).locality = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).locality]])]),
							createVNode("div", { class: "space-y-1.5" }, [createVNode("label", {
								for: "organization",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "Organization"), withDirectives(createVNode("input", {
								type: "text",
								id: "organization",
								"onUpdate:modelValue": ($event) => unref(certForm).organization = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).organization]])]),
							createVNode("div", { class: "space-y-1.5" }, [createVNode("label", {
								for: "ou",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "Organizational Unit"), withDirectives(createVNode("input", {
								type: "text",
								id: "ou",
								"onUpdate:modelValue": ($event) => unref(certForm).organizational_unit = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).organizational_unit]])]),
							createVNode("div", { class: "space-y-1.5" }, [createVNode("label", {
								for: "cn",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "Common Name"), withDirectives(createVNode("input", {
								type: "text",
								id: "cn",
								"onUpdate:modelValue": ($event) => unref(certForm).common_name = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).common_name]])]),
							createVNode("div", { class: "space-y-1.5 sm:col-span-2" }, [createVNode("label", {
								for: "email",
								class: "text-xs font-semibold text-slate-500 uppercase"
							}, "Email Address"), withDirectives(createVNode("input", {
								type: "email",
								id: "email",
								"onUpdate:modelValue": ($event) => unref(certForm).email = $event,
								class: "w-full px-3 py-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-transparent text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all",
								required: ""
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(certForm).email]])])
						]), createVNode("div", { class: "flex items-center justify-end gap-3 border-t border-slate-100 dark:border-slate-900 pt-4" }, [createVNode("button", {
							type: "button",
							onClick: ($event) => showGenerateModal.value = false,
							class: "px-4 py-2 border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-colors cursor-pointer text-slate-700 dark:text-slate-350"
						}, " Cancel ", 8, ["onClick"]), createVNode("button", {
							type: "submit",
							disabled: unref(certForm).processing,
							class: "px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg text-sm font-semibold shadow-sm transition-colors cursor-pointer disabled:opacity-50"
						}, [createVNode("span", null, toDisplayString(unref(certForm).processing ? "Generating..." : "Generate"), 1)], 8, ["disabled"])])], 32)])])) : createCommentVNode("", true),
						showWarningRegenerate.value ? (openBlock(), createBlock("div", {
							key: 1,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4"
						}, [createVNode("div", {
							class: "fixed inset-0 bg-slate-950/60 backdrop-blur-sm",
							onClick: ($event) => showWarningRegenerate.value = false
						}, null, 8, ["onClick"]), createVNode("div", { class: "relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-6" }, [createVNode("div", { class: "flex items-start gap-4" }, [createVNode("div", { class: "h-10 w-10 bg-amber-50 dark:bg-amber-950/30 rounded-lg flex items-center justify-center border border-amber-200/50 dark:border-amber-900/30 flex-shrink-0 text-amber-600 dark:text-amber-400" }, [createVNode(unref(AlertTriangle), { class: "h-5 w-5" })]), createVNode("div", null, [
							createVNode("h3", { class: "text-base font-bold text-slate-900 dark:text-slate-100" }, "Regenerate Signing Certificate?"),
							createVNode("p", { class: "text-xs text-slate-500 dark:text-slate-400 mt-2 leading-relaxed" }, " Regenerating the certificate will permanently delete the current keypair. "),
							createVNode("div", { class: "bg-amber-50/50 dark:bg-amber-950/10 border border-amber-200/40 dark:border-amber-900/25 p-3 rounded-lg text-[11px] text-amber-800 dark:text-amber-400 mt-3 leading-relaxed" }, [createVNode("strong", null, "WARNING:"), createTextVNode(" This will invalidate all previous signatures instantly. You will need to download the new public certificate and configure your local QZ Tray clients with it. ")])
						])]), createVNode("div", { class: "flex items-center justify-end gap-3" }, [createVNode("button", {
							onClick: ($event) => showWarningRegenerate.value = false,
							class: "px-4 py-2 border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-colors cursor-pointer text-slate-700 dark:text-slate-350"
						}, " Cancel ", 8, ["onClick"]), createVNode("button", {
							onClick: ($event) => {
								showGenerateModal.value = true;
								showWarningRegenerate.value = false;
							},
							class: "px-4 py-2 bg-amber-600 hover:bg-amber-500 text-white rounded-lg text-sm font-semibold transition-colors cursor-pointer shadow-sm"
						}, " Proceed to Regenerate ", 8, ["onClick"])])])])) : createCommentVNode("", true),
						showDeleteModal.value ? (openBlock(), createBlock("div", {
							key: 2,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4"
						}, [createVNode("div", {
							class: "fixed inset-0 bg-slate-950/60 backdrop-blur-sm",
							onClick: ($event) => showDeleteModal.value = false
						}, null, 8, ["onClick"]), createVNode("div", { class: "relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-6" }, [createVNode("div", { class: "flex items-start gap-4" }, [createVNode("div", { class: "h-10 w-10 bg-rose-50 dark:bg-rose-950/30 rounded-lg flex items-center justify-center border border-rose-200/50 dark:border-rose-900/30 flex-shrink-0 text-rose-600 dark:text-rose-400" }, [createVNode(unref(Trash2), { class: "h-5 w-5" })]), createVNode("div", null, [
							createVNode("h3", { class: "text-base font-bold text-slate-900 dark:text-slate-100" }, "Delete Signing Certificate?"),
							createVNode("p", { class: "text-xs text-slate-500 dark:text-slate-400 mt-2 leading-relaxed font-medium" }, " Are you absolutely sure you want to delete the QZ Tray certificate? "),
							createVNode("p", { class: "text-xs text-slate-400 dark:text-slate-500 mt-1 leading-relaxed" }, " This will remove the private key and public certificate record. Silent POS printing handshakes will fail until a new certificate is generated. ")
						])]), createVNode("div", { class: "flex items-center justify-end gap-3" }, [createVNode("button", {
							onClick: ($event) => showDeleteModal.value = false,
							class: "px-4 py-2 border border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-colors cursor-pointer text-slate-700 dark:text-slate-350"
						}, " Cancel ", 8, ["onClick"]), createVNode("button", {
							onClick: submitDelete,
							class: "px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-colors cursor-pointer shadow-sm"
						}, " Yes, Delete Certificate ")])])])) : createCommentVNode("", true),
						showLogsModal.value ? (openBlock(), createBlock("div", {
							key: 3,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4"
						}, [createVNode("div", {
							class: "fixed inset-0 bg-slate-950/60 backdrop-blur-sm",
							onClick: ($event) => showLogsModal.value = false
						}, null, 8, ["onClick"]), createVNode("div", { class: "relative bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl max-w-4xl w-full p-6 shadow-2xl space-y-6 overflow-y-auto max-h-[85vh]" }, [
							createVNode("div", { class: "flex items-center justify-between border-b border-slate-100 dark:border-slate-900 pb-3" }, [createVNode("h3", { class: "text-lg font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2" }, [createVNode(unref(Database), { class: "h-5 w-5 text-blue-600" }), createTextVNode(" QZ Tray Audit Logs ")]), createVNode("button", {
								onClick: ($event) => showLogsModal.value = false,
								class: "text-xs font-semibold text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
							}, " Close ", 8, ["onClick"])]),
							createVNode("div", { class: "overflow-x-auto border border-slate-100 dark:border-slate-900 rounded-lg" }, [createVNode("table", { class: "w-full text-left text-sm text-slate-500 dark:text-slate-400" }, [createVNode("thead", { class: "bg-slate-50/50 dark:bg-slate-900/50 text-xs font-semibold text-slate-700 dark:text-slate-300 uppercase" }, [createVNode("tr", null, [
								createVNode("th", { class: "px-4 py-3" }, "Timestamp"),
								createVNode("th", { class: "px-4 py-3" }, "User"),
								createVNode("th", { class: "px-4 py-3" }, "IP Address"),
								createVNode("th", { class: "px-4 py-3" }, "Action"),
								createVNode("th", { class: "px-4 py-3" }, "Result"),
								createVNode("th", { class: "px-4 py-3" }, "Details")
							])]), createVNode("tbody", { class: "divide-y divide-slate-100 dark:divide-slate-900" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.paginatedLogs.data, (log) => {
								return openBlock(), createBlock("tr", {
									key: log.id,
									class: "hover:bg-slate-50/30 dark:hover:bg-slate-900/20"
								}, [
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap font-medium text-slate-900 dark:text-slate-100" }, toDisplayString(formatDate(log.created_at)), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap" }, toDisplayString(log.user_name || "System"), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap font-mono text-xs" }, toDisplayString(log.ip_address), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap" }, toDisplayString(log.action), 1),
									createVNode("td", { class: "px-4 py-3 whitespace-nowrap" }, [createVNode("span", { class: ["inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium", log.result === "Success" ? "bg-emerald-50 dark:bg-emerald-950/20 text-emerald-700 dark:text-emerald-400" : "bg-rose-50 dark:bg-rose-950/20 text-rose-700 dark:text-rose-400"] }, toDisplayString(log.result), 3)]),
									createVNode("td", {
										class: "px-4 py-3 truncate max-w-xs",
										title: log.details || ""
									}, toDisplayString(log.details), 9, ["title"])
								]);
							}), 128)), __props.paginatedLogs.data?.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
								colspan: "6",
								class: "px-4 py-8 text-center text-slate-400"
							}, " No logs found. ")])) : createCommentVNode("", true)])])]),
							createVNode("div", { class: "flex items-center justify-between border-t border-slate-100 dark:border-slate-900 pt-4" }, [createVNode("span", { class: "text-xs text-slate-400" }, " Showing " + toDisplayString(__props.paginatedLogs.from || 0) + " to " + toDisplayString(__props.paginatedLogs.to || 0) + " of " + toDisplayString(__props.paginatedLogs.total || 0) + " logs ", 1), createVNode("div", { class: "flex gap-2" }, [createVNode("button", {
								disabled: !__props.paginatedLogs.prev_page_url,
								onClick: ($event) => unref(router).visit(__props.paginatedLogs.prev_page_url, {
									only: ["paginatedLogs"],
									preserveState: true
								}),
								class: "px-3 py-1 text-xs border border-slate-200 dark:border-slate-800 disabled:opacity-40 rounded cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-900 font-semibold"
							}, " Previous ", 8, ["disabled", "onClick"]), createVNode("button", {
								disabled: !__props.paginatedLogs.next_page_url,
								onClick: ($event) => unref(router).visit(__props.paginatedLogs.next_page_url, {
									only: ["paginatedLogs"],
									preserveState: true
								}),
								class: "px-3 py-1 text-xs border border-slate-200 dark:border-slate-800 disabled:opacity-40 rounded cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-900 font-semibold"
							}, " Next ", 8, ["disabled", "onClick"])])])
						])])) : createCommentVNode("", true)
					];
				}),
				_: 1
			}, _parent));
		};
	}
});
//#endregion
//#region resources/js/Pages/Settings/QzTray.vue
var _sfc_setup = QzTray_vue_vue_type_script_setup_true_lang_default.setup;
QzTray_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/Settings/QzTray.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var QzTray_default = QzTray_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { QzTray_default as default };
