{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/tap-click-2553704d.js"],"names":["startTapClick","config","scrollingEl","activatableEle","activeRipple","activeDefer","lastTouch","MOUSE_WAIT","lastActivated","useRippleEffect","getBoolean","clearDefers","WeakMap","onTouchEnd","ev","pointerUp","cancelActive","clearTimeout","undefined","removeActivated","pointerDown","parentElement","setActivatedElement","getActivatableTarget","el","x","y","has","Error","classList","contains","ACTIVATED","addActivated","deferId","get","delete","delay","isInstant","ADD_ACTIVATED_DEFERS","remove","setTimeout","Date","now","add","rippleEffect","getRippleEffect","addRipple","removeRipple","then","smooth","active","time","CLEAR_STATE_DEFERS","set","doc","document","addEventListener","target","t","composedPath","closest","path","i","length","shadowRoot","ripple","querySelector"],"mappings":"8FAAA,mEAEA,MAAMA,EAAiBC,IACrB,IAEIC,EACAC,EACAC,EACAC,EALAC,EAA0B,IAAbC,EACbC,EAAgB,EAKpB,MAAMC,EAAkBR,EAAOS,WAAW,YAAY,IAAST,EAAOS,WAAW,gBAAgB,GAC3FC,EAAc,IAAIC,QASlBC,EAAcC,IAClBR,EAAY,YAAIQ,GAChBC,EAAUD,IAcNE,EAAe,KACnBC,aAAaZ,GACbA,OAAca,EACVf,IACFgB,GAAgB,GAChBhB,OAAiBe,IAGfE,EAAeN,IACfX,QAhCmBe,IAAhBhB,GAA2D,OAA9BA,EAAYmB,gBAmChDnB,OAAcgB,EACdI,EAAoBC,EAAqBT,GAAKA,KAE1CC,EAAaD,IACjBQ,OAAoBJ,EAAWJ,IAE3BQ,EAAsB,CAACE,EAAIV,KAE/B,GAAIU,GAAMA,IAAOrB,EACf,OAEFc,aAAaZ,GACbA,OAAca,EACd,MAAM,EAAEO,EAAC,EAAEC,GAAM,YAAaZ,GAE9B,GAAIX,EAAgB,CAClB,GAAIQ,EAAYgB,IAAIxB,GAClB,MAAM,IAAIyB,MAAM,kBAEbzB,EAAe0B,UAAUC,SAASC,IACrCC,EAAa7B,EAAgBsB,EAAGC,GAElCP,GAAgB,GAG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,GAAMP,EAChBD,EAAYoD,GACdtC,EAAYN,KA0G+B,GAC/CwC,EAAIE,iBAAiB,UAxGF1C,IACjB,MAAM4C,EAAI,YAAI5C,GAAMP,EAChBD,EAAYoD,GACd3C,EAAUD,KAqG6B,IAEvCS,EAAwBT,IAC5B,IAAIA,EAAG6C,aAUL,OAAO7C,EAAG2C,OAAOG,QAAQ,oBAVN,CACnB,MAAMC,EAAO/C,EAAG6C,eAChB,IAAK,IAAIG,EAAI,EAAGA,EAAID,EAAKE,OAAS,EAAGD,IAAK,CACxC,MAAMtC,EAAKqC,EAAKC,GAChB,GAAItC,EAAGK,WAAaL,EAAGK,UAAUC,SAAS,mBACxC,OAAON,KAQTa,EAAab,GACVA,EAAGK,UAAUC,SAAS,2BAEzBe,EAAmBrB,IACvB,GAAIA,EAAGwC,WAAY,CACjB,MAAMC,EAASzC,EAAGwC,WAAWE,cAAc,qBAC3C,GAAID,EACF,OAAOA,EAGX,OAAOzC,EAAG0C,cAAc,sBAEpBnC,EAAY,gBACZO,EAAuB,IACvBc,EAAqB,IACrB7C,EAAa","file":"64.b7a24153734e40fe9631.js","sourcesContent":["import { o as now, p as pointerCoord } from './helpers-cf6e85ee.js';\n\nconst startTapClick = (config) => {\n let lastTouch = -MOUSE_WAIT * 10;\n let lastActivated = 0;\n let scrollingEl;\n let activatableEle;\n let activeRipple;\n let activeDefer;\n const useRippleEffect = config.getBoolean('animated', true) && config.getBoolean('rippleEffect', true);\n const clearDefers = new WeakMap();\n const isScrolling = () => {\n return scrollingEl !== undefined && scrollingEl.parentElement !== null;\n };\n // Touch Events\n const onTouchStart = (ev) => {\n lastTouch = now(ev);\n pointerDown(ev);\n };\n const onTouchEnd = (ev) => {\n lastTouch = now(ev);\n pointerUp(ev);\n };\n const onMouseDown = (ev) => {\n const t = now(ev) - MOUSE_WAIT;\n if (lastTouch < t) {\n pointerDown(ev);\n }\n };\n const onMouseUp = (ev) => {\n const t = now(ev) - MOUSE_WAIT;\n if (lastTouch < t) {\n pointerUp(ev);\n }\n };\n const cancelActive = () => {\n clearTimeout(activeDefer);\n activeDefer = undefined;\n if (activatableEle) {\n removeActivated(false);\n activatableEle = undefined;\n }\n };\n const pointerDown = (ev) => {\n if (activatableEle || isScrolling()) {\n return;\n }\n scrollingEl = undefined;\n setActivatedElement(getActivatableTarget(ev), ev);\n };\n const pointerUp = (ev) => {\n setActivatedElement(undefined, ev);\n };\n const setActivatedElement = (el, ev) => {\n // do nothing\n if (el && el === activatableEle) {\n return;\n }\n clearTimeout(activeDefer);\n activeDefer = undefined;\n const { x, y } = pointerCoord(ev);\n // deactivate selected\n if (activatableEle) {\n if (clearDefers.has(activatableEle)) {\n throw new Error('internal error');\n }\n if (!activatableEle.classList.contains(ACTIVATED)) {\n addActivated(activatableEle, x, y);\n }\n removeActivated(true);\n }\n // activate\n if (el) {\n const deferId = clearDefers.get(el);\n if (deferId) {\n clearTimeout(deferId);\n clearDefers.delete(el);\n }\n const delay = isInstant(el) ? 0 : ADD_ACTIVATED_DEFERS;\n el.classList.remove(ACTIVATED);\n activeDefer = setTimeout(() => {\n addActivated(el, x, y);\n activeDefer = undefined;\n }, delay);\n }\n activatableEle = el;\n };\n const addActivated = (el, x, y) => {\n lastActivated = Date.now();\n el.classList.add(ACTIVATED);\n const rippleEffect = useRippleEffect && getRippleEffect(el);\n if (rippleEffect && rippleEffect.addRipple) {\n removeRipple();\n activeRipple = rippleEffect.addRipple(x, y);\n }\n };\n const removeRipple = () => {\n if (activeRipple !== undefined) {\n activeRipple.then(remove => remove());\n activeRipple = undefined;\n }\n };\n const removeActivated = (smooth) => {\n removeRipple();\n const active = activatableEle;\n if (!active) {\n return;\n }\n const time = CLEAR_STATE_DEFERS - Date.now() + lastActivated;\n if (smooth && time > 0 && !isInstant(active)) {\n const deferId = setTimeout(() => {\n active.classList.remove(ACTIVATED);\n clearDefers.delete(active);\n }, CLEAR_STATE_DEFERS);\n clearDefers.set(active, deferId);\n }\n else {\n active.classList.remove(ACTIVATED);\n }\n };\n const doc = document;\n doc.addEventListener('ionScrollStart', ev => {\n scrollingEl = ev.target;\n cancelActive();\n });\n doc.addEventListener('ionScrollEnd', () => {\n scrollingEl = undefined;\n });\n doc.addEventListener('ionGestureCaptured', cancelActive);\n doc.addEventListener('touchstart', onTouchStart, true);\n doc.addEventListener('touchcancel', onTouchEnd, true);\n doc.addEventListener('touchend', onTouchEnd, true);\n doc.addEventListener('mousedown', onMouseDown, true);\n doc.addEventListener('mouseup', onMouseUp, true);\n};\nconst getActivatableTarget = (ev) => {\n if (ev.composedPath) {\n const path = ev.composedPath();\n for (let i = 0; i < path.length - 2; i++) {\n const el = path[i];\n if (el.classList && el.classList.contains('ion-activatable')) {\n return el;\n }\n }\n }\n else {\n return ev.target.closest('.ion-activatable');\n }\n};\nconst isInstant = (el) => {\n return el.classList.contains('ion-activatable-instant');\n};\nconst getRippleEffect = (el) => {\n if (el.shadowRoot) {\n const ripple = el.shadowRoot.querySelector('ion-ripple-effect');\n if (ripple) {\n return ripple;\n }\n }\n return el.querySelector('ion-ripple-effect');\n};\nconst ACTIVATED = 'ion-activated';\nconst ADD_ACTIVATED_DEFERS = 200;\nconst CLEAR_STATE_DEFERS = 200;\nconst MOUSE_WAIT = 2500;\n\nexport { startTapClick };\n"],"sourceRoot":"webpack:///"}