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