@angular/animations 4.4.3 → 4.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/@angular/animations/browser/testing.es5.js +1 -1
  2. package/@angular/animations/browser/testing.es5.js.map +1 -1
  3. package/@angular/animations/browser/testing.js +1 -1
  4. package/@angular/animations/browser/testing.js.map +1 -1
  5. package/@angular/animations/browser.es5.js +159 -448
  6. package/@angular/animations/browser.es5.js.map +1 -1
  7. package/@angular/animations/browser.js +159 -397
  8. package/@angular/animations/browser.js.map +1 -1
  9. package/@angular/animations.es5.js +22 -2
  10. package/@angular/animations.es5.js.map +1 -1
  11. package/@angular/animations.js +22 -2
  12. package/@angular/animations.js.map +1 -1
  13. package/animations.metadata.json +1 -1
  14. package/browser/src/dsl/animation_ast.d.ts +31 -61
  15. package/browser/src/dsl/animation_ast.metadata.json +1 -0
  16. package/browser/src/dsl/animation_ast_builder.d.ts +3 -3
  17. package/browser/src/dsl/animation_dsl_visitor.d.ts +14 -15
  18. package/browser/src/dsl/animation_dsl_visitor.metadata.json +1 -0
  19. package/browser/src/dsl/animation_timeline_builder.d.ts +6 -6
  20. package/browser/src/util.d.ts +5 -1
  21. package/browser/src/util.metadata.json +1 -1
  22. package/browser/testing.d.ts +1 -1
  23. package/browser.d.ts +1 -1
  24. package/bundles/animations-browser-testing.umd.js +2 -2
  25. package/bundles/animations-browser-testing.umd.js.map +1 -1
  26. package/bundles/animations-browser-testing.umd.min.js +1 -1
  27. package/bundles/animations-browser-testing.umd.min.js.map +1 -1
  28. package/bundles/animations-browser.umd.js +160 -449
  29. package/bundles/animations-browser.umd.js.map +1 -1
  30. package/bundles/animations-browser.umd.min.js +10 -10
  31. package/bundles/animations-browser.umd.min.js.map +1 -1
  32. package/bundles/animations.umd.js +23 -3
  33. package/bundles/animations.umd.js.map +1 -1
  34. package/bundles/animations.umd.min.js +3 -3
  35. package/bundles/animations.umd.min.js.map +1 -1
  36. package/package.json +2 -2
  37. package/src/animation_metadata.d.ts +28 -1
@@ -1,6 +1,6 @@
1
1
  import * as tslib_1 from "tslib";
