text: !function(t,n){"use strict";null==t&&"undefined"!=typeof global&&(t=global);var e=function(){return n(t,t.mask)};if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var i=e();for(var r in i)t.mask[r]=i[r]}}(this,function(t,n){"use strict";function e(t){return t instanceof Array}function i(t){return"function"==typeof t}function r(t,n){return function(){switch(arguments.length){case 0:return n.call(t);case 1:return n.call(t,arguments[0]);case 2:return n.call(t,arguments[1]);default:return n.apply(t,arguments)}}}var s=document.createElement("div").style,o=function(){return"transform"in s?"":"webkitTransform"in s?"webkit":"MozTransform"in s?"Moz":"OTransform"in s?"O":"msTransform"in s?"ms":""}(),a=function(){for(var t=["transition","webkitTransition","MozTransition","OTransition","msTransition"],n=0,e=t.length;n<e;n++)if(t[n]in s)return!0;return!1}(),l=o?"-"+o.toLowerCase()+"-":"",u=function(){var t=(document.createElement("div"),{transition:"transitionend",OTransition:"oTransitionEnd",msTransition:"msTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"}),n=null;for(var e in t)if(void 0!==s[e]){n=t[e];break}return(u=function(){return n})()},h={prop:l+"transition-property",duration:l+"transition-duration",timing:l+"transition-timing-function",delay:l+"transition-delay"},m=function(){function t(t){var n=null;for(i.lastIndex=0;;){var e=i.exec(t);if(!e)return n;(n||(n={}))[e[1]]=e[0]}}function n(t){for(var n=Object.keys(t).sort().reverse(),e=0;e<n.length;e++)n[e]=t[n[e]];return n.join(" ")}function e(){this.transforms={}}var i=/([\w]+)\([^\)]+\)/g;return e.prototype={constructor:e,handle:function(e){var i=t(e.from),r=t(e.to),s=null;if(i){for(s in this.transforms)s in i==!1&&(i[s]=this.transforms[s]);e.from=n(i);for(s in i)this.transforms[s]=i[s]}for(s in this.transforms)s in r==!1&&(r[s]=this.transforms[s]);e.to=n(r);for(s in r)this.transforms[s]=r[s]}},e}(),c={linear:null,ease:null,"ease-in":null,"ease-out":null,"ease-in-out":null,easeInSine:"cubic-bezier(0.47, 0, 0.745, 0.715)",easeOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInOutSine:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",easeInQuad:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",easeOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInOutQuad:"cubic-bezier(0.455, 0.03, 0.515, 0.955)",easeInCubic:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",easeOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1)",easeInQuart:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",easeOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInOutQuart:"cubic-bezier(0.77, 0, 0.175, 1)",easeInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",easeOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutQuint:"cubic-bezier(0.86, 0, 0.07, 1)",easeInExpo:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",easeOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInOutExpo:"cubic-bezier(1, 0, 0, 1)",easeInCirc:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",easeOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.15, 0.86)",easeInBack:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",easeInOutBack:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},f=function(){function t(t){var n=t.split(/ *\| */g),e={},i=n.length;e.prop=n[0]in u?l+n[0]:n[0];var r=n[1].split(/ *> */);if(r[0]&&(e.from=r[0]),e.to=r[r.length-1],i>2){var s=/(\d+m?s)?\s*([a-z]+[^\s]*)?\s*(\d+m?s)?/.exec(n[2]);if(null!=s)return e.duration=s[1]||"200ms",e.timing=s[2]||"linear",e.delay=s[3]||"0",e}e.duration="200ms",e.timing="linear",e.delay="0";var o=c[e.timing];return null!=o&&(e.timing=o),e}function n(i,r){this.parent=r,this.transformModel=r&&r.transformModel||new m;var s=i.model||i;if(e(s)){this.model=[];for(var o=0,a=s.length;o<a;o++)this.model.push(new n(s[o],this))}else if(s instanceof Object){if(s===i)return console.error('Animation Object Model has no "model" property',i),void(this.modelCount=this.nextCount=this.state=0);this.model=[new n(s,this)]}else"string"==typeof s&&(this.model=t(s),~this.model.prop.indexOf("transform")&&this.transformModel.handle(this.model));null!=i.next&&(this.next=new n(i.next,this)),this.state=0,this.nextCount=0,this.modelCount=e(this.model)?this.model.length:1,null!=this.next&&(this.nextCount=e(this.next)?this.next.length:1)}function r(t){for(var n=e(t),i=n?t.length:1,r=null,s=0;n?s<i:s<1;s++)r=n?t[s]:t,r.reset&&r.reset()}function s(t){return t?-1!==t.indexOf("ms")?parseInt(t):t.indexOf("s")?1e3*parseFloat(t):(console.warn("<mask:animation> parsing time",t),0):0}function o(t){for(var n=e(t),r=n?t.length:1,o=null,a=0,l=0;n?a<r:a<1;a++){o=n?t[a]:t;var u;u=i(o.getDuration)?o.getDuration():s(t.duration)+s(t.delay),u>l&&(l=u)}return l}function a(t,n){if(null!=t)for(var r=e(t),s=r?t.length:1,o=null,a=0;r?a<s:a<1;a++)o=r?t[a]:t,i(o.getFinalCss)?o.getFinalCss(n):n[o.prop]=o.to}var u={transform:null};return n.prototype={constructor:n,reset:function(){this.state=0,this.nextCount=0,this.modelCount=e(this.model)?this.model.length:1,null!=this.next&&(this.nextCount=e(this.next)?this.next.length:1),this.model&&r(this.model),this.next&&r(this.next)},getNext:function(){return 0===this.state?(this.state=1,this):(1===this.state&&this.modelCount>0&&--this.modelCount,1===this.state&&0===this.modelCount&&(this.state=2,this.next)?this.next:(2===this.state&&this.nextCount>0&&--this.nextCount,2===this.state&&0===this.nextCount&&this.parent?this.parent.getNext&&this.parent.getNext():null))},getDuration:function(){var t=0;return this.model&&(t+=o(this.model)),this.next&&(t+=o(this.next)),t},getFinalCss:function(t){return null==t&&(t={}),a(this.model,t),a(this.next,t),t}},n}(),d=function(){function t(){this.arr=[]}return t.prototype={constructor:t,put:function(t){if(null==t)return!1;var n,i,r=t.getNext(),s=!1;if(null==r)return!1;if(e(r)){for(i=0,n=r.length;i<n;i++)!0===this.put(r[i])&&(s=!0);return s}if(0===r.state&&(r.state=1),r.model instanceof Array){for(s=!1,i=0,n=r.model.length;i<n;i++)!0===this.put(r.model[i])&&(s=!0);return s}return this.resolve(r.model.prop),this.arr.push(r),!0},resolve:function(t){for(var n,e=0,i=this.arr.length;e<i;e++)if(n=this.arr[e],n.model.prop===t)return this.arr.splice(e,1),this.put(n);return!1},getCss:function(t,n){var e,i,r,s;for(e=0,i=this.arr.length;e<i;e++){s=this.arr[e],"from"in s.model&&(t[s.model.prop]=s.model.from),n[s.model.prop]=s.model.to;for(r in h)(n[h[r]]||(n[h[r]]=[])).push(s.model[r])}for(r in h)n[h[r]]=n[h[r]].join(",")},clear:function(){this.arr.length=0}},t}(),p=function(){function t(t){this.stack=new d,this.model=new f(t),this.duration=this.model.getDuration(),this._transitionEnd=r(this,this._transitionEnd),this.finish=r(this,this.finish),this.finishTimeout=null}for(var n,e,s=["WebKitTransitionEvent","mozTransitionEvent","oTransitionEvent","TransitionEvent"],o=0;o<s.length;o++)if(s[o]in window){e=s[o],n=window[e];break}null==e&&(e="TransitionEvent");var h={display:1,"font-family":1,visibility:1};try{new n(u(),{propertyName:"opacity",bubbles:!0,cancelable:!0})}catch(t){n=function(t,n){var i=document.createEvent(e);return i["init"+e[0].toUpperCase()+e.substring(1)](u(),!0,!0,n.propertyName,0),i}}return t.prototype={constructor:t,start:function(t,n){if(this.element=t,!1===a)return this.apply(this.model.getFinalCss()),void(n&&n());t.addEventListener(u(),this._transitionEnd,!1);var e={},i={};this.onComplete=n,this.model.reset(),this.stack.clear(),this.stack.put(this.model),this.stack.getCss(e,i),this.apply(e,i),this.finishTimeout=setTimeout(this.finish,this.duration)},stop:function(){this.finish()},finish:function(){if(null!=this.element){this.element.style.setProperty(l+"transition","none"),this.element.removeEventListener(u(),this._transitionEnd,!1);var t=this.onComplete;this.onComplete=null,this.element=null,i(t)&&t()}},_transitionEnd:function(t){if(t.target===t.currentTarget&&!0===this.stack.resolve(t.propertyName)){var n={},e={};return this.stack.getCss(n,e),void this.apply(n,e)}},apply:function(t,e){t[l+"transition"]="none";var i=this.element.style,r=this.element;if(null!=t)for(var s in t)i.setProperty(s,t[s],"");getComputedStyle(r).width;var o;for(var s in e)i.setProperty(s,e[s],""),h.hasOwnProperty(s)&&(o||(o=[])).push(s);if(null!=o&&null!=n)for(var a=u(),m=0;m<o.length;m++){var c=new n(a,{propertyName:o[m],bubbles:!0,cancelable:!0});r.dispatchEvent(c)}}},t}(),v=function(){var t={},n=null,e=function(){n=o?{keyframes:"@"+l+"keyframes",AnimationIterationCount:o+"AnimationIterationCount",AnimationDuration:o+"AnimationDuration",AnimationTimingFunction:o+"AnimationTimingFunction",AnimationFillMode:o+"AnimationFillMode",AnimationName:o+"AnimationName"}:{keyframes:"@keyframes",AnimationIterationCount:"animationIterationCount",AnimationDuration:"animationDuration",AnimationTimingFunction:"animationTimingFunction",AnimationFillMode:"animationFillMode",AnimationName:"animationName"}};return{create:function(i){if(null==n&&e(),null==t[i.id]){for(var r=document.styleSheets[0].insertRule(n.keyframes+" "+i.id+" {}",0),s=document.styleSheets[0].cssRules[r],o=i.frames-(i.frameStart||0),a=100/o,l=i.property||"background-position-x",u=0;u<o;u++){var h=a*(u+1)+"% { "+l+": "+-i.frameWidth*(u+(i.frameStart||0))+"px}";(s.insertRule||s.appendRule).call(s,h)}s.iterationCount=i.iterationCount,s.frameToStop=i.frameToStop,t[i.id]=s}},start:function(e,i,r){var s=e.style;s[n.AnimationName]="none",setTimeout(function(){var o=t[i];if("forwards"===s[n.AnimationFillMode])return void v.stop(e);e.addEventListener(n+"AnimationEnd",function(){var t;if(o.frameToStop){var n=o.cssRules[o.cssRules.length-1].style;t={};for(var i=0;i<n.length;i++)t[n[i]]=n[n[i]]}v.stop(e,t)},!1),s[n.AnimationIterationCount]=o.iterationCount||1,s[n.AnimationDuration]=o.cssRules.length*r+"ms",s[n.AnimationTimingFunction]="step-start",s[n.AnimationFillMode]=o.frameToStop?"forwards":"none",s[n.AnimationName]=i},0)},stop:function(t,e){var i=t.style;i[n.AnimationFillMode]="none",i[n.AnimationName]="",null!=e&&$(t).css(e)}}}();return function(){function t(r){if(null==r)return null;if(r instanceof Array){if(1===r.length)return t(r[0]);for(var s,o=r,a=i(o),l=new a,u=0,h=o.length;u<h;u++)s=o[u],a!==Array?a===Object&&(l[e(s)]=t(s.nodes)):l.push(t(s));return l}if(n.Dom.TEXTNODE===r.type)return r.content;if(n.Dom.FRAGMENT===r.type)return t(r.nodes);if(n.Dom.NODE){var m={};return m[e(r)]=t(r.nodes),m}return null}function e(t){var n=t.tagName;return 64===n.charCodeAt(0)?n.substring(1):n}function i(t){for(var e,i={},r=0,s=t.length;r<s;r++)switch(e=t[r],e.type){case n.Dom.TEXTNODE:case n.Dom.FRAGMENT:return Array;case n.Dom.NODE:if(1===i[e.tagName])return Array;i[e.tagName]=1}return Object}var s=n.Compo,o=1,a=2,l=n.class.create({meta:{template:"merge"},state:o,repeat:1,step:1,delayTimer:null,slots:null,pipes:null,attr:null,render:function(n,e,i){var r=this.nodes;if(null==r)return void console.warn("No Animation Model");var o=this.attr["x-slots"];if(null!=o){o=o.split(";"),this.slots={};for(var a=o.length,l=-1;++l<a;){var u=o[l].trim();this.slots[u]=this.startFromSlot}}var h=this.attr["x-pipes"];if(null!=h){h=h.split(";"),this.pipes={};for(var a=h.length,l=-1;++l<a;){var u=h[l].trim(),m=u.indexOf(".");if(-1!==m){var c=u.substring(0,m);(this.pipes[c]||(this.pipes[c]={}))[u.substring(++m)]=this.startFromPipe}else console.error("Animation - pipeName.slotName : dot not found")}s.pipe.addController(this)}for(var a=r.length,l=-1,f=!1;++l<a;){var d=r[l];if("function"===d.tagName){if(null==d.compile){console.error("Please update MaskJS to compile fns inside Animation compo");break}var v=d.compile(null,this);this[d.name]=v,"start"===d.name&&(f=!0)}}!1===f&&(this.model=new p(t(r))),this.container=i,this.attr["x-repeat"]&&(this.repeat=this.attr["x-repeat"]<<0||1/0),this.attr["x-autostart"]&&(this.slots=this.slots||{},this.slots.domInsert=this.start.bind(this))},startFromSlot:function(t,n){var e=n instanceof Node?n:null;this.start(null,e)},startFromPipe:function(t){var n=t instanceof Node?t:null;this.start(null,n)},start:function(t,n){this.delayTimer&&clearTimeout(this.delayTimer);var e=this.attr["x-delay"];return null!=e?(this.delayTimer=setTimeout(this._start.bind(this,t,n),e<<0),this):(this._start(t,n),this)},_start:function(t,n){this.state===a&&this.stop(),this.element=n||this.container,this.state=a,this.callback=t,this.step=1,this.model.start(this.element,r(this,this.nextStep))},stop:function(){this.callback&&this.callback(this),this.model.stop(),this.element=null,this.callback=null,this.state=o},nextStep:function(){if(++this.step>this.repeat)return this.stop();this.model.start(this.element,r(this,this.nextStep))},dispose:function(){this.state!==o&&(this.model.onComplete=null,this.model.stop(),this.element=null,this.callback=null)}});n.registerHandler(":animation",l),n.registerHandler("Animation",l),s.prototype.animate=function(t,n,e){var i=this.find("#"+t);return null==i?(console.warn("Animation is not found",t),void(n&&n())):i.start(n,e)}}(),function(){function t(){}n.registerHandler(":animation:sprite",t),t.prototype={constructor:t,render:function(t,n,e){var i=this.attr,r=i.src,s=i.id,o=i.frames,a=i.property,l=i.frameWidth,u=i.frameHeight,h=i.iterationCount,m=i.msperframe,c=i.delay,f=(e.getAttribute("style")||"")+";background: url("+r+") 0 0 no-repeat; width:"+l+"px; height:"+u+"px;";e.setAttribute("style",f),v.create({id:s,frameWidth:l,frames:o,property:a,iterationCount:h,delay:c}),i.autostart&&v.start(e,s,m)}}}(),{animate:function(t,n,e){new p(n).start(t,e)},sprite:v}});
  //# sourceMappingURL=mask.animation.min.js.map