{"version":3,"sources":["webpack:///./node_modules/aurelia-animator-css/dist/native-modules/aurelia-animator-css.js"],"names":["CssAnimator","this","useAnimationDoneClasses","animationEnteredClass","animationLeftClass","isAnimating","verifyKeyframesExist","prototype","_addMultipleEventListener","el","s","fn","evts","split","i","ii","length","addEventListener","_removeMultipleEventListener","removeEventListener","_getElementAnimationDelay","element","styl","getComputedStyle","prop","delay","getPropertyValue","Number","replace","_getElementAnimationNames","prefix","animationNames","_performSingleAnimate","className","_this","_triggerDOMEvent","animateBegin","addClass","then","result","animateActive","removeClass","animateDone","catch","animateTimeout","eventType","evt","createCustomEvent","bubbles","cancelable","detail","dispatchEvent","_animationChangeWithValidKeyframe","prevAnimationNames","newAnimationNames","filter","name","indexOf","keyframesRuleType","window","CSSRule","KEYFRAMES_RULE","MOZ_KEYFRAMES_RULE","WEBKIT_KEYFRAMES_RULE","styleSheets","document","cssRules","e","j","cssRule","type","animate","_this2","Array","isArray","Promise","all","map","runSequence","animations","_this3","sequenceBegin","reduce","p","anim","resolve","sequenceDone","_stateAnim","direction","doneClass","_this4","auClass","auClassActive","reject","classList","remove","add","_animStart","animHasStarted","evAnimStart","target","stopPropagation","_animEnd","evAnimEnd","parent","parentElement","attrib","cleanupAnimation","setAttribute","getAttribute","contains","offset","staggerNext","setTimeout","enter","leave","_this5","suppressEvents","arguments","undefined","removeClassBegin","_animStart2","removeClassActive","_animEnd2","removeClassDone","removeClassTimeout","_this6","addClassBegin","_animStart3","addClassActive","_animEnd3","addClassDone","addClassTimeout","configure","config","callback","animator","container","get","configureAnimator"],"mappings":"uOAKWA,EAAc,WACvB,SAASA,IAGPC,KAAKC,yBAA0B,EAC/BD,KAAKE,sBAAwB,aAC7BF,KAAKG,mBAAqB,UAC1BH,KAAKI,aAAc,EAEnBJ,KAAKK,sBAAuB,EAgb9B,OA7aAN,EAAYO,UAAUC,0BAA4B,SAAmCC,EAAIC,EAAGC,GAE1F,IADA,IAAIC,EAAOF,EAAEG,MAAM,KACVC,EAAI,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AO5G,6BAA6BG,EAAS,kCAAmC6G,GAChFJ,EAAO5G,6BAA6BG,EAAS,sCAAuC2G,IAE7D,IAAnBX,GACFS,EAAO3F,iBAAiB,IAAeiG,gBAAiB/G,GAG1DgE,GAAQ,QAKPrF,EAzbgB,GA4blB,SAASqI,EAAUC,EAAQC,GAChC,IAAIC,EAAWF,EAAOG,UAAUC,IAAI1I,GACpCsI,EAAOG,UAAUC,IAAI,KAAkBC,kBAAkBH,GACjC,mBAAbD,GACTA,EAASC","file":"vendor.aurelia-animator-css~be6b90b8.0e36cf8c91224bee4b75.chunk.js","sourcesContent":["\n\nimport { animationEvent, TemplatingEngine } from 'aurelia-templating';\nimport { DOM } from 'aurelia-pal';\n\nexport var CssAnimator = function () {\n function CssAnimator() {\n \n\n this.useAnimationDoneClasses = false;\n this.animationEnteredClass = 'au-entered';\n this.animationLeftClass = 'au-left';\n this.isAnimating = false;\n\n this.verifyKeyframesExist = true;\n }\n\n CssAnimator.prototype._addMultipleEventListener = function _addMultipleEventListener(el, s, fn) {\n var evts = s.split(' ');\n for (var i = 0, ii = evts.length; i < ii; ++i) {\n el.addEventListener(evts[i], fn, false);\n }\n };\n\n CssAnimator.prototype._removeMultipleEventListener = function _removeMultipleEventListener(el, s, fn) {\n var evts = s.split(' ');\n for (var i = 0, ii = evts.length; i < ii; ++i) {\n el.removeEventListener(evts[i], fn, false);\n }\n };\n\n CssAnimator.prototype._getElementAnimationDelay = function _getElementAnimationDelay(element) {\n var styl = DOM.getComputedStyle(element);\n var prop = void 0;\n var delay = void 0;\n\n if (styl.getPropertyValue('animation-delay')) {\n prop = 'animation-delay';\n } else if (styl.getPropertyValue('-webkit-animation-delay')) {\n prop = '-webkit-animation-delay';\n } else if (styl.getPropertyValue('-moz-animation-delay')) {\n prop = '-moz-animation-delay';\n } else {\n return 0;\n }\n\n delay = styl.getPropertyValue(prop);\n delay = Number(delay.replace(/[^\\d\\.]/g, ''));\n\n return delay * 1000;\n };\n\n CssAnimator.prototype._getElementAnimationNames = function _getElementAnimationNames(element) {\n var styl = DOM.getComputedStyle(element);\n var prefix = void 0;\n\n if (styl.getPropertyValue('animation-name')) {\n prefix = '';\n } else if (styl.getPropertyValue('-webkit-animation-name')) {\n prefix = '-webkit-';\n } else if (styl.getPropertyValue('-moz-animation-name')) {\n prefix = '-moz-';\n } else {\n return [];\n }\n\n var animationNames = styl.getPropertyValue(prefix + 'animation-name');\n return animationNames ? animationNames.split(' ') : [];\n };\n\n CssAnimator.prototype._performSingleAnimate = function _performSingleAnimate(element, className) {\n var _this = this;\n\n this._triggerDOMEvent(animationEvent.animateBegin, element);\n\n return this.addClass(element, className, true).then(function (result) {\n _this._triggerDOMEvent(animationEvent.animateActive, element);\n\n if (result !== false) {\n return _this.removeClass(element, className, true).then(function () {\n _this._triggerDOMEvent(animationEvent.animateDone, element);\n });\n }\n\n return false;\n }).catch(function () {\n _this._triggerDOMEvent(animationEvent.animateTimeout, element);\n });\n };\n\n CssAnimator.prototype._triggerDOMEvent = function _triggerDOMEvent(eventType, element) {\n var evt = DOM.createCustomEvent(eventType, { bubbles: true, cancelable: true, detail: element });\n DOM.dispatchEvent(evt);\n };\n\n CssAnimator.prototype._animationChangeWithValidKeyframe = function _animationChangeWithValidKeyframe(animationNames, prevAnimationNames) {\n var newAnimationNames = animationNames.filter(function (name) {\n return prevAnimationNames.indexOf(name) === -1;\n });\n\n if (newAnimationNames.length === 0) {\n return false;\n }\n\n if (!this.verifyKeyframesExist) {\n return true;\n }\n\n var keyframesRuleType = window.CSSRule.KEYFRAMES_RULE || window.CSSRule.MOZ_KEYFRAMES_RULE || window.CSSRule.WEBKIT_KEYFRAMES_RULE;\n\n var styleSheets = document.styleSheets;\n\n try {\n for (var i = 0; i < styleSheets.length; ++i) {\n var cssRules = null;\n\n try {\n cssRules = styleSheets[i].cssRules;\n } catch (e) {}\n\n if (!cssRules) {\n continue;\n }\n\n for (var j = 0; j < cssRules.length; ++j) {\n var cssRule = cssRules[j];\n\n if (cssRule.type === keyframesRuleType) {\n if (newAnimationNames.indexOf(cssRule.name) !== -1) {\n return true;\n }\n }\n }\n }\n } catch (e) {}\n\n return false;\n };\n\n CssAnimator.prototype.animate = function animate(element, className) {\n var _this2 = this;\n\n if (Array.isArray(element)) {\n return Promise.all(element.map(function (el) {\n return _this2._performSingleAnimate(el, className);\n }));\n }\n\n return this._performSingleAnimate(element, className);\n };\n\n CssAnimator.prototype.runSequence = function runSequence(animations) {\n var _this3 = this;\n\n this._triggerDOMEvent(animationEvent.sequenceBegin, null);\n\n return animations.reduce(function (p, anim) {\n return p.then(function () {\n return _this3.animate(anim.element, anim.className);\n });\n }, Promise.resolve(true)).then(function () {\n _this3._triggerDOMEvent(animationEvent.sequenceDone, null);\n });\n };\n\n CssAnimator.prototype._stateAnim = function _stateAnim(element, direction, doneClass) {\n var _this4 = this;\n\n var auClass = 'au-' + direction;\n var auClassActive = auClass + '-active';\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Begin'], element);\n\n if (_this4.useAnimationDoneClasses) {\n classList.remove(_this4.animationEnteredClass);\n classList.remove(_this4.animationLeftClass);\n }\n\n classList.add(auClass);\n var prevAnimationNames = _this4._getElementAnimationNames(element);\n\n var _animStart = void 0;\n var animHasStarted = false;\n _this4._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this4.isAnimating = true;\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Active'], element);\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart);\n }, false);\n\n var _animEnd = void 0;\n _this4._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n evAnimEnd.stopPropagation();\n\n classList.remove(auClassActive);\n classList.remove(auClass);\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd);\n\n if (_this4.useAnimationDoneClasses && doneClass !== undefined && doneClass !== null) {\n classList.add(doneClass);\n }\n\n _this4.isAnimating = false;\n _this4._triggerDOMEvent(animationEvent[direction + 'Done'], element);\n\n resolve(true);\n }, false);\n\n var parent = element.parentElement;\n var attrib = 'data-animator-pending' + direction;\n\n var cleanupAnimation = function cleanupAnimation() {\n var animationNames = _this4._getElementAnimationNames(element);\n if (!_this4._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(auClassActive);\n classList.remove(auClass);\n\n _this4._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd);\n _this4._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart);\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Timeout'], element);\n resolve(false);\n }\n parent && parent.setAttribute(attrib, +(parent.getAttribute(attrib) || 1) - 1);\n };\n\n if (parent !== null && parent !== undefined && (parent.classList.contains('au-stagger') || parent.classList.contains('au-stagger-' + direction))) {\n var offset = +(parent.getAttribute(attrib) || 0);\n parent.setAttribute(attrib, offset + 1);\n var delay = _this4._getElementAnimationDelay(parent) * offset;\n _this4._triggerDOMEvent(animationEvent.staggerNext, element);\n\n setTimeout(function () {\n classList.add(auClassActive);\n cleanupAnimation();\n }, delay);\n } else {\n classList.add(auClassActive);\n cleanupAnimation();\n }\n });\n };\n\n CssAnimator.prototype.enter = function enter(element) {\n return this._stateAnim(element, 'enter', this.animationEnteredClass);\n };\n\n CssAnimator.prototype.leave = function leave(element) {\n return this._stateAnim(element, 'leave', this.animationLeftClass);\n };\n\n CssAnimator.prototype.removeClass = function removeClass(element, className) {\n var _this5 = this;\n\n var suppressEvents = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];\n\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n if (!classList.contains(className) && !classList.contains(className + '-add')) {\n resolve(false);\n return;\n }\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassBegin, element);\n }\n\n if (classList.contains(className + '-add')) {\n classList.remove(className + '-add');\n classList.add(className);\n }\n\n classList.remove(className);\n var prevAnimationNames = _this5._getElementAnimationNames(element);\n\n var _animStart2 = void 0;\n var animHasStarted = false;\n _this5._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2 = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this5.isAnimating = true;\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassActive, element);\n }\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart2);\n }, false);\n\n var _animEnd2 = void 0;\n _this5._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2 = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n if (!element.classList.contains(className + '-remove')) {\n resolve(true);\n }\n\n evAnimEnd.stopPropagation();\n\n classList.remove(className);\n\n classList.remove(className + '-remove');\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd2);\n\n _this5.isAnimating = false;\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassDone, element);\n }\n\n resolve(true);\n }, false);\n\n classList.add(className + '-remove');\n\n var animationNames = _this5._getElementAnimationNames(element);\n if (!_this5._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(className + '-remove');\n classList.remove(className);\n\n _this5._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2);\n _this5._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2);\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassTimeout, element);\n }\n\n resolve(false);\n }\n });\n };\n\n CssAnimator.prototype.addClass = function addClass(element, className) {\n var _this6 = this;\n\n var suppressEvents = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];\n\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassBegin, element);\n }\n\n if (classList.contains(className + '-remove')) {\n classList.remove(className + '-remove');\n classList.remove(className);\n }\n\n var _animStart3 = void 0;\n var animHasStarted = false;\n _this6._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3 = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this6.isAnimating = true;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassActive, element);\n }\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart3);\n }, false);\n\n var _animEnd3 = void 0;\n _this6._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3 = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n if (!element.classList.contains(className + '-add')) {\n resolve(true);\n }\n\n evAnimEnd.stopPropagation();\n\n classList.add(className);\n\n classList.remove(className + '-add');\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd3);\n\n _this6.isAnimating = false;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassDone, element);\n }\n\n resolve(true);\n }, false);\n\n var prevAnimationNames = _this6._getElementAnimationNames(element);\n\n classList.add(className + '-add');\n\n var animationNames = _this6._getElementAnimationNames(element);\n if (!_this6._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(className + '-add');\n classList.add(className);\n\n _this6._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3);\n _this6._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3);\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassTimeout, element);\n }\n\n resolve(false);\n }\n });\n };\n\n return CssAnimator;\n}();\n\nexport function configure(config, callback) {\n var animator = config.container.get(CssAnimator);\n config.container.get(TemplatingEngine).configureAnimator(animator);\n if (typeof callback === 'function') {\n callback(animator);\n }\n}"],"sourceRoot":""}