2
2
  /**
3
- * @license Angular v4.4.3
3
+ * @license Angular v4.4.7
4
4
  * (c) 2010-2017 Google, Inc. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -381,380 +381,34 @@ function dashCaseToCamelCase(input) {
381
381
  function allowPreviousPlayerStylesMerge(duration, delay) {
382
382
  return duration === 0 || delay === 0;
383
383
  }
384
- /**
385
- * @license
386
- * Copyright Google Inc. All Rights Reserved.
387
- *
388
- * Use of this source code is governed by an MIT-style license that can be
389
- * found in the LICENSE file at https://angular.io/license
390
- */
391
- var EMPTY_ANIMATION_OPTIONS = {};
392
- /**
393
- * @abstract
394
- */
395
- var Ast = (function () {
396
- function Ast() {
397
- this.options = EMPTY_ANIMATION_OPTIONS;
398
- }
399
- /**
400
- * @abstract
401
- * @param {?} ast
402
- * @param {?} context
403
- * @return {?}
404
- */
405
- Ast.prototype.visit = function (ast, context) { };
406
- Object.defineProperty(Ast.prototype, "params", {
407
- /**
408
- * @return {?}
409
- */
410
- get: function () { return this.options['params'] || null; },
411
- enumerable: true,
412
- configurable: true
413
- });
414
- return Ast;
415
- }());
416
- var TriggerAst = (function (_super) {
417
- tslib_1.__extends(TriggerAst, _super);
418
- /**
419
- * @param {?} name
420
- * @param {?} states
421
- * @param {?} transitions
422
- */
423
- function TriggerAst(name, states, transitions) {
424
- var _this = _super.call(this) || this;
425
- _this.name = name;
426
- _this.states = states;
427
- _this.transitions = transitions;
428
- _this.queryCount = 0;
429
- _this.depCount = 0;
430
- return _this;
431
- }
432
- /**
433
- * @param {?} visitor
434
- * @param {?} context
435
- * @return {?}
436
- */
437
- TriggerAst.prototype.visit = function (visitor, context) { return visitor.visitTrigger(this, context); };
438
- return TriggerAst;
439
- }(Ast));
440
- var StateAst = (function (_super) {
441
- tslib_1.__extends(StateAst, _super);
442
- /**
443
- * @param {?} name
444
- * @param {?} style
445
- */
446
- function StateAst(name, style$$1) {
447
- var _this = _super.call(this) || this;
448
- _this.name = name;
449
- _this.style = style$$1;
450
- return _this;
451
- }
452
- /**
453
- * @param {?} visitor
454
- * @param {?} context
455
- * @return {?}
456
- */
457
- StateAst.prototype.visit = function (visitor, context) { return visitor.visitState(this, context); };
458
- return StateAst;
459
- }(Ast));
460
- var TransitionAst = (function (_super) {
461
- tslib_1.__extends(TransitionAst, _super);
462
- /**
463
- * @param {?} matchers
464
- * @param {?} animation
465
- */
466
- function TransitionAst(matchers, animation) {
467
- var _this = _super.call(this) || this;
468
- _this.matchers = matchers;
469
- _this.animation = animation;
470
- _this.queryCount = 0;
471
- _this.depCount = 0;
472
- return _this;
473
- }
474
- /**
475
- * @param {?} visitor
476
- * @param {?} context
477
- * @return {?}
478
- */
479
- TransitionAst.prototype.visit = function (visitor, context) { return visitor.visitTransition(this, context); };
480
- return TransitionAst;
481
- }(Ast));
482
- var SequenceAst = (function (_super) {
483
- tslib_1.__extends(SequenceAst, _super);
484
- /**
485
- * @param {?} steps
486
- */
487
- function SequenceAst(steps) {
488
- var _this = _super.call(this) || this;
489
- _this.steps = steps;
490
- return _this;
491
- }
492
- /**
493
- * @param {?} visitor
494
- * @param {?} context
495
- * @return {?}
496
- */
497
- SequenceAst.prototype.visit = function (visitor, context) { return visitor.visitSequence(this, context); };
498
- return SequenceAst;
499
- }(Ast));
500
- var GroupAst = (function (_super) {
501
- tslib_1.__extends(GroupAst, _super);
502
- /**
503
- * @param {?} steps
504
- */
505
- function GroupAst(steps) {
506
- var _this = _super.call(this) || this;
507
- _this.steps = steps;
508
- return _this;
509
- }
510
- /**
511
- * @param {?} visitor
512
- * @param {?} context
513
- * @return {?}
514
- */
515
- GroupAst.prototype.visit = function (visitor, context) { return visitor.visitGroup(this, context); };
516
- return GroupAst;
517
- }(Ast));
518
- var AnimateAst = (function (_super) {
519
- tslib_1.__extends(AnimateAst, _super);
520
- /**
521
- * @param {?} timings
522
- * @param {?} style
523
- */
524
- function AnimateAst(timings, style$$1) {
525
- var _this = _super.call(this) || this;
526
- _this.timings = timings;
527
- _this.style = style$$1;
528
- return _this;
529
- }
530
- /**
531
- * @param {?} visitor
532
- * @param {?} context
533
- * @return {?}
534
- */
535
- AnimateAst.prototype.visit = function (visitor, context) { return visitor.visitAnimate(this, context); };
536
- return AnimateAst;
537
- }(Ast));
538
- var StyleAst = (function (_super) {
539
- tslib_1.__extends(StyleAst, _super);
540
- /**
541
- * @param {?} styles
542
- * @param {?} easing
543
- * @param {?} offset
544
- */
545
- function StyleAst(styles, easing, offset) {
546
- var _this = _super.call(this) || this;
547
- _this.styles = styles;
548
- _this.easing = easing;
549
- _this.offset = offset;
550
- _this.isEmptyStep = false;
551
- _this.containsDynamicStyles = false;
552
- return _this;
553
- }
554
- /**
555
- * @param {?} visitor
556
- * @param {?} context
557
- * @return {?}
558
- */
559
- StyleAst.prototype.visit = function (visitor, context) { return visitor.visitStyle(this, context); };
560
- return StyleAst;
561
- }(Ast));
562
- var KeyframesAst = (function (_super) {
563
- tslib_1.__extends(KeyframesAst, _super);
564
- /**
565
- * @param {?} styles
566
- */
567
- function KeyframesAst(styles) {
568
- var _this = _super.call(this) || this;
569
- _this.styles = styles;
570
- return _this;
571
- }
572
- /**
573
- * @param {?} visitor
574
- * @param {?} context
575
- * @return {?}
576
- */
577
- KeyframesAst.prototype.visit = function (visitor, context) { return visitor.visitKeyframes(this, context); };
578
- return KeyframesAst;
579
- }(Ast));
580
- var ReferenceAst = (function (_super) {
581
- tslib_1.__extends(ReferenceAst, _super);
582
- /**
583
- * @param {?} animation
584
- */
585
- function ReferenceAst(animation) {
586
- var _this = _super.call(this) || this;
587
- _this.animation = animation;
588
- return _this;
589
- }
590
- /**
591
- * @param {?} visitor
592
- * @param {?} context
593
- * @return {?}
594
- */
595
- ReferenceAst.prototype.visit = function (visitor, context) { return visitor.visitReference(this, context); };
596
- return ReferenceAst;
597
- }(Ast));
598
- var AnimateChildAst = (function (_super) {
599
- tslib_1.__extends(AnimateChildAst, _super);
600
- function AnimateChildAst() {
601
- return _super.call(this) || this;
602
- }
603
- /**
604
- * @param {?} visitor
605
- * @param {?} context
606
- * @return {?}
607
- */
608
- AnimateChildAst.prototype.visit = function (visitor, context) { return visitor.visitAnimateChild(this, context); };
609
- return AnimateChildAst;
610
- }(Ast));
611
- var AnimateRefAst = (function (_super) {
612
- tslib_1.__extends(AnimateRefAst, _super);
613
- /**
614
- * @param {?} animation
615
- */
616
- function AnimateRefAst(animation) {
617
- var _this = _super.call(this) || this;
618
- _this.animation = animation;
619
- return _this;
620
- }
621
- /**
622
- * @param {?} visitor
623
- * @param {?} context
624
- * @return {?}
625
- */
626
- AnimateRefAst.prototype.visit = function (visitor, context) { return visitor.visitAnimateRef(this, context); };
627
- return AnimateRefAst;
628
- }(Ast));
629
- var QueryAst = (function (_super) {
630
- tslib_1.__extends(QueryAst, _super);
631
- /**
632
- * @param {?} selector
633
- * @param {?} limit
634
- * @param {?} optional
635
- * @param {?} includeSelf
636
- * @param {?} animation
637
- */
638
- function QueryAst(selector, limit, optional, includeSelf, animation) {
639
- var _this = _super.call(this) || this;
640
- _this.selector = selector;
641
- _this.limit = limit;
642
- _this.optional = optional;
643
- _this.includeSelf = includeSelf;
644
- _this.animation = animation;
645
- return _this;
646
- }
647
- /**
648
- * @param {?} visitor
649
- * @param {?} context
650
- * @return {?}
651
- */
652
- QueryAst.prototype.visit = function (visitor, context) { return visitor.visitQuery(this, context); };
653
- return QueryAst;
654
- }(Ast));
655
- var StaggerAst = (function (_super) {
656
- tslib_1.__extends(StaggerAst, _super);
657
- /**
658
- * @param {?} timings
659
- * @param {?} animation
660
- */
661
- function StaggerAst(timings, animation) {
662
- var _this = _super.call(this) || this;
663
- _this.timings = timings;
664
- _this.animation = animation;
665
- return _this;
666
- }
667
- /**
668
- * @param {?} visitor
669
- * @param {?} context
670
- * @return {?}
671
- */
672
- StaggerAst.prototype.visit = function (visitor, context) { return visitor.visitStagger(this, context); };
673
- return StaggerAst;
674
- }(Ast));
675
- var TimingAst = (function (_super) {
676
- tslib_1.__extends(TimingAst, _super);
677
- /**
678
- * @param {?} duration
679
- * @param {?=} delay
680
- * @param {?=} easing
681
- */
682
- function TimingAst(duration, delay, easing) {
683
- if (delay === void 0) { delay = 0; }
684
- if (easing === void 0) { easing = null; }
685
- var _this = _super.call(this) || this;
686
- _this.duration = duration;
687
- _this.delay = delay;
688
- _this.easing = easing;
689
- return _this;
690
- }
691
- /**
692
- * @param {?} visitor
693
- * @param {?} context
694
- * @return {?}
695
- */
696
- TimingAst.prototype.visit = function (visitor, context) { return visitor.visitTiming(this, context); };
697
- return TimingAst;
698
- }(Ast));
699
- var DynamicTimingAst = (function (_super) {
700
- tslib_1.__extends(DynamicTimingAst, _super);
701
- /**
702
- * @param {?} value
703
- */
704
- function DynamicTimingAst(value) {
705
- var _this = _super.call(this, 0, 0, '') || this;
706
- _this.value = value;
707
- return _this;
708
- }
709
- /**
710
- * @param {?} visitor
711
- * @param {?} context
712
- * @return {?}
713
- */
714
- DynamicTimingAst.prototype.visit = function (visitor, context) { return visitor.visitTiming(this, context); };
715
- return DynamicTimingAst;
716
- }(TimingAst));
717
- /**
718
- * @license
719
- * Copyright Google Inc. All Rights Reserved.
720
- *
721
- * Use of this source code is governed by an MIT-style license that can be
722
- * found in the LICENSE file at https://angular.io/license
723
- */
724
- /**
725
- * @param {?} visitor
726
- * @param {?} node
727
- * @param {?} context
728
- * @return {?}
729
- */
730
- function visitAnimationNode(visitor, node, context) {
384
+ function visitDslNode(visitor, node, context) {
731
385
  switch (node.type) {
732
386
  case 7 /* Trigger */:
733
- return visitor.visitTrigger(/** @type {?} */ (node), context);
387
+ return visitor.visitTrigger(node, context);
734
388
  case 0 /* State */:
735
- return visitor.visitState(/** @type {?} */ (node), context);
389
+ return visitor.visitState(node, context);
736
390
  case 1 /* Transition */:
737
- return visitor.visitTransition(/** @type {?} */ (node), context);
391
+ return visitor.visitTransition(node, context);
738
392
  case 2 /* Sequence */:
739
- return visitor.visitSequence(/** @type {?} */ (node), context);
393
+ return visitor.visitSequence(node, context);
740
394
  case 3 /* Group */:
741
- return visitor.visitGroup(/** @type {?} */ (node), context);
395
+ return visitor.visitGroup(node, context);
742
396
  case 4 /* Animate */:
743
- return visitor.visitAnimate(/** @type {?} */ (node), context);
397
+ return visitor.visitAnimate(node, context);
744
398
  case 5 /* Keyframes */:
745
- return visitor.visitKeyframes(/** @type {?} */ (node), context);
399
+ return visitor.visitKeyframes(node, context);
746
400
  case 6 /* Style */:
747
- return visitor.visitStyle(/** @type {?} */ (node), context);
401
+ return visitor.visitStyle(node, context);
748
402
  case 8 /* Reference */:
749
- return visitor.visitReference(/** @type {?} */ (node), context);
403
+ return visitor.visitReference(node, context);
750
404
  case 9 /* AnimateChild */:
751
- return visitor.visitAnimateChild(/** @type {?} */ (node), context);
405
+ return visitor.visitAnimateChild(node, context);
752
406
  case 10 /* AnimateRef */:
753
- return visitor.visitAnimateRef(/** @type {?} */ (node), context);
407
+ return visitor.visitAnimateRef(node, context);
754
408
  case 11 /* Query */:
755
- return visitor.visitQuery(/** @type {?} */ (node), context);
409
+ return visitor.visitQuery(node, context);
756
410
  case 12 /* Stagger */:
757
- return visitor.visitStagger(/** @type {?} */ (node), context);
411
+ return visitor.visitStagger(node, context);
758
412
  default:
759
413
  throw new Error("Unable to resolve animation metadata node #" + node.type);
760
414
  }
@@ -824,20 +478,28 @@ function parseAnimationAlias(alias, errors) {
824
478
  return '* => *';
825
479
  }
826
480
  }
481
+ var TRUE_BOOLEAN_VALUES = new Set();
482
+ TRUE_BOOLEAN_VALUES.add('true');
483
+ TRUE_BOOLEAN_VALUES.add('1');
484
+ var FALSE_BOOLEAN_VALUES = new Set();
485
+ FALSE_BOOLEAN_VALUES.add('false');
486
+ FALSE_BOOLEAN_VALUES.add('0');
827
487
  /**
828
488
  * @param {?} lhs
829
489
  * @param {?} rhs
830
490
  * @return {?}
831
491
  */
832
492
  function makeLambdaFromStates(lhs, rhs) {
493
+ var /** @type {?} */ LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);
494
+ var /** @type {?} */ RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);
833
495
  return function (fromState, toState) {
834
496
  var /** @type {?} */ lhsMatch = lhs == ANY_STATE || lhs == fromState;
835
497
  var /** @type {?} */ rhsMatch = rhs == ANY_STATE || rhs == toState;
836
- if (!lhsMatch && typeof fromState === 'boolean') {
837
- lhsMatch = fromState ? lhs === 'true' : lhs === 'false';
498
+ if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') {
499
+ lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);
838
500
  }
