const determinePlatform = () => { if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) { return "ios"; } else if (/Android/i.test(window.navigator.userAgent)) { return "android"; } return "other"; }; const convertToMS = (period, unit) => { let multiplier = 1; switch (unit) { case "minutes": multiplier = 1e3 * 60; break; case "hours": multiplier = 1e3 * 60 * 60; break; case "days": multiplier = 1e3 * 60 * 60 * 24; break; case "weeks": multiplier = 1e3 * 60 * 60 * 24 * 7; break; default: throw new Error('Invalid time unit. Please specify one of "minutes", or "hours", "days", or "weeks".'); } return period * multiplier; }; const checkMatchConditions = ({ matchCondition, currentUrl, urlToMatch }) => { let matchResult = false; switch (matchCondition) { case "exact": matchResult = currentUrl === urlToMatch; break; case "starts-with": matchResult = currentUrl.startsWith(urlToMatch); break; case "ends-with": matchResult = currentUrl.endsWith(urlToMatch); break; case "contains": matchResult = currentUrl.includes(urlToMatch); break; case "not-contain": matchResult = !currentUrl.includes(urlToMatch); break; case "regex": const regex = new RegExp(urlToMatch); matchResult = regex.test(currentUrl); break; case "not-ends-with": matchResult = !currentUrl.endsWith(urlToMatch); break; case "not-equal": matchResult = currentUrl !== urlToMatch; break; } return matchResult; }; export { convertToMS as a, checkMatchConditions as c, determinePlatform as d };