export function parseDuration(input: string): number { const matches = input.match(/(\d+)([smhd])/g) || []; let totalSeconds = 0; for (const match of matches) { const value = Number.parseInt(match.match(/\d+/)?.[0] || "0", 10); const unit = match.match(/[smhd]/)?.[0]; switch (unit) { case "s": totalSeconds += value; break; case "m": totalSeconds += value * 60; break; case "h": totalSeconds += value * 3600; break; case "d": totalSeconds += value * 86400; break; } } return totalSeconds; }