839
- if (!rhsMatch && typeof toState === 'boolean') {
840
- rhsMatch = toState ? rhs === 'true' : rhs === 'false';
501
+ if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') {
502
+ rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);
841
503
  }
842
504
  return lhsMatch && rhsMatch;
843
505
  };
@@ -875,7 +537,7 @@ var AnimationAstBuilderVisitor = (function () {
875
537
  AnimationAstBuilderVisitor.prototype.build = function (metadata, errors) {
876
538
  var /** @type {?} */ context = new AnimationAstBuilderContext(errors);
877
539
  this._resetContextStyleTimingState(context);
878
- return (visitAnimationNode(this, normalizeAnimationEntry(metadata), context));
540
+ return (visitDslNode(this, normalizeAnimationEntry(metadata), context));
879
541
  };
880
542
  /**
881
543
  * @param {?} context
@@ -919,11 +581,11 @@ var AnimationAstBuilderVisitor = (function () {
919
581
  context.errors.push('only state() and transition() definitions can sit inside of a trigger()');
920
582
  }
921
583
  });
922
- var /** @type {?} */ ast = new TriggerAst(metadata.name, states, transitions);
923
- ast.options = normalizeAnimationOptions(metadata.options);
924
- ast.queryCount = queryCount;
925
- ast.depCount = depCount;
926
- return ast;
584
+ return {
585
+ type: 7 /* Trigger */,
586
+ name: metadata.name, states: states, transitions: transitions, queryCount: queryCount, depCount: depCount,
587
+ options: null
588
+ };
927
589
  };
928
590
  /**
929
591
  * @param {?} metadata
@@ -953,11 +615,12 @@ var AnimationAstBuilderVisitor = (function () {
953
615
  context.errors.push("state(\"" + metadata.name + "\", ...) must define default values for all the following style substitutions: " + missingSubsArr.join(', '));
954
616
  }
955
617
  }
956
- var /** @type {?} */ stateAst = new StateAst(metadata.name, styleAst);
957
- if (astParams) {
958
- stateAst.options = { params: astParams };
959
- }
960
- return stateAst;
618
+ return {
619
+ type: 0 /* State */,
620
+ name: metadata.name,
621
+ style: styleAst,
622
+ options: astParams ? { params: astParams } : null
623
+ };
961
624
  };
