{"version":3,"sources":["../node_modules/@ionic/core/dist/esm-es5/ion-ripple-effect.entry.js"],"names":["RippleEffect","class_1","hostRef","registerInstance","this","type","prototype","addRipple","x","y","__awaiter","_this","__generator","_a","Promise","resolve","readTask","rect","el","getBoundingClientRect","width","height","hypotenuse","Math","sqrt","maxDim","max","maxRadius","unbounded","PADDING","initialSize","floor","INITIAL_ORIGIN_SCALE","finalScale","posX","left","posY","top","styleX","styleY","moveX","moveY","writeTask","div","document","createElement","classList","add","style","setProperty","shadowRoot","appendChild","setTimeout","removeRipple","Object","defineProperty","get","enumerable","configurable","render","mode","getIonMode","h","Host","role","class","getElement","ripple","remove"],"mappings":"qHAAA,mFAIIA,EAA8B,WAC9B,SAASC,EAAQC,GACbC,YAAiBC,KAAMF,GAUvBE,KAAKC,KAAO,UA0EhB,OAlEAJ,EAAQK,UAAUC,UAAY,SAAUC,EAAGC,GACvC,OAAOC,oBAAUN,UAAM,OAAQ,GAAQ,WACnC,IAAIO,EAAQP,KACZ,OAAOQ,sBAAYR,MAAM,SAAUS,GAC/B,MAAO,CAAC,EAAc,IAAIC,SAAQ,SAAUC,GACpCC,aAAS,WACL,IAAIC,EAAON,EAAMO,GAAGC,wBAChBC,EAAQH,EAAKG,MACbC,EAASJ,EAAKI,OACdC,EAAaC,KAAKC,KAAKJ,EAAQA,EAAQC,EAASA,GAChDI,EAASF,KAAKG,IAAIL,EAAQD,GAC1BO,EAAYhB,EAAMiB,UAAYH,EAASH,EAAaO,EACpDC,EAAcP,KAAKQ,MAAMN,EAASO,GAClCC,EAAaN,EAAYG,EACzBI,EAAO1B,EAAIS,EAAKkB,KAChBC,EAAO3B,EAAIQ,EAAKoB,IAChB1B,EAAMiB,YACNM,EAAe,GAARd,EACPgB,EAAgB,GAATf,GAEX,IAAIiB,EAASJ,EAAqB,GAAdJ,EAChBS,EAASH,EAAqB,GAAdN,EAChBU,EAAgB,GAARpB,EAAcc,EACtBO,EAAiB,GAATpB,EAAee,EAC3BM,aAAU,WACN,IAAIC,EAAMC,SAASC,cAAc,OACjCF,EAAIG,UAAUC,IAAI,iBAClB,IAAIC,EAAQL,EAAIK,MAChBA,EAAMX,IAAME,EAAS,KACrBS,EAAMb,KAAOG,EAAS,KACtBU,EAAM5B,MAAQ4B,EAAM3B,OAASS,EAAc,KAC3CkB,EAAMC,YAAY,gBAAiB,GAAKhB,GACxCe,EAAMC,YAAY,kBAAmBT,EAAQ,OAASC,EAAQ,OAC9C9B,EAAMO,GAAGgC,YAAcvC,EAAMO,IACnCiC,YAAYR,GACtBS,YAAW,WACPrC,GAAQ,WACJsC,EAAaV,QAElB,sBAO/BW,OAAOC,eAAetD,EAAQK,UAAW,YAAa,CAClDkD,IAAK,WACD,MAAqB,cAAdpD,KAAKC,MAEhBoD,YAAY,EACZC,cAAc,IAElBzD,EAAQK,UAAUqD,OAAS,WACvB,IAAI9C,EACA+C,EAAOC,YAAWzD,MACtB,OAAQ0D,YAAEC,IAAM,CAAEC,KAAM,eAAgBC,OAAQpD,EAAK,GAC7CA,EAAG+C,IAAQ,EACX/C,EAAE,UAAgBT,KAAKwB,UACvBf,MAEZyC,OAAOC,eAAetD,EAAQK,UAAW,KAAM,CAC3CkD,IAAK,WAAc,OAAOU,YAAW9D,OACrCqD,YAAY,EACZC,cAAc,IAEXzD,EAtFuB,GAwF9BoD,EAAe,SAAUc,GACzBA,EAAOrB,UAAUC,IAAI,YACrBK,YAAW,WACPe,EAAOC,WACR,MAEHvC,EAAU,GACVG,EAAuB,GAC3BhC,EAAagD,MAjGS","file":"static/js/47.54cc49bd.chunk.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, f as readTask, c as writeTask, h, i as getElement, H as Host } from './index-92848855.js';\nimport { b as getIonMode } from './ionic-global-23e7365a.js';\nvar rippleEffectCss = \":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;-webkit-animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1));-webkit-animation:150ms fadeOutAnimation forwards;animation:150ms fadeOutAnimation forwards}@-webkit-keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@-webkit-keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@-webkit-keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}@keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}\";\nvar RippleEffect = /** @class */ (function () {\n    function class_1(hostRef) {\n        registerInstance(this, hostRef);\n        /**\n         * Sets the type of ripple-effect:\n         *\n         * - `bounded`: the ripple effect expands from the user's click position\n         * - `unbounded`: the ripple effect expands from the center of the button and overflows the container.\n         *\n         * NOTE: Surfaces for bounded ripples should have the overflow property set to hidden,\n         * while surfaces for unbounded ripples should have it set to visible.\n         */\n        this.type = 'bounded';\n    }\n    /**\n     * Adds the ripple effect to the parent element.\n     *\n     * @param x The horizontal coordinate of where the ripple should start.\n     * @param y The vertical coordinate of where the ripple should start.\n     */\n    class_1.prototype.addRipple = function (x, y) {\n        return __awaiter(this, void 0, void 0, function () {\n            var _this = this;\n            return __generator(this, function (_a) {\n                return [2 /*return*/, new Promise(function (resolve) {\n                        readTask(function () {\n                            var rect = _this.el.getBoundingClientRect();\n                            var width = rect.width;\n                            var height = rect.height;\n                            var hypotenuse = Math.sqrt(width * width + height * height);\n                            var maxDim = Math.max(height, width);\n                            var maxRadius = _this.unbounded ? maxDim : hypotenuse + PADDING;\n                            var initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);\n                            var finalScale = maxRadius / initialSize;\n                            var posX = x - rect.left;\n                            var posY = y - rect.top;\n                            if (_this.unbounded) {\n                                posX = width * 0.5;\n                                posY = height * 0.5;\n                            }\n                            var styleX = posX - initialSize * 0.5;\n                            var styleY = posY - initialSize * 0.5;\n                            var moveX = width * 0.5 - posX;\n                            var moveY = height * 0.5 - posY;\n                            writeTask(function () {\n                                var div = document.createElement('div');\n                                div.classList.add('ripple-effect');\n                                var style = div.style;\n                                style.top = styleY + 'px';\n                                style.left = styleX + 'px';\n                                style.width = style.height = initialSize + 'px';\n                                style.setProperty('--final-scale', \"\" + finalScale);\n                                style.setProperty('--translate-end', moveX + \"px, \" + moveY + \"px\");\n                                var container = _this.el.shadowRoot || _this.el;\n                                container.appendChild(div);\n                                setTimeout(function () {\n                                    resolve(function () {\n                                        removeRipple(div);\n                                    });\n                                }, 225 + 100);\n                            });\n                        });\n                    })];\n            });\n        });\n    };\n    Object.defineProperty(class_1.prototype, \"unbounded\", {\n        get: function () {\n            return this.type === 'unbounded';\n        },\n        enumerable: false,\n        configurable: true\n    });\n    class_1.prototype.render = function () {\n        var _a;\n        var mode = getIonMode(this);\n        return (h(Host, { role: \"presentation\", class: (_a = {},\n                _a[mode] = true,\n                _a['unbounded'] = this.unbounded,\n                _a) }));\n    };\n    Object.defineProperty(class_1.prototype, \"el\", {\n        get: function () { return getElement(this); },\n        enumerable: false,\n        configurable: true\n    });\n    return class_1;\n}());\nvar removeRipple = function (ripple) {\n    ripple.classList.add('fade-out');\n    setTimeout(function () {\n        ripple.remove();\n    }, 200);\n};\nvar PADDING = 10;\nvar INITIAL_ORIGIN_SCALE = 0.5;\nRippleEffect.style = rippleEffectCss;\nexport { RippleEffect as ion_ripple_effect };\n"],"sourceRoot":""}