import{w as t}from"./p-3d23a42a.js";import{createGesture as o}from"./p-101feae9.js";import{h as e,a as n,b as r}from"./p-c563b4de.js";const a=(a,s)=>{let i,c;const d=(t,o,e)=>{if("undefined"==typeof document)return;const n=document.elementFromPoint(t,o);n&&s(n)?n!==i&&(f(),m(n,e)):f()},m=(o,e)=>{i=o,c||(c=i);const n=i;t((()=>n.classList.add("ion-activated"))),e()},f=(o=!1)=>{if(!i)return;const e=i;t((()=>e.classList.remove("ion-activated"))),o&&c!==i&&i.click(),i=void 0};return o({el:a,gestureName:"buttonActiveDrag",threshold:0,onStart:t=>d(t.currentX,t.currentY,n),onMove:t=>d(t.currentX,t.currentY,r),onEnd:()=>{f(!0),e(),c=void 0}})};export{a as c}