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E,IAAIvD,GAEdqD,EAAUC,OAAOtD,EAAY,QAE7B8D,EAAUH,OAAOxE,oBAAoB2E,EAAU/B,KAAMmD,GAErDF,EAAO3G,aAAc,GAEE,IAAnBsG,GACFK,EAAO9E,iBAAiB,kBAA6Bb,GAGvDwD,GAAQ,GACV,GAAG,GAEH,IAAI/B,EAAqBkE,EAAOpF,0BAA0BP,GAE1DgE,EAAUE,IAAIvD,EAAY,QAE1B,IAAIF,EAAiBkF,EAAOpF,0BAA0BP,GACjD2F,EAAOnE,kCAAkCf,EAAgBgB,KAC5DuC,EAAUC,OAAOtD,EAAY,QAC7BqD,EAAUE,IAAIvD,GAEdgF,EAAO9F,6BAA6BG,EAAS,kCAAmC6F,GAChFF,EAAO9F,6BAA6BG,EAAS,sCAAuC4F,IAE7D,IAAnBN,GACFK,EAAO9E,iBAAiB,qBAAgCb,GAG1DwD,GAAQ,GAEZ,GACF,EAEO7E,CACT,CA1byB,GA4blB,SAASmH,EAAUC,EAAQC,GAChC,IAAIC,EAAWF,EAAOG,UAAUC,IAAIxH,GACpCoH,EAAOG,UAAUC,IAAI,MAAkBC,kBAAkBH,GACjC,mBAAbD,GACTA,EAASC,EAEb,C","sources":["webpack://client-app/./node_modules/aurelia-animator-css/dist/native-modules/aurelia-animator-css.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}"],"names":["CssAnimator","this","useAnimationDoneClasses","animationEnteredClass","animationLeftClass","isAnimating","verifyKeyframesExist","prototype","_addMultipleEventListener","el","s","fn","evts","split","i","ii","length","addEventListener","_removeMultipleEventListener","removeEventListener","_getElementAnimationDelay","element","styl","prop","delay","getPropertyValue","Number","replace","_getElementAnimationNames","prefix","animationNames","_performSingleAnimate","className","_this","_triggerDOMEvent","addClass","then","result","removeClass","catch","eventType","evt","bubbles","cancelable","detail","_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","reduce","p","anim","resolve","_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","setTimeout","enter","leave","_this5","suppressEvents","arguments","undefined","_animStart2","_animEnd2","_this6","_animStart3","_animEnd3","configure","config","callback","animator","container","get","configureAnimator"],"sourceRoot":""}