"use client";
// src/hooks/use-haptic.ts
var patterns = {
  light: 10,
  medium: 25,
  heavy: 50,
  success: [10, 50, 10],
  warning: [25, 50, 25],
  error: [50, 100, 50],
  selection: 5
};
function useHaptic() {
  const isSupported = typeof navigator !== "undefined" && "vibrate" in navigator;
  const trigger = (pattern = "light") => {
    if (!isSupported) return false;
    try {
      const vibrationPattern = patterns[pattern];
      navigator.vibrate(vibrationPattern);
      return true;
    } catch {
      return false;
    }
  };
  const cancel = () => {
    if (!isSupported) return;
    navigator.vibrate(0);
  };
  return {
    trigger,
    cancel,
    isSupported
  };
}
function triggerHaptic(pattern = "light") {
  if (typeof navigator === "undefined" || !("vibrate" in navigator)) return false;
  try {
    navigator.vibrate(patterns[pattern]);
    return true;
  } catch {
    return false;
  }
}

export { triggerHaptic, useHaptic };
//# sourceMappingURL=chunk-D2JF6C3E.mjs.map
//# sourceMappingURL=chunk-D2JF6C3E.mjs.map