@angular/animations 6.0.0-rc.3 → 6.0.0
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.
- package/browser/testing.d.ts +1 -1
- package/browser.d.ts +1 -1
- package/bundles/animations-browser-testing.umd.js +32 -6
- package/bundles/animations-browser-testing.umd.js.map +1 -1
- package/bundles/animations-browser-testing.umd.min.js +3 -3
- package/bundles/animations-browser-testing.umd.min.js.map +1 -1
- package/bundles/animations-browser.umd.js +101 -19
- package/bundles/animations-browser.umd.js.map +1 -1
- package/bundles/animations-browser.umd.min.js +6 -6
- package/bundles/animations-browser.umd.min.js.map +1 -1
- package/bundles/animations.umd.js +3 -3
- package/bundles/animations.umd.js.map +1 -1
- package/bundles/animations.umd.min.js +4 -4
- package/bundles/animations.umd.min.js.map +1 -1
- package/esm2015/src/version.js +5 -5
- package/esm5/src/version.js +9 -9
- package/fesm2015/animations.js +1 -1
- package/fesm2015/animations.js.map +1 -1
- package/fesm2015/browser/testing.js +1 -1
- package/fesm2015/browser/testing.js.map +1 -1
- package/fesm2015/browser.js +1 -1
- package/fesm2015/browser.js.map +1 -1
- package/fesm5/animations.js +1 -1
- package/fesm5/animations.js.map +1 -1
- package/fesm5/browser/testing.js +1 -1
- package/fesm5/browser/testing.js.map +1 -1
- package/fesm5/browser.js +1 -1
- package/fesm5/browser.js.map +1 -1
- package/package.json +4 -3
- package/src/version.d.ts +3 -3
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v6.0.0
|
|
2
|
+
* @license Angular v6.0.0
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
|
-
!function(e
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/animations"),require("@angular/core")):"function"==typeof define&&define.amd?define("@angular/animations/browser",["exports","@angular/animations","@angular/core"],e):e((t.ng=t.ng||{},t.ng.animations=t.ng.animations||{},t.ng.animations.browser={}),t.ng.animations,t.ng.core)}(this,function(t,e,n){"use strict";var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=Object.assign||function t(e){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}function u(t){switch(t.length){case 0:return new e.NoopAnimationPlayer;case 1:return t[0];default:return new e.ɵAnimationGroupPlayer(t)}}function l(t,n,r,i,o,s){void 0===o&&(o={}),void 0===s&&(s={});var a=[],u=[],l=-1,c=null;if(i.forEach(function(t){var r=t.offset,i=r==l,h=i&&c||{};Object.keys(t).forEach(function(r){var i=r,u=t[r];if("offset"!==r)switch(i=n.normalizePropertyName(i,a),u){case e.ɵPRE_STYLE:u=o[r];break;case e.AUTO_STYLE:u=s[r];break;default:u=n.normalizeStyleValue(r,i,u,a)}h[i]=u}),i||u.push(h),c=h,l=r}),a.length)throw new Error("Unable to animate due to the following errors:\n - "+a.join("\n - "));return u}function c(t,e,n,r){switch(e){case"start":t.onStart(function(){return r(n&&h(n,"start",t))});break;case"done":t.onDone(function(){return r(n&&h(n,"done",t))});break;case"destroy":t.onDestroy(function(){return r(n&&h(n,"destroy",t))})}}function h(t,e,n){var r=n.totalTime,i=p(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,void 0==r?t.totalTime:r,!!n.disabled),o=t._data;return null!=o&&(i._data=o),i}function p(t,e,n,r,i,o,s){return void 0===i&&(i=""),void 0===o&&(o=0),{element:t,triggerName:e,fromState:n,toState:r,phaseName:i,totalTime:o,disabled:!!s}}function f(t,e,n){var r;return t instanceof Map?(r=t.get(e))||t.set(e,r=n):(r=t[e])||(r=t[e]=n),r}function y(t){var e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}var m=function(t,e){return!1},d=function(t,e){return!1},v=function(t,e,n){return[]};if("undefined"!=typeof Element){if(m=function(t,e){return t.contains(e)},Element.prototype.matches)d=function(t,e){return t.matches(e)};else{var g=Element.prototype,_=g.matchesSelector||g.mozMatchesSelector||g.msMatchesSelector||g.oMatchesSelector||g.webkitMatchesSelector;_&&(d=function(t,e){return _.apply(t,[e])})}v=function(t,e,n){var r=[];if(n)r.push.apply(r,a(t.querySelectorAll(e)));else{var i=t.querySelector(e);i&&r.push(i)}return r}}var E=null,S=!1;function b(t){E||(E=T()||{},S=!!E.style&&"WebkitAppearance"in E.style);var e=!0;return E.style&&!function n(t){return"ebkit"==t.substring(1,6)}(t)&&!(e=t in E.style)&&S&&(e="Webkit"+t.charAt(0).toUpperCase()+t.substr(1)in E.style),e}function T(){return"undefined"!=typeof document?document.body:null}var w=d,P=m,k=v,A=function(){function t(){}return t.prototype.validateStyleProperty=function(t){return b(t)},t.prototype.matchesElement=function(t,e){return w(t,e)},t.prototype.containsElement=function(t,e){return P(t,e)},t.prototype.query=function(t,e,n){return k(t,e,n)},t.prototype.computeStyle=function(t,e,n){return n||""},t.prototype.animate=function(t,n,r,i,o,s,a){return void 0===s&&(s=[]),new e.NoopAnimationPlayer(r,i)},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[]},t}(),N=function(){function t(){}return t.NOOP=new A,t}(),O=1e3;function C(t){if("number"==typeof t)return t;var e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:F(parseFloat(e[1]),e[2])}function F(t,e){switch(e){case"s":return t*O;default:return t}}function D(t,e,n){return t.hasOwnProperty("duration")?t:function r(t,e,n){var r,i=0,o="";if("string"==typeof t){var s=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===s)return e.push('The provided timing value "'+t+'" is invalid.'),{duration:0,delay:0,easing:""};r=F(parseFloat(s[1]),s[2]);var a=s[3];null!=a&&(i=F(Math.floor(parseFloat(a)),s[4]));var u=s[5];u&&(o=u)}else r=t;if(!n){var l=!1,c=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),l=!0),i<0&&(e.push("Delay values below 0 are not allowed for this animation step."),l=!0),l&&e.splice(c,0,'The provided timing value "'+t+'" is invalid.')}return{duration:r,delay:i,easing:o}}(t,e,n)}function I(t,e){return void 0===e&&(e={}),Object.keys(t).forEach(function(n){e[n]=t[n]}),e}function L(t){var e={};return Array.isArray(t)?t.forEach(function(t){return x(t,!1,e)}):x(t,!1,e),e}function x(t,e,n){if(void 0===n&&(n={}),e)for(var r in t)n[r]=t[r];else I(t,n);return n}function j(t,e){t.style&&Object.keys(e).forEach(function(n){var r=U(n);t.style[r]=e[n]})}function q(t,e){t.style&&Object.keys(e).forEach(function(e){var n=U(e);t.style[n]=""})}function R(t){return Array.isArray(t)?1==t.length?t[0]:e.sequence(t):t}var K=new RegExp("{{\\s*(.+?)\\s*}}","g");function Q(t){var e=[];if("string"==typeof t){for(var n=t.toString(),r=void 0;r=K.exec(n);)e.push(r[1]);K.lastIndex=0}return e}function B(t,e,n){var r=t.toString(),i=r.replace(K,function(t,r){var i=e[r];return e.hasOwnProperty(r)||(n.push("Please provide a value for the animation param "+r),i=""),i.toString()});return i==r?t:i}function M(t){for(var e=[],n=t.next();!n.done;)e.push(n.value),n=t.next();return e}var z=/-+([a-z0-9])/g;function U(t){return t.replace(z,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t[1].toUpperCase()})}function W(t,e){return 0===t||0===e}function H(t,e,n){var r=Object.keys(n);if(r.length&&e.length){var i=e[0],o=[];if(r.forEach(function(t){i.hasOwnProperty(t)||o.push(t),i[t]=n[t]}),o.length)for(var s=function(){var n=e[a];o.forEach(function(e){n[e]=$(t,e)})},a=1;a<e.length;a++)s()}return e}function Y(t,e,n){switch(e.type){case 7:return t.visitTrigger(e,n);case 0:return t.visitState(e,n);case 1:return t.visitTransition(e,n);case 2:return t.visitSequence(e,n);case 3:return t.visitGroup(e,n);case 4:return t.visitAnimate(e,n);case 5:return t.visitKeyframes(e,n);case 6:return t.visitStyle(e,n);case 8:return t.visitReference(e,n);case 9:return t.visitAnimateChild(e,n);case 10:return t.visitAnimateRef(e,n);case 11:return t.visitQuery(e,n);case 12:return t.visitStagger(e,n);default:throw new Error("Unable to resolve animation metadata node #"+e.type)}}function $(t,e){return window.getComputedStyle(t)[e]}
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright Google Inc. All Rights Reserved.
|
|
10
10
|
*
|
|
11
11
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12
12
|
* found in the LICENSE file at https://angular.io/license
|
|
13
|
-
*/var Z="*",J=new Set(["true","1"]),X=new Set(["false","0"]);function ee(e,t){var n=J.has(e)||X.has(e),r=J.has(t)||X.has(t);return function(i,o){var s=e==Z||e==i,a=t==Z||t==o;return!s&&n&&"boolean"==typeof i&&(s=i?J.has(e):X.has(e)),!a&&r&&"boolean"==typeof o&&(a=o?J.has(t):X.has(t)),s&&a}}var te=new RegExp("s*:selfs*,?","g");function ne(e,t,n){return new re(e).build(t,n)}var re=function(){function e(e){this._driver=e}return e.prototype.build=function(e,t){var n=new ie(t);return this._resetContextStyleTimingState(n),G(this,Q(e),n)},e.prototype._resetContextStyleTimingState=function(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0},e.prototype.visitTrigger=function(e,t){var n=this,r=t.queryCount=0,i=t.depCount=0,o=[],s=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(function(e){if(n._resetContextStyleTimingState(t),0==e.type){var a=e,u=a.name;u.toString().split(/\s*,\s*/).forEach(function(e){a.name=e,o.push(n.visitState(a,t))}),a.name=u}else if(1==e.type){var l=n.visitTransition(e,t);r+=l.queryCount,i+=l.depCount,s.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:o,transitions:s,queryCount:r,depCount:i,options:null}},e.prototype.visitState=function(e,t){var n=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(n.containsDynamicStyles){var i=new Set,o=r||{};if(n.styles.forEach(function(e){if(se(e)){var t=e;Object.keys(t).forEach(function(e){M(t[e]).forEach(function(e){o.hasOwnProperty(e)||i.add(e)})})}}),i.size){var s=U(i.values());t.errors.push('state("'+e.name+'", ...) must define default values for all the following style substitutions: '+s.join(", "))}}return{type:0,name:e.name,style:n,options:r?{params:r}:null}},e.prototype.visitTransition=function(e,t){t.queryCount=0,t.depCount=0;var n=G(this,Q(e.animation),t);return{type:1,matchers:function r(e,t){var n=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(function(e){return function r(e,t,n){if(":"==e[0]){var r=function i(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return function(e,t){return parseFloat(t)>parseFloat(e)};case":decrement":return function(e,t){return parseFloat(t)<parseFloat(e)};default:return t.push('The transition alias value "'+e+'" is not supported'),"* => *"}}(e,n);if("function"==typeof r)return void t.push(r);e=r}var o=e.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==o||o.length<4)return n.push('The provided transition expression "'+e+'" is not supported'),t;var s=o[1],a=o[2],u=o[3];t.push(ee(s,u)),"<"!=a[0]||s==Z&&u==Z||t.push(ee(u,s))}(e,n,t)}):n.push(e),n}(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:ae(e.options)}},e.prototype.visitSequence=function(e,t){var n=this;return{type:2,steps:e.steps.map(function(e){return G(n,e,t)}),options:ae(e.options)}},e.prototype.visitGroup=function(e,t){var n=this,r=t.currentTime,i=0,o=e.steps.map(function(e){t.currentTime=r;var o=G(n,e,t);return i=Math.max(i,t.currentTime),o});return t.currentTime=i,{type:3,steps:o,options:ae(e.options)}},e.prototype.visitAnimate=function(e,n){var r,i=function o(e,t){var n=null;if(e.hasOwnProperty("duration"))n=e;else if("number"==typeof e)return ue(L(e,t).duration,0,"");var r=e;if(r.split(/\s+/).some(function(e){return"{"==e.charAt(0)&&"{"==e.charAt(1)})){var i=ue(0,0,"");return i.dynamic=!0,i.strValue=r,i}return ue((n=n||L(r,t)).duration,n.delay,n.easing)}(e.timings,n.errors);n.currentAnimateTimings=i;var s=e.styles?e.styles:t.style({});if(5==s.type)r=this.visitKeyframes(s,n);else{var a=e.styles,u=!1;if(!a){u=!0;var l={};i.easing&&(l.easing=i.easing),a=t.style(l)}n.currentTime+=i.duration+i.delay;var h=this.visitStyle(a,n);h.isEmptyStep=u,r=h}return n.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}},e.prototype.visitStyle=function(e,t){var n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n},e.prototype._makeStyleAst=function(e,n){var r=[];Array.isArray(e.styles)?e.styles.forEach(function(e){"string"==typeof e?e==t.AUTO_STYLE?r.push(e):n.errors.push("The provided style string value "+e+" is not allowed."):r.push(e)}):r.push(e.styles);var i=!1,o=null;return r.forEach(function(e){if(se(e)){var t=e,n=t.easing;if(n&&(o=n,delete t.easing),!i)for(var r in t)if(t[r].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:r,easing:o,offset:e.offset,containsDynamicStyles:i,options:null}},e.prototype._validateStyleAst=function(e,t){var n=this,r=t.currentAnimateTimings,i=t.currentTime,o=t.currentTime;r&&o>0&&(o-=r.duration+r.delay),e.styles.forEach(function(e){"string"!=typeof e&&Object.keys(e).forEach(function(r){if(n._driver.validateStyleProperty(r)){var s=t.collectedStyles[t.currentQuerySelector],a=s[r],u=!0;a&&(o!=i&&o>=a.startTime&&i<=a.endTime&&(t.errors.push('The CSS property "'+r+'" that exists between the times of "'+a.startTime+'ms" and "'+a.endTime+'ms" is also being animated in a parallel animation between the times of "'+o+'ms" and "'+i+'ms"'),u=!1),o=a.startTime),u&&(s[r]={startTime:o,endTime:i}),t.options&&function l(e,t,n){var r=t.params||{},i=M(e);i.length&&i.forEach(function(e){r.hasOwnProperty(e)||n.push("Unable to resolve the local animation param "+e+" in the given list of values")})}(e[r],t.options,t.errors)}else t.errors.push('The provided animation property "'+r+'" is not a supported CSS property for animations')})})},e.prototype.visitKeyframes=function(e,t){var n=this,r={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),r;var i=0,o=[],s=!1,a=!1,u=0,l=e.steps.map(function(e){var r=n._makeStyleAst(e,t),l=null!=r.offset?r.offset:function h(e){if("string"==typeof e)return null;var t=null;if(Array.isArray(e))e.forEach(function(e){if(se(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}});else if(se(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}return t}(r.styles),c=0;return null!=l&&(i++,c=r.offset=l),a=a||c<0||c>1,s=s||c<u,u=c,o.push(c),r});a&&t.errors.push("Please ensure that all keyframe offsets are between 0 and 1"),s&&t.errors.push("Please ensure that all keyframe offsets are in order");var h=e.steps.length,c=0;i>0&&i<h?t.errors.push("Not all style() steps within the declared keyframes() contain offsets"):0==i&&(c=1/(h-1));var p=h-1,f=t.currentTime,y=t.currentAnimateTimings,m=y.duration;return l.forEach(function(e,i){var s=c>0?i==p?1:c*i:o[i],a=s*m;t.currentTime=f+y.delay+a,y.duration=a,n._validateStyleAst(e,t),e.offset=s,r.styles.push(e)}),r},e.prototype.visitReference=function(e,t){return{type:8,animation:G(this,Q(e.animation),t),options:ae(e.options)}},e.prototype.visitAnimateChild=function(e,t){return t.depCount++,{type:9,options:ae(e.options)}},e.prototype.visitAnimateRef=function(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:ae(e.options)}},e.prototype.visitQuery=function(e,t){var n=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;var o=r.__read(function s(e){var t=!!e.split(/\s*,\s*/).find(function(e){return":self"==e});return t&&(e=e.replace(te,"")),[e=e.replace(/@\*/g,C).replace(/@\w+/g,function(e){return C+"-"+e.substr(1)}).replace(/:animating/g,O),t]}(e.selector),2),a=o[0],u=o[1];t.currentQuerySelector=n.length?n+" "+a:a,l(t.collectedStyles,t.currentQuerySelector,{});var h=G(this,Q(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:11,selector:a,limit:i.limit||0,optional:!!i.optional,includeSelf:u,animation:h,originalSelector:e.selector,options:ae(e.options)}},e.prototype.visitStagger=function(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");var n="full"===e.timings?{duration:0,delay:0,easing:"full"}:L(e.timings,t.errors,!0);return{type:12,animation:G(this,Q(e.animation),t),timings:n,options:null}},e}(),ie=function oe(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null};function se(e){return!Array.isArray(e)&&"object"==typeof e}function ae(e){return e?(e=x(e)).params&&(e.params=function t(e){return e?x(e):null}(e.params)):e={},e}function ue(e,t,n){return{duration:e,delay:t,easing:n}}function le(e,t,n,r,i,o,s,a){return void 0===s&&(s=null),void 0===a&&(a=!1),{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:r,duration:i,delay:o,totalTime:i+o,easing:s,subTimeline:a}}var he=function(){function e(){this._map=new Map}return e.prototype.consume=function(e){var t=this._map.get(e);return t?this._map.delete(e):t=[],t},e.prototype.append=function(e,t){var n=this._map.get(e);n||this._map.set(e,n=[]),n.push.apply(n,r.__spread(t))},e.prototype.has=function(e){return this._map.has(e)},e.prototype.clear=function(){this._map.clear()},e}(),ce=new RegExp(":enter","g"),pe=new RegExp(":leave","g");function fe(e,t,n,r,i,o,s,a,u,l){return void 0===o&&(o={}),void 0===s&&(s={}),void 0===l&&(l=[]),(new ye).buildKeyframes(e,t,n,r,i,o,s,a,u,l)}var ye=function(){function e(){}return e.prototype.buildKeyframes=function(e,t,n,r,i,o,s,a,u,l){void 0===l&&(l=[]),u=u||new he;var h=new de(e,t,u,r,i,l,[]);h.options=a,h.currentTimeline.setStyles([o],null,h.errors,a),G(this,n,h);var c=h.timelines.filter(function(e){return e.containsAnimation()});if(c.length&&Object.keys(s).length){var p=c[c.length-1];p.allowOnlyTimelineStyles()||p.setStyles([s],null,h.errors,a)}return c.length?c.map(function(e){return e.buildKeyframes()}):[le(t,[],[],[],0,0,"",!1)]},e.prototype.visitTrigger=function(e,t){},e.prototype.visitState=function(e,t){},e.prototype.visitTransition=function(e,t){},e.prototype.visitAnimateChild=function(e,t){var n=t.subInstructions.consume(t.element);if(n){var r=t.createSubContext(e.options),i=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,r,r.options);i!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e},e.prototype.visitAnimateRef=function(e,t){var n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e},e.prototype._visitSubInstructions=function(e,t,n){var r=t.currentTimeline.currentTime,i=null!=n.duration?D(n.duration):null,o=null!=n.delay?D(n.delay):null;return 0!==i&&e.forEach(function(e){var n=t.appendInstructionToTimeline(e,i,o);r=Math.max(r,n.duration+n.delay)}),r},e.prototype.visitReference=function(e,t){t.updateOptions(e.options,!0),G(this,e.animation,t),t.previousNode=e},e.prototype.visitSequence=function(e,t){var n=this,r=t.subContextCount,i=t,o=e.options;if(o&&(o.params||o.delay)&&((i=t.createSubContext(o)).transformIntoNewTimeline(),null!=o.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=me);var s=D(o.delay);i.delayNextStep(s)}e.steps.length&&(e.steps.forEach(function(e){return G(n,e,i)}),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e},e.prototype.visitGroup=function(e,t){var n=this,r=[],i=t.currentTimeline.currentTime,o=e.options&&e.options.delay?D(e.options.delay):0;e.steps.forEach(function(s){var a=t.createSubContext(e.options);o&&a.delayNextStep(o),G(n,s,a),i=Math.max(i,a.currentTimeline.currentTime),r.push(a.currentTimeline)}),r.forEach(function(e){return t.currentTimeline.mergeTimelineCollectedStyles(e)}),t.transformIntoNewTimeline(i),t.previousNode=e},e.prototype._visitTiming=function(e,t){if(e.dynamic){var n=e.strValue;return L(t.params?z(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}},e.prototype.visitAnimate=function(e,t){var n=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),r.snapshotCurrentStyles());var i=e.style;5==i.type?this.visitKeyframes(i,t):(t.incrementTime(n.duration),this.visitStyle(i,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e},e.prototype.visitStyle=function(e,t){var n=t.currentTimeline,r=t.currentAnimateTimings;!r&&n.getCurrentStyleProperties().length&&n.forwardFrame();var i=r&&r.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(i):n.setStyles(e.styles,i,t.errors,t.options),t.previousNode=e},e.prototype.visitKeyframes=function(e,t){var n=t.currentAnimateTimings,r=t.currentTimeline.duration,i=n.duration,o=t.createSubContext().currentTimeline;o.easing=n.easing,e.styles.forEach(function(e){o.forwardTime((e.offset||0)*i),o.setStyles(e.styles,e.easing,t.errors,t.options),o.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(o),t.transformIntoNewTimeline(r+i),t.previousNode=e},e.prototype.visitQuery=function(e,t){var n=this,r=t.currentTimeline.currentTime,i=e.options||{},o=i.delay?D(i.delay):0;o&&(6===t.previousNode.type||0==r&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=me);var s=r,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=a.length;var u=null;a.forEach(function(r,i){t.currentQueryIndex=i;var a=t.createSubContext(e.options,r);o&&a.delayNextStep(o),r===t.element&&(u=a.currentTimeline),G(n,e.animation,a),a.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,a.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(s),u&&(t.currentTimeline.mergeTimelineCollectedStyles(u),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e},e.prototype.visitStagger=function(e,t){var n=t.parentContext,r=t.currentTimeline,i=e.timings,o=Math.abs(i.duration),s=o*(t.currentQueryTotal-1),a=o*t.currentQueryIndex;switch(i.duration<0?"reverse":i.easing){case"reverse":a=s-a;break;case"full":a=n.currentStaggerTime}var u=t.currentTimeline;a&&u.delayNextStep(a);var l=u.currentTime;G(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=r.currentTime-l+(r.startTime-n.currentTimeline.startTime)},e}(),me={},de=function(){function e(e,t,n,r,i,o,s,a){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=i,this.errors=o,this.timelines=s,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=me,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new ve(this._driver,t,0),s.push(this.currentTimeline)}return Object.defineProperty(e.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),e.prototype.updateOptions=function(e,t){var n=this;if(e){var r=e,i=this.options;null!=r.duration&&(i.duration=D(r.duration)),null!=r.delay&&(i.delay=D(r.delay));var o=r.params;if(o){var s=i.params;s||(s=this.options.params={}),Object.keys(o).forEach(function(e){t&&s.hasOwnProperty(e)||(s[e]=z(o[e],s,n.errors))})}}},e.prototype._copyOptions=function(){var e={};if(this.options){var t=this.options.params;if(t){var n=e.params={};Object.keys(t).forEach(function(e){n[e]=t[e]})}}return e},e.prototype.createSubContext=function(t,n,r){void 0===t&&(t=null);var i=n||this.element,o=new e(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o},e.prototype.transformIntoNewTimeline=function(e){return this.previousNode=me,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline},e.prototype.appendInstructionToTimeline=function(e,t,n){var r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},i=new ge(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(i),r},e.prototype.incrementTime=function(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)},e.prototype.delayNextStep=function(e){e>0&&this.currentTimeline.delayNextStep(e)},e.prototype.invokeQuery=function(e,t,n,i,o,s){var a=[];if(i&&a.push(this.element),e.length>0){e=(e=e.replace(ce,"."+this._enterClassName)).replace(pe,"."+this._leaveClassName);var u=this._driver.query(this.element,e,1!=n);0!==n&&(u=n<0?u.slice(u.length+n,u.length):u.slice(0,n)),a.push.apply(a,r.__spread(u))}return o||0!=a.length||s.push('`query("'+t+'")` returned zero elements. (Use `query("'+t+'", { optional: true })` if you wish to allow this.)'),a},e}(),ve=function(){function e(e,t,n,r){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}return e.prototype.containsAnimation=function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}},e.prototype.getCurrentStyleProperties=function(){return Object.keys(this._currentKeyframe)},Object.defineProperty(e.prototype,"currentTime",{get:function(){return this.startTime+this.duration},enumerable:!0,configurable:!0}),e.prototype.delayNextStep=function(e){var t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e},e.prototype.fork=function(t,n){return this.applyStylesToKeyframe(),new e(this._driver,t,n||this.currentTime,this._elementTimelineStylesLookup)},e.prototype._loadKeyframe=function(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))},e.prototype.forwardFrame=function(){this.duration+=1,this._loadKeyframe()},e.prototype.forwardTime=function(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()},e.prototype._updateStyle=function(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}},e.prototype.allowOnlyTimelineStyles=function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe},e.prototype.applyEmptyStep=function(e){var n=this;e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(function(e){n._backFill[e]=n._globalTimelineStyles[e]||t.AUTO_STYLE,n._currentKeyframe[e]=t.AUTO_STYLE}),this._currentEmptyStepKeyframe=this._currentKeyframe},e.prototype.setStyles=function(e,n,r,i){var o=this;n&&(this._previousKeyframe.easing=n);var s=i&&i.params||{},a=function u(e,n){var r,i={};return e.forEach(function(e){"*"===e?(r=r||Object.keys(n)).forEach(function(e){i[e]=t.AUTO_STYLE}):R(e,!1,i)}),i}(e,this._globalTimelineStyles);Object.keys(a).forEach(function(e){var n=z(a[e],s,r);o._pendingStyles[e]=n,o._localTimelineStyles.hasOwnProperty(e)||(o._backFill[e]=o._globalTimelineStyles.hasOwnProperty(e)?o._globalTimelineStyles[e]:t.AUTO_STYLE),o._updateStyle(e,n)})},e.prototype.applyStylesToKeyframe=function(){var e=this,t=this._pendingStyles,n=Object.keys(t);0!=n.length&&(this._pendingStyles={},n.forEach(function(n){e._currentKeyframe[n]=t[n]}),Object.keys(this._localTimelineStyles).forEach(function(t){e._currentKeyframe.hasOwnProperty(t)||(e._currentKeyframe[t]=e._localTimelineStyles[t])}))},e.prototype.snapshotCurrentStyles=function(){var e=this;Object.keys(this._localTimelineStyles).forEach(function(t){var n=e._localTimelineStyles[t];e._pendingStyles[t]=n,e._updateStyle(t,n)})},e.prototype.getFinalKeyframe=function(){return this._keyframes.get(this.duration)},Object.defineProperty(e.prototype,"properties",{get:function(){var e=[];for(var t in this._currentKeyframe)e.push(t);return e},enumerable:!0,configurable:!0}),e.prototype.mergeTimelineCollectedStyles=function(e){var t=this;Object.keys(e._styleSummary).forEach(function(n){var r=t._styleSummary[n],i=e._styleSummary[n];(!r||i.time>r.time)&&t._updateStyle(n,i.value)})},e.prototype.buildKeyframes=function(){var e=this;this.applyStylesToKeyframe();var n=new Set,r=new Set,i=1===this._keyframes.size&&0===this.duration,o=[];this._keyframes.forEach(function(s,a){var u=R(s,!0);Object.keys(u).forEach(function(e){var i=u[e];i==t.ɵPRE_STYLE?n.add(e):i==t.AUTO_STYLE&&r.add(e)}),i||(u.offset=a/e.duration),o.push(u)});var s=n.size?U(n.values()):[],a=r.size?U(r.values()):[];if(i){var u=o[0],l=x(u);u.offset=0,l.offset=1,o=[u,l]}return le(this.element,o,s,a,this.duration,this.startTime,this.easing,!1)},e}(),ge=function(e){function t(t,n,r,i,o,s,a){void 0===a&&(a=!1);var u=e.call(this,t,n,s.delay)||this;return u.element=n,u.keyframes=r,u.preStyleProps=i,u.postStyleProps=o,u._stretchStartingKeyframe=a,u.timings={duration:s.duration,delay:s.delay,easing:s.easing},u}return r.__extends(t,e),t.prototype.containsAnimation=function(){return this.keyframes.length>1},t.prototype.buildKeyframes=function(){var e=this.keyframes,t=this.timings,n=t.delay,r=t.duration,i=t.easing;if(this._stretchStartingKeyframe&&n){var o=[],s=r+n,a=n/s,u=R(e[0],!1);u.offset=0,o.push(u);var l=R(e[0],!1);l.offset=_e(a),o.push(l);for(var h=e.length-1,c=1;c<=h;c++){var p=R(e[c],!1);p.offset=_e((n+p.offset*r)/s),o.push(p)}r=s,n=0,i="",e=o}return le(this.element,e,this.preStyleProps,this.postStyleProps,r,n,i,!0)},t}(ve);function _e(e,t){void 0===t&&(t=3);var n=Math.pow(10,t-1);return Math.round(e*n)/n}var Ee=function(){function e(e,t){this._driver=e;var n=[],r=ne(e,t,n);if(n.length){var i="animation validation failed:\n"+n.join("\n");throw new Error(i)}this._animationAst=r}return e.prototype.buildTimelines=function(e,t,n,r,i){var o=Array.isArray(t)?q(t):t,s=Array.isArray(n)?q(n):n,a=[];i=i||new he;var u=fe(this._driver,e,this._animationAst,k,A,o,s,r,i,a);if(a.length){var l="animation building failed:\n"+a.join("\n");throw new Error(l)}return u},e}(),Se=function be(){},Te=function(){function e(){}return e.prototype.normalizePropertyName=function(e,t){return e},e.prototype.normalizeStyleValue=function(e,t,n,r){return n},e}(),we=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.normalizePropertyName=function(e,t){return H(e)},t.prototype.normalizeStyleValue=function(e,t,n,r){var i="",o=n.toString().trim();if(Pe[t]&&0!==n&&"0"!==n)if("number"==typeof n)i="px";else{var s=n.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&0==s[1].length&&r.push("Please provide a CSS unit value for "+e+":"+n)}return o+i},t}(Se),Pe=function ke(e){var t={};return e.forEach(function(e){return t[e]=!0}),t}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(","));
|
|
13
|
+
*/var G="*",V=new Set(["true","1"]),Z=new Set(["false","0"]);function J(t,e){var n=V.has(t)||Z.has(t),r=V.has(e)||Z.has(e);return function(i,o){var s=t==G||t==i,a=e==G||e==o;return!s&&n&&"boolean"==typeof i&&(s=i?V.has(t):Z.has(t)),!a&&r&&"boolean"==typeof o&&(a=o?V.has(e):Z.has(e)),s&&a}}var X=new RegExp("s*:selfs*,?","g");function tt(t,e,n){return new et(t).build(e,n)}var et=function(){function t(t){this._driver=t}return t.prototype.build=function(t,e){var n=new nt(e);return this._resetContextStyleTimingState(n),Y(this,R(t),n)},t.prototype._resetContextStyleTimingState=function(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0},t.prototype.visitTrigger=function(t,e){var n=this,r=e.queryCount=0,i=e.depCount=0,o=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(function(t){if(n._resetContextStyleTimingState(e),0==t.type){var a=t,u=a.name;u.toString().split(/\s*,\s*/).forEach(function(t){a.name=t,o.push(n.visitState(a,e))}),a.name=u}else if(1==t.type){var l=n.visitTransition(t,e);r+=l.queryCount,i+=l.depCount,s.push(l)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:o,transitions:s,queryCount:r,depCount:i,options:null}},t.prototype.visitState=function(t,e){var n=this.visitStyle(t.styles,e),r=t.options&&t.options.params||null;if(n.containsDynamicStyles){var i=new Set,o=r||{};if(n.styles.forEach(function(t){if(rt(t)){var e=t;Object.keys(e).forEach(function(t){Q(e[t]).forEach(function(t){o.hasOwnProperty(t)||i.add(t)})})}}),i.size){var s=M(i.values());e.errors.push('state("'+t.name+'", ...) must define default values for all the following style substitutions: '+s.join(", "))}}return{type:0,name:t.name,style:n,options:r?{params:r}:null}},t.prototype.visitTransition=function(t,e){e.queryCount=0,e.depCount=0;var n=Y(this,R(t.animation),e);return{type:1,matchers:function r(t,e){var n=[];return"string"==typeof t?t.split(/\s*,\s*/).forEach(function(t){return function r(t,e,n){if(":"==t[0]){var r=function i(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return function(t,e){return parseFloat(e)>parseFloat(t)};case":decrement":return function(t,e){return parseFloat(e)<parseFloat(t)};default:return e.push('The transition alias value "'+t+'" is not supported'),"* => *"}}(t,n);if("function"==typeof r)return void e.push(r);t=r}var o=t.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==o||o.length<4)return n.push('The provided transition expression "'+t+'" is not supported'),e;var s=o[1],a=o[2],u=o[3];e.push(J(s,u)),"<"!=a[0]||s==G&&u==G||e.push(J(u,s))}(t,n,e)}):n.push(t),n}(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:it(t.options)}},t.prototype.visitSequence=function(t,e){var n=this;return{type:2,steps:t.steps.map(function(t){return Y(n,t,e)}),options:it(t.options)}},t.prototype.visitGroup=function(t,e){var n=this,r=e.currentTime,i=0,o=t.steps.map(function(t){e.currentTime=r;var o=Y(n,t,e);return i=Math.max(i,e.currentTime),o});return e.currentTime=i,{type:3,steps:o,options:it(t.options)}},t.prototype.visitAnimate=function(t,n){var r,i=function o(t,e){var n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return ot(D(t,e).duration,0,"");var r=t;if(r.split(/\s+/).some(function(t){return"{"==t.charAt(0)&&"{"==t.charAt(1)})){var i=ot(0,0,"");return i.dynamic=!0,i.strValue=r,i}return ot((n=n||D(r,e)).duration,n.delay,n.easing)}(t.timings,n.errors);n.currentAnimateTimings=i;var s=t.styles?t.styles:e.style({});if(5==s.type)r=this.visitKeyframes(s,n);else{var a=t.styles,u=!1;if(!a){u=!0;var l={};i.easing&&(l.easing=i.easing),a=e.style(l)}n.currentTime+=i.duration+i.delay;var c=this.visitStyle(a,n);c.isEmptyStep=u,r=c}return n.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}},t.prototype.visitStyle=function(t,e){var n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n},t.prototype._makeStyleAst=function(t,n){var r=[];Array.isArray(t.styles)?t.styles.forEach(function(t){"string"==typeof t?t==e.AUTO_STYLE?r.push(t):n.errors.push("The provided style string value "+t+" is not allowed."):r.push(t)}):r.push(t.styles);var i=!1,o=null;return r.forEach(function(t){if(rt(t)){var e=t,n=e.easing;if(n&&(o=n,delete e.easing),!i)for(var r in e)if(e[r].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:r,easing:o,offset:t.offset,containsDynamicStyles:i,options:null}},t.prototype._validateStyleAst=function(t,e){var n=this,r=e.currentAnimateTimings,i=e.currentTime,o=e.currentTime;r&&o>0&&(o-=r.duration+r.delay),t.styles.forEach(function(t){"string"!=typeof t&&Object.keys(t).forEach(function(r){if(n._driver.validateStyleProperty(r)){var s=e.collectedStyles[e.currentQuerySelector],a=s[r],u=!0;a&&(o!=i&&o>=a.startTime&&i<=a.endTime&&(e.errors.push('The CSS property "'+r+'" that exists between the times of "'+a.startTime+'ms" and "'+a.endTime+'ms" is also being animated in a parallel animation between the times of "'+o+'ms" and "'+i+'ms"'),u=!1),o=a.startTime),u&&(s[r]={startTime:o,endTime:i}),e.options&&function l(t,e,n){var r=e.params||{},i=Q(t);i.length&&i.forEach(function(t){r.hasOwnProperty(t)||n.push("Unable to resolve the local animation param "+t+" in the given list of values")})}(t[r],e.options,e.errors)}else e.errors.push('The provided animation property "'+r+'" is not a supported CSS property for animations')})})},t.prototype.visitKeyframes=function(t,e){var n=this,r={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),r;var i=0,o=[],s=!1,a=!1,u=0,l=t.steps.map(function(t){var r=n._makeStyleAst(t,e),l=null!=r.offset?r.offset:function c(t){if("string"==typeof t)return null;var e=null;if(Array.isArray(t))t.forEach(function(t){if(rt(t)&&t.hasOwnProperty("offset")){var n=t;e=parseFloat(n.offset),delete n.offset}});else if(rt(t)&&t.hasOwnProperty("offset")){var n=t;e=parseFloat(n.offset),delete n.offset}return e}(r.styles),h=0;return null!=l&&(i++,h=r.offset=l),a=a||h<0||h>1,s=s||h<u,u=h,o.push(h),r});a&&e.errors.push("Please ensure that all keyframe offsets are between 0 and 1"),s&&e.errors.push("Please ensure that all keyframe offsets are in order");var c=t.steps.length,h=0;i>0&&i<c?e.errors.push("Not all style() steps within the declared keyframes() contain offsets"):0==i&&(h=1/(c-1));var p=c-1,f=e.currentTime,y=e.currentAnimateTimings,m=y.duration;return l.forEach(function(t,i){var s=h>0?i==p?1:h*i:o[i],a=s*m;e.currentTime=f+y.delay+a,y.duration=a,n._validateStyleAst(t,e),t.offset=s,r.styles.push(t)}),r},t.prototype.visitReference=function(t,e){return{type:8,animation:Y(this,R(t.animation),e),options:it(t.options)}},t.prototype.visitAnimateChild=function(t,e){return e.depCount++,{type:9,options:it(t.options)}},t.prototype.visitAnimateRef=function(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:it(t.options)}},t.prototype.visitQuery=function(t,e){var n=e.currentQuerySelector,r=t.options||{};e.queryCount++,e.currentQuery=t;var i=s(function o(t){var e=!!t.split(/\s*,\s*/).find(function(t){return":self"==t});return e&&(t=t.replace(X,"")),[t=t.replace(/@\*/g,".ng-trigger").replace(/@\w+/g,function(t){return".ng-trigger-"+t.substr(1)}).replace(/:animating/g,".ng-animating"),e]}(t.selector),2),a=i[0],u=i[1];e.currentQuerySelector=n.length?n+" "+a:a,f(e.collectedStyles,e.currentQuerySelector,{});var l=Y(this,R(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:a,limit:r.limit||0,optional:!!r.optional,includeSelf:u,animation:l,originalSelector:t.selector,options:it(t.options)}},t.prototype.visitStagger=function(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");var n="full"===t.timings?{duration:0,delay:0,easing:"full"}:D(t.timings,e.errors,!0);return{type:12,animation:Y(this,R(t.animation),e),timings:n,options:null}},t}(),nt=function nt(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null};function rt(t){return!Array.isArray(t)&&"object"==typeof t}function it(t){return t?(t=I(t)).params&&(t.params=function e(t){return t?I(t):null}(t.params)):t={},t}function ot(t,e,n){return{duration:t,delay:e,easing:n}}function st(t,e,n,r,i,o,s,a){return void 0===s&&(s=null),void 0===a&&(a=!1),{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:r,duration:i,delay:o,totalTime:i+o,easing:s,subTimeline:a}}var at=function(){function t(){this._map=new Map}return t.prototype.consume=function(t){var e=this._map.get(t);return e?this._map.delete(t):e=[],e},t.prototype.append=function(t,e){var n=this._map.get(t);n||this._map.set(t,n=[]),n.push.apply(n,a(e))},t.prototype.has=function(t){return this._map.has(t)},t.prototype.clear=function(){this._map.clear()},t}(),ut=new RegExp(":enter","g"),lt=new RegExp(":leave","g");function ct(t,e,n,r,i,o,s,a,u,l){return void 0===o&&(o={}),void 0===s&&(s={}),void 0===l&&(l=[]),(new ht).buildKeyframes(t,e,n,r,i,o,s,a,u,l)}var ht=function(){function t(){}return t.prototype.buildKeyframes=function(t,e,n,r,i,o,s,a,u,l){void 0===l&&(l=[]),u=u||new at;var c=new ft(t,e,u,r,i,l,[]);c.options=a,c.currentTimeline.setStyles([o],null,c.errors,a),Y(this,n,c);var h=c.timelines.filter(function(t){return t.containsAnimation()});if(h.length&&Object.keys(s).length){var p=h[h.length-1];p.allowOnlyTimelineStyles()||p.setStyles([s],null,c.errors,a)}return h.length?h.map(function(t){return t.buildKeyframes()}):[st(e,[],[],[],0,0,"",!1)]},t.prototype.visitTrigger=function(t,e){},t.prototype.visitState=function(t,e){},t.prototype.visitTransition=function(t,e){},t.prototype.visitAnimateChild=function(t,e){var n=e.subInstructions.consume(e.element);if(n){var r=e.createSubContext(t.options),i=e.currentTimeline.currentTime,o=this._visitSubInstructions(n,r,r.options);i!=o&&e.transformIntoNewTimeline(o)}e.previousNode=t},t.prototype.visitAnimateRef=function(t,e){var n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t},t.prototype._visitSubInstructions=function(t,e,n){var r=e.currentTimeline.currentTime,i=null!=n.duration?C(n.duration):null,o=null!=n.delay?C(n.delay):null;return 0!==i&&t.forEach(function(t){var n=e.appendInstructionToTimeline(t,i,o);r=Math.max(r,n.duration+n.delay)}),r},t.prototype.visitReference=function(t,e){e.updateOptions(t.options,!0),Y(this,t.animation,e),e.previousNode=t},t.prototype.visitSequence=function(t,e){var n=this,r=e.subContextCount,i=e,o=t.options;if(o&&(o.params||o.delay)&&((i=e.createSubContext(o)).transformIntoNewTimeline(),null!=o.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=pt);var s=C(o.delay);i.delayNextStep(s)}t.steps.length&&(t.steps.forEach(function(t){return Y(n,t,i)}),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),e.previousNode=t},t.prototype.visitGroup=function(t,e){var n=this,r=[],i=e.currentTimeline.currentTime,o=t.options&&t.options.delay?C(t.options.delay):0;t.steps.forEach(function(s){var a=e.createSubContext(t.options);o&&a.delayNextStep(o),Y(n,s,a),i=Math.max(i,a.currentTimeline.currentTime),r.push(a.currentTimeline)}),r.forEach(function(t){return e.currentTimeline.mergeTimelineCollectedStyles(t)}),e.transformIntoNewTimeline(i),e.previousNode=t},t.prototype._visitTiming=function(t,e){if(t.dynamic){var n=t.strValue;return D(e.params?B(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}},t.prototype.visitAnimate=function(t,e){var n=e.currentAnimateTimings=this._visitTiming(t.timings,e),r=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),r.snapshotCurrentStyles());var i=t.style;5==i.type?this.visitKeyframes(i,e):(e.incrementTime(n.duration),this.visitStyle(i,e),r.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t},t.prototype.visitStyle=function(t,e){var n=e.currentTimeline,r=e.currentAnimateTimings;!r&&n.getCurrentStyleProperties().length&&n.forwardFrame();var i=r&&r.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(i):n.setStyles(t.styles,i,e.errors,e.options),e.previousNode=t},t.prototype.visitKeyframes=function(t,e){var n=e.currentAnimateTimings,r=e.currentTimeline.duration,i=n.duration,o=e.createSubContext().currentTimeline;o.easing=n.easing,t.styles.forEach(function(t){o.forwardTime((t.offset||0)*i),o.setStyles(t.styles,t.easing,e.errors,e.options),o.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(o),e.transformIntoNewTimeline(r+i),e.previousNode=t},t.prototype.visitQuery=function(t,e){var n=this,r=e.currentTimeline.currentTime,i=t.options||{},o=i.delay?C(i.delay):0;o&&(6===e.previousNode.type||0==r&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=pt);var s=r,a=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=a.length;var u=null;a.forEach(function(r,i){e.currentQueryIndex=i;var a=e.createSubContext(t.options,r);o&&a.delayNextStep(o),r===e.element&&(u=a.currentTimeline),Y(n,t.animation,a),a.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,a.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),u&&(e.currentTimeline.mergeTimelineCollectedStyles(u),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t},t.prototype.visitStagger=function(t,e){var n=e.parentContext,r=e.currentTimeline,i=t.timings,o=Math.abs(i.duration),s=o*(e.currentQueryTotal-1),a=o*e.currentQueryIndex;switch(i.duration<0?"reverse":i.easing){case"reverse":a=s-a;break;case"full":a=n.currentStaggerTime}var u=e.currentTimeline;a&&u.delayNextStep(a);var l=u.currentTime;Y(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=r.currentTime-l+(r.startTime-n.currentTimeline.startTime)},t}(),pt={},ft=function(){function t(t,e,n,r,i,o,s,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=i,this.errors=o,this.timelines=s,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=pt,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new yt(this._driver,e,0),s.push(this.currentTimeline)}return Object.defineProperty(t.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),t.prototype.updateOptions=function(t,e){var n=this;if(t){var r=t,i=this.options;null!=r.duration&&(i.duration=C(r.duration)),null!=r.delay&&(i.delay=C(r.delay));var o=r.params;if(o){var s=i.params;s||(s=this.options.params={}),Object.keys(o).forEach(function(t){e&&s.hasOwnProperty(t)||(s[t]=B(o[t],s,n.errors))})}}},t.prototype._copyOptions=function(){var t={};if(this.options){var e=this.options.params;if(e){var n=t.params={};Object.keys(e).forEach(function(t){n[t]=e[t]})}}return t},t.prototype.createSubContext=function(e,n,r){void 0===e&&(e=null);var i=n||this.element,o=new t(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(e),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o},t.prototype.transformIntoNewTimeline=function(t){return this.previousNode=pt,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline},t.prototype.appendInstructionToTimeline=function(t,e,n){var r={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},i=new mt(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,r,t.stretchStartingKeyframe);return this.timelines.push(i),r},t.prototype.incrementTime=function(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)},t.prototype.delayNextStep=function(t){t>0&&this.currentTimeline.delayNextStep(t)},t.prototype.invokeQuery=function(t,e,n,r,i,o){var s=[];if(r&&s.push(this.element),t.length>0){t=(t=t.replace(ut,"."+this._enterClassName)).replace(lt,"."+this._leaveClassName);var u=this._driver.query(this.element,t,1!=n);0!==n&&(u=n<0?u.slice(u.length+n,u.length):u.slice(0,n)),s.push.apply(s,a(u))}return i||0!=s.length||o.push('`query("'+e+'")` returned zero elements. (Use `query("'+e+'", { optional: true })` if you wish to allow this.)'),s},t}(),yt=function(){function t(t,e,n,r){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}return t.prototype.containsAnimation=function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}},t.prototype.getCurrentStyleProperties=function(){return Object.keys(this._currentKeyframe)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.startTime+this.duration},enumerable:!0,configurable:!0}),t.prototype.delayNextStep=function(t){var e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t},t.prototype.fork=function(e,n){return this.applyStylesToKeyframe(),new t(this._driver,e,n||this.currentTime,this._elementTimelineStylesLookup)},t.prototype._loadKeyframe=function(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))},t.prototype.forwardFrame=function(){this.duration+=1,this._loadKeyframe()},t.prototype.forwardTime=function(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()},t.prototype._updateStyle=function(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}},t.prototype.allowOnlyTimelineStyles=function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe},t.prototype.applyEmptyStep=function(t){var n=this;t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(function(t){n._backFill[t]=n._globalTimelineStyles[t]||e.AUTO_STYLE,n._currentKeyframe[t]=e.AUTO_STYLE}),this._currentEmptyStepKeyframe=this._currentKeyframe},t.prototype.setStyles=function(t,n,r,i){var o=this;n&&(this._previousKeyframe.easing=n);var s=i&&i.params||{},a=function u(t,n){var r,i={};return t.forEach(function(t){"*"===t?(r=r||Object.keys(n)).forEach(function(t){i[t]=e.AUTO_STYLE}):x(t,!1,i)}),i}(t,this._globalTimelineStyles);Object.keys(a).forEach(function(t){var n=B(a[t],s,r);o._pendingStyles[t]=n,o._localTimelineStyles.hasOwnProperty(t)||(o._backFill[t]=o._globalTimelineStyles.hasOwnProperty(t)?o._globalTimelineStyles[t]:e.AUTO_STYLE),o._updateStyle(t,n)})},t.prototype.applyStylesToKeyframe=function(){var t=this,e=this._pendingStyles,n=Object.keys(e);0!=n.length&&(this._pendingStyles={},n.forEach(function(n){t._currentKeyframe[n]=e[n]}),Object.keys(this._localTimelineStyles).forEach(function(e){t._currentKeyframe.hasOwnProperty(e)||(t._currentKeyframe[e]=t._localTimelineStyles[e])}))},t.prototype.snapshotCurrentStyles=function(){var t=this;Object.keys(this._localTimelineStyles).forEach(function(e){var n=t._localTimelineStyles[e];t._pendingStyles[e]=n,t._updateStyle(e,n)})},t.prototype.getFinalKeyframe=function(){return this._keyframes.get(this.duration)},Object.defineProperty(t.prototype,"properties",{get:function(){var t=[];for(var e in this._currentKeyframe)t.push(e);return t},enumerable:!0,configurable:!0}),t.prototype.mergeTimelineCollectedStyles=function(t){var e=this;Object.keys(t._styleSummary).forEach(function(n){var r=e._styleSummary[n],i=t._styleSummary[n];(!r||i.time>r.time)&&e._updateStyle(n,i.value)})},t.prototype.buildKeyframes=function(){var t=this;this.applyStylesToKeyframe();var n=new Set,r=new Set,i=1===this._keyframes.size&&0===this.duration,o=[];this._keyframes.forEach(function(s,a){var u=x(s,!0);Object.keys(u).forEach(function(t){var i=u[t];i==e.ɵPRE_STYLE?n.add(t):i==e.AUTO_STYLE&&r.add(t)}),i||(u.offset=a/t.duration),o.push(u)});var s=n.size?M(n.values()):[],a=r.size?M(r.values()):[];if(i){var u=o[0],l=I(u);u.offset=0,l.offset=1,o=[u,l]}return st(this.element,o,s,a,this.duration,this.startTime,this.easing,!1)},t}(),mt=function(t){function e(e,n,r,i,o,s,a){void 0===a&&(a=!1);var u=t.call(this,e,n,s.delay)||this;return u.element=n,u.keyframes=r,u.preStyleProps=i,u.postStyleProps=o,u._stretchStartingKeyframe=a,u.timings={duration:s.duration,delay:s.delay,easing:s.easing},u}return i(e,t),e.prototype.containsAnimation=function(){return this.keyframes.length>1},e.prototype.buildKeyframes=function(){var t=this.keyframes,e=this.timings,n=e.delay,r=e.duration,i=e.easing;if(this._stretchStartingKeyframe&&n){var o=[],s=r+n,a=n/s,u=x(t[0],!1);u.offset=0,o.push(u);var l=x(t[0],!1);l.offset=dt(a),o.push(l);for(var c=t.length-1,h=1;h<=c;h++){var p=x(t[h],!1);p.offset=dt((n+p.offset*r)/s),o.push(p)}r=s,n=0,i="",t=o}return st(this.element,t,this.preStyleProps,this.postStyleProps,r,n,i,!0)},e}(yt);function dt(t,e){void 0===e&&(e=3);var n=Math.pow(10,e-1);return Math.round(t*n)/n}var vt=function(){function t(t,e){this._driver=t;var n=[],r=tt(t,e,n);if(n.length){var i="animation validation failed:\n"+n.join("\n");throw new Error(i)}this._animationAst=r}return t.prototype.buildTimelines=function(t,e,n,r,i){var o=Array.isArray(e)?L(e):e,s=Array.isArray(n)?L(n):n,a=[];i=i||new at;var u=ct(this._driver,t,this._animationAst,"ng-enter","ng-leave",o,s,r,i,a);if(a.length){var l="animation building failed:\n"+a.join("\n");throw new Error(l)}return u},t}(),gt=function gt(){},_t=function(){function t(){}return t.prototype.normalizePropertyName=function(t,e){return t},t.prototype.normalizeStyleValue=function(t,e,n,r){return n},t}(),Et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.normalizePropertyName=function(t,e){return U(t)},e.prototype.normalizeStyleValue=function(t,e,n,r){var i="",o=n.toString().trim();if(St[e]&&0!==n&&"0"!==n)if("number"==typeof n)i="px";else{var s=n.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&0==s[1].length&&r.push("Please provide a CSS unit value for "+t+":"+n)}return o+i},e}(gt),St=function bt(t){var e={};return t.forEach(function(t){return e[t]=!0}),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(","));
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright Google Inc. All Rights Reserved.
|
|
17
17
|
*
|
|
18
18
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19
19
|
* found in the LICENSE file at https://angular.io/license
|
|
20
|
-
*/function Ae(e,t,n,r,i,o,s,a,u,l,h,c,p){return{type:0,element:e,triggerName:t,isRemovalTransition:i,fromState:n,fromStyles:o,toState:r,toStyles:s,timelines:a,queriedElements:u,preStyleProps:l,postStyleProps:h,totalTime:c,errors:p}}var Ne={},Ce=function(){function e(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}return e.prototype.match=function(e,t,n,r){return function i(e,t,n,r,o){return e.some(function(e){return e(t,n,r,o)})}(this.ast.matchers,e,t,n,r)},e.prototype.buildStyles=function(e,t,n){var r=this._stateStyles["*"],i=this._stateStyles[e],o=r?r.buildStyles(t,n):{};return i?i.buildStyles(t,n):o},e.prototype.build=function(e,t,n,i,o,s,a,u,h){var c=[],p=this.ast.options&&this.ast.options.params||Ne,f=this.buildStyles(n,a&&a.params||Ne,c),y=u&&u.params||Ne,m=this.buildStyles(i,y,c),d=new Set,v=new Map,g=new Map,_="void"===i,E={params:r.__assign({},p,y)},S=fe(e,t,this.ast.animation,o,s,f,m,E,h,c),b=0;if(S.forEach(function(e){b=Math.max(e.duration+e.delay,b)}),c.length)return Ae(t,this._triggerName,n,i,_,f,m,[],[],v,g,b,c);S.forEach(function(e){var n=e.element,r=l(v,n,{});e.preStyleProps.forEach(function(e){return r[e]=!0});var i=l(g,n,{});e.postStyleProps.forEach(function(e){return i[e]=!0}),n!==t&&d.add(n)});var T=U(d.values());return Ae(t,this._triggerName,n,i,_,f,m,S,T,v,g,b)},e}(),Fe=function(){function e(e,t){this.styles=e,this.defaultParams=t}return e.prototype.buildStyles=function(e,t){var n={},r=x(this.defaultParams);return Object.keys(e).forEach(function(t){var n=e[t];null!=n&&(r[t]=n)}),this.styles.styles.forEach(function(e){if("string"!=typeof e){var i=e;Object.keys(i).forEach(function(e){var o=i[e];o.length>1&&(o=z(o,r,t)),n[e]=o})}}),n},e}(),Oe=function(){function e(e,t){var n=this;this.name=e,this.ast=t,this.transitionFactories=[],this.states={},t.states.forEach(function(e){n.states[e.name]=new Fe(e.style,e.options&&e.options.params||{})}),De(this.states,"true","1"),De(this.states,"false","0"),t.transitions.forEach(function(t){n.transitionFactories.push(new Ce(e,t,n.states))}),this.fallbackTransition=function r(e,t){return new Ce(e,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(e,t){return!0}],options:null,queryCount:0,depCount:0},t)}(e,this.states)}return Object.defineProperty(e.prototype,"containsQueries",{get:function(){return this.ast.queryCount>0},enumerable:!0,configurable:!0}),e.prototype.matchTransition=function(e,t,n,r){return this.transitionFactories.find(function(i){return i.match(e,t,n,r)})||null},e.prototype.matchStyles=function(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)},e}();function De(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}var Ie=new he,Le=function(){function e(e,t){this._driver=e,this._normalizer=t,this._animations={},this._playersById={},this.players=[]}return e.prototype.register=function(e,t){var n=[],r=ne(this._driver,t,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[e]=r},e.prototype._buildPlayer=function(e,t,n){var r=e.element,i=o(0,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(r,i,e.duration,e.delay,e.easing,[],!0)},e.prototype.create=function(e,n,r){var o=this;void 0===r&&(r={});var s,a=[],u=this._animations[e],h=new Map;if(u?(s=fe(this._driver,n,u,k,A,{},{},r,Ie,a)).forEach(function(e){var t=l(h,e.element,{});e.postStyleProps.forEach(function(e){return t[e]=null})}):(a.push("The requested animation doesn't exist or has already been destroyed"),s=[]),a.length)throw new Error("Unable to create the animation due to the following errors: "+a.join("\n"));h.forEach(function(e,n){Object.keys(e).forEach(function(r){e[r]=o._driver.computeStyle(n,r,t.AUTO_STYLE)})});var c=i(s.map(function(e){var t=h.get(e.element);return o._buildPlayer(e,{},t)}));return this._playersById[e]=c,c.onDestroy(function(){return o.destroy(e)}),this.players.push(c),c},e.prototype.destroy=function(e){var t=this._getPlayer(e);t.destroy(),delete this._playersById[e];var n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)},e.prototype._getPlayer=function(e){var t=this._playersById[e];if(!t)throw new Error("Unable to find the timeline player referenced by "+e);return t},e.prototype.listen=function(e,t,n,r){var i=u(t,"","","");return s(this._getPlayer(e),n,i,r),function(){}},e.prototype.command=function(e,t,n,r){if("register"!=n)if("create"!=n){var i=this._getPlayer(e);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}else this.create(e,t,r[0]||{});else this.register(e,r[0])},e}(),xe="ng-animate-queued",qe="ng-animate-disabled",Re=".ng-animate-disabled",je=[],Ke={namespaceId:"",setForRemoval:null,hasAnimation:!1,removedBeforeQueried:!1},Qe={namespaceId:"",setForRemoval:null,hasAnimation:!1,removedBeforeQueried:!0},Be="__ng_removed",Me=function(){function e(e,t){void 0===t&&(t=""),this.namespaceId=t;var n=e&&e.hasOwnProperty("value");if(this.value=function r(e){return null!=e?e:null}(n?e.value:e),n){var i=x(e);delete i.value,this.options=i}else this.options={};this.options.params||(this.options.params={})}return Object.defineProperty(e.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),e.prototype.absorbOptions=function(e){var t=e.params;if(t){var n=this.options.params;Object.keys(t).forEach(function(e){null==n[e]&&(n[e]=t[e])})}},e}(),ze="void",Ue=new Me(ze),We=new Me("DELETED"),He=function(){function e(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,et(t,this._hostClassName)}return e.prototype.listen=function(e,t,n,r){var i=this;if(!this._triggers.hasOwnProperty(t))throw new Error('Unable to listen on the animation trigger event "'+n+'" because the animation trigger "'+t+"\" doesn't exist!");if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'+t+'" because the provided event is undefined!');if(!function o(e){return"start"==e||"done"==e}(n))throw new Error('The provided animation trigger event "'+n+'" for the animation trigger "'+t+'" is not supported!');var s=l(this._elementListeners,e,[]),a={name:t,phase:n,callback:r};s.push(a);var u=l(this._engine.statesByElement,e,{});return u.hasOwnProperty(t)||(et(e,N),et(e,N+"-"+t),u[t]=Ue),function(){i._engine.afterFlush(function(){var e=s.indexOf(a);e>=0&&s.splice(e,1),i._triggers[t]||delete u[t]})}},e.prototype.register=function(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)},e.prototype._getTrigger=function(e){var t=this._triggers[e];if(!t)throw new Error('The provided animation trigger "'+e+'" has not been registered!');return t},e.prototype.trigger=function(e,t,n,r){var i=this;void 0===r&&(r=!0);var o=this._getTrigger(t),s=new $e(this.id,t,e),a=this._engine.statesByElement.get(e);a||(et(e,N),et(e,N+"-"+t),this._engine.statesByElement.set(e,a={}));var u=a[t],h=new Me(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&h.absorbOptions(u.options),a[t]=h,u){if(u===We)return s}else u=Ue;if(h.value===ze||u.value!==h.value){var c=l(this._engine.playersByElement,e,[]);c.forEach(function(e){e.namespaceId==i.id&&e.triggerName==t&&e.queued&&e.destroy()});var p=o.matchTransition(u.value,h.value,e,h.params),f=!1;if(!p){if(!r)return;p=o.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:p,fromState:u,toState:h,player:s,isFallbackTransition:f}),f||(et(e,xe),s.onStart(function(){tt(e,xe)})),s.onDone(function(){var t=i.players.indexOf(s);t>=0&&i.players.splice(t,1);var n=i._engine.playersByElement.get(e);if(n){var r=n.indexOf(s);r>=0&&n.splice(r,1)}}),this.players.push(s),c.push(s),s}if(!function y(e,t){var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i];if(!t.hasOwnProperty(o)||e[o]!==t[o])return!1}return!0}(u.params,h.params)){var m=[],d=o.matchStyles(u.value,u.params,m),v=o.matchStyles(h.value,h.params,m);m.length?this._engine.reportError(m):this._engine.afterFlush(function(){K(e,d),j(e,v)})}},e.prototype.deregister=function(e){var t=this;delete this._triggers[e],this._engine.statesByElement.forEach(function(t,n){delete t[e]}),this._elementListeners.forEach(function(n,r){t._elementListeners.set(r,n.filter(function(t){return t.name!=e}))})},e.prototype.clearElementCache=function(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);var t=this._engine.playersByElement.get(e);t&&(t.forEach(function(e){return e.destroy()}),this._engine.playersByElement.delete(e))},e.prototype._signalRemovalForInnerTriggers=function(e,t,n){var r=this;void 0===n&&(n=!1),this._engine.driver.query(e,C,!0).forEach(function(e){if(!e[Be]){var n=r._engine.fetchNamespacesByElement(e);n.size?n.forEach(function(n){return n.triggerLeaveAnimation(e,t,!1,!0)}):r.clearElementCache(e)}})},e.prototype.triggerLeaveAnimation=function(e,t,n,r){var o=this,s=this._engine.statesByElement.get(e);if(s){var a=[];if(Object.keys(s).forEach(function(t){if(o._triggers[t]){var n=o.trigger(e,t,ze,r);n&&a.push(n)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),n&&i(a).onDone(function(){return o._engine.processLeaveNode(e)}),!0}return!1},e.prototype.prepareLeaveAnimationListeners=function(e){var t=this,n=this._elementListeners.get(e);if(n){var r=new Set;n.forEach(function(n){var i=n.name;if(!r.has(i)){r.add(i);var o=t._triggers[i].fallbackTransition,s=t._engine.statesByElement.get(e)[i]||Ue,a=new Me(ze),u=new $e(t.id,i,e);t._engine.totalQueuedPlayers++,t._queue.push({element:e,triggerName:i,transition:o,fromState:s,toState:a,player:u,isFallbackTransition:!0})}})}},e.prototype.removeNode=function(e,t){var n=this,r=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t,!0),!this.triggerLeaveAnimation(e,t,!0)){var i=!1;if(r.totalAnimations){var o=r.players.length?r.playersByQueriedElement.get(e):[];if(o&&o.length)i=!0;else for(var s=e;s=s.parentNode;)if(r.statesByElement.get(s)){i=!0;break}}this.prepareLeaveAnimationListeners(e),i?r.markElementAsRemoved(this.id,e,!1,t):(r.afterFlush(function(){return n.clearElementCache(e)}),r.destroyInnerAnimations(e),r._onRemovalComplete(e,t))}},e.prototype.insertNode=function(e,t){et(e,this._hostClassName)},e.prototype.drainQueuedTransitions=function(e){var t=this,n=[];return this._queue.forEach(function(r){var i=r.player;if(!i.destroyed){var o=r.element,a=t._elementListeners.get(o);a&&a.forEach(function(t){if(t.name==r.triggerName){var n=u(o,r.triggerName,r.fromState.value,r.toState.value);n._data=e,s(r.player,t.phase,n,t.callback)}}),i.markedForDestroy?t._engine.afterFlush(function(){i.destroy()}):n.push(r)}}),this._queue=[],n.sort(function(e,n){var r=e.transition.ast.depCount,i=n.transition.ast.depCount;return 0==r||0==i?r-i:t._engine.driver.containsElement(e.element,n.element)?1:-1})},e.prototype.destroy=function(e){this.players.forEach(function(e){return e.destroy()}),this._signalRemovalForInnerTriggers(this.hostElement,e)},e.prototype.elementContainsData=function(e){var t=!1;return this._elementListeners.has(e)&&(t=!0),!!this._queue.find(function(t){return t.element===e})||t},e}(),Ye=function(){function e(e,t){this.driver=e,this._normalizer=t,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=function(e,t){}}return e.prototype._onRemovalComplete=function(e,t){this.onRemovalComplete(e,t)},Object.defineProperty(e.prototype,"queuedPlayers",{get:function(){var e=[];return this._namespaceList.forEach(function(t){t.players.forEach(function(t){t.queued&&e.push(t)})}),e},enumerable:!0,configurable:!0}),e.prototype.createNamespace=function(e,t){var n=new He(e,t,this);return t.parentNode?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n},e.prototype._balanceNamespaceList=function(e,t){var n=this._namespaceList.length-1;if(n>=0){for(var r=!1,i=n;i>=0;i--)if(this.driver.containsElement(this._namespaceList[i].hostElement,t)){this._namespaceList.splice(i+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e},e.prototype.register=function(e,t){var n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n},e.prototype.registerTrigger=function(e,t,n){var r=this._namespaceLookup[e];r&&r.register(t,n)&&this.totalAnimations++},e.prototype.destroy=function(e,t){var n=this;if(e){var r=this._fetchNamespace(e);this.afterFlush(function(){n.namespacesByHostElement.delete(r.hostElement),delete n._namespaceLookup[e];var t=n._namespaceList.indexOf(r);t>=0&&n._namespaceList.splice(t,1)}),this.afterFlushAnimationsDone(function(){return r.destroy(t)})}},e.prototype._fetchNamespace=function(e){return this._namespaceLookup[e]},e.prototype.fetchNamespacesByElement=function(e){var t=new Set,n=this.statesByElement.get(e);if(n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=n[r[i]].namespaceId;if(o){var s=this._fetchNamespace(o);s&&t.add(s)}}return t},e.prototype.trigger=function(e,t,n,r){return!!Ge(t)&&(this._fetchNamespace(e).trigger(t,n,r),!0)},e.prototype.insertNode=function(e,t,n,r){if(Ge(t)){var i=t[Be];if(i&&i.setForRemoval&&(i.setForRemoval=!1),e){var o=this._fetchNamespace(e);o&&o.insertNode(t,n)}r&&this.collectEnterElement(t)}},e.prototype.collectEnterElement=function(e){this.collectedEnterElements.push(e)},e.prototype.markElementAsDisabled=function(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),et(e,qe)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),tt(e,qe))},e.prototype.removeNode=function(e,t,n){if(Ge(t)){var r=e?this._fetchNamespace(e):null;r?r.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n)}else this._onRemovalComplete(t,n)},e.prototype.markElementAsRemoved=function(e,t,n,r){this.collectedLeaveElements.push(t),t[Be]={namespaceId:e,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1}},e.prototype.listen=function(e,t,n,r,i){return Ge(t)?this._fetchNamespace(e).listen(t,n,r,i):function(){}},e.prototype._buildInstruction=function(e,t,n,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,r,e.fromState.options,e.toState.options,t)},e.prototype.destroyInnerAnimations=function(e){var t=this,n=this.driver.query(e,C,!0);n.forEach(function(e){return t.destroyActiveAnimationsForElement(e)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(e,O,!0)).forEach(function(e){return t.finishActiveQueriedAnimationOnElement(e)})},e.prototype.destroyActiveAnimationsForElement=function(e){var t=this.playersByElement.get(e);t&&t.forEach(function(e){e.queued?e.markedForDestroy=!0:e.destroy()});var n=this.statesByElement.get(e);n&&Object.keys(n).forEach(function(e){return n[e]=We})},e.prototype.finishActiveQueriedAnimationOnElement=function(e){var t=this.playersByQueriedElement.get(e);t&&t.forEach(function(e){return e.finish()})},e.prototype.whenRenderingDone=function(){var e=this;return new Promise(function(t){if(e.players.length)return i(e.players).onDone(function(){return t()});t()})},e.prototype.processLeaveNode=function(e){var t=this,n=e[Be];if(n&&n.setForRemoval){if(e[Be]=Ke,n.namespaceId){this.destroyInnerAnimations(e);var r=this._fetchNamespace(n.namespaceId);r&&r.clearElementCache(e)}this._onRemovalComplete(e,n.setForRemoval)}this.driver.matchesElement(e,Re)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Re,!0).forEach(function(n){t.markElementAsDisabled(e,!1)})},e.prototype.flush=function(e){var t=this;void 0===e&&(e=-1);var n=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(e,n){return t._balanceNamespaceList(e,n)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var r=0;r<this.collectedEnterElements.length;r++)et(this.collectedEnterElements[r],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){var o=[];try{n=this._flushAnimations(o,e)}finally{for(r=0;r<o.length;r++)o[r]()}}else for(r=0;r<this.collectedLeaveElements.length;r++)this.processLeaveNode(this.collectedLeaveElements[r]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(function(e){return e()}),this._flushFns=[],this._whenQuietFns.length){var s=this._whenQuietFns;this._whenQuietFns=[],n.length?i(n).onDone(function(){s.forEach(function(e){return e()})}):s.forEach(function(e){return e()})}},e.prototype.reportError=function(e){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+e.join("\n"))},e.prototype._flushAnimations=function(e,n){var o=this,s=new he,a=[],u=new Map,h=[],c=new Map,p=new Map,f=new Map,y=new Set;this.disabledNodes.forEach(function(e){y.add(e);for(var t=o.driver.query(e,".ng-animate-queued",!0),n=0;n<t.length;n++)y.add(t[n])});var m=_(),d=Array.from(this.statesByElement.keys()),v=Je(d,this.collectedEnterElements),g=new Map,E=0;v.forEach(function(e,t){var n=k+E++;g.set(t,n),e.forEach(function(e){return et(e,n)})});for(var S=[],b=new Set,T=new Set,w=0;w<this.collectedLeaveElements.length;w++)(H=(W=this.collectedLeaveElements[w])[Be])&&H.setForRemoval&&(S.push(W),b.add(W),H.hasAnimation?this.driver.query(W,".ng-star-inserted",!0).forEach(function(e){return b.add(e)}):T.add(W));var P=new Map,N=Je(d,Array.from(b));N.forEach(function(e,t){var n=A+E++;P.set(t,n),e.forEach(function(e){return et(e,n)})}),e.push(function(){v.forEach(function(e,t){var n=g.get(t);e.forEach(function(e){return tt(e,n)})}),N.forEach(function(e,t){var n=P.get(t);e.forEach(function(e){return tt(e,n)})}),S.forEach(function(e){o.processLeaveNode(e)})});for(var C=[],F=[],D=this._namespaceList.length-1;D>=0;D--)this._namespaceList[D].drainQueuedTransitions(n).forEach(function(e){var t=e.player;C.push(t);var n=e.element;if(m&&o.driver.containsElement(m,n)){var r=P.get(n),i=g.get(n),u=o._buildInstruction(e,s,i,r);if(u.errors&&u.errors.length)F.push(u);else{if(e.isFallbackTransition)return t.onStart(function(){return K(n,u.fromStyles)}),t.onDestroy(function(){return j(n,u.toStyles)}),void a.push(t);u.timelines.forEach(function(e){return e.stretchStartingKeyframe=!0}),s.append(n,u.timelines),h.push({instruction:u,player:t,element:n}),u.queriedElements.forEach(function(e){return l(c,e,[]).push(t)}),u.preStyleProps.forEach(function(e,t){var n=Object.keys(e);if(n.length){var r=p.get(t);r||p.set(t,r=new Set),n.forEach(function(e){return r.add(e)})}}),u.postStyleProps.forEach(function(e,t){var n=Object.keys(e),r=f.get(t);r||f.set(t,r=new Set),n.forEach(function(e){return r.add(e)})})}}else t.destroy()});if(F.length){var I=[];F.forEach(function(e){I.push("@"+e.triggerName+" has failed due to:\n"),e.errors.forEach(function(e){return I.push("- "+e+"\n")})}),C.forEach(function(e){return e.destroy()}),this.reportError(I)}var L=new Map,x=new Map;h.forEach(function(e){var t=e.element;s.has(t)&&(x.set(t,t),o._beforeAnimationBuild(e.player.namespaceId,e.instruction,L))}),a.forEach(function(e){var t=e.element;o._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(function(e){l(L,t,[]).push(e),e.destroy()})});var q=S.filter(function(e){return rt(e,p,f)}),R=new Map;Ze(R,this.driver,T,f,t.AUTO_STYLE).forEach(function(e){rt(e,p,f)&&q.push(e)});var Q=new Map;v.forEach(function(e,n){Ze(Q,o.driver,new Set(e),p,t.ɵPRE_STYLE)}),q.forEach(function(e){var t=R.get(e),n=Q.get(e);R.set(e,r.__assign({},t,n))});var B=[],M=[],z={};h.forEach(function(e){var t=e.element,n=e.player,r=e.instruction;if(s.has(t)){if(y.has(t))return n.onDestroy(function(){return j(t,r.toStyles)}),n.disabled=!0,n.overrideTotalTime(r.totalTime),void a.push(n);var l=z;if(x.size>1){for(var h=t,c=[];h=h.parentNode;){var p=x.get(h);if(p){l=p;break}c.push(h)}c.forEach(function(e){return x.set(e,l)})}var f=o._buildAnimation(n.namespaceId,r,L,u,Q,R);if(n.setRealPlayer(f),l===z)B.push(n);else{var m=o.playersByElement.get(l);m&&m.length&&(n.parentPlayer=i(m)),a.push(n)}}else K(t,r.fromStyles),n.onDestroy(function(){return j(t,r.toStyles)}),M.push(n),y.has(t)&&a.push(n)}),M.forEach(function(e){var t=u.get(e.element);if(t&&t.length){var n=i(t);e.setRealPlayer(n)}}),a.forEach(function(e){e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()});for(var U=0;U<S.length;U++){var W,H=(W=S[U])[Be];if(tt(W,A),!H||!H.hasAnimation){var Y=[];if(c.size){var $=c.get(W);$&&$.length&&Y.push.apply(Y,r.__spread($));for(var G=this.driver.query(W,O,!0),V=0;V<G.length;V++){var Z=c.get(G[V]);Z&&Z.length&&Y.push.apply(Y,r.__spread(Z))}}var J=Y.filter(function(e){return!e.destroyed});J.length?nt(this,W,J):this.processLeaveNode(W)}}return S.length=0,B.forEach(function(e){o.players.push(e),e.onDone(function(){e.destroy();var t=o.players.indexOf(e);o.players.splice(t,1)}),e.play()}),B},e.prototype.elementContainsData=function(e,t){var n=!1,r=t[Be];return r&&r.setForRemoval&&(n=!0),this.playersByElement.has(t)&&(n=!0),this.playersByQueriedElement.has(t)&&(n=!0),this.statesByElement.has(t)&&(n=!0),this._fetchNamespace(e).elementContainsData(t)||n},e.prototype.afterFlush=function(e){this._flushFns.push(e)},e.prototype.afterFlushAnimationsDone=function(e){this._whenQuietFns.push(e)},e.prototype._getPreviousPlayers=function(e,t,n,r,i){var o=[];if(t){var s=this.playersByQueriedElement.get(e);s&&(o=s)}else{var a=this.playersByElement.get(e);if(a){var u=!i||i==ze;a.forEach(function(e){e.queued||(u||e.triggerName==r)&&o.push(e)})}}return(n||r)&&(o=o.filter(function(e){return!(n&&n!=e.namespaceId||r&&r!=e.triggerName)})),o},e.prototype._beforeAnimationBuild=function(e,t,n){var i,o,s=t.element,a=t.isRemovalTransition?void 0:e,u=t.isRemovalTransition?void 0:t.triggerName,h=function(e){var r=e.element,i=r!==s,o=l(n,r,[]);c._getPreviousPlayers(r,i,a,u,t.toState).forEach(function(e){var t=e.getRealPlayer();t.beforeDestroy&&t.beforeDestroy(),e.destroy(),o.push(e)})},c=this;try{for(var p=r.__values(t.timelines),f=p.next();!f.done;f=p.next())h(f.value)}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}K(s,t.fromStyles)},e.prototype._buildAnimation=function(e,n,r,s,a,u){var h=this,c=n.triggerName,p=n.element,f=[],y=new Set,m=new Set,d=n.timelines.map(function(n){var i=n.element;y.add(i);var l=i[Be];if(l&&l.removedBeforeQueried)return new t.NoopAnimationPlayer(n.duration,n.delay);var d=i!==p,v=function g(e){var n=[];return function e(n,r){for(var i=0;i<n.length;i++){var o=n[i];o instanceof t.ɵAnimationGroupPlayer?e(o.players,r):r.push(o)}}(e,n),n}((r.get(i)||je).map(function(e){return e.getRealPlayer()})).filter(function(e){return!!e.element&&e.element===i}),_=a.get(i),E=u.get(i),S=o(0,h._normalizer,0,n.keyframes,_,E),b=h._buildPlayer(n,S,v);if(n.subTimeline&&s&&m.add(i),d){var T=new $e(e,c,i);T.setRealPlayer(b),f.push(T)}return b});f.forEach(function(e){l(h.playersByQueriedElement,e.element,[]).push(e),e.onDone(function(){return function t(e,n,r){var i;if(e instanceof Map){if(i=e.get(n)){if(i.length){var o=i.indexOf(r);i.splice(o,1)}0==i.length&&e.delete(n)}}else(i=e[n])&&(i.length&&(o=i.indexOf(r),i.splice(o,1)),0==i.length&&delete e[n]);return i}(h.playersByQueriedElement,e.element,e)})}),y.forEach(function(e){return et(e,F)});var v=i(d);return v.onDestroy(function(){y.forEach(function(e){return tt(e,F)}),j(p,n.toStyles)}),m.forEach(function(e){l(s,e,[]).push(v)}),v},e.prototype._buildPlayer=function(e,n,r){return n.length>0?this.driver.animate(e.element,n,e.duration,e.delay,e.easing,r):new t.NoopAnimationPlayer(e.duration,e.delay)},e}(),$e=function(){function e(e,n,r){this.namespaceId=e,this.triggerName=n,this.element=r,this._player=new t.NoopAnimationPlayer,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return e.prototype.setRealPlayer=function(e){var t=this;this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(function(n){t._queuedCallbacks[n].forEach(function(t){return s(e,n,void 0,t)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)},e.prototype.getRealPlayer=function(){return this._player},e.prototype.overrideTotalTime=function(e){this.totalTime=e},e.prototype.syncPlayerEvents=function(e){var t=this,n=this._player;n.triggerCallback&&e.onStart(function(){return n.triggerCallback("start")}),e.onDone(function(){return t.finish()}),e.onDestroy(function(){return t.destroy()})},e.prototype._queueEvent=function(e,t){l(this._queuedCallbacks,e,[]).push(t)},e.prototype.onDone=function(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)},e.prototype.onStart=function(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)},e.prototype.onDestroy=function(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)},e.prototype.init=function(){this._player.init()},e.prototype.hasStarted=function(){return!this.queued&&this._player.hasStarted()},e.prototype.play=function(){!this.queued&&this._player.play()},e.prototype.pause=function(){!this.queued&&this._player.pause()},e.prototype.restart=function(){!this.queued&&this._player.restart()},e.prototype.finish=function(){this._player.finish()},e.prototype.destroy=function(){this.destroyed=!0,this._player.destroy()},e.prototype.reset=function(){!this.queued&&this._player.reset()},e.prototype.setPosition=function(e){this.queued||this._player.setPosition(e)},e.prototype.getPosition=function(){return this.queued?0:this._player.getPosition()},e.prototype.triggerCallback=function(e){var t=this._player;t.triggerCallback&&t.triggerCallback(e)},e}();function Ge(e){return e&&1===e.nodeType}function Ve(e,t){var n=e.style.display;return e.style.display=null!=t?t:"none",n}function Ze(e,t,n,r,i){var o=[];n.forEach(function(e){return o.push(Ve(e))});var s=[];r.forEach(function(n,r){var o={};n.forEach(function(e){var n=o[e]=t.computeStyle(r,e,i);n&&0!=n.length||(r[Be]=Qe,s.push(r))}),e.set(r,o)});var a=0;return n.forEach(function(e){return Ve(e,o[a++])}),s}function Je(e,t){var n=new Map;if(e.forEach(function(e){return n.set(e,[])}),0==t.length)return n;var r=new Set(t),i=new Map;return t.forEach(function(e){var t=function e(t){if(!t)return 1;var o=i.get(t);if(o)return o;var s=t.parentNode;return o=n.has(s)?s:r.has(s)?1:e(s),i.set(t,o),o}(e);1!==t&&n.get(t).push(e)}),n}var Xe="$$classes";function et(e,t){if(e.classList)e.classList.add(t);else{var n=e[Xe];n||(n=e[Xe]={}),n[t]=!0}}function tt(e,t){if(e.classList)e.classList.remove(t);else{var n=e[Xe];n&&delete n[t]}}function nt(e,t,n){i(n).onDone(function(){return e.processLeaveNode(t)})}function rt(e,t,n){var r=n.get(e);if(!r)return!1;var i=t.get(e);return i?r.forEach(function(e){return i.add(e)}):t.set(e,r),n.delete(e),!0}var it=function(){function e(e,t){var n=this;this._driver=e,this._triggerCache={},this.onRemovalComplete=function(e,t){},this._transitionEngine=new Ye(e,t),this._timelineEngine=new Le(e,t),this._transitionEngine.onRemovalComplete=function(e,t){return n.onRemovalComplete(e,t)}}return e.prototype.registerTrigger=function(e,t,n,r,i){var o=e+"-"+r,s=this._triggerCache[o];if(!s){var a=[],u=ne(this._driver,i,a);if(a.length)throw new Error('The animation trigger "'+r+'" has failed to build due to the following errors:\n - '+a.join("\n - "));s=function l(e,t){return new Oe(e,t)}(r,u),this._triggerCache[o]=s}this._transitionEngine.registerTrigger(t,r,s)},e.prototype.register=function(e,t){this._transitionEngine.register(e,t)},e.prototype.destroy=function(e,t){this._transitionEngine.destroy(e,t)},e.prototype.onInsert=function(e,t,n,r){this._transitionEngine.insertNode(e,t,n,r)},e.prototype.onRemove=function(e,t,n){this._transitionEngine.removeNode(e,t,n)},e.prototype.disableAnimations=function(e,t){this._transitionEngine.markElementAsDisabled(e,t)},e.prototype.process=function(e,t,n,i){if("@"==n.charAt(0)){var o=r.__read(h(n),2);this._timelineEngine.command(o[0],t,o[1],i)}else this._transitionEngine.trigger(e,t,n,i)},e.prototype.listen=function(e,t,n,i,o){if("@"==n.charAt(0)){var s=r.__read(h(n),2);return this._timelineEngine.listen(s[0],t,s[1],o)}return this._transitionEngine.listen(e,t,n,i,o)},e.prototype.flush=function(e){void 0===e&&(e=-1),this._transitionEngine.flush(e)},Object.defineProperty(e.prototype,"players",{get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)},enumerable:!0,configurable:!0}),e.prototype.whenRenderingDone=function(){return this._transitionEngine.whenRenderingDone()},e}(),ot="animation",st="animationend",at=function(){function e(e,t,n,r,i,o,s){var a=this;this._element=e,this._name=t,this._duration=n,this._delay=r,this._easing=i,this._fillMode=o,this._onDoneFn=s,this._finished=!1,this._destroyed=!1,this._startTime=0,this._position=0,this._eventFn=function(e){return a._handleCallback(e)}}return e.prototype.apply=function(){!function e(t,n){var r=ft(t,"").trim();r.length&&(function i(e,t){for(var n=0,r=0;r<e.length;r++)e.charAt(r)===t&&n++;return n}(r,",")+1,n=r+", "+n),pt(t,"",n)}(this._element,this._duration+"ms "+this._easing+" "+this._delay+"ms 1 normal "+this._fillMode+" "+this._name),ct(this._element,this._eventFn,!1),this._startTime=Date.now()},e.prototype.pause=function(){ut(this._element,this._name,"paused")},e.prototype.resume=function(){ut(this._element,this._name,"running")},e.prototype.setPosition=function(e){var t=lt(this._element,this._name);this._position=e*this._duration,pt(this._element,"Delay","-"+this._position+"ms",t)},e.prototype.getPosition=function(){return this._position},e.prototype._handleCallback=function(e){var t=e._ngTestManualTimestamp||Date.now(),n=1e3*parseFloat(e.elapsedTime.toFixed(3));e.animationName==this._name&&Math.max(t-this._startTime,0)>=this._delay&&n>=this._duration&&this.finish()},e.prototype.finish=function(){this._finished||(this._finished=!0,this._onDoneFn(),ct(this._element,this._eventFn,!0))},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.finish(),function e(t,n){var r=ft(t,"").split(","),i=ht(r,n);i>=0&&(r.splice(i,1),pt(t,"",r.join(",")))}(this._element,this._name))},e}();
|
|
20
|
+
*/function Tt(t,e,n,r,i,o,s,a,u,l,c,h,p){return{type:0,element:t,triggerName:e,isRemovalTransition:i,fromState:n,fromStyles:o,toState:r,toStyles:s,timelines:a,queriedElements:u,preStyleProps:l,postStyleProps:c,totalTime:h,errors:p}}var wt={},Pt=function(){function t(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}return t.prototype.match=function(t,e,n,r){return function i(t,e,n,r,o){return t.some(function(t){return t(e,n,r,o)})}(this.ast.matchers,t,e,n,r)},t.prototype.buildStyles=function(t,e,n){var r=this._stateStyles["*"],i=this._stateStyles[t],o=r?r.buildStyles(e,n):{};return i?i.buildStyles(e,n):o},t.prototype.build=function(t,e,n,r,i,s,a,u,l){var c=[],h=this.ast.options&&this.ast.options.params||wt,p=this.buildStyles(n,a&&a.params||wt,c),y=u&&u.params||wt,m=this.buildStyles(r,y,c),d=new Set,v=new Map,g=new Map,_="void"===r,E={params:o({},h,y)},S=ct(t,e,this.ast.animation,i,s,p,m,E,l,c),b=0;if(S.forEach(function(t){b=Math.max(t.duration+t.delay,b)}),c.length)return Tt(e,this._triggerName,n,r,_,p,m,[],[],v,g,b,c);S.forEach(function(t){var n=t.element,r=f(v,n,{});t.preStyleProps.forEach(function(t){return r[t]=!0});var i=f(g,n,{});t.postStyleProps.forEach(function(t){return i[t]=!0}),n!==e&&d.add(n)});var T=M(d.values());return Tt(e,this._triggerName,n,r,_,p,m,S,T,v,g,b)},t}(),kt=function(){function t(t,e){this.styles=t,this.defaultParams=e}return t.prototype.buildStyles=function(t,e){var n={},r=I(this.defaultParams);return Object.keys(t).forEach(function(e){var n=t[e];null!=n&&(r[e]=n)}),this.styles.styles.forEach(function(t){if("string"!=typeof t){var i=t;Object.keys(i).forEach(function(t){var o=i[t];o.length>1&&(o=B(o,r,e)),n[t]=o})}}),n},t}(),At=function(){function t(t,e){var n=this;this.name=t,this.ast=e,this.transitionFactories=[],this.states={},e.states.forEach(function(t){n.states[t.name]=new kt(t.style,t.options&&t.options.params||{})}),Nt(this.states,"true","1"),Nt(this.states,"false","0"),e.transitions.forEach(function(e){n.transitionFactories.push(new Pt(t,e,n.states))}),this.fallbackTransition=function r(t,e){return new Pt(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(t,e){return!0}],options:null,queryCount:0,depCount:0},e)}(t,this.states)}return Object.defineProperty(t.prototype,"containsQueries",{get:function(){return this.ast.queryCount>0},enumerable:!0,configurable:!0}),t.prototype.matchTransition=function(t,e,n,r){return this.transitionFactories.find(function(i){return i.match(t,e,n,r)})||null},t.prototype.matchStyles=function(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)},t}();function Nt(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}var Ot=new at,Ct=function(){function t(t,e){this._driver=t,this._normalizer=e,this._animations={},this._playersById={},this.players=[]}return t.prototype.register=function(t,e){var n=[],r=tt(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=r},t.prototype._buildPlayer=function(t,e,n){var r=t.element,i=l(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(r,i,t.duration,t.delay,t.easing,[],!0)},t.prototype.create=function(t,n,r){var i=this;void 0===r&&(r={});var o,s=[],a=this._animations[t],l=new Map;if(a?(o=ct(this._driver,n,a,"ng-enter","ng-leave",{},{},r,Ot,s)).forEach(function(t){var e=f(l,t.element,{});t.postStyleProps.forEach(function(t){return e[t]=null})}):(s.push("The requested animation doesn't exist or has already been destroyed"),o=[]),s.length)throw new Error("Unable to create the animation due to the following errors: "+s.join("\n"));l.forEach(function(t,n){Object.keys(t).forEach(function(r){t[r]=i._driver.computeStyle(n,r,e.AUTO_STYLE)})});var c=u(o.map(function(t){var e=l.get(t.element);return i._buildPlayer(t,{},e)}));return this._playersById[t]=c,c.onDestroy(function(){return i.destroy(t)}),this.players.push(c),c},t.prototype.destroy=function(t){var e=this._getPlayer(t);e.destroy(),delete this._playersById[t];var n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)},t.prototype._getPlayer=function(t){var e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e},t.prototype.listen=function(t,e,n,r){var i=p(e,"","","");return c(this._getPlayer(t),n,i,r),function(){}},t.prototype.command=function(t,e,n,r){if("register"!=n)if("create"!=n){var i=this._getPlayer(t);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(t)}}else this.create(t,e,r[0]||{});else this.register(t,r[0])},t}(),Ft=[],Dt={namespaceId:"",setForRemoval:null,hasAnimation:!1,removedBeforeQueried:!1},It={namespaceId:"",setForRemoval:null,hasAnimation:!1,removedBeforeQueried:!0},Lt="__ng_removed",xt=function(){function t(t,e){void 0===e&&(e=""),this.namespaceId=e;var n=t&&t.hasOwnProperty("value");if(this.value=function r(t){return null!=t?t:null}(n?t.value:t),n){var i=I(t);delete i.value,this.options=i}else this.options={};this.options.params||(this.options.params={})}return Object.defineProperty(t.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),t.prototype.absorbOptions=function(t){var e=t.params;if(e){var n=this.options.params;Object.keys(e).forEach(function(t){null==n[t]&&(n[t]=e[t])})}},t}(),jt=new xt("void"),qt=new xt("DELETED"),Rt=function(){function t(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,Ht(e,this._hostClassName)}return t.prototype.listen=function(t,e,n,r){var i=this;if(!this._triggers.hasOwnProperty(e))throw new Error('Unable to listen on the animation trigger event "'+n+'" because the animation trigger "'+e+"\" doesn't exist!");if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'+e+'" because the provided event is undefined!');if(!function o(t){return"start"==t||"done"==t}(n))throw new Error('The provided animation trigger event "'+n+'" for the animation trigger "'+e+'" is not supported!');var s=f(this._elementListeners,t,[]),a={name:e,phase:n,callback:r};s.push(a);var u=f(this._engine.statesByElement,t,{});return u.hasOwnProperty(e)||(Ht(t,"ng-trigger"),Ht(t,"ng-trigger-"+e),u[e]=jt),function(){i._engine.afterFlush(function(){var t=s.indexOf(a);t>=0&&s.splice(t,1),i._triggers[e]||delete u[e]})}},t.prototype.register=function(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)},t.prototype._getTrigger=function(t){var e=this._triggers[t];if(!e)throw new Error('The provided animation trigger "'+t+'" has not been registered!');return e},t.prototype.trigger=function(t,e,n,r){var i=this;void 0===r&&(r=!0);var o=this._getTrigger(e),s=new Qt(this.id,e,t),a=this._engine.statesByElement.get(t);a||(Ht(t,"ng-trigger"),Ht(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,a={}));var u=a[e],l=new xt(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&l.absorbOptions(u.options),a[e]=l,u){if(u===qt)return s}else u=jt;if("void"===l.value||u.value!==l.value){var c=f(this._engine.playersByElement,t,[]);c.forEach(function(t){t.namespaceId==i.id&&t.triggerName==e&&t.queued&&t.destroy()});var h=o.matchTransition(u.value,l.value,t,l.params),p=!1;if(!h){if(!r)return;h=o.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:h,fromState:u,toState:l,player:s,isFallbackTransition:p}),p||(Ht(t,"ng-animate-queued"),s.onStart(function(){Yt(t,"ng-animate-queued")})),s.onDone(function(){var e=i.players.indexOf(s);e>=0&&i.players.splice(e,1);var n=i._engine.playersByElement.get(t);if(n){var r=n.indexOf(s);r>=0&&n.splice(r,1)}}),this.players.push(s),c.push(s),s}if(!function y(t,e){var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i];if(!e.hasOwnProperty(o)||t[o]!==e[o])return!1}return!0}(u.params,l.params)){var m=[],d=o.matchStyles(u.value,u.params,m),v=o.matchStyles(l.value,l.params,m);m.length?this._engine.reportError(m):this._engine.afterFlush(function(){q(t,d),j(t,v)})}},t.prototype.deregister=function(t){var e=this;delete this._triggers[t],this._engine.statesByElement.forEach(function(e,n){delete e[t]}),this._elementListeners.forEach(function(n,r){e._elementListeners.set(r,n.filter(function(e){return e.name!=t}))})},t.prototype.clearElementCache=function(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);var e=this._engine.playersByElement.get(t);e&&(e.forEach(function(t){return t.destroy()}),this._engine.playersByElement.delete(t))},t.prototype._signalRemovalForInnerTriggers=function(t,e,n){var r=this;void 0===n&&(n=!1),this._engine.driver.query(t,".ng-trigger",!0).forEach(function(t){if(!t[Lt]){var n=r._engine.fetchNamespacesByElement(t);n.size?n.forEach(function(n){return n.triggerLeaveAnimation(t,e,!1,!0)}):r.clearElementCache(t)}})},t.prototype.triggerLeaveAnimation=function(t,e,n,r){var i=this,o=this._engine.statesByElement.get(t);if(o){var s=[];if(Object.keys(o).forEach(function(e){if(i._triggers[e]){var n=i.trigger(t,e,"void",r);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&u(s).onDone(function(){return i._engine.processLeaveNode(t)}),!0}return!1},t.prototype.prepareLeaveAnimationListeners=function(t){var e=this,n=this._elementListeners.get(t);if(n){var r=new Set;n.forEach(function(n){var i=n.name;if(!r.has(i)){r.add(i);var o=e._triggers[i].fallbackTransition,s=e._engine.statesByElement.get(t)[i]||jt,a=new xt("void"),u=new Qt(e.id,i,t);e._engine.totalQueuedPlayers++,e._queue.push({element:t,triggerName:i,transition:o,fromState:s,toState:a,player:u,isFallbackTransition:!0})}})}},t.prototype.removeNode=function(t,e){var n=this,r=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e,!0),!this.triggerLeaveAnimation(t,e,!0)){var i=!1;if(r.totalAnimations){var o=r.players.length?r.playersByQueriedElement.get(t):[];if(o&&o.length)i=!0;else for(var s=t;s=s.parentNode;)if(r.statesByElement.get(s)){i=!0;break}}this.prepareLeaveAnimationListeners(t),i?r.markElementAsRemoved(this.id,t,!1,e):(r.afterFlush(function(){return n.clearElementCache(t)}),r.destroyInnerAnimations(t),r._onRemovalComplete(t,e))}},t.prototype.insertNode=function(t,e){Ht(t,this._hostClassName)},t.prototype.drainQueuedTransitions=function(t){var e=this,n=[];return this._queue.forEach(function(r){var i=r.player;if(!i.destroyed){var o=r.element,s=e._elementListeners.get(o);s&&s.forEach(function(e){if(e.name==r.triggerName){var n=p(o,r.triggerName,r.fromState.value,r.toState.value);n._data=t,c(r.player,e.phase,n,e.callback)}}),i.markedForDestroy?e._engine.afterFlush(function(){i.destroy()}):n.push(r)}}),this._queue=[],n.sort(function(t,n){var r=t.transition.ast.depCount,i=n.transition.ast.depCount;return 0==r||0==i?r-i:e._engine.driver.containsElement(t.element,n.element)?1:-1})},t.prototype.destroy=function(t){this.players.forEach(function(t){return t.destroy()}),this._signalRemovalForInnerTriggers(this.hostElement,t)},t.prototype.elementContainsData=function(t){var e=!1;return this._elementListeners.has(t)&&(e=!0),!!this._queue.find(function(e){return e.element===t})||e},t}(),Kt=function(){function t(t,e){this.driver=t,this._normalizer=e,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=function(t,e){}}return t.prototype._onRemovalComplete=function(t,e){this.onRemovalComplete(t,e)},Object.defineProperty(t.prototype,"queuedPlayers",{get:function(){var t=[];return this._namespaceList.forEach(function(e){e.players.forEach(function(e){e.queued&&t.push(e)})}),t},enumerable:!0,configurable:!0}),t.prototype.createNamespace=function(t,e){var n=new Rt(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n},t.prototype._balanceNamespaceList=function(t,e){var n=this._namespaceList.length-1;if(n>=0){for(var r=!1,i=n;i>=0;i--)if(this.driver.containsElement(this._namespaceList[i].hostElement,e)){this._namespaceList.splice(i+1,0,t),r=!0;break}r||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t},t.prototype.register=function(t,e){var n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n},t.prototype.registerTrigger=function(t,e,n){var r=this._namespaceLookup[t];r&&r.register(e,n)&&this.totalAnimations++},t.prototype.destroy=function(t,e){var n=this;if(t){var r=this._fetchNamespace(t);this.afterFlush(function(){n.namespacesByHostElement.delete(r.hostElement),delete n._namespaceLookup[t];var e=n._namespaceList.indexOf(r);e>=0&&n._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(function(){return r.destroy(e)})}},t.prototype._fetchNamespace=function(t){return this._namespaceLookup[t]},t.prototype.fetchNamespacesByElement=function(t){var e=new Set,n=this.statesByElement.get(t);if(n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=n[r[i]].namespaceId;if(o){var s=this._fetchNamespace(o);s&&e.add(s)}}return e},t.prototype.trigger=function(t,e,n,r){return!!Bt(e)&&(this._fetchNamespace(t).trigger(e,n,r),!0)},t.prototype.insertNode=function(t,e,n,r){if(Bt(e)){var i=e[Lt];if(i&&i.setForRemoval&&(i.setForRemoval=!1),t){var o=this._fetchNamespace(t);o&&o.insertNode(e,n)}r&&this.collectEnterElement(e)}},t.prototype.collectEnterElement=function(t){this.collectedEnterElements.push(t)},t.prototype.markElementAsDisabled=function(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Ht(t,"ng-animate-disabled")):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Yt(t,"ng-animate-disabled"))},t.prototype.removeNode=function(t,e,n){if(Bt(e)){var r=t?this._fetchNamespace(t):null;r?r.removeNode(e,n):this.markElementAsRemoved(t,e,!1,n)}else this._onRemovalComplete(e,n)},t.prototype.markElementAsRemoved=function(t,e,n,r){this.collectedLeaveElements.push(e),e[Lt]={namespaceId:t,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1}},t.prototype.listen=function(t,e,n,r,i){return Bt(e)?this._fetchNamespace(t).listen(e,n,r,i):function(){}},t.prototype._buildInstruction=function(t,e,n,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,r,t.fromState.options,t.toState.options,e)},t.prototype.destroyInnerAnimations=function(t){var e=this,n=this.driver.query(t,".ng-trigger",!0);n.forEach(function(t){return e.destroyActiveAnimationsForElement(t)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(t,".ng-animating",!0)).forEach(function(t){return e.finishActiveQueriedAnimationOnElement(t)})},t.prototype.destroyActiveAnimationsForElement=function(t){var e=this.playersByElement.get(t);e&&e.forEach(function(t){t.queued?t.markedForDestroy=!0:t.destroy()});var n=this.statesByElement.get(t);n&&Object.keys(n).forEach(function(t){return n[t]=qt})},t.prototype.finishActiveQueriedAnimationOnElement=function(t){var e=this.playersByQueriedElement.get(t);e&&e.forEach(function(t){return t.finish()})},t.prototype.whenRenderingDone=function(){var t=this;return new Promise(function(e){if(t.players.length)return u(t.players).onDone(function(){return e()});e()})},t.prototype.processLeaveNode=function(t){var e=this,n=t[Lt];if(n&&n.setForRemoval){if(t[Lt]=Dt,n.namespaceId){this.destroyInnerAnimations(t);var r=this._fetchNamespace(n.namespaceId);r&&r.clearElementCache(t)}this._onRemovalComplete(t,n.setForRemoval)}this.driver.matchesElement(t,".ng-animate-disabled")&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach(function(n){e.markElementAsDisabled(t,!1)})},t.prototype.flush=function(t){var e=this;void 0===t&&(t=-1);var n=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(t,n){return e._balanceNamespaceList(t,n)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var r=0;r<this.collectedEnterElements.length;r++)Ht(this.collectedEnterElements[r],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){var i=[];try{n=this._flushAnimations(i,t)}finally{for(r=0;r<i.length;r++)i[r]()}}else for(r=0;r<this.collectedLeaveElements.length;r++)this.processLeaveNode(this.collectedLeaveElements[r]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(function(t){return t()}),this._flushFns=[],this._whenQuietFns.length){var o=this._whenQuietFns;this._whenQuietFns=[],n.length?u(n).onDone(function(){o.forEach(function(t){return t()})}):o.forEach(function(t){return t()})}},t.prototype.reportError=function(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))},t.prototype._flushAnimations=function(t,n){var r=this,i=new at,s=[],l=new Map,c=[],h=new Map,p=new Map,y=new Map,m=new Set;this.disabledNodes.forEach(function(t){m.add(t);for(var e=r.driver.query(t,".ng-animate-queued",!0),n=0;n<e.length;n++)m.add(e[n])});var d=T(),v=Array.from(this.statesByElement.keys()),g=Ut(v,this.collectedEnterElements),_=new Map,E=0;g.forEach(function(t,e){var n="ng-enter"+E++;_.set(e,n),t.forEach(function(t){return Ht(t,n)})});for(var S=[],b=new Set,w=new Set,P=0;P<this.collectedLeaveElements.length;P++)(U=(z=this.collectedLeaveElements[P])[Lt])&&U.setForRemoval&&(S.push(z),b.add(z),U.hasAnimation?this.driver.query(z,".ng-star-inserted",!0).forEach(function(t){return b.add(t)}):w.add(z));var k=new Map,A=Ut(v,Array.from(b));A.forEach(function(t,e){var n="ng-leave"+E++;k.set(e,n),t.forEach(function(t){return Ht(t,n)})}),t.push(function(){g.forEach(function(t,e){var n=_.get(e);t.forEach(function(t){return Yt(t,n)})}),A.forEach(function(t,e){var n=k.get(e);t.forEach(function(t){return Yt(t,n)})}),S.forEach(function(t){r.processLeaveNode(t)})});for(var N=[],O=[],C=this._namespaceList.length-1;C>=0;C--)this._namespaceList[C].drainQueuedTransitions(n).forEach(function(t){var e=t.player;N.push(e);var n=t.element;if(d&&r.driver.containsElement(d,n)){var o=k.get(n),a=_.get(n),u=r._buildInstruction(t,i,a,o);if(u.errors&&u.errors.length)O.push(u);else{if(t.isFallbackTransition)return e.onStart(function(){return q(n,u.fromStyles)}),e.onDestroy(function(){return j(n,u.toStyles)}),void s.push(e);u.timelines.forEach(function(t){return t.stretchStartingKeyframe=!0}),i.append(n,u.timelines),c.push({instruction:u,player:e,element:n}),u.queriedElements.forEach(function(t){return f(h,t,[]).push(e)}),u.preStyleProps.forEach(function(t,e){var n=Object.keys(t);if(n.length){var r=p.get(e);r||p.set(e,r=new Set),n.forEach(function(t){return r.add(t)})}}),u.postStyleProps.forEach(function(t,e){var n=Object.keys(t),r=y.get(e);r||y.set(e,r=new Set),n.forEach(function(t){return r.add(t)})})}}else e.destroy()});if(O.length){var F=[];O.forEach(function(t){F.push("@"+t.triggerName+" has failed due to:\n"),t.errors.forEach(function(t){return F.push("- "+t+"\n")})}),N.forEach(function(t){return t.destroy()}),this.reportError(F)}var D=new Map,I=new Map;c.forEach(function(t){var e=t.element;i.has(e)&&(I.set(e,e),r._beforeAnimationBuild(t.player.namespaceId,t.instruction,D))}),s.forEach(function(t){var e=t.element;r._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(function(t){f(D,e,[]).push(t),t.destroy()})});var L=S.filter(function(t){return Gt(t,p,y)}),x=new Map;zt(x,this.driver,w,y,e.AUTO_STYLE).forEach(function(t){Gt(t,p,y)&&L.push(t)});var R=new Map;g.forEach(function(t,n){zt(R,r.driver,new Set(t),p,e.ɵPRE_STYLE)}),L.forEach(function(t){var e=x.get(t),n=R.get(t);x.set(t,o({},e,n))});var K=[],Q=[],B={};c.forEach(function(t){var e=t.element,n=t.player,o=t.instruction;if(i.has(e)){if(m.has(e))return n.onDestroy(function(){return j(e,o.toStyles)}),n.disabled=!0,n.overrideTotalTime(o.totalTime),void s.push(n);var a=B;if(I.size>1){for(var c=e,h=[];c=c.parentNode;){var p=I.get(c);if(p){a=p;break}h.push(c)}h.forEach(function(t){return I.set(t,a)})}var f=r._buildAnimation(n.namespaceId,o,D,l,R,x);if(n.setRealPlayer(f),a===B)K.push(n);else{var y=r.playersByElement.get(a);y&&y.length&&(n.parentPlayer=u(y)),s.push(n)}}else q(e,o.fromStyles),n.onDestroy(function(){return j(e,o.toStyles)}),Q.push(n),m.has(e)&&s.push(n)}),Q.forEach(function(t){var e=l.get(t.element);if(e&&e.length){var n=u(e);t.setRealPlayer(n)}}),s.forEach(function(t){t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(var M=0;M<S.length;M++){var z,U=(z=S[M])[Lt];if(Yt(z,"ng-leave"),!U||!U.hasAnimation){var W=[];if(h.size){var H=h.get(z);H&&H.length&&W.push.apply(W,a(H));for(var Y=this.driver.query(z,".ng-animating",!0),$=0;$<Y.length;$++){var G=h.get(Y[$]);G&&G.length&&W.push.apply(W,a(G))}}var V=W.filter(function(t){return!t.destroyed});V.length?$t(this,z,V):this.processLeaveNode(z)}}return S.length=0,K.forEach(function(t){r.players.push(t),t.onDone(function(){t.destroy();var e=r.players.indexOf(t);r.players.splice(e,1)}),t.play()}),K},t.prototype.elementContainsData=function(t,e){var n=!1,r=e[Lt];return r&&r.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n},t.prototype.afterFlush=function(t){this._flushFns.push(t)},t.prototype.afterFlushAnimationsDone=function(t){this._whenQuietFns.push(t)},t.prototype._getPreviousPlayers=function(t,e,n,r,i){var o=[];if(e){var s=this.playersByQueriedElement.get(t);s&&(o=s)}else{var a=this.playersByElement.get(t);if(a){var u=!i||"void"==i;a.forEach(function(t){t.queued||(u||t.triggerName==r)&&o.push(t)})}}return(n||r)&&(o=o.filter(function(t){return!(n&&n!=t.namespaceId||r&&r!=t.triggerName)})),o},t.prototype._beforeAnimationBuild=function(t,e,n){var r,i,o=e.element,s=e.isRemovalTransition?void 0:t,a=e.isRemovalTransition?void 0:e.triggerName,u=function(t){var r=t.element,i=r!==o,u=f(n,r,[]);l._getPreviousPlayers(r,i,s,a,e.toState).forEach(function(t){var e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),u.push(t)})},l=this;try{for(var c=function h(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}(e.timelines),p=c.next();!p.done;p=c.next())u(p.value)}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}q(o,e.fromStyles)},t.prototype._buildAnimation=function(t,n,r,i,o,s){var a=this,c=n.triggerName,h=n.element,p=[],y=new Set,m=new Set,d=n.timelines.map(function(n){var u=n.element;y.add(u);var f=u[Lt];if(f&&f.removedBeforeQueried)return new e.NoopAnimationPlayer(n.duration,n.delay);var d=u!==h,v=function g(t){var n=[];return function t(n,r){for(var i=0;i<n.length;i++){var o=n[i];o instanceof e.ɵAnimationGroupPlayer?t(o.players,r):r.push(o)}}(t,n),n}((r.get(u)||Ft).map(function(t){return t.getRealPlayer()})).filter(function(t){return!!t.element&&t.element===u}),_=o.get(u),E=s.get(u),S=l(0,a._normalizer,0,n.keyframes,_,E),b=a._buildPlayer(n,S,v);if(n.subTimeline&&i&&m.add(u),d){var T=new Qt(t,c,u);T.setRealPlayer(b),p.push(T)}return b});p.forEach(function(t){f(a.playersByQueriedElement,t.element,[]).push(t),t.onDone(function(){return function e(t,n,r){var i;if(t instanceof Map){if(i=t.get(n)){if(i.length){var o=i.indexOf(r);i.splice(o,1)}0==i.length&&t.delete(n)}}else(i=t[n])&&(i.length&&(o=i.indexOf(r),i.splice(o,1)),0==i.length&&delete t[n]);return i}(a.playersByQueriedElement,t.element,t)})}),y.forEach(function(t){return Ht(t,"ng-animating")});var v=u(d);return v.onDestroy(function(){y.forEach(function(t){return Yt(t,"ng-animating")}),j(h,n.toStyles)}),m.forEach(function(t){f(i,t,[]).push(v)}),v},t.prototype._buildPlayer=function(t,n,r){return n.length>0?this.driver.animate(t.element,n,t.duration,t.delay,t.easing,r):new e.NoopAnimationPlayer(t.duration,t.delay)},t}(),Qt=function(){function t(t,n,r){this.namespaceId=t,this.triggerName=n,this.element=r,this._player=new e.NoopAnimationPlayer,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return t.prototype.setRealPlayer=function(t){var e=this;this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(function(n){e._queuedCallbacks[n].forEach(function(e){return c(t,n,void 0,e)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)},t.prototype.getRealPlayer=function(){return this._player},t.prototype.overrideTotalTime=function(t){this.totalTime=t},t.prototype.syncPlayerEvents=function(t){var e=this,n=this._player;n.triggerCallback&&t.onStart(function(){return n.triggerCallback("start")}),t.onDone(function(){return e.finish()}),t.onDestroy(function(){return e.destroy()})},t.prototype._queueEvent=function(t,e){f(this._queuedCallbacks,t,[]).push(e)},t.prototype.onDone=function(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)},t.prototype.onStart=function(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)},t.prototype.onDestroy=function(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)},t.prototype.init=function(){this._player.init()},t.prototype.hasStarted=function(){return!this.queued&&this._player.hasStarted()},t.prototype.play=function(){!this.queued&&this._player.play()},t.prototype.pause=function(){!this.queued&&this._player.pause()},t.prototype.restart=function(){!this.queued&&this._player.restart()},t.prototype.finish=function(){this._player.finish()},t.prototype.destroy=function(){this.destroyed=!0,this._player.destroy()},t.prototype.reset=function(){!this.queued&&this._player.reset()},t.prototype.setPosition=function(t){this.queued||this._player.setPosition(t)},t.prototype.getPosition=function(){return this.queued?0:this._player.getPosition()},t.prototype.triggerCallback=function(t){var e=this._player;e.triggerCallback&&e.triggerCallback(t)},t}();function Bt(t){return t&&1===t.nodeType}function Mt(t,e){var n=t.style.display;return t.style.display=null!=e?e:"none",n}function zt(t,e,n,r,i){var o=[];n.forEach(function(t){return o.push(Mt(t))});var s=[];r.forEach(function(n,r){var o={};n.forEach(function(t){var n=o[t]=e.computeStyle(r,t,i);n&&0!=n.length||(r[Lt]=It,s.push(r))}),t.set(r,o)});var a=0;return n.forEach(function(t){return Mt(t,o[a++])}),s}function Ut(t,e){var n=new Map;if(t.forEach(function(t){return n.set(t,[])}),0==e.length)return n;var r=new Set(e),i=new Map;return e.forEach(function(t){var e=function t(e){if(!e)return 1;var o=i.get(e);if(o)return o;var s=e.parentNode;return o=n.has(s)?s:r.has(s)?1:t(s),i.set(e,o),o}(t);1!==e&&n.get(e).push(t)}),n}var Wt="$$classes";function Ht(t,e){if(t.classList)t.classList.add(e);else{var n=t[Wt];n||(n=t[Wt]={}),n[e]=!0}}function Yt(t,e){if(t.classList)t.classList.remove(e);else{var n=t[Wt];n&&delete n[e]}}function $t(t,e,n){u(n).onDone(function(){return t.processLeaveNode(e)})}function Gt(t,e,n){var r=n.get(t);if(!r)return!1;var i=e.get(t);return i?r.forEach(function(t){return i.add(t)}):e.set(t,r),n.delete(t),!0}var Vt=function(){function t(t,e){var n=this;this._driver=t,this._triggerCache={},this.onRemovalComplete=function(t,e){},this._transitionEngine=new Kt(t,e),this._timelineEngine=new Ct(t,e),this._transitionEngine.onRemovalComplete=function(t,e){return n.onRemovalComplete(t,e)}}return t.prototype.registerTrigger=function(t,e,n,r,i){var o=t+"-"+r,s=this._triggerCache[o];if(!s){var a=[],u=tt(this._driver,i,a);if(a.length)throw new Error('The animation trigger "'+r+'" has failed to build due to the following errors:\n - '+a.join("\n - "));s=function l(t,e){return new At(t,e)}(r,u),this._triggerCache[o]=s}this._transitionEngine.registerTrigger(e,r,s)},t.prototype.register=function(t,e){this._transitionEngine.register(t,e)},t.prototype.destroy=function(t,e){this._transitionEngine.destroy(t,e)},t.prototype.onInsert=function(t,e,n,r){this._transitionEngine.insertNode(t,e,n,r)},t.prototype.onRemove=function(t,e,n){this._transitionEngine.removeNode(t,e,n)},t.prototype.disableAnimations=function(t,e){this._transitionEngine.markElementAsDisabled(t,e)},t.prototype.process=function(t,e,n,r){if("@"==n.charAt(0)){var i=s(y(n),2);this._timelineEngine.command(i[0],e,i[1],r)}else this._transitionEngine.trigger(t,e,n,r)},t.prototype.listen=function(t,e,n,r,i){if("@"==n.charAt(0)){var o=s(y(n),2);return this._timelineEngine.listen(o[0],e,o[1],i)}return this._transitionEngine.listen(t,e,n,r,i)},t.prototype.flush=function(t){void 0===t&&(t=-1),this._transitionEngine.flush(t)},Object.defineProperty(t.prototype,"players",{get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)},enumerable:!0,configurable:!0}),t.prototype.whenRenderingDone=function(){return this._transitionEngine.whenRenderingDone()},t}(),Zt="animation",Jt="animationend",Xt=function(){function t(t,e,n,r,i,o,s){var a=this;this._element=t,this._name=e,this._duration=n,this._delay=r,this._easing=i,this._fillMode=o,this._onDoneFn=s,this._finished=!1,this._destroyed=!1,this._startTime=0,this._position=0,this._eventFn=function(t){return a._handleCallback(t)}}return t.prototype.apply=function(){!function t(e,n){var r=oe(e,"").trim();r.length&&(function i(t,e){for(var n=0,r=0;r<t.length;r++)t.charAt(r)===e&&n++;return n}(r,",")+1,n=r+", "+n),ie(e,"",n)}(this._element,this._duration+"ms "+this._easing+" "+this._delay+"ms 1 normal "+this._fillMode+" "+this._name),re(this._element,this._eventFn,!1),this._startTime=Date.now()},t.prototype.pause=function(){te(this._element,this._name,"paused")},t.prototype.resume=function(){te(this._element,this._name,"running")},t.prototype.setPosition=function(t){var e=ee(this._element,this._name);this._position=t*this._duration,ie(this._element,"Delay","-"+this._position+"ms",e)},t.prototype.getPosition=function(){return this._position},t.prototype._handleCallback=function(t){var e=t._ngTestManualTimestamp||Date.now(),n=1e3*parseFloat(t.elapsedTime.toFixed(3));t.animationName==this._name&&Math.max(e-this._startTime,0)>=this._delay&&n>=this._duration&&this.finish()},t.prototype.finish=function(){this._finished||(this._finished=!0,this._onDoneFn(),re(this._element,this._eventFn,!0))},t.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.finish(),function t(e,n){var r=oe(e,"").split(","),i=ne(r,n);i>=0&&(r.splice(i,1),ie(e,"",r.join(",")))}(this._element,this._name))},t}();
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright Google Inc. All Rights Reserved.
|
|
24
24
|
*
|
|
25
25
|
* Use of this source code is governed by an MIT-style license that can be
|
|
26
26
|
* found in the LICENSE file at https://angular.io/license
|
|
27
|
-
*/function
|
|
27
|
+
*/function te(t,e,n){ie(t,"PlayState",n,ee(t,e))}function ee(t,e){var n=oe(t,"");return n.indexOf(",")>0?ne(n.split(","),e):ne([n],e)}function ne(t,e){for(var n=0;n<t.length;n++)if(t[n].indexOf(e)>=0)return n;return-1}function re(t,e,n){n?t.removeEventListener(Jt,e):t.addEventListener(Jt,e)}function ie(t,e,n,r){var i=Zt+e;if(null!=r){var o=t.style[i];if(o.length){var s=o.split(",");s[r]=n,n=s.join(",")}}t.style[i]=n}function oe(t,e){return t.style[Zt+e]}var se,ae="linear";!function(t){t[t.INITIALIZED=1]="INITIALIZED",t[t.STARTED=2]="STARTED",t[t.FINISHED=3]="FINISHED",t[t.DESTROYED=4]="DESTROYED"}(se||(se={}));var ue=function(){function t(t,e,n,r,i,o,s){this.element=t,this.keyframes=e,this.animationName=n,this._duration=r,this._delay=i,this._finalStyles=s,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this.state=0,this.easing=o||ae,this.totalTime=r+i,this._buildStyler()}return t.prototype.onStart=function(t){this._onStartFns.push(t)},t.prototype.onDone=function(t){this._onDoneFns.push(t)},t.prototype.onDestroy=function(t){this._onDestroyFns.push(t)},t.prototype.destroy=function(){this.init(),this.state>=se.DESTROYED||(this.state=se.DESTROYED,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._onDestroyFns.forEach(function(t){return t()}),this._onDestroyFns=[])},t.prototype._flushDoneFns=function(){this._onDoneFns.forEach(function(t){return t()}),this._onDoneFns=[]},t.prototype._flushStartFns=function(){this._onStartFns.forEach(function(t){return t()}),this._onStartFns=[]},t.prototype.finish=function(){this.init(),this.state>=se.FINISHED||(this.state=se.FINISHED,this._styler.finish(),this._flushStartFns(),this._flushDoneFns())},t.prototype.setPosition=function(t){this._styler.setPosition(t)},t.prototype.getPosition=function(){return this._styler.getPosition()},t.prototype.hasStarted=function(){return this.state>=se.STARTED},t.prototype.init=function(){this.state>=se.INITIALIZED||(this.state=se.INITIALIZED,this._styler.apply(),this._delay&&this._styler.pause())},t.prototype.play=function(){this.init(),this.hasStarted()||(this._flushStartFns(),this.state=se.STARTED),this._styler.resume()},t.prototype.pause=function(){this.init(),this._styler.pause()},t.prototype.restart=function(){this.reset(),this.play()},t.prototype.reset=function(){this._styler.destroy(),this._buildStyler(),this._styler.apply()},t.prototype._buildStyler=function(){var t=this;this._styler=new Xt(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",function(){return t.finish()})},t.prototype.triggerCallback=function(t){var e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(function(t){return t()}),e.length=0},t.prototype.beforeDestroy=function(){var t=this;this.init();var e={};if(this.hasStarted()){var n=this.state>=se.FINISHED;Object.keys(this._finalStyles).forEach(function(r){"offset"!=r&&(e[r]=n?t._finalStyles[r]:$(t.element,r))})}this.currentSnapshot=e},t}(),le=function(t){function e(e,n){var r=t.call(this)||this;return r.element=e,r._styles=n,r._startingStyles={},r.__initialized=!1,r}return i(e,t),e.prototype.init=function(){var e=this;!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(function(t){e._startingStyles[t]=e.element.style[t]}),t.prototype.init.call(this))},e.prototype.play=function(){var e=this;this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(function(t){e.element.style[t]=e._styles[t]}),t.prototype.play.call(this))},e.prototype.destroy=function(){var e=this;this._startingStyles&&(Object.keys(this._startingStyles).forEach(function(t){var n=e._startingStyles[t];n?e.element.style[t]=n:e.element.style.removeProperty(t)}),this._startingStyles=null,t.prototype.destroy.call(this))},e}(e.NoopAnimationPlayer),ce=function(){function t(){this._count=0,this._head=document.querySelector("head"),this._warningIssued=!1}return t.prototype.validateStyleProperty=function(t){return b(t)},t.prototype.matchesElement=function(t,e){return w(t,e)},t.prototype.containsElement=function(t,e){return P(t,e)},t.prototype.query=function(t,e,n){return k(t,e,n)},t.prototype.computeStyle=function(t,e,n){return window.getComputedStyle(t)[e]},t.prototype.buildKeyframeElement=function(t,e,n){var r="@keyframes "+e+" {\n",i="";(n=n.map(function(t){return function e(t){var e={};return Object.keys(t).forEach(function(n){var r=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[r]=t[n]}),e}(t)})).forEach(function(t){i=" ";var e=parseFloat(t.offset);r+=""+i+100*e+"% {\n",i+=" ",Object.keys(t).forEach(function(e){var n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(r+=i+"animation-timing-function: "+n+";\n"));default:return void(r+=""+i+e+": "+n+";\n")}}),r+=i+"}\n"}),r+="}\n";var o=document.createElement("style");return o.innerHTML=r,o},t.prototype.animate=function(t,e,n,r,i,o,s){void 0===o&&(o=[]),s&&this._notifyFaultyScrubber();var a=o.filter(function(t){return t instanceof ue}),u={};W(n,r)&&a.forEach(function(t){var e=t.currentSnapshot;Object.keys(e).forEach(function(t){return u[t]=e[t]})});var l=function c(t){var e={};return t&&(Array.isArray(t)?t:[t]).forEach(function(t){Object.keys(t).forEach(function(n){"offset"!=n&&"easing"!=n&&(e[n]=t[n])})}),e}(e=H(t,e,u));if(0==n)return new le(t,l);var h="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(t,h,e);document.querySelector("head").appendChild(p);var f=new ue(t,e,h,n,r,i,l);return f.onDestroy(function(){return function t(e){e.parentNode.removeChild(e)}(p)}),f},t.prototype._notifyFaultyScrubber=function(){this._warningIssued||(console.warn("@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n"," visit http://bit.ly/IWukam to learn more about using the web-animation-js polyfill."),this._warningIssued=!0)},t}(),he=function(){function t(t,e,n){this.element=t,this.keyframes=e,this.options=n,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}return t.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(t){return t()}),this._onDoneFns=[])},t.prototype.init=function(){this._buildPlayer(),this._preparePlayerBeforeStart()},t.prototype._buildPlayer=function(){var t=this;if(!this._initialized){this._initialized=!0;var e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",function(){return t._onFinish()})}},t.prototype._preparePlayerBeforeStart=function(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()},t.prototype._triggerWebAnimation=function(t,e,n){return t.animate(e,n)},t.prototype.onStart=function(t){this._onStartFns.push(t)},t.prototype.onDone=function(t){this._onDoneFns.push(t)},t.prototype.onDestroy=function(t){this._onDestroyFns.push(t)},t.prototype.play=function(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(function(t){return t()}),this._onStartFns=[],this._started=!0),this.domPlayer.play()},t.prototype.pause=function(){this.init(),this.domPlayer.pause()},t.prototype.finish=function(){this.init(),this._onFinish(),this.domPlayer.finish()},t.prototype.reset=function(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1},t.prototype._resetDomPlayerState=function(){this.domPlayer&&this.domPlayer.cancel()},t.prototype.restart=function(){this.reset(),this.play()},t.prototype.hasStarted=function(){return this._started},t.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._onDestroyFns.forEach(function(t){return t()}),this._onDestroyFns=[])},t.prototype.setPosition=function(t){this.domPlayer.currentTime=t*this.time},t.prototype.getPosition=function(){return this.domPlayer.currentTime/this.time},Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._delay+this._duration},enumerable:!0,configurable:!0}),t.prototype.beforeDestroy=function(){var t=this,e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(function(n){"offset"!=n&&(e[n]=t._finished?t._finalKeyframe[n]:$(t.element,n))}),this.currentSnapshot=e},t.prototype.triggerCallback=function(t){var e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(function(t){return t()}),e.length=0},t}(),pe=function(){function t(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(fe().toString()),this._cssKeyframesDriver=new ce}return t.prototype.validateStyleProperty=function(t){return b(t)},t.prototype.matchesElement=function(t,e){return w(t,e)},t.prototype.containsElement=function(t,e){return P(t,e)},t.prototype.query=function(t,e,n){return k(t,e,n)},t.prototype.computeStyle=function(t,e,n){return window.getComputedStyle(t)[e]},t.prototype.overrideWebAnimationsSupport=function(t){this._isNativeImpl=t},t.prototype.animate=function(t,e,n,r,i,o,s){if(void 0===o&&(o=[]),!s&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,r,i,o);var a={duration:n,delay:r,fill:0==r?"both":"forwards"};i&&(a.easing=i);var u={},l=o.filter(function(t){return t instanceof he});return W(n,r)&&l.forEach(function(t){var e=t.currentSnapshot;Object.keys(e).forEach(function(t){return u[t]=e[t]})}),e=H(t,e=e.map(function(t){return x(t,!1)}),u),new he(t,e,a)},t}();function fe(){return"undefined"!=typeof Element&&Element.prototype.animate||{}}
|
|
28
28
|
/**
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
*
|
|
46
46
|
* Use of this source code is governed by an MIT-style license that can be
|
|
47
47
|
* found in the LICENSE file at https://angular.io/license
|
|
48
|
-
*/
|
|
48
|
+
*/t.AnimationDriver=N,t.ɵAnimation=vt,t.ɵAnimationStyleNormalizer=gt,t.ɵNoopAnimationStyleNormalizer=_t,t.ɵWebAnimationsStyleNormalizer=Et,t.ɵAnimationDriver=N,t.ɵNoopAnimationDriver=A,t.ɵAnimationEngine=Vt,t.ɵCssKeyframesDriver=ce,t.ɵCssKeyframesPlayer=ue,t.ɵcontainsElement=P,t.ɵinvokeQuery=k,t.ɵmatchesElement=w,t.ɵvalidateStyleProperty=b,t.ɵWebAnimationsDriver=pe,t.ɵsupportsWebAnimations=function ye(){return"function"==typeof fe()},t.ɵWebAnimationsPlayer=he,t.ɵallowPreviousPlayerStylesMerge=W,Object.defineProperty(t,"__esModule",{value:!0})});
|