962
625
  /**
963
626
  * @param {?} metadata
@@ -967,13 +630,16 @@ var AnimationAstBuilderVisitor = (function () {
967
630
  AnimationAstBuilderVisitor.prototype.visitTransition = function (metadata, context) {
968
631
  context.queryCount = 0;
969
632
  context.depCount = 0;
970
- var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
633
+ var /** @type {?} */ animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
971
634
  var /** @type {?} */ matchers = parseTransitionExpr(metadata.expr, context.errors);
972
- var /** @type {?} */ ast = new TransitionAst(matchers, entry);
973
- ast.options = normalizeAnimationOptions(metadata.options);
974
- ast.queryCount = context.queryCount;
975
- ast.depCount = context.depCount;
976
- return ast;
635
+ return {
636
+ type: 1 /* Transition */,
637
+ matchers: matchers,
638
+ animation: animation,
639
+ queryCount: context.queryCount,
640
+ depCount: context.depCount,
641
+ options: normalizeAnimationOptions(metadata.options)
642
+ };
977
643
  };
978
644
  /**
979
645
  * @param {?} metadata
@@ -982,9 +648,11 @@ var AnimationAstBuilderVisitor = (function () {
982
648
  */
983
649
  AnimationAstBuilderVisitor.prototype.visitSequence = function (metadata, context) {
984
650
  var _this = this;
985
- var /** @type {?} */ ast = new SequenceAst(metadata.steps.map(function (s) { return visitAnimationNode(_this, s, context); }));
986
- ast.options = normalizeAnimationOptions(metadata.options);
987
- return ast;
651
+ return {
652
+ type: 2 /* Sequence */,
653
+ steps: metadata.steps.map(function (s) { return visitDslNode(_this, s, context); }),
654
+ options: normalizeAnimationOptions(metadata.options)
655
+ };
988
656
  };
