/**
 * Creates a click handler for anchor elements that distinguishes between default clicks and modified clicks.
 *
 * A default click is defined as a left-click (button === 0) without the meta key (Cmd on Mac)
 * or ctrl key pressed. Default clicks prevent the browser's default behavior and execute the
 * defaultHandler. Modified clicks (right-clicks, middle-clicks, or clicks with modifier keys)
 * execute the modifiedHandler instead.
 *
 * @param defaultHandler - Optional handler to be called on default clicks (left-click without modifiers)
 * @param modifiedHandler - Optional handler to be called on modified clicks (with meta/ctrl keys or non-left clicks)
 * @returns A click event handler function that can be used as an onClick prop for anchor elements
 *
 * @example
 * ```tsx
 * <Link
 *   onClick={handleLinkClick(
 *     () => {
 *       // SPA navigation
 *     },
 *     () => {
 *       // Default browser behavior
 *     }
 *   )}
 * >
 *   Click me
 * </Link>
 * ```
 */
export default (defaultHandler, modifiedHandler) => {
    return (e => {
        const defaultClick = e.button === 0 && !e.metaKey && !e.ctrlKey;
        if (defaultClick) {
            e.preventDefault();
            defaultHandler?.(e);
        }
        else {
            modifiedHandler?.(e);
        }
    });
};
//# sourceMappingURL=handleLinkClick.js.map