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