989
657
  /**
990
658
  * @param {?} metadata
@@ -997,14 +665,16 @@ var AnimationAstBuilderVisitor = (function () {
997
665
  var /** @type {?} */ furthestTime = 0;
998
666
  var /** @type {?} */ steps = metadata.steps.map(function (step) {
999
667
  context.currentTime = currentTime;
1000
- var /** @type {?} */ innerAst = visitAnimationNode(_this, step, context);
668
+ var /** @type {?} */ innerAst = visitDslNode(_this, step, context);
1001
669
  furthestTime = Math.max(furthestTime, context.currentTime);
1002
670
  return innerAst;
1003
671
  });
1004
672
  context.currentTime = furthestTime;
1005
- var /** @type {?} */ ast = new GroupAst(steps);
1006
- ast.options = normalizeAnimationOptions(metadata.options);
1007
- return ast;
673
+ return {
674
+ type: 3 /* Group */,
675
+ steps: steps,
676
+ options: normalizeAnimationOptions(metadata.options)
677
+ };
1008
678
  };
1009
679
  /**
1010
680
  * @param {?} metadata
@@ -1014,10 +684,10 @@ var AnimationAstBuilderVisitor = (function () {
1014
684
  AnimationAstBuilderVisitor.prototype.visitAnimate = function (metadata, context) {
1015
685
  var /** @type {?} */ timingAst = constructTimingAst(metadata.timings, context.errors);
1016
686
  context.currentAnimateTimings = timingAst;
1017
- var /** @type {?} */ styles;
687
+ var /** @type {?} */ styleAst;
1018
688
  var /** @type {?} */ styleMetadata = metadata.styles ? metadata.styles : style({});
1019
689
  if (styleMetadata.type == 5 /* Keyframes */) {
1020
- styles = this.visitKeyframes(/** @type {?} */ (styleMetadata), context);
690
+ styleAst = this.visitKeyframes(/** @type {?} */ (styleMetadata), context);
1021
691
  }
1022
692
  else {
1023
693
  var /** @type {?} */ styleMetadata_1 = (metadata.styles);
@@ -1031,12 +701,17 @@ var AnimationAstBuilderVisitor = (function () {
1031
701
  styleMetadata_1 = style(newStyleData);
1032
702
  }
1033
703
  context.currentTime += timingAst.duration + timingAst.delay;
1034
- var /** @type {?} */ styleAst = this.visitStyle(styleMetadata_1, context);
1035
- styleAst.isEmptyStep = isEmpty;
1036
- styles = styleAst;
704
+ var /** @type {?} */ _styleAst = this.visitStyle(styleMetadata_1, context);
705
+ _styleAst.isEmptyStep = isEmpty;
706
+ styleAst = _styleAst;
1037
707
  }
1038
708
  context.currentAnimateTimings = null;
1039
- return new AnimateAst(timingAst, styles);
709
+ return {
710
+ type: 4 /* Animate */,
711
+ timings: timingAst,
712
+ style: styleAst,
713
+ options: null
714
+ };
1040
715
  };
1041
716
  /**
1042
717
  * @param {?} metadata
@@ -1094,9 +769,13 @@ var AnimationAstBuilderVisitor = (function () {
1094
769
  }
1095
770
  }
1096
771
  });
1097
- var /** @type {?} */ ast = new StyleAst(styles, collectedEasing, metadata.offset);
1098
- ast.containsDynamicStyles = containsDynamicStyles;
1099
- return ast;
772
+ return {
773
+ type: 6 /* Style */,
774
+ styles: styles,
775
+ easing: collectedEasing,
776
+ offset: metadata.offset, containsDynamicStyles: containsDynamicStyles,
777
+ options: null
778
+ };
1100
779
  };
1101
780
  /**
1102
781
  * @param {?} ast
@@ -1144,9 +823,10 @@ var AnimationAstBuilderVisitor = (function () {
1144
823
  */
1145
824
  AnimationAstBuilderVisitor.prototype.visitKeyframes = function (metadata, context) {
1146
825
  var _this = this;
826
+ var /** @type {?} */ ast = { type: 5 /* Keyframes */, styles: [], options: null };
1147
827
  if (!context.currentAnimateTimings) {
1148
828
  context.errors.push("keyframes() must be placed inside of a call to animate()");
1149
- return new KeyframesAst([]);
829
+ return ast;
1150
830
  }
1151
831
  var /** @type {?} */ MAX_KEYFRAME_OFFSET = 1;
1152
832
  var /** @type {?} */ totalKeyframesWithOffsets = 0;
@@ -1193,8 +873,9 @@ var AnimationAstBuilderVisitor = (function () {
1193
873
  currentAnimateTimings.duration = durationUpToThisFrame;
1194
874
  _this._validateStyleAst(kf, context);
1195
875
  kf.offset = offset;
876
+ ast.styles.push(kf);
1196
877
  });
1197
- return new KeyframesAst(keyframes);
878
+ return ast;
1198
879
  };
