// Lalaluxe booking — booking/ui/icons.jsx (load before app.jsx — see docs/architecture.md, "The no-build multi-file Babel contract")
// The booking app's icon set (Ico), the Afterpay mark, and the tile art: the plan's punch card and the booked check.

/* ---------- Icons: one 24px stroke set, currentColor ---------- */
const ICO_PATHS = {
	back: <path d="m14.5 5.5-6.5 6.5 6.5 6.5" />,
	next: <path d="m9.5 5.5 6.5 6.5-6.5 6.5" />,
	arrow: <path d="M4.5 12h15m-5.5-6 6 6-6 6" />,
	check: <path d="m5 12.5 4.6 4.6L19 7.6" />,
	down: <path d="M12 4.5v15m-6-5.5 6 6 6-6" />,
	undo: <path d="M8.5 5 4 9.5 8.5 14M4 9.5h10a5.5 5.5 0 0 1 0 11h-4" />,
	plus: <path d="M12 5.5v13M5.5 12h13" />,
	x: <path d="m6.5 6.5 11 11m0-11-11 11" />,
	moon: <path d="M20 14.2A8.2 8.2 0 0 1 9.8 4a8.2 8.2 0 1 0 10.2 10.2Z" />,
	sun: <><circle cx="12" cy="12" r="3.9" /><path d="M12 2.8v2.1m0 14.2v2.1M2.8 12h2.1m14.2 0h2.1M5.5 5.5 7 7m10 10 1.5 1.5m0-13L17 7M7 17l-1.5 1.5" /></>,
	calendar: <><rect x="3.5" y="5" width="17" height="15.5" rx="4" /><path d="M3.5 10h17M8 3v4m8-4v4" /></>,
	clock: <><circle cx="12" cy="12" r="8.6" /><path d="M12 7.4V12l3 2" /></>,
	image: <><rect x="3.5" y="4.5" width="17" height="15" rx="4" /><circle cx="9" cy="10" r="1.6" /><path d="m4.5 17 4.7-4.3 3.6 3.3 2.7-2.5 4 3.7" /></>,
	lock: <><rect x="5" y="10.5" width="14" height="10" rx="3.2" /><path d="M8.2 10.5V8a3.8 3.8 0 0 1 7.6 0v2.5" /></>,
	edit: <path d="M4.5 19.5 5.3 16 15.8 5.5a2.1 2.1 0 0 1 3 3L8.2 19l-3.7.5ZM14 7.3l3 3" />,
	pin: <><path d="M12 21s6.5-5.6 6.5-10.7a6.5 6.5 0 1 0-13 0C5.5 15.4 12 21 12 21Z" /><circle cx="12" cy="10.2" r="2.3" /></>,
};
function Ico({ name, className }) {
	return (
		<svg
			className={"ico" + (className ? " " + className : "")}
			viewBox="0 0 24 24"
			fill="none"
			stroke="currentColor"
			strokeWidth="1.5"
			strokeLinecap="round"
			strokeLinejoin="round"
			aria-hidden="true"
		>
			{ICO_PATHS[name] || null}
		</svg>
	);
}

// "Afterpay" set in running text with its mark in front, kept on one line. The mark is
// Afterpay's own (simple-icons, CC0) and takes the text colour, so it reads in both themes.
function Afterpay() {
	return (
		<span className="afterpay">
			<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
				<path d="M12 0C5.373 0 0 5.373 0 12c0 6.628 5.373 12 12 12 6.628 0 12-5.372 12-12 0-6.627-5.372-12-12-12Zm1.236 4.924a2.21 2.21 0 0 1 1.15.299l4.457 2.557c1.495.857 1.495 3.013 0 3.87l-4.457 2.558c-1.488.854-3.342-.22-3.342-1.935v-.34a.441.441 0 0 0-.66-.383L6.287 13.9a.441.441 0 0 0 0 .765l4.096 2.35a.44.44 0 0 0 .661-.382v-.685c0-.333.36-.542.649-.376l1.041.597a.441.441 0 0 1 .222.383v.29c0 1.715-1.854 2.789-3.342 1.935L5.157 16.22c-1.495-.857-1.495-3.013 0-3.87l4.457-2.558c1.488-.854 3.342.22 3.342 1.935v.34c0 .34.366.551.66.383l4.097-2.35a.441.441 0 0 0 0-.765l-4.096-2.351a.441.441 0 0 0-.661.382v.685c0 .333-.36.541-.649.375l-1.041-.597a.442.442 0 0 1-.222-.383v-.29c0-1.285 1.043-2.21 2.192-2.233z" />
			</svg>
			Afterpay
		</span>
	);
}

// "Booked": a check made in one pass of the brush.
function DoneMark() {
	return (
		<svg viewBox="0 0 88 70" aria-hidden="true">
			<path d="M9 40C18 45 26 54 32 62C43 37 61 17 81 7" pathLength="1" fill="none" stroke="currentColor" strokeWidth="9" strokeLinecap="round" strokeLinejoin="round" filter="url(#paint-hand)" />
		</svg>
	);
}

// Three-visit plan as a punch card: `left` visits still to use out of `total`.
function PunchCard({ total = 3, left = 3 }) {
	return (
		<span className="punch" role="img" aria-label={`${left} of ${total} visits remaining`}>
			{Array.from({ length: total }, (_, i) => (
				<span key={i} className={"punch-dot" + (i < total - left ? " used" : "")}>
					{i < total - left ? <Ico name="check" /> : i + 1}
				</span>
			))}
		</span>
	);
}
