import{useRef as l}from"react";import{MouseButton as f}from'../components/mouse.js';import{isDisabledReactIssue7711 as n}from'../utils/bugs.js';import{useEvent as o}from'./use-event.js';function s(t){let r=l(null),u=o(e=>{r.current=e.pointerType,!n(e.currentTarget)&&e.pointerType==="mouse"&&e.button===f.Left&&(e.preventDefault(),t(e))}),i=o(e=>{r.current!=="mouse"&&(n(e.currentTarget)||t(e))});return{onPointerDown:u,onClick:i}}export{s as useHandleToggle};