1199
880
  /**
1200
881
  * @param {?} metadata
@@ -1202,10 +883,11 @@ var AnimationAstBuilderVisitor = (function () {
1202
883
  * @return {?}
1203
884
  */
1204
885
  AnimationAstBuilderVisitor.prototype.visitReference = function (metadata, context) {
1205
- var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
1206
- var /** @type {?} */ ast = new ReferenceAst(entry);
1207
- ast.options = normalizeAnimationOptions(metadata.options);
1208
- return ast;
886
+ return {
887
+ type: 8 /* Reference */,
888
+ animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),
889
+ options: normalizeAnimationOptions(metadata.options)
890
+ };
1209
891
  };
1210
892
  /**
1211
893
  * @param {?} metadata
@@ -1214,9 +896,10 @@ var AnimationAstBuilderVisitor = (function () {
1214
896
  */
1215
897
  AnimationAstBuilderVisitor.prototype.visitAnimateChild = function (metadata, context) {
1216
898
  context.depCount++;
1217
- var /** @type {?} */ ast = new AnimateChildAst();
1218
- ast.options = normalizeAnimationOptions(metadata.options);
1219
- return ast;
899
+ return {
900
+ type: 9 /* AnimateChild */,
901
+ options: normalizeAnimationOptions(metadata.options)
902
+ };
1220
903
  };
1221
904
  /**
1222
905
  * @param {?} metadata
@@ -1224,10 +907,11 @@ var AnimationAstBuilderVisitor = (function () {
1224
907
  * @return {?}
1225
908
  */
1226
909
  AnimationAstBuilderVisitor.prototype.visitAnimateRef = function (metadata, context) {
1227
- var /** @type {?} */ animation = this.visitReference(metadata.animation, context);
1228
- var /** @type {?} */ ast = new AnimateRefAst(animation);
1229
- ast.options = normalizeAnimationOptions(metadata.options);
1230
- return ast;
910
+ return {
911
+ type: 10 /* AnimateRef */,
912
+ animation: this.visitReference(metadata.animation, context),
913
+ options: normalizeAnimationOptions(metadata.options)
914
+ };
1231
915
  };
1232
916
  /**
1233
917
  * @param {?} metadata
@@ -1243,13 +927,17 @@ var AnimationAstBuilderVisitor = (function () {
1243
927
  context.currentQuerySelector =
1244
928
  parentSelector.length ? (parentSelector + ' ' + selector) : selector;
1245
929
  getOrSetAsInMap(context.collectedStyles, context.currentQuerySelector, {});
1246
- var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
930
+ var /** @type {?} */ animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
1247
931
  context.currentQuery = null;
1248
932
  context.currentQuerySelector = parentSelector;
1249
- var /** @type {?} */ ast = new QueryAst(selector, options.limit || 0, !!options.optional, includeSelf, entry);
1250
- ast.originalSelector = metadata.selector;
1251
- ast.options = normalizeAnimationOptions(metadata.options);
1252
- return ast;
933
+ return {
934
+ type: 11 /* Query */,
935
+ selector: selector,
936
+ limit: options.limit || 0,
937
+ optional: !!options.optional, includeSelf: includeSelf, animation: animation,
938
+ originalSelector: metadata.selector,
939
+ options: normalizeAnimationOptions(metadata.options)
940
+ };
1253
941
  };
1254
942
  /**
1255
943
  * @param {?} metadata
@@ -1263,8 +951,11 @@ var AnimationAstBuilderVisitor = (function () {
1263
951
  var /** @type {?} */ timings = metadata.timings === 'full' ?
1264
952
  { duration: 0, delay: 0, easing: 'full' } :
1265
953
  resolveTiming(metadata.timings, context.errors, true);
1266
- var /** @type {?} */ animation = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
1267
- return new StaggerAst(timings, animation);
954
+ return {
955
+ type: 12 /* Stagger */,
956
+ animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context), timings: timings,
957
+ options: null
958
+ };
1268
959
  };
1269
960
  return AnimationAstBuilderVisitor;
1270
961
  }());
@@ -1352,15 +1043,18 @@ function constructTimingAst(value, errors) {
1352
1043
  }
1353
1044
  else if (typeof value == 'number') {
1354
1045
  var /** @type {?} */ duration = resolveTiming(/** @type {?} */ (value), errors).duration;
1355
- return new TimingAst(/** @type {?} */ (value), 0, '');
1046
+ return makeTimingAst(/** @type {?} */ (duration), 0, '');
1356
1047
  }
1357
1048
  var /** @type {?} */ strValue = (value);
1358
1049
  var /** @type {?} */ isDynamic = strValue.split(/\s+/).some(function (v) { return v.charAt(0) == '{' && v.charAt(1) == '{'; });
1359
1050
  if (isDynamic) {
1360
- return new DynamicTimingAst(strValue);
1051
+ var /** @type {?} */ ast = (makeTimingAst(0, 0, ''));
1052
+ ast.dynamic = true;
1053
+ ast.strValue = strValue;
1054
+ return (ast);
1361
1055
  }
