11define ( [ 'exports' , 'aurelia-templating' , 'aurelia-pal' ] , function ( exports , _aureliaTemplating , _aureliaPal ) {
22 'use strict' ;
33
4- exports . __esModule = true ;
4+ Object . defineProperty ( exports , "__esModule" , {
5+ value : true
6+ } ) ;
7+ exports . CssAnimator = undefined ;
58 exports . configure = configure ;
69
7- function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( 'Cannot call a class as a function' ) ; } }
10+ function _classCallCheck ( instance , Constructor ) {
11+ if ( ! ( instance instanceof Constructor ) ) {
12+ throw new TypeError ( "Cannot call a class as a function" ) ;
13+ }
14+ }
815
9- var CssAnimator = ( function ( ) {
16+ var CssAnimator = exports . CssAnimator = function ( ) {
1017 function CssAnimator ( ) {
1118 _classCallCheck ( this , CssAnimator ) ;
1219
@@ -27,8 +34,8 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
2734
2835 CssAnimator . prototype . _getElementAnimationDelay = function _getElementAnimationDelay ( element ) {
2936 var styl = _aureliaPal . DOM . getComputedStyle ( element ) ;
30- var prop = undefined ;
31- var delay = undefined ;
37+ var prop = void 0 ;
38+ var delay = void 0 ;
3239
3340 if ( styl . getPropertyValue ( 'animation-delay' ) ) {
3441 prop = 'animation-delay' ;
@@ -48,7 +55,7 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
4855
4956 CssAnimator . prototype . _getElementAnimationNames = function _getElementAnimationNames ( element ) {
5057 var styl = _aureliaPal . DOM . getComputedStyle ( element ) ;
51- var prefix = undefined ;
58+ var prefix = void 0 ;
5259
5360 if ( styl . getPropertyValue ( 'animation-name' ) ) {
5461 prefix = '' ;
@@ -79,7 +86,7 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
7986 }
8087
8188 return false ;
82- } ) [ ' catch' ] ( function ( ) {
89+ } ) . catch ( function ( ) {
8390 _this . _triggerDOMEvent ( _aureliaTemplating . animationEvent . animateTimeout , element ) ;
8491 } ) ;
8592 } ;
@@ -105,23 +112,26 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
105112 var keyframesRuleType = window . CSSRule . KEYFRAMES_RULE || window . CSSRule . MOZ_KEYFRAMES_RULE || window . CSSRule . WEBKIT_KEYFRAMES_RULE ;
106113
107114 var styleSheets = document . styleSheets ;
108- for ( var i = 0 ; i < styleSheets . length ; ++ i ) {
109- var cssRules = styleSheets [ i ] . cssRules ;
110115
111- if ( ! cssRules ) {
112- continue ;
113- }
116+ try {
117+ for ( var i = 0 ; i < styleSheets . length ; ++ i ) {
118+ var cssRules = styleSheets [ i ] . cssRules ;
114119
115- for ( var j = 0 ; j < cssRules . length ; ++ j ) {
116- var cssRule = cssRules [ j ] ;
120+ if ( ! cssRules ) {
121+ continue ;
122+ }
117123
118- if ( cssRule . type === keyframesRuleType ) {
119- if ( newAnimationNames . indexOf ( cssRule . name ) !== - 1 ) {
120- return true ;
124+ for ( var j = 0 ; j < cssRules . length ; ++ j ) {
125+ var cssRule = cssRules [ j ] ;
126+
127+ if ( cssRule . type === keyframesRuleType ) {
128+ if ( newAnimationNames . indexOf ( cssRule . name ) !== - 1 ) {
129+ return true ;
130+ }
121131 }
122132 }
123133 }
124- }
134+ } catch ( e ) { }
125135
126136 return false ;
127137 } ;
@@ -168,21 +178,21 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
168178 classList . add ( 'au-enter' ) ;
169179 var prevAnimationNames = _this4 . _getElementAnimationNames ( element ) ;
170180
171- var animStart = undefined ;
181+ var _animStart = void 0 ;
172182 var animHasStarted = false ;
173- _this4 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , animStart = function ( evAnimStart ) {
183+ _this4 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , _animStart = function animStart ( evAnimStart ) {
174184 animHasStarted = true ;
175185 _this4 . isAnimating = true ;
176186
177187 _this4 . _triggerDOMEvent ( _aureliaTemplating . animationEvent . enterActive , element ) ;
178188
179189 evAnimStart . stopPropagation ( ) ;
180190
181- evAnimStart . target . removeEventListener ( evAnimStart . type , animStart ) ;
191+ evAnimStart . target . removeEventListener ( evAnimStart . type , _animStart ) ;
182192 } , false ) ;
183193
184- var animEnd = undefined ;
185- _this4 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , animEnd = function ( evAnimEnd ) {
194+ var _animEnd = void 0 ;
195+ _this4 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , _animEnd = function animEnd ( evAnimEnd ) {
186196 if ( ! animHasStarted ) {
187197 return ;
188198 }
@@ -192,7 +202,7 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
192202 classList . remove ( 'au-enter-active' ) ;
193203 classList . remove ( 'au-enter' ) ;
194204
195- evAnimEnd . target . removeEventListener ( evAnimEnd . type , animEnd ) ;
205+ evAnimEnd . target . removeEventListener ( evAnimEnd . type , _animEnd ) ;
196206
197207 if ( _this4 . useAnimationDoneClasses && _this4 . animationEnteredClass !== undefined && _this4 . animationEnteredClass !== null ) {
198208 classList . add ( _this4 . animationEnteredClass ) ;
@@ -250,21 +260,21 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
250260 classList . add ( 'au-leave' ) ;
251261 var prevAnimationNames = _this5 . _getElementAnimationNames ( element ) ;
252262
253- var animStart = undefined ;
263+ var _animStart2 = void 0 ;
254264 var animHasStarted = false ;
255- _this5 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , animStart = function ( evAnimStart ) {
265+ _this5 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , _animStart2 = function animStart ( evAnimStart ) {
256266 animHasStarted = true ;
257267 _this5 . isAnimating = true ;
258268
259269 _this5 . _triggerDOMEvent ( _aureliaTemplating . animationEvent . leaveActive , element ) ;
260270
261271 evAnimStart . stopPropagation ( ) ;
262272
263- evAnimStart . target . removeEventListener ( evAnimStart . type , animStart ) ;
273+ evAnimStart . target . removeEventListener ( evAnimStart . type , _animStart2 ) ;
264274 } , false ) ;
265275
266- var animEnd = undefined ;
267- _this5 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , animEnd = function ( evAnimEnd ) {
276+ var _animEnd2 = void 0 ;
277+ _this5 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , _animEnd2 = function animEnd ( evAnimEnd ) {
268278 if ( ! animHasStarted ) {
269279 return ;
270280 }
@@ -274,7 +284,7 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
274284 classList . remove ( 'au-leave-active' ) ;
275285 classList . remove ( 'au-leave' ) ;
276286
277- evAnimEnd . target . removeEventListener ( evAnimEnd . type , animEnd ) ;
287+ evAnimEnd . target . removeEventListener ( evAnimEnd . type , _animEnd2 ) ;
278288
279289 if ( _this5 . useAnimationDoneClasses && _this5 . animationLeftClass !== undefined && _this5 . animationLeftClass !== null ) {
280290 classList . add ( _this5 . animationLeftClass ) ;
@@ -336,9 +346,9 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
336346 classList . remove ( className ) ;
337347 var prevAnimationNames = _this6 . _getElementAnimationNames ( element ) ;
338348
339- var animStart = undefined ;
349+ var _animStart3 = void 0 ;
340350 var animHasStarted = false ;
341- _this6 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , animStart = function ( evAnimStart ) {
351+ _this6 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , _animStart3 = function animStart ( evAnimStart ) {
342352 animHasStarted = true ;
343353 _this6 . isAnimating = true ;
344354
@@ -348,11 +358,11 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
348358
349359 evAnimStart . stopPropagation ( ) ;
350360
351- evAnimStart . target . removeEventListener ( evAnimStart . type , animStart ) ;
361+ evAnimStart . target . removeEventListener ( evAnimStart . type , _animStart3 ) ;
352362 } , false ) ;
353363
354- var animEnd = undefined ;
355- _this6 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , animEnd = function ( evAnimEnd ) {
364+ var _animEnd3 = void 0 ;
365+ _this6 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , _animEnd3 = function animEnd ( evAnimEnd ) {
356366 if ( ! animHasStarted ) {
357367 return ;
358368 }
@@ -361,7 +371,7 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
361371
362372 classList . remove ( className + '-remove' ) ;
363373
364- evAnimEnd . target . removeEventListener ( evAnimEnd . type , animEnd ) ;
374+ evAnimEnd . target . removeEventListener ( evAnimEnd . type , _animEnd3 ) ;
365375
366376 _this6 . isAnimating = false ;
367377
@@ -400,9 +410,9 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
400410 _this7 . _triggerDOMEvent ( _aureliaTemplating . animationEvent . addClassBegin , element ) ;
401411 }
402412
403- var animStart = undefined ;
413+ var _animStart4 = void 0 ;
404414 var animHasStarted = false ;
405- _this7 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , animStart = function ( evAnimStart ) {
415+ _this7 . _addMultipleEventListener ( element , 'webkitAnimationStart animationstart' , _animStart4 = function animStart ( evAnimStart ) {
406416 animHasStarted = true ;
407417 _this7 . isAnimating = true ;
408418
@@ -412,11 +422,11 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
412422
413423 evAnimStart . stopPropagation ( ) ;
414424
415- evAnimStart . target . removeEventListener ( evAnimStart . type , animStart ) ;
425+ evAnimStart . target . removeEventListener ( evAnimStart . type , _animStart4 ) ;
416426 } , false ) ;
417427
418- var animEnd = undefined ;
419- _this7 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , animEnd = function ( evAnimEnd ) {
428+ var _animEnd4 = void 0 ;
429+ _this7 . _addMultipleEventListener ( element , 'webkitAnimationEnd animationend' , _animEnd4 = function animEnd ( evAnimEnd ) {
420430 if ( ! animHasStarted ) {
421431 return ;
422432 }
@@ -427,7 +437,7 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
427437
428438 classList . remove ( className + '-add' ) ;
429439
430- evAnimEnd . target . removeEventListener ( evAnimEnd . type , animEnd ) ;
440+ evAnimEnd . target . removeEventListener ( evAnimEnd . type , _animEnd4 ) ;
431441
432442 _this7 . isAnimating = false ;
433443
@@ -457,9 +467,7 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
457467 } ;
458468
459469 return CssAnimator ;
460- } ) ( ) ;
461-
462- exports . CssAnimator = CssAnimator ;
470+ } ( ) ;
463471
464472 function configure ( config , callback ) {
465473 var animator = config . container . get ( CssAnimator ) ;
0 commit comments