import{n as e,p as t}from"./p-0d273727.js";const o=o=>{let l,v,u,p,f=10*-d,m=0;const L=o.getBoolean("animated",!0)&&o.getBoolean("rippleEffect",!0),E=new WeakMap,h=t=>{f=e(t),S(t)},w=()=>{clearTimeout(p),p=void 0,v&&(b(!1),v=void 0)},g=e=>{v||(()=>void 0!==l&&null!==l.parentElement)()||(l=void 0,T(n(e),e))},S=e=>{T(void 0,e)},T=(e,o)=>{if(e&&e===v)return;clearTimeout(p),p=void 0;const{x:n,y:i}=t(o);if(v){if(E.has(v))throw new Error("internal error");v.classList.contains(a)||R(v,n,i),b(!0)}if(e){const t=E.get(e);t&&(clearTimeout(t),E.delete(e));const o=s(e)?0:r;e.classList.remove(a),p=setTimeout(()=>{R(e,n,i),p=void 0},o)}v=e},R=(e,t,o)=>{m=Date.now(),e.classList.add(a);const n=L&&i(e);n&&n.addRipple&&(u=n.addRipple(t,o))},b=e=>{void 0!==u&&u.then(e=>e());const t=v;if(!t)return;const o=c-Date.now()+m;if(e&&o>0&&!s(t)){const e=setTimeout(()=>{t.classList.remove(a),E.delete(t)},c);E.set(t,e)}else t.classList.remove(a)},y=document;y.addEventListener("ionScrollStart",e=>{l=e.target,w()}),y.addEventListener("ionScrollEnd",()=>{l=void 0}),y.addEventListener("ionGestureCaptured",w),y.addEventListener("touchstart",t=>{f=e(t),g(t)},!0),y.addEventListener("touchcancel",h,!0),y.addEventListener("touchend",h,!0),y.addEventListener("mousedown",t=>{const o=e(t)-d;f<o&&g(t)},!0),y.addEventListener("mouseup",t=>{const o=e(t)-d;f<o&&S(t)},!0)},n=e=>{if(!e.composedPath)return e.target.closest(".ion-activatable");{const t=e.composedPath();for(let e=0;e<t.length-2;e++){const o=t[e];if(o.classList&&o.classList.contains("ion-activatable"))return o}}},s=e=>e.classList.contains("ion-activatable-instant"),i=e=>{if(e.shadowRoot){const t=e.shadowRoot.querySelector("ion-ripple-effect");if(t)return t}return e.querySelector("ion-ripple-effect")},a="activated",r=200,c=200,d=2500;export{o as startTapClick};