1362
1056
  timings = timings || resolveTiming(strValue, errors);
1363
- return new TimingAst(timings.duration, timings.delay, timings.easing);
1057
+ return makeTimingAst(timings.duration, timings.delay, timings.easing);
1364
1058
  }
1365
1059
  /**
1366
1060
  * @param {?} options
@@ -1378,6 +1072,15 @@ function normalizeAnimationOptions(options) {
1378
1072
  }
1379
1073
  return options;
1380
1074
  }
1075
+ /**
1076
+ * @param {?} duration
1077
+ * @param {?} delay
1078
+ * @param {?} easing
1079
+ * @return {?}
1080
+ */
1081
+ function makeTimingAst(duration, delay, easing) {
1082
+ return { duration: duration, delay: delay, easing: easing };
1083
+ }
1381
1084
  /**
1382
1085
  * @license
1383
1086
  * Copyright Google Inc. All Rights Reserved.
@@ -1503,7 +1206,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1503
1206
  var /** @type {?} */ context = new AnimationTimelineContext(driver, rootElement, subInstructions, errors, []);
1504
1207
  context.options = options;
1505
1208
  context.currentTimeline.setStyles([startingStyles], null, context.errors, options);
1506
- ast.visit(this, context);
1209
+ visitDslNode(this, ast, context);
1507
1210
  // this checks to see if an actual animation happened
1508
1211
  var /** @type {?} */ timelines = context.timelines.filter(function (timeline) { return timeline.containsAnimation(); });
1509
1212
  if (timelines.length && Object.keys(finalStyles).length) {
@@ -1599,7 +1302,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1599
1302
  */
1600
1303
  AnimationTimelineBuilderVisitor.prototype.visitReference = function (ast, context) {
1601
1304
  context.updateOptions(ast.options, true);
1602
- ast.animation.visit(this, context);
1305
+ visitDslNode(this, ast.animation, context);
1603
1306
  context.previousNode = ast;
1604
1307
  };
1605
1308
  /**
@@ -1616,7 +1319,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1616
1319
  ctx = context.createSubContext(options);
1617
1320
  ctx.transformIntoNewTimeline();
1618
1321
  if (options.delay != null) {
1619
- if (ctx.previousNode instanceof StyleAst) {
1322
+ if (ctx.previousNode.type == 6 /* Style */) {
1620
1323
  ctx.currentTimeline.snapshotCurrentStyles();
1621
1324
  ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
1622
1325
  }
@@ -1625,7 +1328,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1625
1328
  }
1626
1329
  }
1627
1330
  if (ast.steps.length) {
1628
- ast.steps.forEach(function (s) { return s.visit(_this, ctx); });
1331
+ ast.steps.forEach(function (s) { return visitDslNode(_this, s, ctx); });
1629
1332
  // this is here just incase the inner steps only contain or end with a style() call
1630
1333
  ctx.currentTimeline.applyStylesToKeyframe();
1631
1334
  // this means that some animation function within the sequence
@@ -1652,7 +1355,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1652
1355
  if (delay) {
1653
1356
  innerContext.delayNextStep(delay);
1654
1357
  }
1655
- s.visit(_this, innerContext);
1358
+ visitDslNode(_this, s, innerContext);
1656
1359
  furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);
1657
1360
  innerTimelines.push(innerContext.currentTimeline);
1658
1361
  });
