import{N as e,q as t}from"./Tooltip.DJg7muty.js";import{a as n}from"./useFocusRing.Ct2U5AmE.js";var r=`default`,i=``,a=new WeakMap;function o(n){if(e()){if(r==="default"){let e=t(n);i=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect=`none`}r=`disabled`}else if(n instanceof HTMLElement||n instanceof SVGElement){let e=`userSelect`in n.style?`userSelect`:`webkitUserSelect`;a.set(n,n.style[e]),n.style[e]=`none`}}function s(o){if(e()){if(r!==`disabled`)return;r=`restoring`,setTimeout(()=>{n(()=>{if(r===`restoring`){let e=t(o);e.documentElement.style.webkitUserSelect===`none`&&(e.documentElement.style.webkitUserSelect=i||``),i=``,r=`default`}})},300)}else if((o instanceof HTMLElement||o instanceof SVGElement)&&o&&a.has(o)){let e=a.get(o),t=`userSelect`in o.style?`userSelect`:`webkitUserSelect`;o.style[t]===`none`&&(o.style[t]=e),o.getAttribute(`style`)===``&&o.removeAttribute(`style`),a.delete(o)}}export{s as n,o as t};