import { Button as e } from "../primitives/button.js";
import { useConsent as t } from "../hooks/useConsent.js";
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
//#region src/react/consent/banner.tsx
function a({ title: a = "We use cookies", description: o = "We use cookies and similar technologies to improve your experience. You can accept all cookies, reject non-essential ones, or manage your preferences.", acceptLabel: s = "Accept all", rejectLabel: c = "Reject all", preferencesLabel: l = "Preferences", policyHref: u, onPreferences: d }) {
	let { preferences: f, acceptAll: p, rejectAll: m } = t();
	if (f !== null) return null;
	function h() {
		p();
	}
	function g() {
		m();
	}
	function _() {
		d ? d() : window.location.hash = "#consent-preferences";
	}
	return /* @__PURE__ */ r("div", {
		role: "region",
		"aria-label": "Cookie consent",
		"data-slot": "consent-banner",
		className: [
			"fixed bottom-0 left-0 right-0 z-50",
			"bg-background/95 backdrop-blur-[20px]",
			"border-t border-border-glass",
			"px-4 py-4 sm:px-6",
			"motion-safe:animate-in motion-safe:slide-in-from-bottom-4 motion-safe:duration-300"
		].join(" "),
		children: /* @__PURE__ */ i("div", {
			className: "mx-auto flex max-w-7xl flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
			children: [/* @__PURE__ */ i("div", {
				className: "flex-1 space-y-1",
				children: [/* @__PURE__ */ r("p", {
					className: "text-foreground text-sm font-semibold",
					children: a
				}), /* @__PURE__ */ i("p", {
					className: "text-foreground-muted text-sm",
					children: [o, u && /* @__PURE__ */ i(n, { children: [" ", /* @__PURE__ */ r("a", {
						href: u,
						target: "_blank",
						rel: "noopener noreferrer",
						className: "text-primary underline-offset-4 hover:underline",
						children: "Privacy policy"
					})] })]
				})]
			}), /* @__PURE__ */ i("div", {
				className: "flex flex-shrink-0 flex-wrap items-center gap-2",
				children: [
					/* @__PURE__ */ r(e, {
						variant: "link",
						size: "sm",
						type: "button",
						onClick: _,
						children: l
					}),
					/* @__PURE__ */ r(e, {
						variant: "secondary",
						size: "sm",
						type: "button",
						onClick: g,
						children: c
					}),
					/* @__PURE__ */ r(e, {
						variant: "default",
						size: "sm",
						type: "button",
						onClick: h,
						children: s
					})
				]
			})]
		})
	});
}
//#endregion
export { a as ConsentBanner };

//# sourceMappingURL=banner.js.map