@@ -1668,12 +1371,11 @@ var AnimationTimelineBuilderVisitor = (function () {
1668
1371
  * @param {?} context
1669
1372
  * @return {?}
1670
1373
  */
1671
- AnimationTimelineBuilderVisitor.prototype.visitTiming = function (ast, context) {
1672
- if (ast instanceof DynamicTimingAst) {
1673
- var /** @type {?} */ strValue = context.params ?
1674
- interpolateParams(ast.value, context.params, context.errors) :
1675
- ast.value.toString();
1676
- return resolveTiming(strValue, context.errors);
1374
+ AnimationTimelineBuilderVisitor.prototype._visitTiming = function (ast, context) {
1375
+ if (((ast)).dynamic) {
1376
+ var /** @type {?} */ strValue = ((ast)).strValue;
1377
+ var /** @type {?} */ timingValue = context.params ? interpolateParams(strValue, context.params, context.errors) : strValue;
1378
+ return resolveTiming(timingValue, context.errors);
1677
1379
  }
1678
1380
  else {
1679
1381
  return { duration: ast.duration, delay: ast.delay, easing: ast.easing };
@@ -1685,14 +1387,14 @@ var AnimationTimelineBuilderVisitor = (function () {
1685
1387
  * @return {?}
1686
1388
  */
1687
1389
  AnimationTimelineBuilderVisitor.prototype.visitAnimate = function (ast, context) {
1688
- var /** @type {?} */ timings = context.currentAnimateTimings = this.visitTiming(ast.timings, context);
1390
+ var /** @type {?} */ timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context);
1689
1391
  var /** @type {?} */ timeline = context.currentTimeline;
1690
1392
  if (timings.delay) {
1691
1393
  context.incrementTime(timings.delay);
1692
1394
  timeline.snapshotCurrentStyles();
1693
1395
  }
1694
1396
  var /** @type {?} */ style$$1 = ast.style;
1695
- if (style$$1 instanceof KeyframesAst) {
1397
+ if (style$$1.type == 5 /* Keyframes */) {
1696
1398
  this.visitKeyframes(style$$1, context);
1697
1399
  }
1698
1400
  else {
@@ -1763,7 +1465,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1763
1465
  var /** @type {?} */ startTime = context.currentTimeline.currentTime;
1764
1466
  var /** @type {?} */ options = ((ast.options || {}));
1765
1467
  var /** @type {?} */ delay = options.delay ? resolveTimingValue(options.delay) : 0;
1766
- if (delay && (context.previousNode instanceof StyleAst ||
1468
+ if (delay && (context.previousNode.type === 6 /* Style */ ||
1767
1469
  (startTime == 0 && context.currentTimeline.getCurrentStyleProperties().length))) {
1768
1470
  context.currentTimeline.snapshotCurrentStyles();
1769
1471
  context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
@@ -1781,7 +1483,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1781
1483
  if (element === context.element) {
1782
1484
  sameElementTimeline = innerContext.currentTimeline;
1783
1485
  }
1784
- ast.animation.visit(_this, innerContext);
1486
+ visitDslNode(_this, ast.animation, innerContext);
1785
1487
  // this is here just incase the inner steps only contain or end
1786
1488
  // with a style() call (which is here to signal that this is a preparatory
1787
1489
  // call to style an element before it is animated again)
@@ -1824,7 +1526,7 @@ var AnimationTimelineBuilderVisitor = (function () {
1824
1526
  timeline.delayNextStep(delay);
1825
1527
  }
1826
1528
  var /** @type {?} */ startingTime = timeline.currentTime;
1827
- ast.animation.visit(this, context);
1529
+ visitDslNode(this, ast.animation, context);
1828
1530
  context.previousNode = ast;
1829
1531
  // time = duration + delay
1830
1532
  // the reason why this computation is so complex is because
@@ -1910,7 +1612,7 @@ var AnimationTimelineContext = (function () {
1910
1612
  var /** @type {?} */ oldParams_1 = this.options.params;
1911
1613
  if (oldParams_1) {
1912
1614
  var /** @type {?} */ params_2 = options['params'] = {};
1913
- Object.keys(this.options.params).forEach(function (name) { params_2[name] = oldParams_1[name]; });
1615
+ Object.keys(oldParams_1).forEach(function (name) { params_2[name] = oldParams_1[name]; });
1914
1616
  }
1915
1617
  }
1916
1618
  return options;
@@ -1994,7 +1696,11 @@ var AnimationTimelineContext = (function () {
1994
1696
  }
1995
1697
  if (selector.length > 0) {
1996
1698
  var /** @type {?} */ multi = limit != 1;
1997
- results.push.apply(results, this._driver.query(this.element, selector, multi));
1699
+ var /** @type {?} */ elements = this._driver.query(this.element, selector, multi);
1700
+ if (limit !== 0) {
1701
+ elements = elements.slice(0, limit);
1702
+ }
1703
+ results.push.apply(results, elements);
1998
1704
  }
1999
1705
  if (!optional && results.length == 0) {
2000
1706
  errors.push("`query(\"" + originalSelector + "\")` returned zero elements. (Use `query(\"" + originalSelector + "\", { optional: true })` if you wish to allow this.)");
@@ -2758,8 +2464,15 @@ var AnimationTrigger = (function () {
2758
2464
  */
2759
2465
  function createFallbackTransition(triggerName, states) {
2760
2466
  var /** @type {?} */ matchers = [function (fromState, toState) { return true; }];
2761
- var /** @type {?} */ animation = new SequenceAst([]);
2762
- var /** @type {?} */ transition = new TransitionAst(matchers, animation);
2467
+ var /** @type {?} */ animation = { type: 2 /* Sequence */, steps: [], options: null };
2468
+ var /** @type {?} */ transition = {
2469
+ type: 1 /* Transition */,
2470
+ animation: animation,
2471
+ matchers: matchers,
2472
+ options: null,
2473
+ queryCount: 0,
2474
+ depCount: 0
2475
+ };
2763
2476
  return new AnimationTransitionFactory(triggerName, transition, states);
2764
2477
  }
2765
2478
  /**
@@ -3824,7 +3537,7 @@ var TransitionAnimationEngine = (function () {
3824
3537
  * @return {?}
3825
3538
  */
3826
3539
  TransitionAnimationEngine.prototype.reportError = function (errors) {
3827
- throw new Error("Unable to process animations due to the following failed trigger transitions\n " + errors.join("\n"));
3540
+ throw new Error("Unable to process animations due to the following failed trigger transitions\n " + errors.join('\n'));
3828
3541
  };
3829
3542
  /**
3830
3543
  * @param {?} cleanupFns
@@ -4482,12 +4195,10 @@ function deleteOrUnsetInMap(map, key, value) {
4482
4195
  * @return {?}
4483
4196
  */
4484
4197
  function normalizeTriggerValue(value) {
4485
- switch (typeof value) {
4486
- case 'boolean':
4487
- return value ? '1' : '0';
4488
- default:
4489
- return value != null ? value.toString() : null;
4490
- }
4198
+ // we use `!= null` here because it's the most simple
4199
+ // way to test against a "falsy" value without mixing
4200
+ // in empty strings or a zero value. DO NOT OPTIMIZE.
4201
+ return value != null ? value : null;
4491
4202
  }
4492
4203
  /**
4493
4204
  * @param {?} node