angular-animate.js 25 KB

1
  1. !function(n,t){"use strict";function e(n,t,e){if(!n)throw ln("areq","Argument '{0}' is {1}",t||"?",e||"required");return n}function a(n,t){return n||t?n?t?(J(n)&&(n=n.join(" ")),J(t)&&(t=t.join(" ")),n+" "+t):n:t:""}function r(n){var t={};return n&&(n.to||n.from)&&(t.to=n.to,t.from=n.from),t}function i(n,t,e){var a="";return n=J(n)?n:n&&K(n)&&n.length?n.split(/\s+/):[],B(n,function(n,r){n&&n.length>0&&(a+=r>0?" ":"",a+=e?t+n:n+t)}),a}function o(n,t){var e=n.indexOf(t);t>=0&&n.splice(e,1)}function s(n){if(n instanceof H)switch(n.length){case 0:return n;case 1:if(n[0].nodeType===G)return n;break;default:return H(u(n))}if(n.nodeType===G)return H(n)}function u(n){if(!n[0])return n;for(var t=0;t<n.length;t++){var e=n[t];if(e.nodeType==G)return e}}function l(n,t,e){B(t,function(t){n.addClass(t,e)})}function c(n,t,e){B(t,function(t){n.removeClass(t,e)})}function f(n){return function(t,e){e.addClass&&(l(n,t,e.addClass),e.addClass=null),e.removeClass&&(c(n,t,e.removeClass),e.removeClass=null)}}function m(n){if(!(n=n||{}).$$prepared){var t=n.domOperation||R;n.domOperation=function(){n.$$domOperationFired=!0,t(),t=R},n.$$prepared=!0}return n}function d(n,t){v(n,t),p(n,t)}function v(n,t){t.from&&(n.css(t.from),t.from=null)}function p(n,t){t.to&&(n.css(t.to),t.to=null)}function h(n,t,e){var a=t.options||{},r=e.options||{},i=(a.addClass||"")+" "+(r.addClass||""),o=(a.removeClass||"")+" "+(r.removeClass||""),s=g(n.attr("class"),i,o);r.preparationClasses&&(a.preparationClasses=k(r.preparationClasses,a.preparationClasses),delete r.preparationClasses);var u=a.domOperation!==R?a.domOperation:null;return L(a,r),u&&(a.domOperation=u),s.addClass?a.addClass=s.addClass:a.addClass=null,s.removeClass?a.removeClass=s.removeClass:a.removeClass=null,t.addClass=a.addClass,t.removeClass=a.removeClass,a}function g(n,t,e){function a(n){K(n)&&(n=n.split(" "));var t={};return B(n,function(n){n.length&&(t[n]=!0)}),t}var r={};n=a(n),t=a(t),B(t,function(n,t){r[t]=1}),e=a(e),B(e,function(n,t){r[t]=1===r[t]?null:-1});var i={addClass:"",removeClass:""};return B(r,function(t,e){var a,r;1===t?(a="addClass",r=!n[e]):-1===t&&(a="removeClass",r=n[e]),r&&(i[a].length&&(i[a]+=" "),i[a]+=e)}),i}function $(n){return n instanceof t.element?n[0]:n}function C(n,t,e){var a="";t&&(a=i(t,Z,!0)),e.addClass&&(a=k(a,i(e.addClass,X))),e.removeClass&&(a=k(a,i(e.removeClass,Y))),a.length&&(e.preparationClasses=a,n.addClass(a))}function y(n,t){t.preparationClasses&&(n.removeClass(t.preparationClasses),t.preparationClasses=null),t.activeClasses&&(n.removeClass(t.activeClasses),t.activeClasses=null)}function D(n,t){var e=t?"-"+t+"s":"";return A(n,[sn,e]),[sn,e]}function b(n,t){var e=t?"paused":"",a=E+an;return A(n,[a,e]),[a,e]}function A(n,t){var e=t[0],a=t[1];n.style[e]=a}function k(n,t){return n?t?n+" "+t:n:t}function w(n){return[on,n+"s"]}function S(n,t){return[t?rn:sn,n+"s"]}function T(n,t,e){var a=Object.create(null),r=n.getComputedStyle(t)||{};return B(e,function(n,t){var e=r[n];if(e){var i=e.charAt(0);("-"===i||"+"===i||i>=0)&&(e=j(e)),0===e&&(e=null),a[t]=e}}),a}function j(n){var t=0,e=n.split(/\s*,\s*/);return B(e,function(n){"s"==n.charAt(n.length-1)&&(n=n.substring(0,n.length-1)),n=parseFloat(n)||0,t=t?Math.max(n,t):n}),t}function x(n){return 0===n||null!=n}function O(n,t){var e=F,a=n+"s";return t?e+=tn:a+=" linear all",[e,a]}function P(){var n=Object.create(null);return{flush:function(){n=Object.create(null)},count:function(t){var e=n[t];return e?e.total:0},get:function(t){var e=n[t];return e&&e.value},put:function(t,e){n[t]?n[t].total++:n[t]={total:1,value:e}}}}function N(n,t,e){B(e,function(e){n[e]=W(n[e])?n[e]:t.style.getPropertyValue(e)})}var F,M,E,I,R=t.noop,q=t.copy,L=t.extend,H=t.element,B=t.forEach,J=t.isArray,K=t.isString,Q=t.isObject,U=t.isUndefined,W=t.isDefined,V=t.isFunction,z=t.isElement,G=1,X="-add",Y="-remove",Z="ng-",_="ng-animate",nn="$$ngAnimateChildren";U(n.ontransitionend)&&W(n.onwebkittransitionend)?("-webkit-",F="WebkitTransition",M="webkitTransitionEnd transitionend"):(F="transition",M="transitionend"),U(n.onanimationend)&&W(n.onwebkitanimationend)?("-webkit-",E="WebkitAnimation",I="webkitAnimationEnd animationend"):(E="animation",I="animationend");var tn="Duration",en="TimingFunction",an="PlayState",rn=E+"Delay",on=E+tn,sn=F+"Delay",un=F+tn,ln=t.$$minErr("ng"),cn=["$$rAF",function(n){function t(n){a=a.concat(n),e()}function e(){if(a.length){for(var t=a.shift(),i=0;i<t.length;i++)t[i]();r||n(function(){r||e()})}}var a,r;return a=t.queue=[],t.waitUntilQuiet=function(t){r&&r(),r=n(function(){r=null,t(),e()})},t}],fn=["$interpolate",function(n){return{link:function(e,a,r){function i(n){n="on"===n||"true"===n,a.data(nn,n)}var o=r.ngAnimateChildren;t.isString(o)&&0===o.length?a.data(nn,!0):(i(n(o)(e)),r.$observe("ngAnimateChildren",i))}}}],mn="$$animateCss",dn=1e3,vn=3,pn=1.5,hn={transitionDuration:un,transitionDelay:sn,transitionProperty:F+"Property",animationDuration:on,animationDelay:rn,animationIterationCount:E+"IterationCount"},gn={transitionDuration:un,transitionDelay:sn,animationDuration:on,animationDelay:rn},$n=["$animateProvider",function(n){var t=P(),e=P();this.$get=["$window","$$jqLite","$$AnimateRunner","$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(n,a,s,u,l,c,h,g){function C(n,t){var e="$$ngAnimateParentKey",a=n.parentNode;return(a[e]||(a[e]=++H))+"-"+n.getAttribute("class")+"-"+t}function y(e,a,r,i){var o=t.get(r);return o||"infinite"===(o=T(n,e,i)).animationIterationCount&&(o.animationIterationCount=1),t.put(r,o),o}function k(r,o,s,u){var l;if(t.count(s)>0&&!(l=e.get(s))){var c=i(o,"-stagger");a.addClass(r,c),(l=T(n,r,u)).animationDuration=Math.max(l.animationDuration,0),l.transitionDuration=Math.max(l.transitionDuration,0),a.removeClass(r,c),e.put(s,l)}return l||{}}function j(n){K.push(n),h.waitUntilQuiet(function(){t.flush(),e.flush();for(var n=l(),a=0;a<K.length;a++)K[a](n);K.length=0})}function P(n,t,e){var a=y(n,t,e,hn),r=a.animationDelay,i=a.transitionDelay;return a.maxDelay=r&&i?Math.max(r,i):r||i,a.maxDuration=Math.max(a.animationDuration*a.animationIterationCount,a.transitionDuration),a}var L=f(a),H=0,K=[];return function(n,e){function l(){h()}function f(){h(!0)}function h(t){if(!(V||G&&z)){V=!0,z=!1,Q.$$skipPreparationClasses||a.removeClass(n,yn),a.removeClass(n,bn),b(W,!1),D(W,!1),B(un,function(n){W.style[n[0]]=""}),L(n,Q),d(n,Q),Object.keys(U).length&&B(U,function(n,t){n?W.style.setProperty(t,n):W.style.removeProperty(t)}),Q.onDone&&Q.onDone(),fn&&fn.length&&n.off(fn.join(" "),H);var e=n.data(mn);e&&(u.cancel(e[0].timer),n.removeData(mn)),_&&_.complete(!t)}}function y(n){En.blockTransition&&D(W,n),En.blockKeyframeAnimation&&b(W,!!n)}function T(){return _=new s({end:l,cancel:f}),j(R),h(),{$$willAnimate:!1,start:function(){return _},end:l}}function H(n){n.stopPropagation();var t=n.originalEvent||n,e=t.$manualTimeStamp||Date.now(),a=parseFloat(t.elapsedTime.toFixed(vn));Math.max(e-sn,0)>=an&&a>=rn&&(G=!0,h())}function K(){function t(){if(!V){if(y(!1),B(un,function(n){var t=n[0],e=n[1];W.style[t]=e}),L(n,Q),a.addClass(n,bn),En.recalculateTimingStyles){if(Dn=W.className+" "+yn,kn=C(W,Dn),Fn=P(W,Dn,kn),Mn=Fn.maxDelay,tn=Math.max(Mn,0),0===(rn=Fn.maxDuration))return void h();En.hasTransitions=Fn.transitionDuration>0,En.hasAnimations=Fn.animationDuration>0}if(En.applyAnimationDelay&&(Mn="boolean"!=typeof Q.delay&&x(Q.delay)?parseFloat(Q.delay):Mn,tn=Math.max(Mn,0),Fn.animationDelay=Mn,In=S(Mn,!0),un.push(In),W.style[In[0]]=In[1]),an=tn*dn,on=rn*dn,Q.easing){var t,r=Q.easing;En.hasTransitions&&(t=F+en,un.push([t,r]),W.style[t]=r),En.hasAnimations&&(t=E+en,un.push([t,r]),W.style[t]=r)}Fn.transitionDuration&&fn.push(M),Fn.animationDuration&&fn.push(I),sn=Date.now();var i=an+pn*on,o=sn+i,s=n.data(mn)||[],l=!0;if(s.length){var c=s[0];(l=o>c.expectedEndTime)?u.cancel(c.timer):s.push(h)}if(l){var f=u(e,i,!1);s[0]={timer:f,expectedEndTime:o},s.push(h),n.data(mn,s)}fn.length&&n.on(fn.join(" "),H),Q.to&&(Q.cleanupStyles&&N(U,W,Object.keys(Q.to)),p(n,Q))}}function e(){var t=n.data(mn);if(t){for(var e=1;e<t.length;e++)t[e]();n.removeData(mn)}}if(!V)if(W.parentNode){var r=function(n){if(G)z&&n&&(z=!1,h());else if(z=!n,Fn.animationDuration){var t=b(W,z);z?un.push(t):o(un,t)}},i=Pn>0&&(Fn.transitionDuration&&0===wn.transitionDuration||Fn.animationDuration&&0===wn.animationDuration)&&Math.max(wn.animationDelay,wn.transitionDelay);i?u(t,Math.floor(i*Pn*dn),!1):t(),nn.resume=function(){r(!0)},nn.pause=function(){r(!1)}}else h()}var Q=e||{};Q.$$prepared||(Q=m(q(Q)));var U={},W=$(n);if(!W||!W.parentNode||!g.enabled())return T();var V,z,G,_,nn,tn,an,rn,on,sn,un=[],ln=n.attr("class"),cn=r(Q),fn=[];if(0===Q.duration||!c.animations&&!c.transitions)return T();var hn=Q.event&&J(Q.event)?Q.event.join(" "):Q.event,$n="",Cn="";hn&&Q.structural?$n=i(hn,Z,!0):hn&&($n=hn),Q.addClass&&(Cn+=i(Q.addClass,X)),Q.removeClass&&(Cn.length&&(Cn+=" "),Cn+=i(Q.removeClass,Y)),Q.applyClassesEarly&&Cn.length&&L(n,Q);var yn=[$n,Cn].join(" ").trim(),Dn=ln+" "+yn,bn=i(yn,"-active"),An=cn.to&&Object.keys(cn.to).length>0;if(!((Q.keyframeStyle||"").length>0)&&!An&&!yn)return T();var kn,wn;if(Q.stagger>0){var Sn=parseFloat(Q.stagger);wn={transitionDelay:Sn,animationDelay:Sn,transitionDuration:0,animationDuration:0}}else kn=C(W,Dn),wn=k(W,yn,kn,gn);Q.$$skipPreparationClasses||a.addClass(n,yn);var Tn;if(Q.transitionStyle){var jn=[F,Q.transitionStyle];A(W,jn),un.push(jn)}if(Q.duration>=0){Tn=W.style[F].length>0;var xn=O(Q.duration,Tn);A(W,xn),un.push(xn)}if(Q.keyframeStyle){var On=[E,Q.keyframeStyle];A(W,On),un.push(On)}var Pn=wn?Q.staggerIndex>=0?Q.staggerIndex:t.count(kn):0,Nn=0===Pn;Nn&&!Q.skipBlocking&&D(W,9999);var Fn=P(W,Dn,kn),Mn=Fn.maxDelay;tn=Math.max(Mn,0),rn=Fn.maxDuration;var En={};if(En.hasTransitions=Fn.transitionDuration>0,En.hasAnimations=Fn.animationDuration>0,En.hasTransitionAll=En.hasTransitions&&"all"==Fn.transitionProperty,En.applyTransitionDuration=An&&(En.hasTransitions&&!En.hasTransitionAll||En.hasAnimations&&!En.hasTransitions),En.applyAnimationDuration=Q.duration&&En.hasAnimations,En.applyTransitionDelay=x(Q.delay)&&(En.applyTransitionDuration||En.hasTransitions),En.applyAnimationDelay=x(Q.delay)&&En.hasAnimations,En.recalculateTimingStyles=Cn.length>0,(En.applyTransitionDuration||En.applyAnimationDuration)&&(rn=Q.duration?parseFloat(Q.duration):rn,En.applyTransitionDuration&&(En.hasTransitions=!0,Fn.transitionDuration=rn,Tn=W.style[F+"Property"].length>0,un.push(O(rn,Tn))),En.applyAnimationDuration&&(En.hasAnimations=!0,Fn.animationDuration=rn,un.push(w(rn)))),0===rn&&!En.recalculateTimingStyles)return T();if(null!=Q.delay){var In;"boolean"!=typeof Q.delay&&(In=parseFloat(Q.delay),tn=Math.max(In,0)),En.applyTransitionDelay&&un.push(S(In)),En.applyAnimationDelay&&un.push(S(In,!0))}return null==Q.duration&&Fn.transitionDuration>0&&(En.recalculateTimingStyles=En.recalculateTimingStyles||Nn),an=tn*dn,on=rn*dn,Q.skipBlocking||(En.blockTransition=Fn.transitionDuration>0,En.blockKeyframeAnimation=Fn.animationDuration>0&&wn.animationDelay>0&&0===wn.animationDuration),Q.from&&(Q.cleanupStyles&&N(U,W,Object.keys(Q.from)),v(n,Q)),En.blockTransition||En.blockKeyframeAnimation?y(rn):Q.skipBlocking||D(W,!1),{$$willAnimate:!0,end:l,start:function(){if(!V)return nn={end:l,cancel:f,resume:null,pause:null},_=new s(nn),j(K),_}}}}]}],Cn=["$$animationProvider",function(n){function t(n){return n.parentNode&&11===n.parentNode.nodeType}n.drivers.push("$$animateCssDriver");var e="ng-animate-shim",a="ng-anchor",r="ng-anchor-out",i="ng-anchor-in";this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(n,o,s,u,l,c,m){function d(n){return n.replace(/\bng-\S+\b/g,"")}function v(n,t){return K(n)&&(n=n.split(" ")),K(t)&&(t=t.split(" ")),n.filter(function(n){return-1===t.indexOf(n)}).join(" ")}function p(t,o,u){function l(n){var t={},e=$(n).getBoundingClientRect();return B(["width","height","top","left"],function(n){var a=e[n];switch(n){case"top":a+=C.scrollTop;break;case"left":a+=C.scrollLeft}t[n]=Math.floor(a)+"px"}),t}function c(n){return n.attr("class")||""}function f(){var t=d(c(u)),e=v(t,h),a=v(h,t),o=n(p,{to:l(u),addClass:i+" "+e,removeClass:r+" "+a,delay:!0});return o.$$willAnimate?o:null}function m(){p.remove(),o.removeClass(e),u.removeClass(e)}var p=H($(o).cloneNode(!0)),h=d(c(p));o.addClass(e),u.addClass(e),p.addClass(a),D.append(p);var g,y=function(){var t=n(p,{addClass:r,delay:!0,from:l(o)});return t.$$willAnimate?t:null}();if(!y&&!(g=f()))return m();var b=y||g;return{start:function(){function n(){e&&e.end()}var t,e=b.start();return e.done(function(){if(e=null,!g&&(g=f()))return(e=g.start()).done(function(){e=null,m(),t.complete()}),e;m(),t.complete()}),t=new s({end:n,cancel:n})}}}function h(n,t,e,a){var r=g(n),i=g(t),o=[];if(B(a,function(n){var t=n.out,a=n.in,r=p(e,t,a);r&&o.push(r)}),r||i||0!==o.length)return{start:function(){function n(){B(t,function(n){n.end()})}var t=[];r&&t.push(r.start()),i&&t.push(i.start()),B(o,function(n){t.push(n.start())});var e=new s({end:n,cancel:n});return s.all(t,function(n){e.complete(n)}),e}}}function g(t){var e=t.element,a=t.options||{};t.structural&&(a.event=t.event,a.structural=!0,a.applyClassesEarly=!0,"leave"===t.event&&(a.onDone=a.domOperation)),a.preparationClasses&&(a.event=k(a.event,a.preparationClasses));var r=n(e,a);return r.$$willAnimate?r:null}if(!l.animations&&!l.transitions)return R;var C=m[0].body,y=$(u),D=H(t(y)||C.contains(y)?y:C);f(c);return function(n){return n.from&&n.to?h(n.from,n.to,n.classes,n.anchors):g(n)}}]}],yn=["$animateProvider",function(n){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(t,e,a){function r(e){e=J(e)?e:e.split(" ");for(var a=[],r={},i=0;i<e.length;i++){var o=e[i],s=n.$$registeredAnimations[o];s&&!r[o]&&(a.push(t.get(s)),r[o]=!0)}return a}var i=f(a);return function(n,t,a,o){function s(){o.domOperation(),i(n,o)}function u(){v=!0,s(),d(n,o)}function l(n,t,a,r,i){var o;switch(a){case"animate":o=[t,r.from,r.to,i];break;case"setClass":o=[t,g,$,i];break;case"addClass":o=[t,g,i];break;case"removeClass":o=[t,$,i];break;default:o=[t,i]}o.push(r);var s=n.apply(n,o);if(s)if(V(s.start)&&(s=s.start()),s instanceof e)s.done(i);else if(V(s))return s;return R}function c(n,t,a,r,i){var o=[];return B(r,function(r){var s=r[i];s&&o.push(function(){var r,i,o=!1,u=function(n){o||(o=!0,(i||R)(n),r.complete(!n))};return r=new e({end:function(){u()},cancel:function(){u(!0)}}),i=l(s,n,t,a,function(n){u(!1===n)}),r})}),o}function f(n,t,a,r,i){var o=c(n,t,a,r,i);if(0===o.length){var s,u;"beforeSetClass"===i?(s=c(n,"removeClass",a,r,"beforeRemoveClass"),u=c(n,"addClass",a,r,"beforeAddClass")):"setClass"===i&&(s=c(n,"removeClass",a,r,"removeClass"),u=c(n,"addClass",a,r,"addClass")),s&&(o=o.concat(s)),u&&(o=o.concat(u))}if(0!==o.length)return function(n){var t=[];return o.length&&B(o,function(n){t.push(n())}),t.length?e.all(t,n):n(),function(n){B(t,function(t){n?t.cancel():t.end()})}}}var v=!1;3===arguments.length&&Q(a)&&(o=a,a=null),o=m(o),a||(a=n.attr("class")||"",o.addClass&&(a+=" "+o.addClass),o.removeClass&&(a+=" "+o.removeClass));var p,h,g=o.addClass,$=o.removeClass,C=r(a);if(C.length){var y,D;"leave"==t?(D="leave",y="afterLeave"):(D="before"+t.charAt(0).toUpperCase()+t.substr(1),y=t),"enter"!==t&&"move"!==t&&(p=f(n,t,o,C,D)),h=f(n,t,o,C,y)}if(p||h){var b;return{$$willAnimate:!0,end:function(){return b?b.end():(u(),(b=new e).complete(!0)),b},start:function(){function n(n){u(n),b.complete(n)}function t(t){v||((a||R)(t),n(t))}if(b)return b;b=new e;var a,r=[];return p&&r.push(function(n){a=p(n)}),r.length?r.push(function(n){s(),n(!0)}):s(),h&&r.push(function(n){a=h(n)}),b.setHost({end:function(){t()},cancel:function(){t(!0)}}),e.chain(r,n),b}}}}}]}],Dn=["$$animationProvider",function(n){n.drivers.push("$$animateJsDriver"),this.$get=["$$animateJs","$$AnimateRunner",function(n,t){function e(t){var e=t.element,a=t.event,r=t.options,i=t.classes;return n(e,a,i,r)}return function(n){if(n.from&&n.to){var a=e(n.from),r=e(n.to);if(!a&&!r)return;return{start:function(){function n(){return function(){B(e,function(n){n.end()})}}var e=[];a&&e.push(a.start()),r&&e.push(r.start()),t.all(e,function(n){i.complete(n)});var i=new t({end:n(),cancel:n()});return i}}}return e(n)}}]}],bn="data-ng-animate",An="$ngAnimatePin",kn=["$animateProvider",function(a){function r(n){if(!n)return null;var t=n.split(p),e=Object.create(null);return B(t,function(n){e[n]=!0}),e}function i(n,t){if(n&&t){var e=r(t);return n.split(p).some(function(n){return e[n]})}}function o(n,t,e,a){return g[n].some(function(n){return n(t,e,a)})}function l(n,t){var e=(n.addClass||"").length>0,a=(n.removeClass||"").length>0;return t?e&&a:e||a}var c=1,v=2,p=" ",g=this.rules={skip:[],cancel:[],join:[]};g.join.push(function(n,t,e){return!t.structural&&l(t)}),g.skip.push(function(n,t,e){return!t.structural&&!l(t)}),g.skip.push(function(n,t,e){return"leave"==e.event&&t.structural}),g.skip.push(function(n,t,e){return e.structural&&e.state===v&&!t.structural}),g.cancel.push(function(n,t,e){return e.structural&&t.structural}),g.cancel.push(function(n,t,e){return e.state===v&&t.structural}),g.cancel.push(function(n,t,e){if(e.structural)return!1;var a=t.addClass,r=t.removeClass,o=e.addClass,s=e.removeClass;return!(U(a)&&U(r)||U(o)&&U(s))&&(i(a,s)||i(r,o))}),this.$get=["$$rAF","$rootScope","$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow",function(r,i,p,g,D,b,A,k,w,S){function T(){var n=!1;return function(t){n?t():i.$$postDigest(function(){n=!0,t()})}}function j(n,t){return h(n,t,{})}function x(n,t,e){var a=$(t),r=$(n),i=[],o=_[e];return o&&B(o,function(n){rn.call(n.node,a)?i.push(n.callback):"leave"===e&&rn.call(n.node,r)&&i.push(n.callback)}),i}function O(n,t,e){var a=u(t);return n.filter(function(n){return!(n.node===a&&(!e||n.callback===e))})}function P(n,t){"close"!==n||t[0].parentNode||on.off(t)}function N(n,t,e){function a(t,e,a,i){w(function(){var t=x(p,n,e);t.length?r(function(){B(t,function(t){t(n,a,i)}),P(a,n)}):P(a,n)}),t.progress(e,a,i)}function u(t){y(n,D),an(n,D),d(n,D),D.domOperation(),k.complete(!t)}var f,p,D=q(e);(n=s(n))&&(f=$(n),p=n.parent()),D=m(D);var k=new A,w=T();if(J(D.addClass)&&(D.addClass=D.addClass.join(" ")),D.addClass&&!K(D.addClass)&&(D.addClass=null),J(D.removeClass)&&(D.removeClass=D.removeClass.join(" ")),D.removeClass&&!K(D.removeClass)&&(D.removeClass=null),D.from&&!Q(D.from)&&(D.from=null),D.to&&!Q(D.to)&&(D.to=null),!f)return u(),k;var S=[f.className,D.addClass,D.removeClass].join(" ");if(!en(S))return u(),k;var O=["enter","move","leave"].indexOf(t)>=0,N=g[0].hidden,E=!Y||N||X.get(f),L=!E&&V.get(f)||{},H=!!L.state;if(E||H&&L.state==c||(E=!I(n,p,t)),E)return N&&a(k,t,"start"),u(),N&&a(k,t,"close"),k;O&&F(n);var U={structural:O,element:n,event:t,addClass:D.addClass,removeClass:D.removeClass,close:u,options:D,runner:k};if(H){if(o("skip",n,U,L))return L.state===v?(u(),k):(h(n,L,U),L.runner);if(o("cancel",n,U,L))if(L.state===v)L.runner.end();else{if(!L.structural)return h(n,L,U),L.runner;L.close()}else if(o("join",n,U,L)){if(L.state!==v)return C(n,O?t:null,D),t=U.event=L.event,D=h(n,L,U),L.runner;j(n,U)}}else j(n,U);var W=U.structural;if(W||(W="animate"===U.event&&Object.keys(U.options.to||{}).length>0||l(U)),!W)return u(),M(n),k;var z=(L.counter||0)+1;return U.counter=z,R(n,c,U),i.$$postDigest(function(){var e=V.get(f),r=!e;e=e||{};var i=(n.parent()||[]).length>0&&("animate"===e.event||e.structural||l(e));if(r||e.counter!==z||!i)return r&&(an(n,D),d(n,D)),(r||O&&e.event!==t)&&(D.domOperation(),k.end()),void(i||M(n));t=!e.structural&&l(e,!0)?"setClass":e.event,R(n,v);var o=b(n,t,e.options);k.setHost(o),a(k,t,"start",{}),o.done(function(e){u(!e);var r=V.get(f);r&&r.counter===z&&M($(n)),a(k,t,"close",{})})}),k}function F(n){var t=$(n).querySelectorAll("["+bn+"]");B(t,function(n){var t=parseInt(n.getAttribute(bn)),e=V.get(n);if(e)switch(t){case v:e.runner.end();case c:V.remove(n)}})}function M(n){var t=$(n);t.removeAttribute(bn),V.remove(t)}function E(n,t){return $(n)===$(t)}function I(n,t,e){var a,r=H(g[0].body),i=E(n,r)||"HTML"===n[0].nodeName,o=E(n,p),s=!1,u=X.get($(n)),l=H.data(n[0],An);for(l&&(t=l),t=$(t);t&&(o||(o=E(t,p)),t.nodeType===G);){var c=V.get(t)||{};if(!s){var f=X.get(t);if(!0===f&&!1!==u){u=!0;break}!1===f&&(u=!1),s=c.structural}if(U(a)||!0===a){var m=H.data(t,nn);W(m)&&(a=m)}if(s&&!1===a)break;if(i||(i=E(t,r)),i&&o)break;t=o||!(l=H.data(t,An))?t.parentNode:$(l)}return(!s||a)&&!0!==u&&o&&i}function R(n,t,e){(e=e||{}).state=t;var a=$(n);a.setAttribute(bn,t);var r=V.get(a),i=r?L(r,e):e;V.put(a,i)}var V=new D,X=new D,Y=null,Z=i.$watch(function(){return 0===k.totalPendingRequests},function(n){n&&(Z(),i.$$postDigest(function(){i.$$postDigest(function(){null===Y&&(Y=!0)})}))}),_={},tn=a.classNameFilter(),en=tn?function(n){return tn.test(n)}:function(){return!0},an=f(w),rn=n.Node.prototype.contains||function(n){return this===n||!!(16&this.compareDocumentPosition(n))},on={on:function(n,t,e){var a=u(t);_[n]=_[n]||[],_[n].push({node:a,callback:e}),H(t).on("$destroy",function(){V.get(a)||on.off(n,t,e)})},off:function(n,e,a){if(1!==arguments.length||t.isString(arguments[0])){var r=_[n];r&&(_[n]=1===arguments.length?null:O(r,e,a))}else{e=arguments[0];for(var i in _)_[i]=O(_[i],e)}},pin:function(n,t){e(z(n),"element","not an element"),e(z(t),"parentElement","not an element"),n.data(An,t)},push:function(n,t,e,a){return e=e||{},e.domOperation=a,N(n,t,e)},enabled:function(n,t){var e=arguments.length;if(0===e)t=!!Y;else if(z(n)){var a=$(n),r=X.get(a);1===e?t=!r:X.put(a,!t)}else t=Y=!!n;return t}};return on}]}],wn=["$animateProvider",function(n){function t(n,t){n.data(s,t)}function e(n){n.removeData(s)}function r(n){return n.data(s)}var i="ng-animate-ref",o=this.drivers=[],s="$$animationRunner";this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$HashMap","$$rAFScheduler",function(n,s,u,l,c,v){function p(n){function t(n){if(n.processed)return n;n.processed=!0;var e=n.domNode,i=e.parentNode;r.put(e,n);for(var o;i;){if(o=r.get(i)){o.processed||(o=t(o));break}i=i.parentNode}return(o||a).children.push(n),n}var e,a={children:[]},r=new c;for(e=0;e<n.length;e++){var i=n[e];r.put(i.domNode,n[e]={domNode:i.domNode,fn:i.fn,children:[]})}for(e=0;e<n.length;e++)t(n[e]);return function(n){var t,e=[],a=[];for(t=0;t<n.children.length;t++)a.push(n.children[t]);var r=a.length,i=0,o=[];for(t=0;t<a.length;t++){var s=a[t];r<=0&&(r=i,i=0,e.push(o),o=[]),o.push(s.fn),s.children.forEach(function(n){i++,a.push(n)}),r--}return o.length&&e.push(o),e}(a)}var h=[],g=f(n);return function(c,f,C){function y(n){var t="["+i+"]",e=n.hasAttribute(i)?[n]:n.querySelectorAll(t),a=[];return B(e,function(n){var t=n.getAttribute(i);t&&t.length&&a.push(n)}),a}function D(n){var t=[],e={};B(n,function(n,a){var r=$(n.element),o=n.event,s=["enter","move"].indexOf(o)>=0,u=n.structural?y(r):[];if(u.length){var l=s?"to":"from";B(u,function(n){var t=n.getAttribute(i);e[t]=e[t]||{},e[t][l]={animationID:a,element:H(n)}})}else t.push(n)});var a={},r={};return B(e,function(e,i){var o=e.from,s=e.to;if(o&&s){var u=n[o.animationID],l=n[s.animationID],c=o.animationID.toString();if(!r[c]){var f=r[c]={structural:!0,beforeStart:function(){u.beforeStart(),l.beforeStart()},close:function(){u.close(),l.close()},classes:b(u.classes,l.classes),from:u,to:l,anchors:[]};f.classes.length?t.push(f):(t.push(u),t.push(l))}r[c].anchors.push({out:o.element,in:s.element})}else{var m=o?o.animationID:s.animationID,d=m.toString();a[d]||(a[d]=!0,t.push(n[m]))}}),t}function b(n,t){n=n.split(" "),t=t.split(" ");for(var e=[],a=0;a<n.length;a++){var r=n[a];if("ng-"!==r.substring(0,3))for(var i=0;i<t.length;i++)if(r===t[i]){e.push(r);break}}return e.join(" ")}function A(n){for(var t=o.length-1;t>=0;t--){var e=o[t];if(u.has(e)){var a=u.get(e)(n);if(a)return a}}}function k(n,t){function e(n){var e=r(n);e&&e.setHost(t)}n.from&&n.to?(e(n.from.element),e(n.to.element)):e(n.element)}function w(){var n=r(c);!n||"leave"===f&&C.$$domOperationFired||n.end()}function S(t){c.off("$destroy",w),e(c),g(c,C),d(c,C),C.domOperation(),O&&n.removeClass(c,O),c.removeClass(_),j.complete(!t)}C=m(C);var T=["enter","move","leave"].indexOf(f)>=0,j=new l({end:function(){S()},cancel:function(){S(!0)}});if(!o.length)return S(),j;t(c,j);var x=a(c.attr("class"),a(C.addClass,C.removeClass)),O=C.tempClasses;O&&(x+=" "+O,C.tempClasses=null);var P;return T&&(P="ng-"+f+"-prepare",n.addClass(c,P)),h.push({element:c,classes:x,event:f,structural:T,options:C,beforeStart:function(){c.addClass(_),O&&n.addClass(c,O),P&&(n.removeClass(c,P),P=null)},close:S}),c.on("$destroy",w),h.length>1?j:(s.$$postDigest(function(){var n=[];B(h,function(t){r(t.element)?n.push(t):t.close()}),h.length=0;var t=D(n),e=[];B(t,function(n){e.push({domNode:$(n.from?n.from.element:n.element),fn:function(){n.beforeStart();var t,e=n.close;if(r(n.anchors?n.from.element||n.to.element:n.element)){var a=A(n);a&&(t=a.start)}if(t){var i=t();i.done(function(n){e(!n)}),k(n,i)}else e()}})}),v(p(e))}),j)}}]}],Sn=["$animate","$rootScope",function(n,t){return{restrict:"A",transclude:"element",terminal:!0,priority:600,link:function(t,e,a,r,i){var o,s;t.$watchCollection(a.ngAnimateSwap||a.for,function(a){o&&n.leave(o),s&&(s.$destroy(),s=null),(a||0===a)&&(s=t.$new(),i(s,function(t){o=t,n.enter(t,null,e)}))})}}}];t.module("ngAnimate",[]).directive("ngAnimateSwap",Sn).directive("ngAnimateChildren",fn).factory("$$rAFScheduler",cn).provider("$$animateQueue",kn).provider("$$animation",wn).provider("$animateCss",$n).provider("$$animateCssDriver",Cn).provider("$$animateJs",yn).provider("$$animateJsDriver",Dn)}(window,window.angular);