From 31c913b9f0beb03ba6fce18eb11154af9d795e2b Mon Sep 17 00:00:00 2001 From: Oleg Solomka Date: Fri, 25 Mar 2016 13:33:28 +0100 Subject: [PATCH] burst: add tune method --- bower.json | 2 +- build/mo.js | 231 +++++++++++++++++------------ build/mo.min.js | 11 +- js/burst.babel.js | 39 ++++- js/easing/easing.coffee | 6 +- js/mojs.babel.js | 46 +++--- js/tween/timeline.babel.js | 1 + js/tween/tween.babel.js | 4 +- karma.conf.js | 3 + lib/burst.js | 289 +++++++++++++++---------------------- lib/easing/easing.js | 3 + lib/mojs.js | 51 ++++--- lib/tween/tween.js | 1 - package.json | 2 +- spec/burst.coffee | 69 +++++++++ spec/burst.js | 83 ++++++++++- spec/easing/easing.coffee | 4 + spec/easing/easing.js | 5 + spec/transit.coffee | 2 +- spec/transit.js | 3 +- spec/tween/tween.coffee | 9 +- spec/tween/tween.js | 10 +- 22 files changed, 532 insertions(+), 342 deletions(-) diff --git a/bower.json b/bower.json index 309b81bf4..2a0bad396 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "mojs", "description": "motion graphics toolbelt for the web", - "version": "0.205.0", + "version": "0.206.0", "license": "MIT", "homepage": "https://github.com/legomushroom/mojs", "authors": [ diff --git a/build/mo.js b/build/mo.js index d75d1ba21..5c7433d01 100644 --- a/build/mo.js +++ b/build/mo.js @@ -1107,16 +1107,18 @@ }, { key: '_assignProp', value: function _assignProp(key, value) { + // fallback to defaults + if (value == null) { + value = this._defaults[key]; + } // parse easing key === 'easing' && (value = _easing2.default.parseEasing(value)); - // handle control callbacks overrides var control = this._callbackOverrides[key], isntOverriden = !value || !value.isMojsCallbackOverride; if (control && isntOverriden) { value = this._overrideCallback(value, control); } - // call super on Module (0, _get3.default)((0, _getPrototypeOf2.default)(Tween.prototype), '_assignProp', this).call(this, key, value); } @@ -1562,6 +1564,7 @@ (0, _get3.default)((0, _getPrototypeOf2.default)(Burst.prototype), '_makeTimeline', this).call(this); (_timeline = this.timeline).add.apply(_timeline, (0, _toConsumableArray3.default)(this._swirls)); + this._o.timeline = null; } /* Method to make Tween for the module. @@ -1572,93 +1575,118 @@ }, { key: '_makeTween', value: function _makeTween() {} /* don't create any tween */ - - // /* - // Method to get if need to update new transform. - // @private - // @returns {Boolean} If transform update needed. - // */ - // // _isNeedsTransform () { - // // return this._isPropChanged('x') || - // // this._isPropChanged('y') || - // // this._isPropChanged('angle'); - // // } - /* - Method to run tween with new options. - @public - @param {Object} New options object. - @returns {Object} this. + /* + Method to tune new history options to all the submodules. + @private + @override @ Tunable */ - // run ( o ) { - // if ( o != null && Object.keys(o).length) { - // if ( o.count || ( o.childOptions && o.childOptions.count )) { - // h.warn('Sorry, count can not be changed on run'); - // } - // this._extendDefaults(o); - // // copy child options to options - // var keys = Object.keys(o.childOptions || {}); - // if ( this._o.childOptions == null ) { this._o.childOptions = {}; } + }, { + key: '_tuneSubModules', + value: function _tuneSubModules() { + // call _tuneSubModules on Tunable + (0, _get3.default)((0, _getPrototypeOf2.default)(Burst.prototype), '_tuneSubModules', this).call(this); + // tune swirls including their tweens + for (var index = 0; index < this._swirls.length; index++) { + var swirl = this._swirls[index], + options = this._getOption(index); - // for (var i = 0; i < keys.length; i++) { - // var key = keys[i]; - // this._o.childOptions[key] = o.childOptions[key]; - // } - // // tune transits - // var len = this._swirls.length; - // while(len--) { - // // we should keep transit's angle otherwise - // // it will fallback to default 0 value - // var option = this._getOption(len), - // ref; - - // if ( (((ref = o.childOptions) != null ? ref.angle : void 0) == null) && ( o.angleShift == null ) ) { - // option.angle = this._swirls[len]._o.angle; - // } - // // calculate bit angle if new angle related option passed - // // and not isResetAngles - // else if ( !o.isResetAngles ) { - // option.angle = this._getBitAngle(option.angle, len); - // } - // this._swirls[len]._tuneNewOption(option, true); - // } - // this.timeline._recalcTotalDuration() - // } - // if ( this._props.randomAngle || this._props.randomRadius ) { - // var len = this._swirls.length; - // while(len--) { - // var tr = this._swirls[len]; - // this._props.randomAngle && tr._setProp({angleShift: this._generateRandomAngle()}); - // this._props.randomRadius && tr._setProp({radiusScale: this._generateRandomRadius()}) - // } - // } - // this.play(); - // return this; - // } - /* - Method to create then chain record. - @private - returns {Object} this. - */ - // then (o) { - // h.error(`Burst's \"then\" method is under consideration, - // you can vote for it in github repo issues`); - // // 1. merge @o and o - // // 2. get i option from merged object - // // 3. pass the object to transit then - // // 4. transform self chain on run - // // i = this._swirls.length - // // while(i--) { this._swirls[i].then(o); } - // // - // return this; - // } + swirl._tuneNewOptions(options); + this._resetTween(swirl.tween, options); + } + this._o.timeline && this.timeline._setProp(this._o.timeline); + this.timeline._recalcTotalDuration(); + } + }, { + key: '_resetTweens', + value: function _resetTweens() {} }]); return Burst; }(_swirl2.default); exports.default = Burst; + // /* + // Method to get if need to update new transform. + // @private + // @returns {Boolean} If transform update needed. + // */ + // // _isNeedsTransform () { + // // return this._isPropChanged('x') || + // // this._isPropChanged('y') || + // // this._isPropChanged('angle'); + // // } + /* + Method to run tween with new options. + @public + @param {Object} New options object. + @returns {Object} this. + */ + // run ( o ) { + // if ( o != null && Object.keys(o).length) { + // if ( o.count || ( o.childOptions && o.childOptions.count )) { + // h.warn('Sorry, count can not be changed on run'); + // } + // this._extendDefaults(o); + // // copy child options to options + // var keys = Object.keys(o.childOptions || {}); + + // if ( this._o.childOptions == null ) { this._o.childOptions = {}; } + + // for (var i = 0; i < keys.length; i++) { + // var key = keys[i]; + // this._o.childOptions[key] = o.childOptions[key]; + // } + // // tune transits + // var len = this._swirls.length; + // while(len--) { + // // we should keep transit's angle otherwise + // // it will fallback to default 0 value + // var option = this._getOption(len), + // ref; + + // if ( (((ref = o.childOptions) != null ? ref.angle : void 0) == null) && ( o.angleShift == null ) ) { + // option.angle = this._swirls[len]._o.angle; + // } + // // calculate bit angle if new angle related option passed + // // and not isResetAngles + // else if ( !o.isResetAngles ) { + // option.angle = this._getBitAngle(option.angle, len); + // } + // this._swirls[len]._tuneNewOption(option, true); + // } + // this.timeline._recalcTotalDuration() + // } + // if ( this._props.randomAngle || this._props.randomRadius ) { + // var len = this._swirls.length; + // while(len--) { + // var tr = this._swirls[len]; + // this._props.randomAngle && tr._setProp({angleShift: this._generateRandomAngle()}); + // this._props.randomRadius && tr._setProp({radiusScale: this._generateRandomRadius()}) + // } + // } + // this.play(); + // return this; + // } + /* + Method to create then chain record. + @private + returns {Object} this. + */ + // then (o) { + // h.error(`Burst's \"then\" method is under consideration, + // you can vote for it in github repo issues`); + // // 1. merge @o and o + // // 2. get i option from merged object + // // 3. pass the object to transit then + // // 4. transform self chain on run + // // i = this._swirls.length + // // while(i--) { this._swirls[i].then(o); } + // // + // return this; + // } + /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { @@ -3072,6 +3100,7 @@ value: function _recalcDuration(timeline) { var p = timeline._props, timelineTime = p.repeatTime / p.speed + (p.shiftTime || 0); + this._props.duration = Math.max(timelineTime, this._props.duration); } /* @@ -5864,6 +5893,9 @@ Easing.prototype.parseEasing = function(easing) { var easingParent, type; + if (easing == null) { + easing = 'linear.none'; + } type = typeof easing; if (type === 'string') { if (easing.charAt(0).toLowerCase() === 'm') { @@ -7672,7 +7704,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } window.mojs = { - revision: '0.205.0', isDebug: true, helpers: _h2.default, + revision: '0.206.0', isDebug: true, helpers: _h2.default, Transit: _transit2.default, Swirl: _swirl2.default, Burst: _burst2.default, stagger: _stagger2.default, Spriter: _spriter2.default, MotionPath: _motionPath2.default, Tween: _tween2.default, Timeline: _timeline2.default, Tweenable: _tweenable2.default, Thenable: _thenable2.default, Tunable: _tunable2.default, Module: _module2.default, tweener: _tweener2.default, easing: _easing2.default, shapesMap: _shapesMap2.default @@ -7682,6 +7714,7 @@ /* add then, generate to burst. randoms in then chains for transit and swirl. + module names parse rand(stagger(20, 10), 20) values perf optimizations. percentage for radius @@ -7689,33 +7722,39 @@ var sw = new mojs.Burst({ left: '50%', top: '50%', - // delay: 'stagger(rand(20, 40))', - // degree: 170, - shape: ['cross', 'polygon', 'zigzag'], + duration: 2000, + easing: 'ease.out', + // shape: ['cross', 'polygon', 'zigzag'], + points: 'rand(3, 5)', stroke: 'cyan', fill: 'none', - radius: { 0: 150 }, + radius: { 0: 50 }, angle: 190, degreeShift: 'rand(-50,50)', - pathScale: 'rand(.5, 1)', - strokeWidth: { 2: 0 }, - childOptions: { - radius: 5, - isSwirl: 1, - swirlSize: 'rand(3, 6)', - swirlFrequency: 'rand(3, 10)', - angle: { 0: 200 } - } + pathScale: 'rand(.5, 1)' }); + // strokeWidth: { 2 : 0 } var playEl = document.querySelector('#js-play'), rangeSliderEl = document.querySelector('#js-range-slider'); document.body.addEventListener('click', function (e) { - sw - // .tune(sw._o) + sw.tune({ + left: e.pageX, top: e.pageY, + duration: 250, + easing: 'ease.out', + isSwirl: 1, + timeline: { + onComplete: function onComplete() { + console.log('comple'); + } + } + // childOptions: { + // radius: 'rand(10, 50)' + // } + }) // .generate() // .tune({ swirlFrequency: 'rand(2, 20)' }) - .play(); + .replay(); // .run(); }); diff --git a/build/mo.min.js b/build/mo.min.js index 55dd25607..22d8e190c 100644 --- a/build/mo.min.js +++ b/build/mo.min.js @@ -1,11 +1,10 @@ /*! :: mo · js :: motion graphics toolbelt for the web Oleg Solomka @LegoMushroom 2015 MIT - 0.205.0 + 0.206.0 */ -!function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="build/",e(0)}([function(t,e,r){t.exports=r(57)},function(t,e,r){r(70),r(71),t.exports=r(65).Symbol},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(27),s=i(n),o=r(22),a=i(o),u=r(24),p=i(u),l=r(20),h=i(l),f=r(23),c=i(f),d=r(25),y=i(d),_=r(15),v=(i(_),r(9)),m=i(v),g=r(18),w=i(g),b=r(13),x=i(b),k=function(t){function e(){var t,r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];a["default"](this,e);var i=p["default"](this,s["default"](e).call(this,r));return null==i._props.name&&i._setSelfName(),t=i,p["default"](i,t)}return y["default"](e,t),c["default"](e,[{key:"_declareDefaults",value:function(){this._defaults={duration:600,delay:0,repeat:0,speed:1,yoyo:!1,easing:"Linear.None",name:null,nameBase:"Tween",onProgress:null,onStart:null,onComplete:null,onRepeatStart:null,onRepeatComplete:null,onFirstUpdate:null,onUpdate:null,isChained:!1,callbacksContext:null}}},{key:"play",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return"play"===this._state&&this._isRunning?!1:(this._props.isReversed=!1,this._subPlay(t,"play"),this._setPlaybackState("play"),this)}},{key:"playBackward",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return"reverse"===this._state&&this._isRunning?!1:(this._props.isReversed=!0,this._subPlay(t,"reverse"),this._setPlaybackState("reverse"),this)}},{key:"pause",value:function(){return this._removeFromTweener(),this._setPlaybackState("pause"),this}},{key:"stop",value:function(t){if("stop"!==this._state){this._props.isReversed=!1,this._removeFromTweener();var e=null!=t?t:"reverse"===this._state?1:0;return this.setProgress(e),this._setPlaybackState("stop"),this._prevTime=null,this}}},{key:"replay",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return this.stop(),this.play(t),this}},{key:"replayBackward",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return this.stop(),this.playBackward(t),this}},{key:"setProgress",value:function(t){var e=this._props;return!e.startTime&&this._setStartTime(),this._playTime=null,0>t&&(t=0),t>1&&(t=1),this._update(e.startTime-e.delay+t*e.repeatTime),this}},{key:"_subPlay",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=arguments[1],r=this._props,i=this._state,n=this._prevState,s="pause"===i,o="play"===i||s&&"play"===n,a="reverse"===i||s&&"reverse"===n,u=o&&"reverse"===e||a&&"play"===e;return this._progressTime=this._progressTime>=r.repeatTime?0:this._progressTime,u&&(this._progressTime=r.repeatTime-this._progressTime),this._resumeTime=performance.now(),this._setStartTime(this._resumeTime-Math.abs(t)-this._progressTime,!1,e),null!=this._prevTime&&(this._prevTime="play"===e?this._normPrevTimeForward():r.endTime-this._progressTime),m["default"].add(this),this}},{key:"_normPrevTimeForward",value:function(){var t=this._props;return t.startTime+this._progressTime-t.delay}}]),c["default"](e,[{key:"_setSelfName",value:function(){var t="_"+this._props.nameBase+"s";m["default"][t]=null==m["default"][t]?1:++m["default"][t],this._props.name=this._props.nameBase+" "+m["default"][t]}},{key:"_setPlaybackState",value:function(t){this._prevState=this._state,this._state=t}},{key:"_vars",value:function(){return this.progress=0,this._prevTime=null,this._progressTime=0,this._negativeShift=0,this._state="stop",this._props.delay<0&&(this._negativeShift=this._props.delay,this._props.delay=0),this._calcDimentions()}},{key:"_calcDimentions",value:function(){this._props.time=this._props.duration+this._props.delay,this._props.repeatTime=this._props.time*(this._props.repeat+1)}},{key:"_extendDefaults",value:function(){this._callbackOverrides=this._o.callbackOverrides||{},delete this._o.callbackOverrides,h["default"](s["default"](e.prototype),"_extendDefaults",this).call(this),this._props.easing=w["default"].parseEasing(this._props.easing)}},{key:"_setStartTime",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],r=this._props,i=r.shiftTime||0;e&&(this._isCompleted=!1,this._isRepeatCompleted=!1,this._isStarted=!1);var n=null==t?performance.now():t;return r.startTime=n+r.delay+this._negativeShift+i,r.endTime=r.startTime+r.repeatTime-r.delay,this._playTime=null!=this._resumeTime?this._resumeTime:n+i,this._resumeTime=null,this}},{key:"_update",value:function(t,e,r,i){var n=this._props;null==this._prevTime&&null!=e&&(this._prevTime=e,this._wasUknownUpdate=!0);var s=n.startTime-n.delay;if(n.speed&&this._playTime&&(t=this._playTime+n.speed*(t-this._playTime)),i&&null!=r){var o=this._getPeriod(t),a=!(!n.yoyo||!this._props.repeat||o%2!==1);1===i?r?(this._prevTime=t+1,this._repeatStart(t,a),this._start(t,a)):(this._prevTime=t-1,this._repeatComplete(t,a),this._complete(t,a)):-1===i&&(r?(this._prevTime=t-1,this._repeatComplete(t,a),this._complete(t,a)):this._prevTime>=n.startTime&&this._prevTime<=n.endTime&&(this._prevTime=t+1,this._repeatStart(t,a),this._start(t,a),this._isCompleted=!0)),this._prevTime=null}return t>s&&t=t?this._progressTime=0:t>=n.endTime&&(this._progressTime=n.repeatTime+1e-11),n.isReversed&&(t=n.endTime-this._progressTime),null===this._prevTime?(this._prevTime=t,this._wasUknownUpdate=!0,!1):(t>=s&&t<=n.endTime&&this._progress((t-s)/n.repeatTime,t),t>=n.startTime&&t<=n.endTime?this._updateInActiveArea(t):this._isInActiveArea&&this._updateInInactiveArea(t),this._prevTime=t,t>=n.endTime||s>=t)}},{key:"_updateInInactiveArea",value:function(t){if(this._isInActiveArea){var e=this._props;if(t>e.endTime&&!this._isCompleted){this._progress(1,t);var r=this._getPeriod(e.endTime),i=e.yoyo&&r%2===0;this._setProgress(i?0:1,t,i),this._repeatComplete(t,i),this._complete(t,i)}tthis._prevTime&&(this._isRepeatCompleted=!1),this._repeatComplete(t,l),this._complete(t,l)}if(this._isCompleted=!1,i+n>=e.startTime){this._isInActiveArea=!0,this._isRepeatCompleted=!1,this._isRepeatStart=!1,this._isStarted=!1;var c=(t-e.startTime)%r,d=c/e.duration,y=o>0&&o>u,_=u>o;if(this._onEdge=0,y&&(this._onEdge=1),_&&(this._onEdge=-1),this._wasUknownUpdate&&(t>this._prevTime&&(this._start(t,l),this._repeatStart(t,l),this._firstUpdate(t,l)),t=0&&this._repeatStart(t,l)}t>this._prevTime&&(!this._isStarted&&this._prevTime<=e.startTime&&(this._start(t,l),this._repeatStart(t,l),this._isStarted=!1,this._isRepeatStart=!1),this._firstUpdate(t,l)),_&&(0!==this.progress&&1!==this.progress&&u!=s&&this._repeatStart(t,h),u!==s||this._wasUknownUpdate||(this._complete(t,l),this._repeatComplete(t,l),this._firstUpdate(t,l),this._isCompleted=!1),this._repeatComplete(t,l)),"delay"===u&&(p>o&&this._repeatComplete(t,l),o===p&&o>0&&this._repeatStart(t,l)),t>this._prevTime?(0===d&&this._repeatStart(t,l),t!==e.endTime&&this._setProgress(l?1-d:d,t,l)):(t!==e.endTime&&this._setProgress(l?1-d:d,t,l),0===d&&this._repeatStart(t,l)),t===e.startTime&&this._start(t,l)}else if(this._isInActiveArea){var m="delay"===o?a:o,g=t>this._prevTime;g&&m--,f=e.yoyo&&m%2===1?1:0,tthis._prevTime&&(0!==this.progress||1===f)&&this._repeatComplete(t,1===f),this._isInActiveArea=!1}this._wasUknownUpdate=!1}},{key:"_removeFromTweener",value:function(){return m["default"].remove(this),this}},{key:"_getPeriod",value:function(t){var e=this._props,r=e.delay+e.duration,i=e.delay+t-e.startTime,n=i/r,s=t=e.endTime?Math.round(n):Math.floor(n),t>e.endTime?n=Math.round((e.endTime-e.startTime+e.delay)/r):s>0&&sthis._prevTime,r),i.prevEasedProgress=this.easedProgress,i.wasYoyo=r,this}},{key:"_start",value:function(t,e){if(!this._isStarted){var r=this._props;null!=r.onStart&&"function"==typeof r.onStart&&r.onStart.call(r.callbacksContext||this,t>this._prevTime,e),this._isCompleted=!1,this._isStarted=!0,this._isFirstUpdate=!1}}},{key:"_complete",value:function(t,e){if(!this._isCompleted){var r=this._props;null!=r.onComplete&&"function"==typeof r.onComplete&&r.onComplete.call(r.callbacksContext||this,t>this._prevTime,e),this._isCompleted=!0,this._isStarted=!1,this._isFirstUpdate=!1,this._prevYoyo=void 0}}},{key:"_firstUpdate",value:function(t,e){if(!this._isFirstUpdate){var r=this._props;null!=r.onFirstUpdate&&"function"==typeof r.onFirstUpdate&&(r.onFirstUpdate.tween=this,r.onFirstUpdate.call(r.callbacksContext||this,t>this._prevTime,e)),this._isFirstUpdate=!0}}},{key:"_repeatComplete",value:function(t,e){if(!this._isRepeatCompleted){var r=this._props;null!=r.onRepeatComplete&&"function"==typeof r.onRepeatComplete&&r.onRepeatComplete.call(r.callbacksContext||this,t>this._prevTime,e),this._isRepeatCompleted=!0}}},{key:"_repeatStart",value:function(t,e){if(!this._isRepeatStart){var r=this._props;null!=r.onRepeatStart&&"function"==typeof r.onRepeatStart&&r.onRepeatStart.call(r.callbacksContext||this,t>this._prevTime,e),this._isRepeatStart=!0}}},{key:"_progress",value:function(t,e){var r=this._props;null!=r.onProgress&&"function"==typeof r.onProgress&&r.onProgress.call(r.callbacksContext||this,t,e>this._prevTime)}},{key:"_onTweenerRemove",value:function(){}},{key:"_onTweenerFinish",value:function(){this._setPlaybackState("stop")}},{key:"_setProp",value:function(t,r){h["default"](s["default"](e.prototype),"_setProp",this).call(this,t,r),this._calcDimentions()}},{key:"_assignProp",value:function(t,r){"easing"===t&&(r=w["default"].parseEasing(r));var i=this._callbackOverrides[t],n=!r||!r.isMojsCallbackOverride;i&&n&&(r=this._overrideCallback(r,i)),h["default"](s["default"](e.prototype),"_assignProp",this).call(this,t,r)}},{key:"_overrideCallback",value:function(t,e){var r=t&&"function"==typeof t,i=function(){r&&t.apply(this,arguments),e.apply(this,arguments)};return i.isMojsCallbackOverride=!0,i}}]),e}(x["default"]);e["default"]=k},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(21),s=i(n),o=r(28),a=i(o),u=r(27),p=i(u),l=r(22),h=i(l),f=r(23),c=i(f),d=r(24),y=i(d),_=r(20),v=i(_),m=r(25),g=i(m),w=r(4),b=(i(w),r(5)),x=i(b),k=r(15),S=i(k),T=function(t){function e(){return h["default"](this,e),y["default"](this,p["default"](e).apply(this,arguments))}return g["default"](e,t),c["default"](e,[{key:"_declareDefaults",value:function(){v["default"](p["default"](e.prototype),"_declareDefaults",this).call(this),this._declareChildDefaults(),this._defaults.count=5,this._defaults.degree=360,this._defaults.radius={5:50},this._optionsIntersection={radius:1,radiusX:1,radiusY:1,angle:1,scale:1,opacity:1}}},{key:"_extendDefaults",value:function(){v["default"](p["default"](e.prototype),"_extendDefaults",this).call(this),this._calcSize()}},{key:"_declareChildDefaults",value:function(){this._childDefaults=S["default"].cloneObj(this._defaults),this._childDefaults.isSwirl=!1;for(var t in S["default"].tweenOptionMap)this._childDefaults[t]=null;for(var t in S["default"].callbacksMap)this._childDefaults[t]=null}},{key:"_createBit",value:function(){this._swirls=[];for(var t=0;ti;i++){var n=this._getOptionByIndex(i,t);n.isRunLess=!0;var s=new e(n);this.childModules.push(s),this.timeline.add(s)}return this}},{key:"run",value:function(){this.timeline.play()}}]),t}();t.exports=function(t){return function(e){return new d(e,t)}}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(22),s=i(n),o=r(23),a=i(o),u=r(15),p=i(u),l=r(2),h=i(l),f=r(8),c=i(f),d=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return s["default"](this,t),this.o=e,this.o.el?(this._vars(),this._declareDefaults(),this._extendDefaults(),this._parseFrames(),this._frames.length<=2&&p["default"].warn("Spriter: only "+this._frames.length+" frames found"),this._frames.length<1&&p["default"].error("Spriter: there is no frames to animate, aborting"),this._createTween(),this):p["default"].error('No "el" option specified, aborting')}return a["default"](t,[{key:"_declareDefaults",value:function(){this._defaults={duration:500,delay:0,easing:"linear.none",repeat:0,yoyo:!1,isRunLess:!1,isShowEnd:!1,onStart:null,onUpdate:null,onComplete:null}}}]),a["default"](t,[{key:"_vars",value:function(){this._props=p["default"].cloneObj(this.o),this.el=this.o.el,this._frames=[]}},{key:"run",value:function(t){return this.timeline.play()}},{key:"_extendDefaults",value:function(){return p["default"].extend(this._props,this._defaults)}},{key:"_parseFrames",value:function(){this._frames=Array.prototype.slice.call(this.el.children,0),this._frames.forEach(function(t,e){return t.style.opacity=0}),this._frameStep=1/this._frames.length}},{key:"_createTween",value:function(){var t=this;this._tween=new h["default"]({duration:this._props.duration,delay:this._props.delay,yoyo:this._props.yoyo,repeat:this._props.repeat,easing:this._props.easing,onStart:function(){return t._props.onStart&&t._props.onStart()},onComplete:function(){return t._props.onComplete&&t._props.onComplete()},onUpdate:function(e){return t._setProgress(e)}}),this.timeline=new c["default"],this.timeline.add(this._tween),this._props.isRunLess||this._startTween()}},{key:"_startTween",value:function(){var t=this;setTimeout(function(){return t.timeline.play()},1)}},{key:"_setProgress",value:function(t){var e=Math.floor(t/this._frameStep);if(this._prevFrame!=this._frames[e]){this._prevFrame&&(this._prevFrame.style.opacity=0);var r=1===t&&this._props.isShowEnd?e-1:e;this._frames[r]&&(this._frames[r].style.opacity=1),this._prevFrame=this._frames[e]}this._props.onUpdate&&this._props.onUpdate(t)}}]),t}();e["default"]=d},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(27),s=i(n),o=r(29),a=i(o),u=r(22),p=i(u),l=r(24),h=i(l),f=r(23),c=i(f),d=r(25),y=i(d),_=r(20),v=i(_),m=r(15),g=i(m),w=r(9),b=(i(w),r(2)),x=i(b),k=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return p["default"](this,e),h["default"](this,s["default"](e).call(this,t))}return y["default"](e,t),c["default"](e,[{key:"add",value:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return this._pushTimelineArray(e),this._calcDimentions(),this}},{key:"append",value:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var i=!0,n=!1,s=void 0;try{for(var o,u=a["default"](e);!(i=(o=u.next()).done);i=!0){var p=o.value;g["default"].isArray(p)?this._appendTimelineArray(p):this._appendTimeline(p,this._timelines.length),this._calcDimentions()}}catch(l){n=!0,s=l}finally{try{!i&&u["return"]&&u["return"]()}finally{if(n)throw s}}return this}},{key:"_appendTimelineArray",value:function(t){for(var e=t.length,r=this._props.repeatTime-this._props.delay,i=this._timelines.length;e--;)this._appendTimeline(t[e],i,r)}},{key:"_appendTimeline",value:function(t,r,i){t.timeline instanceof e&&(t=t.timeline),t.tween instanceof x["default"]&&(t=t.tween);var n=null!=i?i:this._props.duration;n+=t._props.shiftTime||0,t.index=r,this._pushTimeline(t,n)}},{key:"_pushTimelineArray",value:function(t){for(var e=0;ethis._prevTime?-1:1;this._props.yoyo&&i&&(n*=-1);for(var o=this._props.startTime+t*this._props.duration,a=o+n,u=this._timelines.length,p=0;u>p;p++){var l=o>a?p:u-1-p;this._timelines[l]._update(o,a,this._prevYoyo,this._onEdge)}this._prevYoyo=i}},{key:"_recalcDuration",value:function(t){var e=t._props,r=e.repeatTime/e.speed+(e.shiftTime||0);this._props.duration=Math.max(r,this._props.duration)}},{key:"_recalcTotalDuration",value:function(){var t=this._timelines.length;for(this._props.duration=0;t--;)this._recalcDuration(this._timelines[t]);this._calcDimentions()}},{key:"_setStartTime",value:function(t){var r=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];v["default"](s["default"](e.prototype),"_setStartTime",this).call(this,t),this._startTimelines(this._props.startTime,r)}},{key:"_startTimelines",value:function(t){{var e,r=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this._props}null==t&&(t=this._props.startTime);for(var i=0;i-1,this.isChrome=t.indexOf("Chrome")>-1,this.isOpera=t.toLowerCase().indexOf("op")>-1,this.isChrome&&this.isSafari&&(this.isSafari=!1),t.match(/PhantomJS/gim)&&(this.isSafari=!1),this.isChrome&&this.isOpera&&(this.isChrome=!1),this.is3d=this.checkIf3d(),this.uniqIDs=-1,this.div=document.createElement("div"),document.body.appendChild(this.div)},t.prototype.cloneObj=function(t,e){var r,i,n,s;for(n=Object.keys(t),s={},r=n.length;r--;)i=n[r],null!=e?e[i]||(s[i]=t[i]):s[i]=t[i];return s},t.prototype.extend=function(t,e){var r,i;for(r in e)i=e[r],null==t[r]&&(t[r]=e[r]);return t},t.prototype.getRemBase=function(){var t,e;return t=document.querySelector("html"),e=getComputedStyle(t),this.remBase=parseFloat(e.fontSize)},t.prototype.clamp=function(t,e,r){return e>t?e:t>r?r:t},t.prototype.setPrefixedStyle=function(t,e,r){return e.match(/transform/gim)?(t.style[""+e]=r,t.style[""+this.prefix.css+e]=r):t.style[e]=r},t.prototype.style=function(t,e,r){var i,n,s,o;if("object"==typeof e){for(n=Object.keys(e),s=n.length,o=[];s--;)i=n[s],r=e[i],o.push(this.setPrefixedStyle(t,i,r));return o}return this.setPrefixedStyle(t,e,r)},t.prototype.prepareForLog=function(t){return t=Array.prototype.slice.apply(t),t.unshift("::"),t.unshift(this.logBadgeCss),t.unshift("%cmo·js%c"),t},t.prototype.log=function(){return mojs.isDebug!==!1?console.log.apply(console,this.prepareForLog(arguments)):void 0},t.prototype.warn=function(){return mojs.isDebug!==!1?console.warn.apply(console,this.prepareForLog(arguments)):void 0},t.prototype.error=function(){return mojs.isDebug!==!1?console.error.apply(console,this.prepareForLog(arguments)):void 0},t.prototype.parseUnit=function(t){var e,r,i,n,s,o;return"number"==typeof t?s={unit:"px",isStrict:!1,value:t,string:t+"px"}:"string"==typeof t?(n=/px|%|rem|em|ex|cm|ch|mm|in|pt|pc|vh|vw|vmin/gim,o=null!=(i=t.match(n))?i[0]:void 0,r=!0,o||(o="px",r=!1),e=parseFloat(t),s={unit:o,isStrict:r,value:e,string:""+e+o}):t},t.prototype.bind=function(t,e){var r,i;return i=function(){var i,n;return i=Array.prototype.slice.call(arguments),n=r.concat(i),t.apply(e,n)},r=Array.prototype.slice.call(arguments,2),i},t.prototype.getRadialPoint=function(t){var e,r,i,n;return null==t&&(t={}),null!=t.radius&&null!=t.angle&&null!=t.center?(r=(t.angle-90)*(Math.PI/180),i=null!=t.radiusX?t.radiusX:t.radius,n=null!=t.radiusY?t.radiusY:t.radius,e={x:t.center.x+Math.cos(r)*i,y:t.center.y+Math.sin(r)*n}):void 0},t.prototype.getPrefix=function(){var t,e,r,i;return r=window.getComputedStyle(document.documentElement,""),i=Array.prototype.slice.call(r).join("").match(/-(moz|webkit|ms)-/),e=(i||""===r.OLink&&["","o"])[1],t="WebKit|Moz|MS|O".match(new RegExp("("+e+")","i"))[1],{dom:t,lowercase:e,css:"-"+e+"-",js:e[0].toUpperCase()+e.substr(1)}},t.prototype.strToArr=function(t){var e;return e=[],"number"!=typeof t||isNaN(t)?(t.trim().split(/\s+/gim).forEach(function(t){return function(r){return e.push(t.parseUnit(t.parseIfRand(r)))}}(this)),e):(e.push(this.parseUnit(t)),e)},t.prototype.calcArrDelta=function(t,e){var r,i,n,s,o;for(r=[],i=n=0,s=t.length;s>n;i=++n)o=t[i],r[i]=this.parseUnit(""+(e[i].value-t[i].value)+e[i].unit);return r},t.prototype.isArray=function(t){return t instanceof Array},t.prototype.normDashArrays=function(t,e){var r,i,n,s,o,a,u,p,l,h;if(r=t.length,i=e.length,r>i)for(u=r-i,h=e.length,s=o=0,p=u;p>=0?p>o:o>p;s=p>=0?++o:--o)n=s+h,e.push(this.parseUnit("0"+t[n].unit));else if(i>r)for(u=i-r,h=t.length,s=a=0,l=u;l>=0?l>a:a>l;s=l>=0?++a:--a)n=s+h,t.push(this.parseUnit("0"+e[n].unit));return[t,e]},t.prototype.makeColorObj=function(t){var e,r,i,n,s,o,a,u,p,l;return"#"===t[0]&&(p=/^#?([a-f\d]{1,2})([a-f\d]{1,2})([a-f\d]{1,2})$/i.exec(t),i={},p&&(o=2===p[1].length?p[1]:p[1]+p[1],n=2===p[2].length?p[2]:p[2]+p[2],r=2===p[3].length?p[3]:p[3]+p[3],i={r:parseInt(o,16),g:parseInt(n,16),b:parseInt(r,16),a:1})),"#"!==t[0]&&(s="r"===t[0]&&"g"===t[1]&&"b"===t[2],s&&(l=t),s||(l=this.shortColors[t]?this.shortColors[t]:(this.div.style.color=t,this.computedStyle(this.div).color)),a="^rgba?\\((\\d{1,3}),\\s?(\\d{1,3}),",u="\\s?(\\d{1,3}),?\\s?(\\d{1}|0?\\.\\d{1,})?\\)$",p=new RegExp(a+u,"gi").exec(l),i={},e=parseFloat(p[4]||1),p&&(i={r:parseInt(p[1],10),g:parseInt(p[2],10),b:parseInt(p[3],10),a:null==e||isNaN(e)?1:e})),i},t.prototype.computedStyle=function(t){return getComputedStyle(t)},t.prototype.capitalize=function(t){if("string"!=typeof t)throw Error("String expected - nothing to capitalize");return t.charAt(0).toUpperCase()+t.substring(1)},t.prototype.parseRand=function(t){var e,r,i;return r=t.split(/rand\(|\,|\)/),i=this.parseUnit(r[2]),e=this.rand(parseFloat(r[1]),parseFloat(r[2])),i.unit&&r[2].match(i.unit)?e+i.unit:e},t.prototype.parseStagger=function(t,e){var r,i,n,s,o,a;return a=t.split(/stagger\(|\)$/)[1].toLowerCase(),n=a.split(/(rand\(.*?\)|[^\(,\s]+)(?=\s*,|\s*$)/gim),a=n.length>3?(r=this.parseUnit(this.parseIfRand(n[1])),n[3]):(r=this.parseUnit(0),n[1]),a=this.parseIfRand(a),o=this.parseUnit(a),i=e*o.value+r.value,s=r.isStrict?r.unit:o.isStrict?o.unit:"",s?""+i+s:i},t.prototype.parseIfStagger=function(t,e){return"string"==typeof t&&t.match(/stagger/g)?this.parseStagger(t,e):t},t.prototype.parseIfRand=function(t){return"string"==typeof t&&t.match(/rand\(/)?this.parseRand(t):t},t.prototype.parseDelta=function(t,e){var r,i,n,s,o,a,u,p,l,h,f;if(l=Object.keys(e)[0],i=e[l],r={start:l},isNaN(parseFloat(l))&&!l.match(/rand\(/)){if("strokeLinecap"===t)return this.warn("Sorry, stroke-linecap property is not animatable yet, using the start("+l+") value instead",e),r;f=this.makeColorObj(l),s=this.makeColorObj(i),r={start:f,end:s,type:"color",delta:{r:s.r-f.r,g:s.g-f.g,b:s.b-f.b,a:s.a-f.a}}}else if("strokeDasharray"===t||"strokeDashoffset"===t){for(h=this.strToArr(l),n=this.strToArr(i),this.normDashArrays(h,n),o=u=0,p=h.length;p>u;o=++u)l=h[o],i=n[o],this.mergeUnits(l,i,t);r={start:h,end:n,delta:this.calcArrDelta(h,n),type:"array"}}else a=!this.callbacksMap[t]&&!this.tweenOptionMap[t],!this.chainOptionMap[t]&&a&&(this.unitOptionMap[t]?(i=this.parseUnit(this.parseIfRand(i)),l=this.parseUnit(this.parseIfRand(l)),this.mergeUnits(l,i,t),r={start:l,end:i,delta:i.value-l.value,type:"unit"}):(i=parseFloat(this.parseIfRand(i)),l=parseFloat(this.parseIfRand(l)),r={start:l,end:i,delta:i-l,type:"number"}));return r},t.prototype.mergeUnits=function(t,e,r){return!e.isStrict&&t.isStrict?(e.unit=t.unit,e.string=""+e.value+e.unit):e.isStrict&&!t.isStrict?(t.unit=e.unit,t.string=""+t.value+t.unit):e.isStrict&&t.isStrict&&e.unit!==t.unit?(t.unit=e.unit,t.string=""+t.value+t.unit,this.warn('Two different units were specified on "'+r+'" delta property, mo · js will fallback to end "'+e.unit+'" unit ')):void 0},t.prototype.rand=function(t,e){return Math.random()*(e-t)+t},t.prototype.isDOM=function(t){var e;return null==t?!1:(e="number"==typeof t.nodeType&&"string"==typeof t.nodeName,"object"==typeof t&&e)},t.prototype.getChildElements=function(t){var e,r,i;for(e=t.childNodes,r=[],i=e.length;i--;)1===e[i].nodeType&&r.unshift(e[i]);return r},t.prototype.delta=function(t,e){var r,i,n,s,o;return s=typeof t,o=typeof e,r="string"===s||"number"===s&&!isNaN(t),i="string"===o||"number"===o&&!isNaN(e),r&&i?(n={},n[t]=e,n):void this.error("delta method expects Strings or Numbers at input but got - "+t+", "+e)},t.prototype.getUniqID=function(){return++this.uniqIDs},t.prototype.parsePath=function(t){var e;return"string"==typeof t?"m"===t.charAt(0).toLowerCase()?(e=document.createElementNS(this.NS,"path"),e.setAttributeNS(null,"d",t),e):document.querySelector(t):t.style?t:void 0},t.prototype.closeEnough=function(t,e,r){return Math.abs(t-e)0&&this.createFilter(),this.path=this.getPath(),this.path.getAttribute("d")?(this.len=this.path.getTotalLength(),this.slicedLen=this.len*(this.props.pathEnd-this.props.pathStart),this.startLen=this.props.pathStart*this.len,this.fill=this.props.fill,null!=this.fill&&(this.container=this.parseEl(this.props.fill.container),this.fillRule=this.props.fill.fillRule||"all",this.getScaler(),null!=this.container)?(this.removeEvent(this.container,"onresize",this.getScaler),this.addEvent(this.container,"onresize",this.getScaler)):void 0):(o.error("Path has no coordinates to work with, aborting"),!0)):(o.error('Missed "el" option. It could be a selector, DOMNode or another module.'),!0)},t.prototype.addEvent=function(t,e,r){return t.addEventListener(e,r,!1)},t.prototype.removeEvent=function(t,e,r){return t.removeEventListener(e,r,!1)},t.prototype.createFilter=function(){var t,e;return t=document.createElement("div"),this.filterID="filter-"+o.getUniqID(),t.innerHTML='',e=t.querySelector("#svg-"+this.filterID),this.filter=e.querySelector("#blur"),this.filterOffset=e.querySelector("#blur-offset"),document.body.insertBefore(e,document.body.firstChild),this.el.style.filter="url(#"+this.filterID+")",this.el.style[o.prefix.css+"filter"]="url(#"+this.filterID+")"},t.prototype.parseEl=function(t){return"string"==typeof t?document.querySelector(t):t instanceof HTMLElement?t:null!=t._setProp?(this.isModule=!0,t):void 0},t.prototype.getPath=function(){var t;return t=o.parsePath(this.props.path),t?t:this.props.path.x||this.props.path.y?this.curveToPath({start:{x:0,y:0},shift:{x:this.props.path.x||0,y:this.props.path.y||0},curvature:{x:this.props.curvature.x||this.defaults.curvature.x,y:this.props.curvature.y||this.defaults.curvature.y}}):void 0},t.prototype.getScaler=function(){var t,e,r;switch(this.cSize={width:this.container.offsetWidth||0,height:this.container.offsetHeight||0},r=this.path.getPointAtLength(0),t=this.path.getPointAtLength(this.len),e={},this.scaler={},e.width=t.x>=r.x?t.x-r.x:r.x-t.x,e.height=t.y>=r.y?t.y-r.y:r.y-t.y,this.fillRule){case"all":return this.calcWidth(e),this.calcHeight(e);case"width":return this.calcWidth(e),this.scaler.y=this.scaler.x;case"height":return this.calcHeight(e),this.scaler.x=this.scaler.y}},t.prototype.calcWidth=function(t){return this.scaler.x=this.cSize.width/t.width,!isFinite(this.scaler.x)&&(this.scaler.x=1)},t.prototype.calcHeight=function(t){return this.scaler.y=this.cSize.height/t.height,!isFinite(this.scaler.y)&&(this.scaler.y=1)},t.prototype.run=function(t){var e,r,i;if(t){e=this.history[0];for(r in t)i=t[r],o.callbacksMap[r]||o.tweenOptionMap[r]?(o.warn('the property "'+r+'" property can not be overridden on run yet'),delete t[r]):this.history[0][r]=i;this.tuneOptions(t)}return this.startTween()},t.prototype.createTween=function(){return this.tween=new s({duration:this.props.duration,delay:this.props.delay,yoyo:this.props.yoyo,repeat:this.props.repeat,easing:this.props.easing,onStart:function(t){return function(){var e;return null!=(e=t.props.onStart)?e.apply(t):void 0}}(this),onComplete:function(t){return function(){var e;return t.props.motionBlur&&t.setBlur({blur:{x:0,y:0},offset:{x:0,y:0}}),null!=(e=t.props.onComplete)?e.apply(t):void 0}}(this),onUpdate:function(t){return function(e){return t.setProgress(e)}}(this),onFirstUpdate:function(t){return function(e,r){return e?void 0:t.history.length>1&&t.tuneOptions(t.history[0])}}(this)}),this.timeline=new n,this.timeline.add(this.tween),!this.props.isRunLess&&this.startTween(),this.props.isPresetPosition&&this.setProgress(0,!0)},t.prototype.startTween=function(){return setTimeout(function(t){return function(){var e;return null!=(e=t.timeline)?e.play():void 0}}(this),1)},t.prototype.setProgress=function(t,e){var r,i,n,s;return r=this.startLen+(this.props.isReverse?(1-t)*this.slicedLen:t*this.slicedLen),i=this.path.getPointAtLength(r),n=i.x+this.props.offsetX,s=i.y+this.props.offsetY,this._getCurrentAngle(i,r,t),this._setTransformOrigin(t),this._setTransform(n,s,t,e),this.props.motionBlur&&this.makeMotionBlur(n,s)},t.prototype.setElPosition=function(t,e,r){var i,n,s,a;return s=0!==this.angle?"rotate("+this.angle+"deg)":"",n=this.props.isCompositeLayer&&o.is3d,i=n?"translateZ(0)":"",a="translate("+t+"px,"+e+"px) "+s+" "+i,o.setPrefixedStyle(this.el,"transform",a)},t.prototype.setModulePosition=function(t,e){return this.el._setProp({shiftX:t+"px",shiftY:e+"px",angle:this.angle}),this.el._draw()},t.prototype._getCurrentAngle=function(t,e,r){var i,n,s,a,u;return n="function"==typeof this.props.transformOrigin,this.props.isAngle||null!=this.props.angleOffset||n?(s=this.path.getPointAtLength(e-1),a=t.y-s.y,u=t.x-s.x,i=Math.atan(a/u),!isFinite(i)&&(i=0),this.angle=i*o.RAD_TO_DEG,"function"!=typeof this.props.angleOffset?this.angle+=this.props.angleOffset||0:this.angle=this.props.angleOffset.call(this,this.angle,r)):this.angle=0},t.prototype._setTransform=function(t,e,r,i){var n;return this.scaler&&(t*=this.scaler.x,e*=this.scaler.y),n=null,i||(n="function"==typeof this.onUpdate?this.onUpdate(r,{x:t,y:e,angle:this.angle}):void 0),this.isModule?this.setModulePosition(t,e):"string"!=typeof n?this.setElPosition(t,e,r):o.setPrefixedStyle(this.el,"transform",n)},t.prototype._setTransformOrigin=function(t){var e,r;return this.props.transformOrigin?(e="function"==typeof this.props.transformOrigin,r=e?this.props.transformOrigin(this.angle,t):this.props.transformOrigin,o.setPrefixedStyle(this.el,"transform-origin",r)):void 0},t.prototype.makeMotionBlur=function(t,e){var r,i,n,s,a,u,p;return p=0,a=1,u=1,null==this.prevCoords.x||null==this.prevCoords.y?(this.speedX=0,this.speedY=0):(n=t-this.prevCoords.x,s=e-this.prevCoords.y,n>0&&(a=-1),0>a&&(u=-1),this.speedX=Math.abs(n),this.speedY=Math.abs(s),p=Math.atan(s/n)*(180/Math.PI)+90),r=p-this.angle,i=this.angToCoords(r),this.blurX=o.clamp(this.speedX/16*this.props.motionBlur,0,1),this.blurY=o.clamp(this.speedY/16*this.props.motionBlur,0,1),this.setBlur({blur:{x:3*this.blurX*this.blurAmount*Math.abs(i.x),y:3*this.blurY*this.blurAmount*Math.abs(i.y)},offset:{x:3*a*this.blurX*i.x*this.blurAmount,y:3*u*this.blurY*i.y*this.blurAmount}}),this.prevCoords.x=t,this.prevCoords.y=e},t.prototype.setBlur=function(t){return this.isMotionBlurReset?void 0:(this.filter.setAttribute("stdDeviation",t.blur.x+","+t.blur.y),this.filterOffset.setAttribute("dx",t.offset.x),this.filterOffset.setAttribute("dy",t.offset.y))},t.prototype.extendDefaults=function(t){var e,r,i;r=[];for(e in t)i=t[e],r.push(this[e]=i);return r},t.prototype.extendOptions=function(t){var e,r,i;r=[];for(e in t)i=t[e],r.push(this.props[e]=i);return r},t.prototype.then=function(t){var e,r,i,n,a;n=this.history[this.history.length-1],i={};for(r in n)a=n[r],!o.callbacksMap[r]&&!o.tweenOptionMap[r]||"duration"===r?null==t[r]&&(t[r]=a):null==t[r]&&(t[r]=void 0),o.tweenOptionMap[r]&&(i[r]="duration"!==r?t[r]:null!=t[r]?t[r]:n[r]);return this.history.push(t),e=this,i.onUpdate=function(t){return function(e){return t.setProgress(e)}}(this),i.onStart=function(t){return function(){var e;return null!=(e=t.props.onStart)?e.apply(t):void 0}}(this),i.onComplete=function(t){return function(){var e;return null!=(e=t.props.onComplete)?e.apply(t):void 0}}(this),i.onFirstUpdate=function(){return e.tuneOptions(e.history[this.index])},i.isChained=!t.delay,this.timeline.append(new s(i)),this},t.prototype.tuneOptions=function(t){return this.extendOptions(t),this.postVars()},t.prototype.angToCoords=function(t){var e,r,i;return t%=360,e=(t-90)*Math.PI/180,r=Math.cos(e),i=Math.sin(e),r=0>r?Math.max(r,-.7):Math.min(r,.7),i=0>i?Math.max(i,-.7):Math.min(i,.7),{x:1.428571429*r,y:1.428571429*i}},t}(),t.exports=i},function(t,e,r){var i,n,s,o,a,u;s=r(41),n=r(40),u=r(42),a=r(15),i=function(){function t(){}return t.prototype.bezier=s,t.prototype.PathEasing=n,t.prototype.path=new n("creator").create,t.prototype.inverse=function(t){return 1-t},t.prototype.linear={none:function(t){return t}},t.prototype.ease={"in":s.apply(t,[.42,0,1,1]),out:s.apply(t,[0,0,.58,1]),inout:s.apply(t,[.42,0,.58,1])},t.prototype.quad={"in":function(t){return t*t},out:function(t){return t*(2-t)},inout:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},t.prototype.cubic={"in":function(t){return t*t*t},out:function(t){return--t*t*t+1},inout:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},t.prototype.quart={"in":function(t){return t*t*t*t},out:function(t){return 1- --t*t*t*t},inout:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},t.prototype.quint={"in":function(t){return t*t*t*t*t},out:function(t){return--t*t*t*t*t+1},inout:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},t.prototype.sin={"in":function(t){return 1-Math.cos(t*Math.PI/2)},out:function(t){return Math.sin(t*Math.PI/2)},inout:function(t){return.5*(1-Math.cos(Math.PI*t))}},t.prototype.expo={"in":function(t){return 0===t?0:Math.pow(1024,t-1)},out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},inout:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)}},t.prototype.circ={"in":function(t){return 1-Math.sqrt(1-t*t)},out:function(t){return Math.sqrt(1- --t*t)},inout:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},t.prototype.back={"in":function(t){var e;return e=1.70158,t*t*((e+1)*t-e)},out:function(t){var e;return e=1.70158,--t*t*((e+1)*t+e)+1},inout:function(t){var e;return e=2.5949095,(t*=2)<1?.5*t*t*((e+1)*t-e):.5*((t-=2)*t*((e+1)*t+e)+2)}},t.prototype.elastic={"in":function(t){var e,r,i;return i=void 0,r=.4,0===t?0:1===t?1:(e=1,i=r/4,-(e*Math.pow(2,10*(t-=1))*Math.sin(2*(t-i)*Math.PI/r)))},out:function(t){var e,r,i;return i=void 0,r=.4,0===t?0:1===t?1:(e=1,i=r/4,e*Math.pow(2,-10*t)*Math.sin(2*(t-i)*Math.PI/r)+1)},inout:function(t){var e,r,i;return i=void 0,r=.4,0===t?0:1===t?1:(e=1,i=r/4,(t*=2)<1?-.5*e*Math.pow(2,10*(t-=1))*Math.sin(2*(t-i)*Math.PI/r):e*Math.pow(2,-10*(t-=1))*Math.sin(2*(t-i)*Math.PI/r)*.5+1)}},t.prototype.bounce={"in":function(t){return 1-o.bounce.out(1-t)},out:function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},inout:function(t){return.5>t?.5*o.bounce["in"](2*t):.5*o.bounce.out(2*t-1)+.5}},t.prototype.parseEasing=function(t){var e,r;return r=typeof t,"string"===r?"m"===t.charAt(0).toLowerCase()?this.path(t):(t=this._splitEasing(t),e=this[t[0]],e?e[t[1]]:(a.error('Easing with name "'+t[0]+'" was not found, fallback to "linear.none" instead'), -this.linear.none)):a.isArray(t)?this.bezier.apply(this,t):t},t.prototype._splitEasing=function(t){var e,r,i;return"function"==typeof t?t:"string"==typeof t&&t.length?(i=t.split("."),e=i[0].toLowerCase()||"linear",r=i[1].toLowerCase()||"none",[e,r]):["linear","none"]},t}(),o=new i,o.mix=u(o),t.exports=o},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var n="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof _Symbol&&t.constructor===_Symbol?"symbol":typeof t};e.__esModule=!0;var s=r(45),o=i(s),a=r(46),u=i(a);e["default"]="function"==typeof u["default"]&&"symbol"===n(o["default"])?function(t){return"undefined"==typeof t?"undefined":n(t)}:function(t){return t&&"function"==typeof u["default"]&&t.constructor===u["default"]?"symbol":"undefined"==typeof t?"undefined":n(t)}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=r(27),s=i(n),o=r(44),a=i(o);e["default"]=function u(t,e,r){null===t&&(t=Function.prototype);var i=a["default"](t,e);if(void 0===i){var n=s["default"](t);return null===n?void 0:u(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0===o?void 0:o.call(r)}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=r(48),s=i(n);e["default"]=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);es;i=++s)r=a[i],e="%"===r.unit?this.castPercent(r.value):r.value,u+=e+" ";return this.props[t]="0 "===u?u="":u,this.props[t]=u}return"object"==typeof this.props[t]?(u="%"===this.props[t].unit?this.castPercent(this.props[t].value):this.props[t].value,this.props[t]=0===u?u="":u):void 0},t.prototype.castPercent=function(t){return t*(this.props.length/100)},t.prototype.setAttrsIfChanged=function(t,e){var r,i,n,s;if("object"==typeof t){for(i=Object.keys(t),n=i.length,s=[];n--;)r=i[n],e=t[r],s.push(this.setAttrIfChanged(r,e));return s}return null==e&&(e=this.props[t]),this.setAttrIfChanged(t,e)},t.prototype.setAttrIfChanged=function(t,e){return this.isChanged(t,e)?(this.el.setAttribute(t,e),this.state[t]=e):void 0},t.prototype.isChanged=function(t,e){return null==e&&(e=this.props[t]),this.state[t]!==e},t.prototype.getLength=function(){var t;return null!=(null!=(t=this.el)?t.getTotalLength:void 0)&&this.el.getAttribute("d")?this.el.getTotalLength():2*(null!=this.props.radiusX?this.props.radiusX:this.props.radius)},t}(),t.exports=i},function(t,e,r){t.exports={"default":r(53),__esModule:!0}},function(t,e,r){t.exports={"default":r(52),__esModule:!0}},function(t,e,r){t.exports={"default":r(51),__esModule:!0}},function(t,e,r){!function(){"use strict";var t,e,r,i,n,s,o;for(n=["webkit","moz"],e=0,o=window;e=h?0>a:a>0;r=0>=h?++a:--a)i=y+r*f+d,s=_+r*c+d,n=y+(r-1)*f+d,o=_+(r-1)*c+d,t=r===this.props.points?"M":"L",u+=""+t+i+","+s+" l0, -"+c+" l-"+f+", 0";return this.setAttr({d:u}),e.__super__.draw.apply(this,arguments)}},e}(i),t.exports=n},function(t,e,r){var i,n,s=function(t,e){function r(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;i=r(26),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.shape="rect",e.prototype.ratio=1.43,e.prototype.draw=function(){var t,r;return e.__super__.draw.apply(this,arguments),t=null!=this.props.radiusX?this.props.radiusX:this.props.radius,r=null!=this.props.radiusY?this.props.radiusY:this.props.radius,this.setAttrsIfChanged({width:2*t,height:2*r,x:this.props.x-t,y:this.props.y-r,rx:this.props.rx,ry:this.props.ry})},e.prototype.getLength=function(){var t,e;return t=null!=this.props.radiusX?this.props.radiusX:this.props.radius,e=null!=this.props.radiusY?this.props.radiusY:this.props.radius,2*t+2*e},e}(i),t.exports=n},function(t,e,r){var i,n,s,o=function(t,e){function r(){this.constructor=t}for(var i in e)a.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=r(26),s=r(15),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.shape="path",e.prototype.draw=function(){return this.drawShape(),e.__super__.draw.apply(this,arguments)},e.prototype.drawShape=function(){var t,e,r,i,n,o,a,u,p,l;for(l=360/this.props.points,this.radialPoints=[],r=i=0,u=this.props.points;u>=0?u>i:i>u;r=u>=0?++i:--i)this.radialPoints.push(s.getRadialPoint({radius:this.props.radius,radiusX:this.props.radiusX,radiusY:this.props.radiusY,angle:r*l,center:{x:this.props.x,y:this.props.y}}));for(e="",p=this.radialPoints,r=n=0,o=p.length;o>n;r=++n)a=p[r],t=0===r?"M":"L",e+=""+t+a.x.toFixed(4)+","+a.y.toFixed(4)+" ";return this.setAttr({d:e+="z"})},e.prototype.getLength=function(){return this.el.getTotalLength()},e}(i),t.exports=n},function(t,e,r){var i,n,s=function(t,e){function r(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;i=r(26),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.shape="path",e.prototype.draw=function(){var t,r,i,n,s,o,a,u,p;return e.__super__.draw.apply(this,arguments),n=null!=this.props.radiusX?this.props.radiusX:this.props.radius,s=null!=this.props.radiusY?this.props.radiusY:this.props.radius,o=this.props.x-n,a=this.props.x+n,r="M"+o+","+this.props.y+" L"+a+","+this.props.y,u=this.props.y-s,p=this.props.y+s,i="M"+this.props.x+","+u+" L"+this.props.x+","+p,t=r+" "+i,this.setAttr({d:t})},e.prototype.getLength=function(){var t,e;return t=null!=this.props.radiusX?this.props.radiusX:this.props.radius,e=null!=this.props.radiusY?this.props.radiusY:this.props.radius,2*(t+e)},e}(i),t.exports=n},function(t,e,r){var i,n,s=function(t,e){function r(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;i=r(26),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.shape="path",e.prototype.ratio=1.43,e.prototype.draw=function(){var t,r,i,n,s,o,a,u,p,l,h;if(e.__super__.draw.apply(this,arguments),this.props.points){for(n=null!=this.props.radiusX?this.props.radiusX:this.props.radius,s=null!=this.props.radiusY?this.props.radiusY:this.props.radius,a=this.props.x-n,u=this.props.x+n,t="",h=2*s/(this.props.points-1),l=this.props.y-s,r=i=0,o=this.props.points;o>=0?o>i:i>o;r=o>=0?++i:--i)p=""+(r*h+l),t+="M"+a+", "+p+" L"+u+", "+p+" ";return this.setAttr({d:t})}},e.prototype.getLength=function(){return 2*(null!=this.props.radiusX?this.props.radiusX:this.props.radius)},e}(i),t.exports=n},function(t,e,r){var i,n;n=r(15),i=function(){function t(t,e){if(this.o=null!=e?e:{},"creator"!==t){if(this.path=n.parsePath(t),null==this.path)return n.error("Error while parsing the path");this._vars(),this.path.setAttribute("d",this._normalizePath(this.path.getAttribute("d"))),this.pathLength=this.path.getTotalLength(),this.sample=n.bind(this.sample,this),this._hardSample=n.bind(this._hardSample,this),this._preSample()}}return t.prototype._vars=function(){return this._precompute=n.clamp(this.o.precompute||1450,100,1e4),this._step=1/this._precompute,this._rect=this.o.rect||100,this._approximateMax=this.o.approximateMax||5,this._eps=this.o.eps||.001,this._boundsPrevProgress=-1},t.prototype._preSample=function(){var t,e,r,i,n,s,o;for(this._samples=[],o=[],t=e=0,s=this._precompute;s>=0?s>=e:e>=s;t=s>=0?++e:--e)n=t*this._step,r=this.pathLength*n,i=this.path.getPointAtLength(r),o.push(this._samples[t]={point:i,length:r,progress:n});return o},t.prototype._findBounds=function(t,e){var r,i,n,s,o,a,u,p,l,h,f,c,d;if(e===this._boundsPrevProgress)return this._prevBounds;for(null==this._boundsStartIndex&&(this._boundsStartIndex=0),a=t.length,this._boundsPrevProgress>e?(u=0,i="reverse"):(u=a,i="forward"),"forward"===i?(c=t[0],n=t[t.length-1]):(c=t[t.length-1],n=t[0]),s=o=h=this._boundsStartIndex,f=u;f>=h?f>o:o>f;s=f>=h?++o:--o){if(d=t[s],l=d.point.x/this._rect,p=e,"reverse"===i&&(r=l,l=p,p=r),!(p>l)){n=d;break}c=d,this._boundsStartIndex=s}return this._boundsPrevProgress=e,this._prevBounds={start:c,end:n}},t.prototype.sample=function(t){var e,r;return t=n.clamp(t,0,1),e=this._findBounds(this._samples,t),r=this._checkIfBoundsCloseEnough(t,e),null!=r?r:this._findApproximate(t,e.start,e.end)},t.prototype._checkIfBoundsCloseEnough=function(t,e){var r,i;return r=void 0,i=this._checkIfPointCloseEnough(t,e.start.point),null!=i?i:this._checkIfPointCloseEnough(t,e.end.point)},t.prototype._checkIfPointCloseEnough=function(t,e){return n.closeEnough(t,e.x/this._rect,this._eps)?this._resolveY(e):void 0},t.prototype._approximate=function(t,e,r){var i,n;return i=e.point.x-t.point.x,n=(r-t.point.x/this._rect)/(i/this._rect),t.length+n*(e.length-t.length)},t.prototype._findApproximate=function(t,e,r,i){var s,o,a,u,p;return null==i&&(i=this._approximateMax),s=this._approximate(e,r,t),u=this.path.getPointAtLength(s),p=u.x/this._rect,n.closeEnough(t,p,this._eps)?this._resolveY(u):--i<1?this._resolveY(u):(a={point:u,length:s},o=p>t?[t,e,a,i]:[t,a,r,i],this._findApproximate.apply(this,o))},t.prototype._resolveY=function(t){return 1-t.y/this._rect},t.prototype._normalizePath=function(t){var e,r,i,n,s,o;return o=/[M|L|H|V|C|S|Q|T|A]/gim,n=t.split(o),n.shift(),e=t.match(o),s=0,n[s]=this._normalizeSegment(n[s]),r=n.length-1,n[r]=this._normalizeSegment(n[r],this._rect||100),i=this._joinNormalizedPath(e,n)},t.prototype._joinNormalizedPath=function(t,e){var r,i,n,s,o,a;for(o="",i=n=0,s=t.length;s>n;i=++n)r=t[i],a=0===i?"":" ",o+=""+a+r+e[i].trim();return o},t.prototype._normalizeSegment=function(t,e){var r,i,n,s,o,a,u,p,l,h;if(null==e&&(e=0),t=t.trim(),o=/(-|\+)?((\d+(\.(\d|\e(-|\+)?)+)?)|(\.?(\d|\e|(\-|\+))+))/gim,a=this._getSegmentPairs(t.match(o)),n=a[a.length-1],h=n[0],u=Number(h),u!==e)for(t="",n[0]=e,r=i=0,s=a.length;s>i;r=++i)p=a[r],l=0===r?"":" ",t+=""+l+p[0]+","+p[1];return t},t.prototype._getSegmentPairs=function(t){var e,r,i,s,o,a;for(t.length%2!==0&&n.error("Failed to parse the path - segment pairs are not even.",t),s=[],e=r=0,i=t.length;i>r;e=r+=2)a=t[e],o=[t[e],t[e+1]],s.push(o);return s},t.prototype.create=function(e,r){var i;return i=new t(e,r),i.sample.path=i.path,i.sample},t}(),t.exports=i},function(t,e,r){(function(e){var i,n,s,o=[].indexOf||function(t){for(var e=0,r=this.length;r>e;e++)if(e in this&&this[e]===t)return e;return-1};s=r(15),i=function(){function t(t){return this.vars(),this.generate}return t.prototype.vars=function(){return this.generate=s.bind(this.generate,this)},t.prototype.generate=function(t,r,i,n){var s,a,u,p,l,h,f,c,d,y,_,v,m,g,w,b,x,k,S,T,M,P,O,E;if(arguments.length<4)return this.error("Bezier function expects 4 arguments");for(x=k=0;4>k;x=++k)if(d=arguments[x],"number"!=typeof d||isNaN(d)||!isFinite(d))return this.error("Bezier function expects 4 arguments");return 0>t||t>1||0>i||i>1?this.error("Bezier x values should be > 0 and < 1"):(p=4,l=.001,f=1e-7,h=10,T=11,S=1/(T-1),g=o.call(e,"Float32Array")>=0,s=function(t,e){return 1-3*e+3*t},a=function(t,e){return 3*e-6*t},u=function(t){return 3*t},_=function(t,e,r){return((s(e,r)*t+a(e,r))*t+u(e))*t},w=function(t,e,r){return 3*s(e,r)*t*t+2*a(e,r)*t+u(e)},P=function(e,r){var n,s;for(x=0;p>x;){if(n=w(r,t,i),0===n)return r;s=_(r,t,i)-e,r-=s/n,++x}return r},v=function(){for(x=0;T>x;)M[x]=_(x*S,t,i),++x},y=function(e,r,n){var s,o,a;for(o=void 0,s=void 0,x=0;;)if(s=r+(n-r)/2,o=_(s,t,i)-e,o>0?n=s:r=s,a=Math.abs(o)>f,!(a&&++x=l?P(e,o):0===a?o:y(e,u,u+S)},O=function(){var e;return e=!0,t!==r||i!==n?v():void 0},M=g?new Float32Array(T):new Array(T),c=!1,m=function(e){return c||O(),t===r&&i===n?e:0===e?0:1===e?1:_(b(e),r,n)},E="bezier("+[t,r,i,n]+")",m.toStr=function(){return E},m)},t.prototype.error=function(t){return s.error(t)},t}(),n=new i,t.exports=n}).call(e,function(){return this}())},function(t,e,r){var i,n,s,o,a,u,p=[].slice;n=null,a=function(t){return"number"==typeof t.value?t.value:n.parseEasing(t.value)},u=function(t,e){var r;return t.value=a(t),e.value=a(e),r=0,t.toe.to&&(r=1),r},s=function(t,e){var r,i,n,s,o;for(i=0,r=n=0,s=t.length;s>n&&(o=t[r],i=r,!(o.to>e));r=++n);return i},o=function(){var t;return t=1<=arguments.length?p.call(arguments,0):[],t.length>1?t=t.sort(u):t[0].value=a(t[0]),function(e){var r,i;return r=s(t,e),-1!==r?(i=t[r].value,r===t.length-1&&e>t[r].to?1:"function"==typeof i?i(e):i):void 0}},i=function(t){return n=t,o},t.exports=i},function(t,e,r){var i,n;!function(){var r;return r=function(){function t(t){this.o=null!=t?t:{},window.isAnyResizeEventInited||(this.vars(),this.redefineProto())}return t.prototype.vars=function(){return window.isAnyResizeEventInited=!0,this.allowedProtos=[HTMLDivElement,HTMLFormElement,HTMLLinkElement,HTMLBodyElement,HTMLParagraphElement,HTMLFieldSetElement,HTMLLegendElement,HTMLLabelElement,HTMLButtonElement,HTMLUListElement,HTMLOListElement,HTMLLIElement,HTMLHeadingElement,HTMLQuoteElement,HTMLPreElement,HTMLBRElement,HTMLFontElement,HTMLHRElement,HTMLModElement,HTMLParamElement,HTMLMapElement,HTMLTableElement,HTMLTableCaptionElement,HTMLImageElement,HTMLTableCellElement,HTMLSelectElement,HTMLInputElement,HTMLTextAreaElement,HTMLAnchorElement,HTMLObjectElement,HTMLTableColElement,HTMLTableSectionElement,HTMLTableRowElement],this.timerElements={img:1,textarea:1,input:1,embed:1,object:1,svg:1,canvas:1,tr:1,tbody:1,thead:1,tfoot:1,a:1,select:1,option:1,optgroup:1,dl:1,dt:1,br:1,basefont:1,font:1,col:1,iframe:1}},t.prototype.redefineProto=function(){var t,e,r,i;return e=this,i=function(){var i,n,s,o;for(s=this.allowedProtos,o=[],t=i=0,n=s.length;n>i;t=++i)r=s[t],null!=r.prototype&&o.push(function(t){var r,i;return r=t.prototype.addEventListener||t.prototype.attachEvent,function(r){var i;return i=function(){var t;return(this!==window||this!==document)&&(t="onresize"===arguments[0]&&!this.isAnyResizeEventInited,t&&e.handleResize({args:arguments,that:this})),r.apply(this,arguments)},t.prototype.addEventListener?t.prototype.addEventListener=i:t.prototype.attachEvent?t.prototype.attachEvent=i:void 0}(r),i=t.prototype.removeEventListener||t.prototype.detachEvent,function(e){var r;return r=function(){return this.isAnyResizeEventInited=!1,this.iframe&&this.removeChild(this.iframe),e.apply(this,arguments)},t.prototype.removeEventListener?t.prototype.removeEventListener=r:t.prototype.detachEvent?t.prototype.detachEvent=wrappedListener:void 0}(i)}(r));return o}.call(this)},t.prototype.handleResize=function(t){var e,r,i,n,s,o,a;return r=t.that,this.timerElements[r.tagName.toLowerCase()]?this.initTimer(r):(i=document.createElement("iframe"),r.appendChild(i),i.style.width="100%",i.style.height="100%",i.style.position="absolute",i.style.zIndex=-999,i.style.opacity=0,i.style.top=0,i.style.left=0,e=window.getComputedStyle?getComputedStyle(r):r.currentStyle,s=""===r.style.position,o="static"===e.position&&s,n=""===e.position&&""===r.style.position,(o||n)&&(r.style.position="relative"),null!=(a=i.contentWindow)&&(a.onresize=function(t){return function(e){return t.dispatchEvent(r)}}(this)),r.iframe=i),r.isAnyResizeEventInited=!0},t.prototype.initTimer=function(t){var e,r;return r=0,e=0,this.interval=setInterval(function(i){return function(){var n,s;return s=t.offsetWidth,n=t.offsetHeight,s!==r||n!==e?(i.dispatchEvent(t),r=s,e=n):void 0}}(this),this.o.interval||62.5)},t.prototype.dispatchEvent=function(t){var e;return document.createEvent?(e=document.createEvent("HTMLEvents"),e.initEvent("onresize",!1,!1),t.dispatchEvent(e)):document.createEventObject?(e=document.createEventObject(),t.fireEvent("onresize",e)):!1},t.prototype.destroy=function(){var t,e,r,i,n,s,o;for(clearInterval(this.interval),this.interval=null,window.isAnyResizeEventInited=!1,e=this,s=this.allowedProtos,o=[],t=r=0,i=s.length;i>r;t=++r)n=s[t],null!=n.prototype&&o.push(function(t){var e;return e=t.prototype.addEventListener||t.prototype.attachEvent,t.prototype.addEventListener?t.prototype.addEventListener=Element.prototype.addEventListener:t.prototype.attachEvent&&(t.prototype.attachEvent=Element.prototype.attachEvent),t.prototype.removeEventListener?t.prototype.removeEventListener=Element.prototype.removeEventListener:t.prototype.detachEvent?t.prototype.detachEvent=Element.prototype.detachEvent:void 0}(n));return o},t}(),i=[],n=function(){return new r}.apply(e,i),!(void 0!==n&&(t.exports=n))}()},function(t,e,r){t.exports={"default":r(54),__esModule:!0}},function(t,e,r){t.exports={"default":r(56),__esModule:!0}},function(t,e,r){t.exports={"default":r(1),__esModule:!0}},function(t,e,r){t.exports={"default":r(55),__esModule:!0}},function(t,e,r){t.exports={"default":r(60),__esModule:!0}},function(t,e,r){t.exports={"default":r(58),__esModule:!0}},function(t,e,r){t.exports={"default":r(59),__esModule:!0}},function(t,e,r){r(61),r(62),t.exports=r(63)},function(t,e,r){r(64),t.exports=r(65).Object.keys},function(t,e,r){r(68),t.exports=r(65).Object.getPrototypeOf},function(t,e,r){var i=r(66);r(67),t.exports=function(t,e){return i.getDesc(t,e)}},function(t,e,r){var i=r(66);t.exports=function(t,e,r){return i.setDesc(t,e,r)}},function(t,e,r){r(62),r(61),t.exports=r(69)("iterator")},function(t,e,r){var i,n;(function(t){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}var o=r(19),a=s(o),u=r(15),p=s(u),l=r(16),h=s(l),f=r(3),c=s(f),d=r(4),y=s(d),_=r(5),v=s(_),m=r(6),g=s(m),w=r(7),b=s(w),x=r(17),k=s(x),S=r(2),T=s(S),M=r(8),P=s(M),O=r(9),E=s(O),C=r(10),A=s(C),D=r(11),L=s(D),R=r(12),F=s(R),I=r(13),j=s(I),z=r(18),B=s(z);window.mojs={revision:"0.205.0",isDebug:!0,helpers:p["default"],Transit:y["default"],Swirl:v["default"],Burst:c["default"],stagger:g["default"],Spriter:b["default"],MotionPath:k["default"],Tween:T["default"],Timeline:P["default"],Tweenable:A["default"],Thenable:L["default"],Tunable:F["default"],Module:j["default"],tweener:E["default"],easing:B["default"],shapesMap:h["default"]};{var U=new mojs.Burst({left:"50%",top:"50%",shape:["cross","polygon","zigzag"],stroke:"cyan",fill:"none",radius:{0:150},angle:190,degreeShift:"rand(-50,50)",pathScale:"rand(.5, 1)",strokeWidth:{2:0},childOptions:{radius:5,isSwirl:1,swirlSize:"rand(3, 6)",swirlFrequency:"rand(3, 10)",angle:{0:200}}});document.querySelector("#js-play"),document.querySelector("#js-range-slider")}document.body.addEventListener("click",function(t){U.play()}),mojs.h=mojs.helpers,mojs.delta=mojs.h.delta,i=[],n=function(){return mojs}.apply(e,i),!(void 0!==n&&(t.exports=n)),"object"===a["default"](t)&&"object"===a["default"](t.exports)&&(t.exports=mojs)}).call(e,r(14)(t))},function(t,e,r){r(72),t.exports=r(65).Object.setPrototypeOf},function(t,e,r){var i=r(66);t.exports=function(t,e){return i.create(t,e)}},function(t,e,r){r(62),r(73),t.exports=r(65).Array.from},function(t,e,r){r(74);var i=r(75);i.NodeList=i.HTMLCollection=i.Array},function(t,e,r){"use strict";var i=r(76)(!0);r(77)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=i(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){var i=r(78),n=r(79);t.exports=r(65).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return i(e.call(t))}},function(t,e,r){var i=r(80);r(81)("keys",function(t){return function(e){return t(i(e))}})},function(t,e,r){var i=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=i)},function(t,e,r){var i=Object;t.exports={create:i.create,getProto:i.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:i.getOwnPropertyDescriptor,setDesc:i.defineProperty,setDescs:i.defineProperties,getKeys:i.keys,getNames:i.getOwnPropertyNames,getSymbols:i.getOwnPropertySymbols,each:[].forEach}},function(t,e,r){var i=r(82);r(81)("getOwnPropertyDescriptor",function(t){return function(e,r){return t(i(e),r)}})},function(t,e,r){var i=r(80);r(81)("getPrototypeOf",function(t){return function(e){return t(i(e))}})},function(t,e,r){var i=r(83)("wks"),n=r(84),s=r(85).Symbol;t.exports=function(t){return i[t]||(i[t]=s&&s[t]||(s||n)("Symbol."+t))}},function(t,e,r){"use strict";var i=r(66),n=r(85),s=r(93),o=r(94),a=r(86),u=r(95),p=r(96),l=r(83),h=r(97),f=r(84),c=r(69),d=r(98),y=r(99),_=r(100),v=r(101),m=r(78),g=r(82),w=r(102),b=i.getDesc,x=i.setDesc,k=i.create,S=y.get,T=n.Symbol,M=n.JSON,P=M&&M.stringify,O=!1,E=c("_hidden"),C=i.isEnum,A=l("symbol-registry"),D=l("symbols"),L="function"==typeof T,R=Object.prototype,F=o&&p(function(){return 7!=k(x({},"a",{get:function(){return x(this,"a",{value:7}).a}})).a})?function(t,e,r){var i=b(R,e);i&&delete R[e],x(t,e,r),i&&t!==R&&x(R,e,i)}:x,I=function(t){var e=D[t]=k(T.prototype);return e._k=t,o&&O&&F(R,t,{configurable:!0,set:function(e){s(this,E)&&s(this[E],t)&&(this[E][t]=!1),F(this,t,w(1,e))}}),e},j=function(t){return"symbol"==typeof t},z=function(t,e,r){return r&&s(D,e)?(r.enumerable?(s(t,E)&&t[E][e]&&(t[E][e]=!1),r=k(r,{enumerable:w(0,!1)})):(s(t,E)||x(t,E,w(1,{})),t[E][e]=!0),F(t,e,r)):x(t,e,r)},B=function(t,e){m(t);for(var r,i=_(e=g(e)),n=0,s=i.length;s>n;)z(t,r=i[n++],e[r]);return t},U=function(t,e){return void 0===e?k(t):B(k(t),e)},N=function(t){var e=C.call(this,t);return e||!s(this,t)||!s(D,t)||s(this,E)&&this[E][t]?e:!0},H=function(t,e){var r=b(t=g(t),e);return!r||!s(D,e)||s(t,E)&&t[E][e]||(r.enumerable=!0),r},Y=function(t){for(var e,r=S(g(t)),i=[],n=0;r.length>n;)s(D,e=r[n++])||e==E||i.push(e);return i},X=function(t){for(var e,r=S(g(t)),i=[],n=0;r.length>n;)s(D,e=r[n++])&&i.push(D[e]);return i},q=function(t){if(void 0!==t&&!j(t)){for(var e,r,i=[t],n=1,s=arguments;s.length>n;)i.push(s[n++]);return e=i[1],"function"==typeof e&&(r=e),(r||!v(e))&&(e=function(t,e){return r&&(e=r.call(this,t,e)),j(e)?void 0:e}),i[1]=e,P.apply(M,i)}},W=p(function(){var t=T();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))});L||(T=function(){if(j(this))throw TypeError("Symbol is not a constructor");return I(f(arguments.length>0?arguments[0]:void 0))},u(T.prototype,"toString",function(){return this._k}),j=function(t){return t instanceof T},i.create=U,i.isEnum=N,i.getDesc=H,i.setDesc=z,i.setDescs=B,i.getNames=y.get=Y,i.getSymbols=X,o&&!r(103)&&u(R,"propertyIsEnumerable",N,!0));var G={"for":function(t){return s(A,t+="")?A[t]:A[t]=T(t)},keyFor:function(t){return d(A,t)},useSetter:function(){O=!0},useSimple:function(){O=!1}};i.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(t){var e=c(t);G[t]=L?e:I(e)}),O=!0,a(a.G+a.W,{Symbol:T}),a(a.S,"Symbol",G),a(a.S+a.F*!L,"Object",{create:U,defineProperty:z,defineProperties:B,getOwnPropertyDescriptor:H,getOwnPropertyNames:Y,getOwnPropertySymbols:X}),M&&a(a.S+a.F*(!L||W),"JSON",{stringify:q}),h(T,"Symbol"),h(Math,"Math",!0),h(n.JSON,"JSON",!0)},function(t,e,r){},function(t,e,r){var i=r(86);i(i.S,"Object",{setPrototypeOf:r(87).set})},function(t,e,r){"use strict";var i=r(89),n=r(86),s=r(80),o=r(90),a=r(88),u=r(91),p=r(79);n(n.S+n.F*!r(92)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,n,l,h=s(t),f="function"==typeof this?this:Array,c=arguments,d=c.length,y=d>1?c[1]:void 0,_=void 0!==y,v=0,m=p(h);if(_&&(y=i(y,d>2?c[2]:void 0,2)),void 0==m||f==Array&&a(m))for(e=u(h.length),r=new f(e);e>v;v++)r[v]=_?y(h[v],v):h[v];else for(l=m.call(h),r=new f;!(n=l.next()).done;v++)r[v]=_?o(l,y,[n.value,v],!0):n.value;return r.length=v,r}})},function(t,e,r){"use strict";var i=r(104),n=r(105),s=r(75),o=r(82);t.exports=r(77)(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,r):"values"==e?n(0,t[r]):n(0,[r,t[r]])},"values"),s.Arguments=s.Array,i("keys"),i("values"),i("entries")},function(t,e,r){t.exports={}},function(t,e,r){var i=r(106),n=r(107);t.exports=function(t){return function(e,r){var s,o,a=String(n(e)),u=i(r),p=a.length;return 0>u||u>=p?t?"":void 0:(s=a.charCodeAt(u),55296>s||s>56319||u+1===p||(o=a.charCodeAt(u+1))<56320||o>57343?t?a.charAt(u):s:t?a.slice(u,u+2):(s-55296<<10)+(o-56320)+65536)}}},function(t,e,r){"use strict";var i=r(103),n=r(86),s=r(95),o=r(108),a=r(93),u=r(75),p=r(109),l=r(97),h=r(66).getProto,f=r(69)("iterator"),c=!([].keys&&"next"in[].keys()),d="@@iterator",y="keys",_="values",v=function(){return this};t.exports=function(t,e,r,m,g,w,b){p(r,e,m);var x,k,S=function(t){if(!c&&t in O)return O[t];switch(t){case y:return function(){return new r(this,t)};case _:return function(){return new r(this,t)}}return function(){return new r(this,t)}},T=e+" Iterator",M=g==_,P=!1,O=t.prototype,E=O[f]||O[d]||g&&O[g],C=E||S(g);if(E){var A=h(C.call(new t));l(A,T,!0),!i&&a(O,d)&&o(A,f,v),M&&E.name!==_&&(P=!0,C=function(){return E.call(this)})}if(i&&!b||!c&&!P&&O[f]||o(O,f,C),u[e]=C,u[T]=v,g)if(x={values:M?C:S(_),keys:w?C:S(y),entries:M?S("entries"):C},b)for(k in x)k in O||s(O,k,x[k]);else n(n.P+n.F*(c||P),e,x); - -return x}},function(t,e,r){var i=r(110);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){var i=r(111),n=r(69)("iterator"),s=r(75);t.exports=r(65).getIteratorMethod=function(t){return void 0!=t?t[n]||t["@@iterator"]||s[i(t)]:void 0}},function(t,e,r){var i=r(107);t.exports=function(t){return Object(i(t))}},function(t,e,r){var i=r(86),n=r(65),s=r(96);t.exports=function(t,e){var r=(n.Object||{})[t]||Object[t],o={};o[t]=e(r),i(i.S+i.F*s(function(){r(1)}),"Object",o)}},function(t,e,r){var i=r(112),n=r(107);t.exports=function(t){return i(n(t))}},function(t,e,r){var i=r(85),n="__core-js_shared__",s=i[n]||(i[n]={});t.exports=function(t){return s[t]||(s[t]={})}},function(t,e,r){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,r){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,r){var i=r(85),n=r(65),s=r(89),o="prototype",a=function(t,e,r){var u,p,l,h=t&a.F,f=t&a.G,c=t&a.S,d=t&a.P,y=t&a.B,_=t&a.W,v=f?n:n[e]||(n[e]={}),m=f?i:c?i[e]:(i[e]||{})[o];f&&(r=e);for(u in r)p=!h&&m&&u in m,p&&u in v||(l=p?m[u]:r[u],v[u]=f&&"function"!=typeof m[u]?r[u]:y&&p?s(l,i):_&&m[u]==l?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};return e[o]=t[o],e}(l):d&&"function"==typeof l?s(Function.call,l):l,d&&((v[o]||(v[o]={}))[u]=l))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,t.exports=a},function(t,e,r){var i=r(66).getDesc,n=r(110),s=r(78),o=function(t,e){if(s(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=r(89)(Function.call,i(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(s){e=!0}return function(t,r){return o(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:o}},function(t,e,r){var i=r(75),n=r(69)("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[n]===t)}},function(t,e,r){var i=r(113);t.exports=function(t,e,r){if(i(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,i){return t.call(e,r,i)};case 3:return function(r,i,n){return t.call(e,r,i,n)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var i=r(78);t.exports=function(t,e,r,n){try{return n?e(i(r)[0],r[1]):e(r)}catch(s){var o=t["return"];throw void 0!==o&&i(o.call(t)),s}}},function(t,e,r){var i=r(106),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},function(t,e,r){var i=r(69)("iterator"),n=!1;try{var s=[7][i]();s["return"]=function(){n=!0},Array.from(s,function(){throw 2})}catch(o){}t.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var s=[7],o=s[i]();o.next=function(){r=!0},s[i]=function(){return o},t(s)}catch(a){}return r}},function(t,e,r){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,r){t.exports=!r(96)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,r){t.exports=r(108)},function(t,e,r){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,r){var i=r(66).setDesc,n=r(93),s=r(69)("toStringTag");t.exports=function(t,e,r){t&&!n(t=r?t:t.prototype,s)&&i(t,s,{configurable:!0,value:e})}},function(t,e,r){var i=r(66),n=r(82);t.exports=function(t,e){for(var r,s=n(t),o=i.getKeys(s),a=o.length,u=0;a>u;)if(s[r=o[u++]]===e)return r}},function(t,e,r){var i=r(82),n=r(66).getNames,s={}.toString,o="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return n(t)}catch(e){return o.slice()}};t.exports.get=function(t){return o&&"[object Window]"==s.call(t)?a(t):n(i(t))}},function(t,e,r){var i=r(66);t.exports=function(t){var e=i.getKeys(t),r=i.getSymbols;if(r)for(var n,s=r(t),o=i.isEnum,a=0;s.length>a;)o.call(t,n=s[a++])&&e.push(n);return e}},function(t,e,r){var i=r(114);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,r){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){t.exports=!0},function(t,e,r){t.exports=function(){}},function(t,e,r){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,r){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var i=r(66),n=r(102);t.exports=r(94)?function(t,e,r){return i.setDesc(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){"use strict";var i=r(66),n=r(102),s=r(97),o={};r(108)(o,r(69)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=i.create(o,{next:n(1,r)}),s(t,e+" Iterator")}},function(t,e,r){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var i=r(114),n=r(69)("toStringTag"),s="Arguments"==i(function(){return arguments}());t.exports=function(t){var e,r,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=(e=Object(t))[n])?r:s?i(e):"Object"==(o=i(e))&&"function"==typeof e.callee?"Arguments":o}},function(t,e,r){var i=r(114);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,r){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}}]); \ No newline at end of file +!function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="build/",e(0)}([function(t,e,r){t.exports=r(57)},function(t,e,r){r(70),r(71),t.exports=r(65).Symbol},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(27),s=i(n),o=r(22),a=i(o),u=r(24),p=i(u),l=r(20),h=i(l),f=r(23),c=i(f),d=r(25),y=i(d),_=r(15),v=(i(_),r(9)),m=i(v),g=r(18),w=i(g),b=r(13),x=i(b),k=function(t){function e(){var t,r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];a["default"](this,e);var i=p["default"](this,s["default"](e).call(this,r));return null==i._props.name&&i._setSelfName(),t=i,p["default"](i,t)}return y["default"](e,t),c["default"](e,[{key:"_declareDefaults",value:function(){this._defaults={duration:600,delay:0,repeat:0,speed:1,yoyo:!1,easing:"Linear.None",name:null,nameBase:"Tween",onProgress:null,onStart:null,onComplete:null,onRepeatStart:null,onRepeatComplete:null,onFirstUpdate:null,onUpdate:null,isChained:!1,callbacksContext:null}}},{key:"play",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return"play"===this._state&&this._isRunning?!1:(this._props.isReversed=!1,this._subPlay(t,"play"),this._setPlaybackState("play"),this)}},{key:"playBackward",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return"reverse"===this._state&&this._isRunning?!1:(this._props.isReversed=!0,this._subPlay(t,"reverse"),this._setPlaybackState("reverse"),this)}},{key:"pause",value:function(){return this._removeFromTweener(),this._setPlaybackState("pause"),this}},{key:"stop",value:function(t){if("stop"!==this._state){this._props.isReversed=!1,this._removeFromTweener();var e=null!=t?t:"reverse"===this._state?1:0;return this.setProgress(e),this._setPlaybackState("stop"),this._prevTime=null,this}}},{key:"replay",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return this.stop(),this.play(t),this}},{key:"replayBackward",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return this.stop(),this.playBackward(t),this}},{key:"setProgress",value:function(t){var e=this._props;return!e.startTime&&this._setStartTime(),this._playTime=null,0>t&&(t=0),t>1&&(t=1),this._update(e.startTime-e.delay+t*e.repeatTime),this}},{key:"_subPlay",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=arguments[1],r=this._props,i=this._state,n=this._prevState,s="pause"===i,o="play"===i||s&&"play"===n,a="reverse"===i||s&&"reverse"===n,u=o&&"reverse"===e||a&&"play"===e;return this._progressTime=this._progressTime>=r.repeatTime?0:this._progressTime,u&&(this._progressTime=r.repeatTime-this._progressTime),this._resumeTime=performance.now(),this._setStartTime(this._resumeTime-Math.abs(t)-this._progressTime,!1,e),null!=this._prevTime&&(this._prevTime="play"===e?this._normPrevTimeForward():r.endTime-this._progressTime),m["default"].add(this),this}},{key:"_normPrevTimeForward",value:function(){var t=this._props;return t.startTime+this._progressTime-t.delay}}]),c["default"](e,[{key:"_setSelfName",value:function(){var t="_"+this._props.nameBase+"s";m["default"][t]=null==m["default"][t]?1:++m["default"][t],this._props.name=this._props.nameBase+" "+m["default"][t]}},{key:"_setPlaybackState",value:function(t){this._prevState=this._state,this._state=t}},{key:"_vars",value:function(){return this.progress=0,this._prevTime=null,this._progressTime=0,this._negativeShift=0,this._state="stop",this._props.delay<0&&(this._negativeShift=this._props.delay,this._props.delay=0),this._calcDimentions()}},{key:"_calcDimentions",value:function(){this._props.time=this._props.duration+this._props.delay,this._props.repeatTime=this._props.time*(this._props.repeat+1)}},{key:"_extendDefaults",value:function(){this._callbackOverrides=this._o.callbackOverrides||{},delete this._o.callbackOverrides,h["default"](s["default"](e.prototype),"_extendDefaults",this).call(this),this._props.easing=w["default"].parseEasing(this._props.easing)}},{key:"_setStartTime",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],r=this._props,i=r.shiftTime||0;e&&(this._isCompleted=!1,this._isRepeatCompleted=!1,this._isStarted=!1);var n=null==t?performance.now():t;return r.startTime=n+r.delay+this._negativeShift+i,r.endTime=r.startTime+r.repeatTime-r.delay,this._playTime=null!=this._resumeTime?this._resumeTime:n+i,this._resumeTime=null,this}},{key:"_update",value:function(t,e,r,i){var n=this._props;null==this._prevTime&&null!=e&&(this._prevTime=e,this._wasUknownUpdate=!0);var s=n.startTime-n.delay;if(n.speed&&this._playTime&&(t=this._playTime+n.speed*(t-this._playTime)),i&&null!=r){var o=this._getPeriod(t),a=!(!n.yoyo||!this._props.repeat||o%2!==1);1===i?r?(this._prevTime=t+1,this._repeatStart(t,a),this._start(t,a)):(this._prevTime=t-1,this._repeatComplete(t,a),this._complete(t,a)):-1===i&&(r?(this._prevTime=t-1,this._repeatComplete(t,a),this._complete(t,a)):this._prevTime>=n.startTime&&this._prevTime<=n.endTime&&(this._prevTime=t+1,this._repeatStart(t,a),this._start(t,a),this._isCompleted=!0)),this._prevTime=null}return t>s&&t=t?this._progressTime=0:t>=n.endTime&&(this._progressTime=n.repeatTime+1e-11),n.isReversed&&(t=n.endTime-this._progressTime),null===this._prevTime?(this._prevTime=t,this._wasUknownUpdate=!0,!1):(t>=s&&t<=n.endTime&&this._progress((t-s)/n.repeatTime,t),t>=n.startTime&&t<=n.endTime?this._updateInActiveArea(t):this._isInActiveArea&&this._updateInInactiveArea(t),this._prevTime=t,t>=n.endTime||s>=t)}},{key:"_updateInInactiveArea",value:function(t){if(this._isInActiveArea){var e=this._props;if(t>e.endTime&&!this._isCompleted){this._progress(1,t);var r=this._getPeriod(e.endTime),i=e.yoyo&&r%2===0;this._setProgress(i?0:1,t,i),this._repeatComplete(t,i),this._complete(t,i)}tthis._prevTime&&(this._isRepeatCompleted=!1),this._repeatComplete(t,l),this._complete(t,l)}if(this._isCompleted=!1,i+n>=e.startTime){this._isInActiveArea=!0,this._isRepeatCompleted=!1,this._isRepeatStart=!1,this._isStarted=!1;var c=(t-e.startTime)%r,d=c/e.duration,y=o>0&&o>u,_=u>o;if(this._onEdge=0,y&&(this._onEdge=1),_&&(this._onEdge=-1),this._wasUknownUpdate&&(t>this._prevTime&&(this._start(t,l),this._repeatStart(t,l),this._firstUpdate(t,l)),t=0&&this._repeatStart(t,l)}t>this._prevTime&&(!this._isStarted&&this._prevTime<=e.startTime&&(this._start(t,l),this._repeatStart(t,l),this._isStarted=!1,this._isRepeatStart=!1),this._firstUpdate(t,l)),_&&(0!==this.progress&&1!==this.progress&&u!=s&&this._repeatStart(t,h),u!==s||this._wasUknownUpdate||(this._complete(t,l),this._repeatComplete(t,l),this._firstUpdate(t,l),this._isCompleted=!1),this._repeatComplete(t,l)),"delay"===u&&(p>o&&this._repeatComplete(t,l),o===p&&o>0&&this._repeatStart(t,l)),t>this._prevTime?(0===d&&this._repeatStart(t,l),t!==e.endTime&&this._setProgress(l?1-d:d,t,l)):(t!==e.endTime&&this._setProgress(l?1-d:d,t,l),0===d&&this._repeatStart(t,l)),t===e.startTime&&this._start(t,l)}else if(this._isInActiveArea){var m="delay"===o?a:o,g=t>this._prevTime;g&&m--,f=e.yoyo&&m%2===1?1:0,tthis._prevTime&&(0!==this.progress||1===f)&&this._repeatComplete(t,1===f),this._isInActiveArea=!1}this._wasUknownUpdate=!1}},{key:"_removeFromTweener",value:function(){return m["default"].remove(this),this}},{key:"_getPeriod",value:function(t){var e=this._props,r=e.delay+e.duration,i=e.delay+t-e.startTime,n=i/r,s=t=e.endTime?Math.round(n):Math.floor(n),t>e.endTime?n=Math.round((e.endTime-e.startTime+e.delay)/r):s>0&&sthis._prevTime,r),i.prevEasedProgress=this.easedProgress,i.wasYoyo=r,this}},{key:"_start",value:function(t,e){if(!this._isStarted){var r=this._props;null!=r.onStart&&"function"==typeof r.onStart&&r.onStart.call(r.callbacksContext||this,t>this._prevTime,e),this._isCompleted=!1,this._isStarted=!0,this._isFirstUpdate=!1}}},{key:"_complete",value:function(t,e){if(!this._isCompleted){var r=this._props;null!=r.onComplete&&"function"==typeof r.onComplete&&r.onComplete.call(r.callbacksContext||this,t>this._prevTime,e),this._isCompleted=!0,this._isStarted=!1,this._isFirstUpdate=!1,this._prevYoyo=void 0}}},{key:"_firstUpdate",value:function(t,e){if(!this._isFirstUpdate){var r=this._props;null!=r.onFirstUpdate&&"function"==typeof r.onFirstUpdate&&(r.onFirstUpdate.tween=this,r.onFirstUpdate.call(r.callbacksContext||this,t>this._prevTime,e)),this._isFirstUpdate=!0}}},{key:"_repeatComplete",value:function(t,e){if(!this._isRepeatCompleted){var r=this._props;null!=r.onRepeatComplete&&"function"==typeof r.onRepeatComplete&&r.onRepeatComplete.call(r.callbacksContext||this,t>this._prevTime,e),this._isRepeatCompleted=!0}}},{key:"_repeatStart",value:function(t,e){if(!this._isRepeatStart){var r=this._props;null!=r.onRepeatStart&&"function"==typeof r.onRepeatStart&&r.onRepeatStart.call(r.callbacksContext||this,t>this._prevTime,e),this._isRepeatStart=!0}}},{key:"_progress",value:function(t,e){var r=this._props;null!=r.onProgress&&"function"==typeof r.onProgress&&r.onProgress.call(r.callbacksContext||this,t,e>this._prevTime)}},{key:"_onTweenerRemove",value:function(){}},{key:"_onTweenerFinish",value:function(){this._setPlaybackState("stop")}},{key:"_setProp",value:function(t,r){h["default"](s["default"](e.prototype),"_setProp",this).call(this,t,r),this._calcDimentions()}},{key:"_assignProp",value:function(t,r){null==r&&(r=this._defaults[t]),"easing"===t&&(r=w["default"].parseEasing(r));var i=this._callbackOverrides[t],n=!r||!r.isMojsCallbackOverride;i&&n&&(r=this._overrideCallback(r,i)),h["default"](s["default"](e.prototype),"_assignProp",this).call(this,t,r)}},{key:"_overrideCallback",value:function(t,e){var r=t&&"function"==typeof t,i=function(){r&&t.apply(this,arguments),e.apply(this,arguments)};return i.isMojsCallbackOverride=!0,i}}]),e}(x["default"]);e["default"]=k},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(21),s=i(n),o=r(28),a=i(o),u=r(27),p=i(u),l=r(22),h=i(l),f=r(23),c=i(f),d=r(24),y=i(d),_=r(20),v=i(_),m=r(25),g=i(m),w=r(4),b=(i(w),r(5)),x=i(b),k=r(15),S=i(k),T=function(t){function e(){return h["default"](this,e),y["default"](this,p["default"](e).apply(this,arguments))}return g["default"](e,t),c["default"](e,[{key:"_declareDefaults",value:function(){v["default"](p["default"](e.prototype),"_declareDefaults",this).call(this),this._declareChildDefaults(),this._defaults.count=5,this._defaults.degree=360,this._defaults.radius={5:50},this._optionsIntersection={radius:1,radiusX:1,radiusY:1,angle:1,scale:1,opacity:1}}},{key:"_extendDefaults",value:function(){v["default"](p["default"](e.prototype),"_extendDefaults",this).call(this),this._calcSize()}},{key:"_declareChildDefaults",value:function(){this._childDefaults=S["default"].cloneObj(this._defaults),this._childDefaults.isSwirl=!1;for(var t in S["default"].tweenOptionMap)this._childDefaults[t]=null;for(var t in S["default"].callbacksMap)this._childDefaults[t]=null}},{key:"_createBit",value:function(){this._swirls=[];for(var t=0;ti;i++){var n=this._getOptionByIndex(i,t);n.isRunLess=!0;var s=new e(n);this.childModules.push(s),this.timeline.add(s)}return this}},{key:"run",value:function(){this.timeline.play()}}]),t}();t.exports=function(t){return function(e){return new d(e,t)}}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(22),s=i(n),o=r(23),a=i(o),u=r(15),p=i(u),l=r(2),h=i(l),f=r(8),c=i(f),d=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return s["default"](this,t),this.o=e,this.o.el?(this._vars(),this._declareDefaults(),this._extendDefaults(),this._parseFrames(),this._frames.length<=2&&p["default"].warn("Spriter: only "+this._frames.length+" frames found"),this._frames.length<1&&p["default"].error("Spriter: there is no frames to animate, aborting"),this._createTween(),this):p["default"].error('No "el" option specified, aborting')}return a["default"](t,[{key:"_declareDefaults",value:function(){this._defaults={duration:500,delay:0,easing:"linear.none",repeat:0,yoyo:!1,isRunLess:!1,isShowEnd:!1,onStart:null,onUpdate:null,onComplete:null}}}]),a["default"](t,[{key:"_vars",value:function(){this._props=p["default"].cloneObj(this.o),this.el=this.o.el,this._frames=[]}},{key:"run",value:function(t){return this.timeline.play()}},{key:"_extendDefaults",value:function(){return p["default"].extend(this._props,this._defaults)}},{key:"_parseFrames",value:function(){this._frames=Array.prototype.slice.call(this.el.children,0),this._frames.forEach(function(t,e){return t.style.opacity=0}),this._frameStep=1/this._frames.length}},{key:"_createTween",value:function(){var t=this;this._tween=new h["default"]({duration:this._props.duration,delay:this._props.delay,yoyo:this._props.yoyo,repeat:this._props.repeat,easing:this._props.easing,onStart:function(){return t._props.onStart&&t._props.onStart()},onComplete:function(){return t._props.onComplete&&t._props.onComplete()},onUpdate:function(e){return t._setProgress(e)}}),this.timeline=new c["default"],this.timeline.add(this._tween),this._props.isRunLess||this._startTween()}},{key:"_startTween",value:function(){var t=this;setTimeout(function(){return t.timeline.play()},1)}},{key:"_setProgress",value:function(t){var e=Math.floor(t/this._frameStep);if(this._prevFrame!=this._frames[e]){this._prevFrame&&(this._prevFrame.style.opacity=0);var r=1===t&&this._props.isShowEnd?e-1:e;this._frames[r]&&(this._frames[r].style.opacity=1),this._prevFrame=this._frames[e]}this._props.onUpdate&&this._props.onUpdate(t)}}]),t}();e["default"]=d},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(27),s=i(n),o=r(29),a=i(o),u=r(22),p=i(u),l=r(24),h=i(l),f=r(23),c=i(f),d=r(25),y=i(d),_=r(20),v=i(_),m=r(15),g=i(m),w=r(9),b=(i(w),r(2)),x=i(b),k=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return p["default"](this,e),h["default"](this,s["default"](e).call(this,t))}return y["default"](e,t),c["default"](e,[{key:"add",value:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return this._pushTimelineArray(e),this._calcDimentions(),this}},{key:"append",value:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var i=!0,n=!1,s=void 0;try{for(var o,u=a["default"](e);!(i=(o=u.next()).done);i=!0){var p=o.value;g["default"].isArray(p)?this._appendTimelineArray(p):this._appendTimeline(p,this._timelines.length),this._calcDimentions()}}catch(l){n=!0,s=l}finally{try{!i&&u["return"]&&u["return"]()}finally{if(n)throw s}}return this}},{key:"_appendTimelineArray",value:function(t){for(var e=t.length,r=this._props.repeatTime-this._props.delay,i=this._timelines.length;e--;)this._appendTimeline(t[e],i,r)}},{key:"_appendTimeline",value:function(t,r,i){t.timeline instanceof e&&(t=t.timeline),t.tween instanceof x["default"]&&(t=t.tween);var n=null!=i?i:this._props.duration;n+=t._props.shiftTime||0,t.index=r,this._pushTimeline(t,n)}},{key:"_pushTimelineArray",value:function(t){for(var e=0;ethis._prevTime?-1:1;this._props.yoyo&&i&&(n*=-1);for(var o=this._props.startTime+t*this._props.duration,a=o+n,u=this._timelines.length,p=0;u>p;p++){var l=o>a?p:u-1-p;this._timelines[l]._update(o,a,this._prevYoyo,this._onEdge)}this._prevYoyo=i}},{key:"_recalcDuration",value:function(t){var e=t._props,r=e.repeatTime/e.speed+(e.shiftTime||0);this._props.duration=Math.max(r,this._props.duration)}},{key:"_recalcTotalDuration",value:function(){var t=this._timelines.length;for(this._props.duration=0;t--;)this._recalcDuration(this._timelines[t]);this._calcDimentions()}},{key:"_setStartTime",value:function(t){var r=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];v["default"](s["default"](e.prototype),"_setStartTime",this).call(this,t),this._startTimelines(this._props.startTime,r)}},{key:"_startTimelines",value:function(t){{var e,r=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this._props}null==t&&(t=this._props.startTime);for(var i=0;i-1,this.isChrome=t.indexOf("Chrome")>-1,this.isOpera=t.toLowerCase().indexOf("op")>-1,this.isChrome&&this.isSafari&&(this.isSafari=!1),t.match(/PhantomJS/gim)&&(this.isSafari=!1),this.isChrome&&this.isOpera&&(this.isChrome=!1),this.is3d=this.checkIf3d(),this.uniqIDs=-1,this.div=document.createElement("div"),document.body.appendChild(this.div)},t.prototype.cloneObj=function(t,e){var r,i,n,s;for(n=Object.keys(t),s={},r=n.length;r--;)i=n[r],null!=e?e[i]||(s[i]=t[i]):s[i]=t[i];return s},t.prototype.extend=function(t,e){var r,i;for(r in e)i=e[r],null==t[r]&&(t[r]=e[r]);return t},t.prototype.getRemBase=function(){var t,e;return t=document.querySelector("html"),e=getComputedStyle(t),this.remBase=parseFloat(e.fontSize)},t.prototype.clamp=function(t,e,r){return e>t?e:t>r?r:t},t.prototype.setPrefixedStyle=function(t,e,r){return e.match(/transform/gim)?(t.style[""+e]=r,t.style[""+this.prefix.css+e]=r):t.style[e]=r},t.prototype.style=function(t,e,r){var i,n,s,o;if("object"==typeof e){for(n=Object.keys(e),s=n.length,o=[];s--;)i=n[s],r=e[i],o.push(this.setPrefixedStyle(t,i,r));return o}return this.setPrefixedStyle(t,e,r)},t.prototype.prepareForLog=function(t){return t=Array.prototype.slice.apply(t),t.unshift("::"),t.unshift(this.logBadgeCss),t.unshift("%cmo·js%c"),t},t.prototype.log=function(){return mojs.isDebug!==!1?console.log.apply(console,this.prepareForLog(arguments)):void 0},t.prototype.warn=function(){return mojs.isDebug!==!1?console.warn.apply(console,this.prepareForLog(arguments)):void 0},t.prototype.error=function(){return mojs.isDebug!==!1?console.error.apply(console,this.prepareForLog(arguments)):void 0},t.prototype.parseUnit=function(t){var e,r,i,n,s,o;return"number"==typeof t?s={unit:"px",isStrict:!1,value:t,string:t+"px"}:"string"==typeof t?(n=/px|%|rem|em|ex|cm|ch|mm|in|pt|pc|vh|vw|vmin/gim,o=null!=(i=t.match(n))?i[0]:void 0,r=!0,o||(o="px",r=!1),e=parseFloat(t),s={unit:o,isStrict:r,value:e,string:""+e+o}):t},t.prototype.bind=function(t,e){var r,i;return i=function(){var i,n;return i=Array.prototype.slice.call(arguments),n=r.concat(i),t.apply(e,n)},r=Array.prototype.slice.call(arguments,2),i},t.prototype.getRadialPoint=function(t){var e,r,i,n;return null==t&&(t={}),null!=t.radius&&null!=t.angle&&null!=t.center?(r=(t.angle-90)*(Math.PI/180),i=null!=t.radiusX?t.radiusX:t.radius,n=null!=t.radiusY?t.radiusY:t.radius,e={x:t.center.x+Math.cos(r)*i,y:t.center.y+Math.sin(r)*n}):void 0},t.prototype.getPrefix=function(){var t,e,r,i;return r=window.getComputedStyle(document.documentElement,""),i=Array.prototype.slice.call(r).join("").match(/-(moz|webkit|ms)-/),e=(i||""===r.OLink&&["","o"])[1],t="WebKit|Moz|MS|O".match(new RegExp("("+e+")","i"))[1],{dom:t,lowercase:e,css:"-"+e+"-",js:e[0].toUpperCase()+e.substr(1)}},t.prototype.strToArr=function(t){var e;return e=[],"number"!=typeof t||isNaN(t)?(t.trim().split(/\s+/gim).forEach(function(t){return function(r){return e.push(t.parseUnit(t.parseIfRand(r)))}}(this)),e):(e.push(this.parseUnit(t)),e)},t.prototype.calcArrDelta=function(t,e){var r,i,n,s,o;for(r=[],i=n=0,s=t.length;s>n;i=++n)o=t[i],r[i]=this.parseUnit(""+(e[i].value-t[i].value)+e[i].unit);return r},t.prototype.isArray=function(t){return t instanceof Array},t.prototype.normDashArrays=function(t,e){var r,i,n,s,o,a,u,p,l,h;if(r=t.length,i=e.length,r>i)for(u=r-i,h=e.length,s=o=0,p=u;p>=0?p>o:o>p;s=p>=0?++o:--o)n=s+h,e.push(this.parseUnit("0"+t[n].unit));else if(i>r)for(u=i-r,h=t.length,s=a=0,l=u;l>=0?l>a:a>l;s=l>=0?++a:--a)n=s+h,t.push(this.parseUnit("0"+e[n].unit));return[t,e]},t.prototype.makeColorObj=function(t){var e,r,i,n,s,o,a,u,p,l;return"#"===t[0]&&(p=/^#?([a-f\d]{1,2})([a-f\d]{1,2})([a-f\d]{1,2})$/i.exec(t),i={},p&&(o=2===p[1].length?p[1]:p[1]+p[1],n=2===p[2].length?p[2]:p[2]+p[2],r=2===p[3].length?p[3]:p[3]+p[3],i={r:parseInt(o,16),g:parseInt(n,16),b:parseInt(r,16),a:1})),"#"!==t[0]&&(s="r"===t[0]&&"g"===t[1]&&"b"===t[2],s&&(l=t),s||(l=this.shortColors[t]?this.shortColors[t]:(this.div.style.color=t,this.computedStyle(this.div).color)),a="^rgba?\\((\\d{1,3}),\\s?(\\d{1,3}),",u="\\s?(\\d{1,3}),?\\s?(\\d{1}|0?\\.\\d{1,})?\\)$",p=new RegExp(a+u,"gi").exec(l),i={},e=parseFloat(p[4]||1),p&&(i={r:parseInt(p[1],10),g:parseInt(p[2],10),b:parseInt(p[3],10),a:null==e||isNaN(e)?1:e})),i},t.prototype.computedStyle=function(t){return getComputedStyle(t)},t.prototype.capitalize=function(t){if("string"!=typeof t)throw Error("String expected - nothing to capitalize");return t.charAt(0).toUpperCase()+t.substring(1)},t.prototype.parseRand=function(t){var e,r,i;return r=t.split(/rand\(|\,|\)/),i=this.parseUnit(r[2]),e=this.rand(parseFloat(r[1]),parseFloat(r[2])),i.unit&&r[2].match(i.unit)?e+i.unit:e},t.prototype.parseStagger=function(t,e){var r,i,n,s,o,a;return a=t.split(/stagger\(|\)$/)[1].toLowerCase(),n=a.split(/(rand\(.*?\)|[^\(,\s]+)(?=\s*,|\s*$)/gim),a=n.length>3?(r=this.parseUnit(this.parseIfRand(n[1])),n[3]):(r=this.parseUnit(0),n[1]),a=this.parseIfRand(a),o=this.parseUnit(a),i=e*o.value+r.value,s=r.isStrict?r.unit:o.isStrict?o.unit:"",s?""+i+s:i},t.prototype.parseIfStagger=function(t,e){return"string"==typeof t&&t.match(/stagger/g)?this.parseStagger(t,e):t},t.prototype.parseIfRand=function(t){return"string"==typeof t&&t.match(/rand\(/)?this.parseRand(t):t},t.prototype.parseDelta=function(t,e){var r,i,n,s,o,a,u,p,l,h,f;if(l=Object.keys(e)[0],i=e[l],r={start:l},isNaN(parseFloat(l))&&!l.match(/rand\(/)){if("strokeLinecap"===t)return this.warn("Sorry, stroke-linecap property is not animatable yet, using the start("+l+") value instead",e),r;f=this.makeColorObj(l),s=this.makeColorObj(i),r={start:f,end:s,type:"color",delta:{r:s.r-f.r,g:s.g-f.g,b:s.b-f.b,a:s.a-f.a}}}else if("strokeDasharray"===t||"strokeDashoffset"===t){for(h=this.strToArr(l),n=this.strToArr(i),this.normDashArrays(h,n),o=u=0,p=h.length;p>u;o=++u)l=h[o],i=n[o],this.mergeUnits(l,i,t);r={start:h,end:n,delta:this.calcArrDelta(h,n),type:"array"}}else a=!this.callbacksMap[t]&&!this.tweenOptionMap[t],!this.chainOptionMap[t]&&a&&(this.unitOptionMap[t]?(i=this.parseUnit(this.parseIfRand(i)),l=this.parseUnit(this.parseIfRand(l)),this.mergeUnits(l,i,t),r={start:l,end:i,delta:i.value-l.value,type:"unit"}):(i=parseFloat(this.parseIfRand(i)),l=parseFloat(this.parseIfRand(l)),r={start:l,end:i,delta:i-l,type:"number"}));return r},t.prototype.mergeUnits=function(t,e,r){return!e.isStrict&&t.isStrict?(e.unit=t.unit,e.string=""+e.value+e.unit):e.isStrict&&!t.isStrict?(t.unit=e.unit,t.string=""+t.value+t.unit):e.isStrict&&t.isStrict&&e.unit!==t.unit?(t.unit=e.unit,t.string=""+t.value+t.unit,this.warn('Two different units were specified on "'+r+'" delta property, mo · js will fallback to end "'+e.unit+'" unit ')):void 0},t.prototype.rand=function(t,e){return Math.random()*(e-t)+t},t.prototype.isDOM=function(t){var e;return null==t?!1:(e="number"==typeof t.nodeType&&"string"==typeof t.nodeName,"object"==typeof t&&e)},t.prototype.getChildElements=function(t){var e,r,i;for(e=t.childNodes,r=[],i=e.length;i--;)1===e[i].nodeType&&r.unshift(e[i]);return r},t.prototype.delta=function(t,e){var r,i,n,s,o;return s=typeof t,o=typeof e,r="string"===s||"number"===s&&!isNaN(t),i="string"===o||"number"===o&&!isNaN(e),r&&i?(n={},n[t]=e,n):void this.error("delta method expects Strings or Numbers at input but got - "+t+", "+e)},t.prototype.getUniqID=function(){return++this.uniqIDs},t.prototype.parsePath=function(t){var e;return"string"==typeof t?"m"===t.charAt(0).toLowerCase()?(e=document.createElementNS(this.NS,"path"),e.setAttributeNS(null,"d",t),e):document.querySelector(t):t.style?t:void 0},t.prototype.closeEnough=function(t,e,r){return Math.abs(t-e)0&&this.createFilter(),this.path=this.getPath(),this.path.getAttribute("d")?(this.len=this.path.getTotalLength(),this.slicedLen=this.len*(this.props.pathEnd-this.props.pathStart),this.startLen=this.props.pathStart*this.len,this.fill=this.props.fill,null!=this.fill&&(this.container=this.parseEl(this.props.fill.container),this.fillRule=this.props.fill.fillRule||"all",this.getScaler(),null!=this.container)?(this.removeEvent(this.container,"onresize",this.getScaler),this.addEvent(this.container,"onresize",this.getScaler)):void 0):(o.error("Path has no coordinates to work with, aborting"),!0)):(o.error('Missed "el" option. It could be a selector, DOMNode or another module.'),!0)},t.prototype.addEvent=function(t,e,r){return t.addEventListener(e,r,!1)},t.prototype.removeEvent=function(t,e,r){return t.removeEventListener(e,r,!1)},t.prototype.createFilter=function(){var t,e;return t=document.createElement("div"),this.filterID="filter-"+o.getUniqID(),t.innerHTML='',e=t.querySelector("#svg-"+this.filterID),this.filter=e.querySelector("#blur"),this.filterOffset=e.querySelector("#blur-offset"),document.body.insertBefore(e,document.body.firstChild),this.el.style.filter="url(#"+this.filterID+")",this.el.style[o.prefix.css+"filter"]="url(#"+this.filterID+")"},t.prototype.parseEl=function(t){return"string"==typeof t?document.querySelector(t):t instanceof HTMLElement?t:null!=t._setProp?(this.isModule=!0,t):void 0},t.prototype.getPath=function(){var t;return t=o.parsePath(this.props.path),t?t:this.props.path.x||this.props.path.y?this.curveToPath({start:{x:0,y:0},shift:{x:this.props.path.x||0,y:this.props.path.y||0},curvature:{x:this.props.curvature.x||this.defaults.curvature.x,y:this.props.curvature.y||this.defaults.curvature.y}}):void 0},t.prototype.getScaler=function(){var t,e,r;switch(this.cSize={width:this.container.offsetWidth||0,height:this.container.offsetHeight||0},r=this.path.getPointAtLength(0),t=this.path.getPointAtLength(this.len),e={},this.scaler={},e.width=t.x>=r.x?t.x-r.x:r.x-t.x,e.height=t.y>=r.y?t.y-r.y:r.y-t.y,this.fillRule){case"all":return this.calcWidth(e),this.calcHeight(e);case"width":return this.calcWidth(e),this.scaler.y=this.scaler.x;case"height":return this.calcHeight(e),this.scaler.x=this.scaler.y}},t.prototype.calcWidth=function(t){return this.scaler.x=this.cSize.width/t.width,!isFinite(this.scaler.x)&&(this.scaler.x=1)},t.prototype.calcHeight=function(t){return this.scaler.y=this.cSize.height/t.height,!isFinite(this.scaler.y)&&(this.scaler.y=1)},t.prototype.run=function(t){var e,r,i;if(t){e=this.history[0];for(r in t)i=t[r],o.callbacksMap[r]||o.tweenOptionMap[r]?(o.warn('the property "'+r+'" property can not be overridden on run yet'),delete t[r]):this.history[0][r]=i;this.tuneOptions(t)}return this.startTween()},t.prototype.createTween=function(){return this.tween=new s({duration:this.props.duration,delay:this.props.delay,yoyo:this.props.yoyo,repeat:this.props.repeat,easing:this.props.easing,onStart:function(t){return function(){var e;return null!=(e=t.props.onStart)?e.apply(t):void 0}}(this),onComplete:function(t){return function(){var e;return t.props.motionBlur&&t.setBlur({blur:{x:0,y:0},offset:{x:0,y:0}}),null!=(e=t.props.onComplete)?e.apply(t):void 0}}(this),onUpdate:function(t){return function(e){return t.setProgress(e)}}(this),onFirstUpdate:function(t){return function(e,r){return e?void 0:t.history.length>1&&t.tuneOptions(t.history[0])}}(this)}),this.timeline=new n,this.timeline.add(this.tween),!this.props.isRunLess&&this.startTween(),this.props.isPresetPosition&&this.setProgress(0,!0)},t.prototype.startTween=function(){return setTimeout(function(t){return function(){var e;return null!=(e=t.timeline)?e.play():void 0}}(this),1)},t.prototype.setProgress=function(t,e){var r,i,n,s;return r=this.startLen+(this.props.isReverse?(1-t)*this.slicedLen:t*this.slicedLen),i=this.path.getPointAtLength(r),n=i.x+this.props.offsetX,s=i.y+this.props.offsetY,this._getCurrentAngle(i,r,t),this._setTransformOrigin(t),this._setTransform(n,s,t,e),this.props.motionBlur&&this.makeMotionBlur(n,s)},t.prototype.setElPosition=function(t,e,r){var i,n,s,a;return s=0!==this.angle?"rotate("+this.angle+"deg)":"",n=this.props.isCompositeLayer&&o.is3d,i=n?"translateZ(0)":"",a="translate("+t+"px,"+e+"px) "+s+" "+i,o.setPrefixedStyle(this.el,"transform",a)},t.prototype.setModulePosition=function(t,e){return this.el._setProp({shiftX:t+"px",shiftY:e+"px",angle:this.angle}),this.el._draw()},t.prototype._getCurrentAngle=function(t,e,r){var i,n,s,a,u;return n="function"==typeof this.props.transformOrigin,this.props.isAngle||null!=this.props.angleOffset||n?(s=this.path.getPointAtLength(e-1),a=t.y-s.y,u=t.x-s.x,i=Math.atan(a/u),!isFinite(i)&&(i=0),this.angle=i*o.RAD_TO_DEG,"function"!=typeof this.props.angleOffset?this.angle+=this.props.angleOffset||0:this.angle=this.props.angleOffset.call(this,this.angle,r)):this.angle=0},t.prototype._setTransform=function(t,e,r,i){var n;return this.scaler&&(t*=this.scaler.x,e*=this.scaler.y),n=null,i||(n="function"==typeof this.onUpdate?this.onUpdate(r,{x:t,y:e,angle:this.angle}):void 0),this.isModule?this.setModulePosition(t,e):"string"!=typeof n?this.setElPosition(t,e,r):o.setPrefixedStyle(this.el,"transform",n)},t.prototype._setTransformOrigin=function(t){var e,r;return this.props.transformOrigin?(e="function"==typeof this.props.transformOrigin,r=e?this.props.transformOrigin(this.angle,t):this.props.transformOrigin,o.setPrefixedStyle(this.el,"transform-origin",r)):void 0},t.prototype.makeMotionBlur=function(t,e){var r,i,n,s,a,u,p;return p=0,a=1,u=1,null==this.prevCoords.x||null==this.prevCoords.y?(this.speedX=0,this.speedY=0):(n=t-this.prevCoords.x,s=e-this.prevCoords.y,n>0&&(a=-1),0>a&&(u=-1),this.speedX=Math.abs(n),this.speedY=Math.abs(s),p=Math.atan(s/n)*(180/Math.PI)+90),r=p-this.angle,i=this.angToCoords(r),this.blurX=o.clamp(this.speedX/16*this.props.motionBlur,0,1),this.blurY=o.clamp(this.speedY/16*this.props.motionBlur,0,1),this.setBlur({blur:{x:3*this.blurX*this.blurAmount*Math.abs(i.x),y:3*this.blurY*this.blurAmount*Math.abs(i.y)},offset:{x:3*a*this.blurX*i.x*this.blurAmount,y:3*u*this.blurY*i.y*this.blurAmount}}),this.prevCoords.x=t,this.prevCoords.y=e},t.prototype.setBlur=function(t){return this.isMotionBlurReset?void 0:(this.filter.setAttribute("stdDeviation",t.blur.x+","+t.blur.y),this.filterOffset.setAttribute("dx",t.offset.x),this.filterOffset.setAttribute("dy",t.offset.y))},t.prototype.extendDefaults=function(t){var e,r,i;r=[];for(e in t)i=t[e],r.push(this[e]=i);return r},t.prototype.extendOptions=function(t){var e,r,i;r=[];for(e in t)i=t[e],r.push(this.props[e]=i);return r},t.prototype.then=function(t){var e,r,i,n,a;n=this.history[this.history.length-1],i={};for(r in n)a=n[r],!o.callbacksMap[r]&&!o.tweenOptionMap[r]||"duration"===r?null==t[r]&&(t[r]=a):null==t[r]&&(t[r]=void 0),o.tweenOptionMap[r]&&(i[r]="duration"!==r?t[r]:null!=t[r]?t[r]:n[r]);return this.history.push(t),e=this,i.onUpdate=function(t){return function(e){return t.setProgress(e)}}(this),i.onStart=function(t){return function(){var e;return null!=(e=t.props.onStart)?e.apply(t):void 0}}(this),i.onComplete=function(t){return function(){var e;return null!=(e=t.props.onComplete)?e.apply(t):void 0}}(this),i.onFirstUpdate=function(){return e.tuneOptions(e.history[this.index])},i.isChained=!t.delay,this.timeline.append(new s(i)),this},t.prototype.tuneOptions=function(t){return this.extendOptions(t),this.postVars()},t.prototype.angToCoords=function(t){var e,r,i;return t%=360,e=(t-90)*Math.PI/180,r=Math.cos(e),i=Math.sin(e),r=0>r?Math.max(r,-.7):Math.min(r,.7),i=0>i?Math.max(i,-.7):Math.min(i,.7),{x:1.428571429*r,y:1.428571429*i}},t}(),t.exports=i},function(t,e,r){var i,n,s,o,a,u;s=r(41),n=r(40),u=r(42),a=r(15),i=function(){function t(){}return t.prototype.bezier=s,t.prototype.PathEasing=n,t.prototype.path=new n("creator").create,t.prototype.inverse=function(t){return 1-t},t.prototype.linear={none:function(t){return t}},t.prototype.ease={"in":s.apply(t,[.42,0,1,1]),out:s.apply(t,[0,0,.58,1]),inout:s.apply(t,[.42,0,.58,1])},t.prototype.quad={"in":function(t){return t*t},out:function(t){return t*(2-t)},inout:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},t.prototype.cubic={"in":function(t){return t*t*t},out:function(t){return--t*t*t+1},inout:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},t.prototype.quart={"in":function(t){return t*t*t*t},out:function(t){return 1- --t*t*t*t},inout:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},t.prototype.quint={"in":function(t){return t*t*t*t*t},out:function(t){return--t*t*t*t*t+1},inout:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},t.prototype.sin={"in":function(t){return 1-Math.cos(t*Math.PI/2)},out:function(t){return Math.sin(t*Math.PI/2)},inout:function(t){return.5*(1-Math.cos(Math.PI*t))}},t.prototype.expo={"in":function(t){return 0===t?0:Math.pow(1024,t-1)},out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},inout:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)}},t.prototype.circ={"in":function(t){return 1-Math.sqrt(1-t*t)},out:function(t){return Math.sqrt(1- --t*t)},inout:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},t.prototype.back={"in":function(t){var e;return e=1.70158,t*t*((e+1)*t-e)},out:function(t){var e;return e=1.70158,--t*t*((e+1)*t+e)+1},inout:function(t){var e;return e=2.5949095,(t*=2)<1?.5*t*t*((e+1)*t-e):.5*((t-=2)*t*((e+1)*t+e)+2)}},t.prototype.elastic={"in":function(t){var e,r,i;return i=void 0,r=.4,0===t?0:1===t?1:(e=1,i=r/4,-(e*Math.pow(2,10*(t-=1))*Math.sin(2*(t-i)*Math.PI/r)))},out:function(t){var e,r,i;return i=void 0,r=.4,0===t?0:1===t?1:(e=1,i=r/4,e*Math.pow(2,-10*t)*Math.sin(2*(t-i)*Math.PI/r)+1)},inout:function(t){var e,r,i;return i=void 0,r=.4,0===t?0:1===t?1:(e=1,i=r/4,(t*=2)<1?-.5*e*Math.pow(2,10*(t-=1))*Math.sin(2*(t-i)*Math.PI/r):e*Math.pow(2,-10*(t-=1))*Math.sin(2*(t-i)*Math.PI/r)*.5+1)}},t.prototype.bounce={"in":function(t){return 1-o.bounce.out(1-t)},out:function(t){ +return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},inout:function(t){return.5>t?.5*o.bounce["in"](2*t):.5*o.bounce.out(2*t-1)+.5}},t.prototype.parseEasing=function(t){var e,r;return null==t&&(t="linear.none"),r=typeof t,"string"===r?"m"===t.charAt(0).toLowerCase()?this.path(t):(t=this._splitEasing(t),e=this[t[0]],e?e[t[1]]:(a.error('Easing with name "'+t[0]+'" was not found, fallback to "linear.none" instead'),this.linear.none)):a.isArray(t)?this.bezier.apply(this,t):t},t.prototype._splitEasing=function(t){var e,r,i;return"function"==typeof t?t:"string"==typeof t&&t.length?(i=t.split("."),e=i[0].toLowerCase()||"linear",r=i[1].toLowerCase()||"none",[e,r]):["linear","none"]},t}(),o=new i,o.mix=u(o),t.exports=o},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var n="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof _Symbol&&t.constructor===_Symbol?"symbol":typeof t};e.__esModule=!0;var s=r(45),o=i(s),a=r(46),u=i(a);e["default"]="function"==typeof u["default"]&&"symbol"===n(o["default"])?function(t){return"undefined"==typeof t?"undefined":n(t)}:function(t){return t&&"function"==typeof u["default"]&&t.constructor===u["default"]?"symbol":"undefined"==typeof t?"undefined":n(t)}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=r(27),s=i(n),o=r(44),a=i(o);e["default"]=function u(t,e,r){null===t&&(t=Function.prototype);var i=a["default"](t,e);if(void 0===i){var n=s["default"](t);return null===n?void 0:u(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0===o?void 0:o.call(r)}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=r(48),s=i(n);e["default"]=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);es;i=++s)r=a[i],e="%"===r.unit?this.castPercent(r.value):r.value,u+=e+" ";return this.props[t]="0 "===u?u="":u,this.props[t]=u}return"object"==typeof this.props[t]?(u="%"===this.props[t].unit?this.castPercent(this.props[t].value):this.props[t].value,this.props[t]=0===u?u="":u):void 0},t.prototype.castPercent=function(t){return t*(this.props.length/100)},t.prototype.setAttrsIfChanged=function(t,e){var r,i,n,s;if("object"==typeof t){for(i=Object.keys(t),n=i.length,s=[];n--;)r=i[n],e=t[r],s.push(this.setAttrIfChanged(r,e));return s}return null==e&&(e=this.props[t]),this.setAttrIfChanged(t,e)},t.prototype.setAttrIfChanged=function(t,e){return this.isChanged(t,e)?(this.el.setAttribute(t,e),this.state[t]=e):void 0},t.prototype.isChanged=function(t,e){return null==e&&(e=this.props[t]),this.state[t]!==e},t.prototype.getLength=function(){var t;return null!=(null!=(t=this.el)?t.getTotalLength:void 0)&&this.el.getAttribute("d")?this.el.getTotalLength():2*(null!=this.props.radiusX?this.props.radiusX:this.props.radius)},t}(),t.exports=i},function(t,e,r){t.exports={"default":r(53),__esModule:!0}},function(t,e,r){t.exports={"default":r(52),__esModule:!0}},function(t,e,r){t.exports={"default":r(51),__esModule:!0}},function(t,e,r){!function(){"use strict";var t,e,r,i,n,s,o;for(n=["webkit","moz"],e=0,o=window;e=h?0>a:a>0;r=0>=h?++a:--a)i=y+r*f+d,s=_+r*c+d,n=y+(r-1)*f+d,o=_+(r-1)*c+d,t=r===this.props.points?"M":"L",u+=""+t+i+","+s+" l0, -"+c+" l-"+f+", 0";return this.setAttr({d:u}),e.__super__.draw.apply(this,arguments)}},e}(i),t.exports=n},function(t,e,r){var i,n,s=function(t,e){function r(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;i=r(26),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.shape="rect",e.prototype.ratio=1.43,e.prototype.draw=function(){var t,r;return e.__super__.draw.apply(this,arguments),t=null!=this.props.radiusX?this.props.radiusX:this.props.radius,r=null!=this.props.radiusY?this.props.radiusY:this.props.radius,this.setAttrsIfChanged({width:2*t,height:2*r,x:this.props.x-t,y:this.props.y-r,rx:this.props.rx,ry:this.props.ry})},e.prototype.getLength=function(){var t,e;return t=null!=this.props.radiusX?this.props.radiusX:this.props.radius,e=null!=this.props.radiusY?this.props.radiusY:this.props.radius,2*t+2*e},e}(i),t.exports=n},function(t,e,r){var i,n,s,o=function(t,e){function r(){this.constructor=t}for(var i in e)a.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=r(26),s=r(15),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.shape="path",e.prototype.draw=function(){return this.drawShape(),e.__super__.draw.apply(this,arguments)},e.prototype.drawShape=function(){var t,e,r,i,n,o,a,u,p,l;for(l=360/this.props.points,this.radialPoints=[],r=i=0,u=this.props.points;u>=0?u>i:i>u;r=u>=0?++i:--i)this.radialPoints.push(s.getRadialPoint({radius:this.props.radius,radiusX:this.props.radiusX,radiusY:this.props.radiusY,angle:r*l,center:{x:this.props.x,y:this.props.y}}));for(e="",p=this.radialPoints,r=n=0,o=p.length;o>n;r=++n)a=p[r],t=0===r?"M":"L",e+=""+t+a.x.toFixed(4)+","+a.y.toFixed(4)+" ";return this.setAttr({d:e+="z"})},e.prototype.getLength=function(){return this.el.getTotalLength()},e}(i),t.exports=n},function(t,e,r){var i,n,s=function(t,e){function r(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;i=r(26),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.shape="path",e.prototype.draw=function(){var t,r,i,n,s,o,a,u,p;return e.__super__.draw.apply(this,arguments),n=null!=this.props.radiusX?this.props.radiusX:this.props.radius,s=null!=this.props.radiusY?this.props.radiusY:this.props.radius,o=this.props.x-n,a=this.props.x+n,r="M"+o+","+this.props.y+" L"+a+","+this.props.y,u=this.props.y-s,p=this.props.y+s,i="M"+this.props.x+","+u+" L"+this.props.x+","+p,t=r+" "+i,this.setAttr({d:t})},e.prototype.getLength=function(){var t,e;return t=null!=this.props.radiusX?this.props.radiusX:this.props.radius,e=null!=this.props.radiusY?this.props.radiusY:this.props.radius,2*(t+e)},e}(i),t.exports=n},function(t,e,r){var i,n,s=function(t,e){function r(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;i=r(26),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.shape="path",e.prototype.ratio=1.43,e.prototype.draw=function(){var t,r,i,n,s,o,a,u,p,l,h;if(e.__super__.draw.apply(this,arguments),this.props.points){for(n=null!=this.props.radiusX?this.props.radiusX:this.props.radius,s=null!=this.props.radiusY?this.props.radiusY:this.props.radius,a=this.props.x-n,u=this.props.x+n,t="",h=2*s/(this.props.points-1),l=this.props.y-s,r=i=0,o=this.props.points;o>=0?o>i:i>o;r=o>=0?++i:--i)p=""+(r*h+l),t+="M"+a+", "+p+" L"+u+", "+p+" ";return this.setAttr({d:t})}},e.prototype.getLength=function(){return 2*(null!=this.props.radiusX?this.props.radiusX:this.props.radius)},e}(i),t.exports=n},function(t,e,r){var i,n;n=r(15),i=function(){function t(t,e){if(this.o=null!=e?e:{},"creator"!==t){if(this.path=n.parsePath(t),null==this.path)return n.error("Error while parsing the path");this._vars(),this.path.setAttribute("d",this._normalizePath(this.path.getAttribute("d"))),this.pathLength=this.path.getTotalLength(),this.sample=n.bind(this.sample,this),this._hardSample=n.bind(this._hardSample,this),this._preSample()}}return t.prototype._vars=function(){return this._precompute=n.clamp(this.o.precompute||1450,100,1e4),this._step=1/this._precompute,this._rect=this.o.rect||100,this._approximateMax=this.o.approximateMax||5,this._eps=this.o.eps||.001,this._boundsPrevProgress=-1},t.prototype._preSample=function(){var t,e,r,i,n,s,o;for(this._samples=[],o=[],t=e=0,s=this._precompute;s>=0?s>=e:e>=s;t=s>=0?++e:--e)n=t*this._step,r=this.pathLength*n,i=this.path.getPointAtLength(r),o.push(this._samples[t]={point:i,length:r,progress:n});return o},t.prototype._findBounds=function(t,e){var r,i,n,s,o,a,u,p,l,h,f,c,d;if(e===this._boundsPrevProgress)return this._prevBounds;for(null==this._boundsStartIndex&&(this._boundsStartIndex=0),a=t.length,this._boundsPrevProgress>e?(u=0,i="reverse"):(u=a,i="forward"),"forward"===i?(c=t[0],n=t[t.length-1]):(c=t[t.length-1],n=t[0]),s=o=h=this._boundsStartIndex,f=u;f>=h?f>o:o>f;s=f>=h?++o:--o){if(d=t[s],l=d.point.x/this._rect,p=e,"reverse"===i&&(r=l,l=p,p=r),!(p>l)){n=d;break}c=d,this._boundsStartIndex=s}return this._boundsPrevProgress=e,this._prevBounds={start:c,end:n}},t.prototype.sample=function(t){var e,r;return t=n.clamp(t,0,1),e=this._findBounds(this._samples,t),r=this._checkIfBoundsCloseEnough(t,e),null!=r?r:this._findApproximate(t,e.start,e.end)},t.prototype._checkIfBoundsCloseEnough=function(t,e){var r,i;return r=void 0,i=this._checkIfPointCloseEnough(t,e.start.point),null!=i?i:this._checkIfPointCloseEnough(t,e.end.point)},t.prototype._checkIfPointCloseEnough=function(t,e){return n.closeEnough(t,e.x/this._rect,this._eps)?this._resolveY(e):void 0},t.prototype._approximate=function(t,e,r){var i,n;return i=e.point.x-t.point.x,n=(r-t.point.x/this._rect)/(i/this._rect),t.length+n*(e.length-t.length)},t.prototype._findApproximate=function(t,e,r,i){var s,o,a,u,p;return null==i&&(i=this._approximateMax),s=this._approximate(e,r,t),u=this.path.getPointAtLength(s),p=u.x/this._rect,n.closeEnough(t,p,this._eps)?this._resolveY(u):--i<1?this._resolveY(u):(a={point:u,length:s},o=p>t?[t,e,a,i]:[t,a,r,i],this._findApproximate.apply(this,o))},t.prototype._resolveY=function(t){return 1-t.y/this._rect},t.prototype._normalizePath=function(t){var e,r,i,n,s,o;return o=/[M|L|H|V|C|S|Q|T|A]/gim,n=t.split(o),n.shift(),e=t.match(o),s=0,n[s]=this._normalizeSegment(n[s]),r=n.length-1,n[r]=this._normalizeSegment(n[r],this._rect||100),i=this._joinNormalizedPath(e,n)},t.prototype._joinNormalizedPath=function(t,e){var r,i,n,s,o,a;for(o="",i=n=0,s=t.length;s>n;i=++n)r=t[i],a=0===i?"":" ",o+=""+a+r+e[i].trim();return o},t.prototype._normalizeSegment=function(t,e){var r,i,n,s,o,a,u,p,l,h;if(null==e&&(e=0),t=t.trim(),o=/(-|\+)?((\d+(\.(\d|\e(-|\+)?)+)?)|(\.?(\d|\e|(\-|\+))+))/gim,a=this._getSegmentPairs(t.match(o)),n=a[a.length-1],h=n[0],u=Number(h),u!==e)for(t="",n[0]=e,r=i=0,s=a.length;s>i;r=++i)p=a[r],l=0===r?"":" ",t+=""+l+p[0]+","+p[1];return t},t.prototype._getSegmentPairs=function(t){var e,r,i,s,o,a;for(t.length%2!==0&&n.error("Failed to parse the path - segment pairs are not even.",t),s=[],e=r=0,i=t.length;i>r;e=r+=2)a=t[e],o=[t[e],t[e+1]],s.push(o);return s},t.prototype.create=function(e,r){var i;return i=new t(e,r),i.sample.path=i.path,i.sample},t}(),t.exports=i},function(t,e,r){(function(e){var i,n,s,o=[].indexOf||function(t){for(var e=0,r=this.length;r>e;e++)if(e in this&&this[e]===t)return e;return-1};s=r(15),i=function(){function t(t){return this.vars(),this.generate}return t.prototype.vars=function(){return this.generate=s.bind(this.generate,this)},t.prototype.generate=function(t,r,i,n){var s,a,u,p,l,h,f,c,d,y,_,v,m,g,w,b,x,k,S,T,M,P,O,E;if(arguments.length<4)return this.error("Bezier function expects 4 arguments");for(x=k=0;4>k;x=++k)if(d=arguments[x],"number"!=typeof d||isNaN(d)||!isFinite(d))return this.error("Bezier function expects 4 arguments");return 0>t||t>1||0>i||i>1?this.error("Bezier x values should be > 0 and < 1"):(p=4,l=.001,f=1e-7,h=10,T=11,S=1/(T-1),g=o.call(e,"Float32Array")>=0,s=function(t,e){return 1-3*e+3*t},a=function(t,e){return 3*e-6*t},u=function(t){return 3*t},_=function(t,e,r){return((s(e,r)*t+a(e,r))*t+u(e))*t},w=function(t,e,r){return 3*s(e,r)*t*t+2*a(e,r)*t+u(e)},P=function(e,r){var n,s;for(x=0;p>x;){if(n=w(r,t,i),0===n)return r;s=_(r,t,i)-e,r-=s/n,++x}return r},v=function(){for(x=0;T>x;)M[x]=_(x*S,t,i),++x},y=function(e,r,n){var s,o,a;for(o=void 0,s=void 0,x=0;;)if(s=r+(n-r)/2,o=_(s,t,i)-e,o>0?n=s:r=s,a=Math.abs(o)>f,!(a&&++x=l?P(e,o):0===a?o:y(e,u,u+S)},O=function(){var e;return e=!0,t!==r||i!==n?v():void 0},M=g?new Float32Array(T):new Array(T),c=!1,m=function(e){return c||O(),t===r&&i===n?e:0===e?0:1===e?1:_(b(e),r,n)},E="bezier("+[t,r,i,n]+")",m.toStr=function(){return E},m)},t.prototype.error=function(t){return s.error(t)},t}(),n=new i,t.exports=n}).call(e,function(){return this}())},function(t,e,r){var i,n,s,o,a,u,p=[].slice;n=null,a=function(t){return"number"==typeof t.value?t.value:n.parseEasing(t.value)},u=function(t,e){var r;return t.value=a(t),e.value=a(e),r=0,t.toe.to&&(r=1),r},s=function(t,e){var r,i,n,s,o;for(i=0,r=n=0,s=t.length;s>n&&(o=t[r],i=r,!(o.to>e));r=++n);return i},o=function(){var t;return t=1<=arguments.length?p.call(arguments,0):[],t.length>1?t=t.sort(u):t[0].value=a(t[0]),function(e){var r,i;return r=s(t,e),-1!==r?(i=t[r].value,r===t.length-1&&e>t[r].to?1:"function"==typeof i?i(e):i):void 0}},i=function(t){return n=t,o},t.exports=i},function(t,e,r){var i,n;!function(){var r;return r=function(){function t(t){this.o=null!=t?t:{},window.isAnyResizeEventInited||(this.vars(),this.redefineProto())}return t.prototype.vars=function(){return window.isAnyResizeEventInited=!0,this.allowedProtos=[HTMLDivElement,HTMLFormElement,HTMLLinkElement,HTMLBodyElement,HTMLParagraphElement,HTMLFieldSetElement,HTMLLegendElement,HTMLLabelElement,HTMLButtonElement,HTMLUListElement,HTMLOListElement,HTMLLIElement,HTMLHeadingElement,HTMLQuoteElement,HTMLPreElement,HTMLBRElement,HTMLFontElement,HTMLHRElement,HTMLModElement,HTMLParamElement,HTMLMapElement,HTMLTableElement,HTMLTableCaptionElement,HTMLImageElement,HTMLTableCellElement,HTMLSelectElement,HTMLInputElement,HTMLTextAreaElement,HTMLAnchorElement,HTMLObjectElement,HTMLTableColElement,HTMLTableSectionElement,HTMLTableRowElement],this.timerElements={img:1,textarea:1,input:1,embed:1,object:1,svg:1,canvas:1,tr:1,tbody:1,thead:1,tfoot:1,a:1,select:1,option:1,optgroup:1,dl:1,dt:1,br:1,basefont:1,font:1,col:1,iframe:1}},t.prototype.redefineProto=function(){var t,e,r,i;return e=this,i=function(){var i,n,s,o;for(s=this.allowedProtos,o=[],t=i=0,n=s.length;n>i;t=++i)r=s[t],null!=r.prototype&&o.push(function(t){var r,i;return r=t.prototype.addEventListener||t.prototype.attachEvent,function(r){var i;return i=function(){var t;return(this!==window||this!==document)&&(t="onresize"===arguments[0]&&!this.isAnyResizeEventInited,t&&e.handleResize({args:arguments,that:this})),r.apply(this,arguments)},t.prototype.addEventListener?t.prototype.addEventListener=i:t.prototype.attachEvent?t.prototype.attachEvent=i:void 0}(r),i=t.prototype.removeEventListener||t.prototype.detachEvent,function(e){var r;return r=function(){return this.isAnyResizeEventInited=!1,this.iframe&&this.removeChild(this.iframe),e.apply(this,arguments)},t.prototype.removeEventListener?t.prototype.removeEventListener=r:t.prototype.detachEvent?t.prototype.detachEvent=wrappedListener:void 0}(i)}(r));return o}.call(this)},t.prototype.handleResize=function(t){var e,r,i,n,s,o,a;return r=t.that,this.timerElements[r.tagName.toLowerCase()]?this.initTimer(r):(i=document.createElement("iframe"),r.appendChild(i),i.style.width="100%",i.style.height="100%",i.style.position="absolute",i.style.zIndex=-999,i.style.opacity=0,i.style.top=0,i.style.left=0,e=window.getComputedStyle?getComputedStyle(r):r.currentStyle,s=""===r.style.position,o="static"===e.position&&s,n=""===e.position&&""===r.style.position,(o||n)&&(r.style.position="relative"),null!=(a=i.contentWindow)&&(a.onresize=function(t){return function(e){return t.dispatchEvent(r)}}(this)),r.iframe=i),r.isAnyResizeEventInited=!0},t.prototype.initTimer=function(t){var e,r;return r=0,e=0,this.interval=setInterval(function(i){return function(){var n,s;return s=t.offsetWidth,n=t.offsetHeight,s!==r||n!==e?(i.dispatchEvent(t),r=s,e=n):void 0}}(this),this.o.interval||62.5)},t.prototype.dispatchEvent=function(t){var e;return document.createEvent?(e=document.createEvent("HTMLEvents"),e.initEvent("onresize",!1,!1),t.dispatchEvent(e)):document.createEventObject?(e=document.createEventObject(),t.fireEvent("onresize",e)):!1},t.prototype.destroy=function(){var t,e,r,i,n,s,o;for(clearInterval(this.interval),this.interval=null,window.isAnyResizeEventInited=!1,e=this,s=this.allowedProtos,o=[],t=r=0,i=s.length;i>r;t=++r)n=s[t],null!=n.prototype&&o.push(function(t){var e;return e=t.prototype.addEventListener||t.prototype.attachEvent,t.prototype.addEventListener?t.prototype.addEventListener=Element.prototype.addEventListener:t.prototype.attachEvent&&(t.prototype.attachEvent=Element.prototype.attachEvent),t.prototype.removeEventListener?t.prototype.removeEventListener=Element.prototype.removeEventListener:t.prototype.detachEvent?t.prototype.detachEvent=Element.prototype.detachEvent:void 0}(n));return o},t}(),i=[],n=function(){return new r}.apply(e,i),!(void 0!==n&&(t.exports=n))}()},function(t,e,r){t.exports={"default":r(54),__esModule:!0}},function(t,e,r){t.exports={"default":r(56),__esModule:!0}},function(t,e,r){t.exports={"default":r(1),__esModule:!0}},function(t,e,r){t.exports={"default":r(55),__esModule:!0}},function(t,e,r){t.exports={"default":r(60),__esModule:!0}},function(t,e,r){t.exports={"default":r(58),__esModule:!0}},function(t,e,r){t.exports={"default":r(59),__esModule:!0}},function(t,e,r){r(61),r(62),t.exports=r(63)},function(t,e,r){r(64),t.exports=r(65).Object.keys},function(t,e,r){r(68),t.exports=r(65).Object.getPrototypeOf},function(t,e,r){var i=r(66);r(67),t.exports=function(t,e){return i.getDesc(t,e)}},function(t,e,r){var i=r(66);t.exports=function(t,e,r){return i.setDesc(t,e,r)}},function(t,e,r){r(62),r(61),t.exports=r(69)("iterator")},function(t,e,r){var i,n;(function(t){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}var o=r(19),a=s(o),u=r(15),p=s(u),l=r(16),h=s(l),f=r(3),c=s(f),d=r(4),y=s(d),_=r(5),v=s(_),m=r(6),g=s(m),w=r(7),b=s(w),x=r(17),k=s(x),S=r(2),T=s(S),M=r(8),P=s(M),O=r(9),E=s(O),C=r(10),A=s(C),D=r(11),L=s(D),R=r(12),F=s(R),I=r(13),j=s(I),B=r(18),z=s(B);window.mojs={revision:"0.206.0",isDebug:!0,helpers:p["default"],Transit:y["default"],Swirl:v["default"],Burst:c["default"],stagger:g["default"],Spriter:b["default"],MotionPath:k["default"],Tween:T["default"],Timeline:P["default"],Tweenable:A["default"],Thenable:L["default"],Tunable:F["default"],Module:j["default"],tweener:E["default"],easing:z["default"],shapesMap:h["default"]};{var U=new mojs.Burst({left:"50%",top:"50%",duration:2e3,easing:"ease.out",points:"rand(3, 5)",stroke:"cyan",fill:"none",radius:{0:50},angle:190,degreeShift:"rand(-50,50)",pathScale:"rand(.5, 1)"});document.querySelector("#js-play"),document.querySelector("#js-range-slider")}document.body.addEventListener("click",function(t){U.tune({left:t.pageX,top:t.pageY,duration:250,easing:"ease.out",isSwirl:1,timeline:{onComplete:function(){console.log("comple")}}}).replay()}),mojs.h=mojs.helpers,mojs.delta=mojs.h.delta,i=[],n=function(){return mojs}.apply(e,i),!(void 0!==n&&(t.exports=n)),"object"===a["default"](t)&&"object"===a["default"](t.exports)&&(t.exports=mojs)}).call(e,r(14)(t))},function(t,e,r){r(72),t.exports=r(65).Object.setPrototypeOf},function(t,e,r){var i=r(66);t.exports=function(t,e){return i.create(t,e)}},function(t,e,r){r(62),r(73),t.exports=r(65).Array.from},function(t,e,r){r(74);var i=r(75);i.NodeList=i.HTMLCollection=i.Array},function(t,e,r){"use strict";var i=r(76)(!0);r(77)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=i(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){var i=r(78),n=r(79);t.exports=r(65).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return i(e.call(t))}},function(t,e,r){var i=r(80);r(81)("keys",function(t){return function(e){return t(i(e))}})},function(t,e,r){var i=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=i)},function(t,e,r){var i=Object;t.exports={create:i.create,getProto:i.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:i.getOwnPropertyDescriptor,setDesc:i.defineProperty,setDescs:i.defineProperties,getKeys:i.keys,getNames:i.getOwnPropertyNames,getSymbols:i.getOwnPropertySymbols,each:[].forEach}},function(t,e,r){var i=r(82);r(81)("getOwnPropertyDescriptor",function(t){return function(e,r){return t(i(e),r)}})},function(t,e,r){var i=r(80);r(81)("getPrototypeOf",function(t){return function(e){return t(i(e))}})},function(t,e,r){var i=r(83)("wks"),n=r(84),s=r(85).Symbol;t.exports=function(t){return i[t]||(i[t]=s&&s[t]||(s||n)("Symbol."+t))}},function(t,e,r){"use strict";var i=r(66),n=r(85),s=r(93),o=r(94),a=r(86),u=r(95),p=r(96),l=r(83),h=r(97),f=r(84),c=r(69),d=r(98),y=r(99),_=r(100),v=r(101),m=r(78),g=r(82),w=r(102),b=i.getDesc,x=i.setDesc,k=i.create,S=y.get,T=n.Symbol,M=n.JSON,P=M&&M.stringify,O=!1,E=c("_hidden"),C=i.isEnum,A=l("symbol-registry"),D=l("symbols"),L="function"==typeof T,R=Object.prototype,F=o&&p(function(){return 7!=k(x({},"a",{get:function(){return x(this,"a",{value:7}).a}})).a})?function(t,e,r){var i=b(R,e);i&&delete R[e],x(t,e,r),i&&t!==R&&x(R,e,i)}:x,I=function(t){var e=D[t]=k(T.prototype);return e._k=t,o&&O&&F(R,t,{configurable:!0,set:function(e){s(this,E)&&s(this[E],t)&&(this[E][t]=!1),F(this,t,w(1,e))}}),e},j=function(t){return"symbol"==typeof t},B=function(t,e,r){return r&&s(D,e)?(r.enumerable?(s(t,E)&&t[E][e]&&(t[E][e]=!1),r=k(r,{enumerable:w(0,!1)})):(s(t,E)||x(t,E,w(1,{})),t[E][e]=!0),F(t,e,r)):x(t,e,r)},z=function(t,e){m(t);for(var r,i=_(e=g(e)),n=0,s=i.length;s>n;)B(t,r=i[n++],e[r]);return t},U=function(t,e){return void 0===e?k(t):z(k(t),e)},N=function(t){var e=C.call(this,t);return e||!s(this,t)||!s(D,t)||s(this,E)&&this[E][t]?e:!0},H=function(t,e){var r=b(t=g(t),e);return!r||!s(D,e)||s(t,E)&&t[E][e]||(r.enumerable=!0),r},Y=function(t){for(var e,r=S(g(t)),i=[],n=0;r.length>n;)s(D,e=r[n++])||e==E||i.push(e);return i},X=function(t){for(var e,r=S(g(t)),i=[],n=0;r.length>n;)s(D,e=r[n++])&&i.push(D[e]);return i},q=function(t){if(void 0!==t&&!j(t)){for(var e,r,i=[t],n=1,s=arguments;s.length>n;)i.push(s[n++]);return e=i[1],"function"==typeof e&&(r=e),(r||!v(e))&&(e=function(t,e){return r&&(e=r.call(this,t,e)),j(e)?void 0:e}),i[1]=e,P.apply(M,i)}},W=p(function(){var t=T();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))});L||(T=function(){if(j(this))throw TypeError("Symbol is not a constructor");return I(f(arguments.length>0?arguments[0]:void 0))},u(T.prototype,"toString",function(){return this._k}),j=function(t){return t instanceof T},i.create=U,i.isEnum=N,i.getDesc=H,i.setDesc=B,i.setDescs=z,i.getNames=y.get=Y,i.getSymbols=X,o&&!r(103)&&u(R,"propertyIsEnumerable",N,!0));var G={"for":function(t){return s(A,t+="")?A[t]:A[t]=T(t)},keyFor:function(t){return d(A,t)},useSetter:function(){O=!0},useSimple:function(){O=!1}};i.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(t){var e=c(t);G[t]=L?e:I(e)}),O=!0,a(a.G+a.W,{Symbol:T}),a(a.S,"Symbol",G),a(a.S+a.F*!L,"Object",{create:U,defineProperty:B,defineProperties:z,getOwnPropertyDescriptor:H,getOwnPropertyNames:Y,getOwnPropertySymbols:X}),M&&a(a.S+a.F*(!L||W),"JSON",{stringify:q}),h(T,"Symbol"),h(Math,"Math",!0),h(n.JSON,"JSON",!0)},function(t,e,r){},function(t,e,r){var i=r(86);i(i.S,"Object",{setPrototypeOf:r(87).set})},function(t,e,r){"use strict";var i=r(89),n=r(86),s=r(80),o=r(90),a=r(88),u=r(91),p=r(79);n(n.S+n.F*!r(92)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,n,l,h=s(t),f="function"==typeof this?this:Array,c=arguments,d=c.length,y=d>1?c[1]:void 0,_=void 0!==y,v=0,m=p(h);if(_&&(y=i(y,d>2?c[2]:void 0,2)),void 0==m||f==Array&&a(m))for(e=u(h.length),r=new f(e);e>v;v++)r[v]=_?y(h[v],v):h[v];else for(l=m.call(h),r=new f;!(n=l.next()).done;v++)r[v]=_?o(l,y,[n.value,v],!0):n.value;return r.length=v,r}})},function(t,e,r){"use strict";var i=r(104),n=r(105),s=r(75),o=r(82);t.exports=r(77)(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,r):"values"==e?n(0,t[r]):n(0,[r,t[r]])},"values"),s.Arguments=s.Array,i("keys"),i("values"),i("entries")},function(t,e,r){t.exports={}},function(t,e,r){var i=r(106),n=r(107);t.exports=function(t){return function(e,r){var s,o,a=String(n(e)),u=i(r),p=a.length;return 0>u||u>=p?t?"":void 0:(s=a.charCodeAt(u),55296>s||s>56319||u+1===p||(o=a.charCodeAt(u+1))<56320||o>57343?t?a.charAt(u):s:t?a.slice(u,u+2):(s-55296<<10)+(o-56320)+65536)}}},function(t,e,r){"use strict";var i=r(103),n=r(86),s=r(95),o=r(108),a=r(93),u=r(75),p=r(109),l=r(97),h=r(66).getProto,f=r(69)("iterator"),c=!([].keys&&"next"in[].keys()),d="@@iterator",y="keys",_="values",v=function(){return this};t.exports=function(t,e,r,m,g,w,b){p(r,e,m);var x,k,S=function(t){ +if(!c&&t in O)return O[t];switch(t){case y:return function(){return new r(this,t)};case _:return function(){return new r(this,t)}}return function(){return new r(this,t)}},T=e+" Iterator",M=g==_,P=!1,O=t.prototype,E=O[f]||O[d]||g&&O[g],C=E||S(g);if(E){var A=h(C.call(new t));l(A,T,!0),!i&&a(O,d)&&o(A,f,v),M&&E.name!==_&&(P=!0,C=function(){return E.call(this)})}if(i&&!b||!c&&!P&&O[f]||o(O,f,C),u[e]=C,u[T]=v,g)if(x={values:M?C:S(_),keys:w?C:S(y),entries:M?S("entries"):C},b)for(k in x)k in O||s(O,k,x[k]);else n(n.P+n.F*(c||P),e,x);return x}},function(t,e,r){var i=r(110);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){var i=r(111),n=r(69)("iterator"),s=r(75);t.exports=r(65).getIteratorMethod=function(t){return void 0!=t?t[n]||t["@@iterator"]||s[i(t)]:void 0}},function(t,e,r){var i=r(107);t.exports=function(t){return Object(i(t))}},function(t,e,r){var i=r(86),n=r(65),s=r(96);t.exports=function(t,e){var r=(n.Object||{})[t]||Object[t],o={};o[t]=e(r),i(i.S+i.F*s(function(){r(1)}),"Object",o)}},function(t,e,r){var i=r(112),n=r(107);t.exports=function(t){return i(n(t))}},function(t,e,r){var i=r(85),n="__core-js_shared__",s=i[n]||(i[n]={});t.exports=function(t){return s[t]||(s[t]={})}},function(t,e,r){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,r){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,r){var i=r(85),n=r(65),s=r(89),o="prototype",a=function(t,e,r){var u,p,l,h=t&a.F,f=t&a.G,c=t&a.S,d=t&a.P,y=t&a.B,_=t&a.W,v=f?n:n[e]||(n[e]={}),m=f?i:c?i[e]:(i[e]||{})[o];f&&(r=e);for(u in r)p=!h&&m&&u in m,p&&u in v||(l=p?m[u]:r[u],v[u]=f&&"function"!=typeof m[u]?r[u]:y&&p?s(l,i):_&&m[u]==l?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};return e[o]=t[o],e}(l):d&&"function"==typeof l?s(Function.call,l):l,d&&((v[o]||(v[o]={}))[u]=l))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,t.exports=a},function(t,e,r){var i=r(66).getDesc,n=r(110),s=r(78),o=function(t,e){if(s(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=r(89)(Function.call,i(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(s){e=!0}return function(t,r){return o(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:o}},function(t,e,r){var i=r(75),n=r(69)("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[n]===t)}},function(t,e,r){var i=r(113);t.exports=function(t,e,r){if(i(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,i){return t.call(e,r,i)};case 3:return function(r,i,n){return t.call(e,r,i,n)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var i=r(78);t.exports=function(t,e,r,n){try{return n?e(i(r)[0],r[1]):e(r)}catch(s){var o=t["return"];throw void 0!==o&&i(o.call(t)),s}}},function(t,e,r){var i=r(106),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},function(t,e,r){var i=r(69)("iterator"),n=!1;try{var s=[7][i]();s["return"]=function(){n=!0},Array.from(s,function(){throw 2})}catch(o){}t.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var s=[7],o=s[i]();o.next=function(){r=!0},s[i]=function(){return o},t(s)}catch(a){}return r}},function(t,e,r){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,r){t.exports=!r(96)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,r){t.exports=r(108)},function(t,e,r){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,r){var i=r(66).setDesc,n=r(93),s=r(69)("toStringTag");t.exports=function(t,e,r){t&&!n(t=r?t:t.prototype,s)&&i(t,s,{configurable:!0,value:e})}},function(t,e,r){var i=r(66),n=r(82);t.exports=function(t,e){for(var r,s=n(t),o=i.getKeys(s),a=o.length,u=0;a>u;)if(s[r=o[u++]]===e)return r}},function(t,e,r){var i=r(82),n=r(66).getNames,s={}.toString,o="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return n(t)}catch(e){return o.slice()}};t.exports.get=function(t){return o&&"[object Window]"==s.call(t)?a(t):n(i(t))}},function(t,e,r){var i=r(66);t.exports=function(t){var e=i.getKeys(t),r=i.getSymbols;if(r)for(var n,s=r(t),o=i.isEnum,a=0;s.length>a;)o.call(t,n=s[a++])&&e.push(n);return e}},function(t,e,r){var i=r(114);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,r){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){t.exports=!0},function(t,e,r){t.exports=function(){}},function(t,e,r){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,r){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var i=r(66),n=r(102);t.exports=r(94)?function(t,e,r){return i.setDesc(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){"use strict";var i=r(66),n=r(102),s=r(97),o={};r(108)(o,r(69)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=i.create(o,{next:n(1,r)}),s(t,e+" Iterator")}},function(t,e,r){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var i=r(114),n=r(69)("toStringTag"),s="Arguments"==i(function(){return arguments}());t.exports=function(t){var e,r,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=(e=Object(t))[n])?r:s?i(e):"Object"==(o=i(e))&&"function"==typeof e.callee?"Arguments":o}},function(t,e,r){var i=r(114);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,r){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}}]); \ No newline at end of file diff --git a/js/burst.babel.js b/js/burst.babel.js index 1b08f4789..e9ffe78d8 100644 --- a/js/burst.babel.js +++ b/js/burst.babel.js @@ -256,6 +256,7 @@ class Burst extends Swirl { _makeTimeline () { super._makeTimeline(); this.timeline.add( ...this._swirls ); + this._o.timeline = null; } /* Method to make Tween for the module. @@ -263,6 +264,39 @@ class Burst extends Swirl { @override @ Tweenable */ _makeTween () { /* don't create any tween */ } + /* + Method to tune new history options to all the submodules. + @private + @override @ Tunable + */ + _tuneSubModules () { + // call _tuneSubModules on Tunable + super._tuneSubModules(); + // tune swirls including their tweens + for (var index = 0; index < this._swirls.length; index++) { + var swirl = this._swirls[index], + options = this._getOption( index ); + + swirl._tuneNewOptions( options ); + this._resetTween( swirl.tween, options ); + } + + this._o.timeline && this.timeline._setProp(this._o.timeline); + this.timeline._recalcTotalDuration(); + } + + + + _resetTweens () {} +} + +export default Burst; + + + + + + // /* // Method to get if need to update new transform. @@ -342,7 +376,4 @@ class Burst extends Swirl { // // while(i--) { this._swirls[i].then(o); } // // // return this; - // } -} - -export default Burst; \ No newline at end of file + // } \ No newline at end of file diff --git a/js/easing/easing.coffee b/js/easing/easing.coffee index d7460b38e..9c8abd560 100644 --- a/js/easing/easing.coffee +++ b/js/easing/easing.coffee @@ -144,6 +144,9 @@ class Easing # # @return {Function} parseEasing:(easing)-> + + if !easing? then easing = 'linear.none' + type = typeof easing if type is 'string' return if easing.charAt(0).toLowerCase() is 'm' @@ -156,8 +159,7 @@ class Easing fallback to \"linear.none\" instead" return @['linear']['none'] easingParent[easing[1]] - if h.isArray(easing) - return @bezier.apply(@, easing) + if h.isArray(easing) then return @bezier.apply(@, easing) if 'function' then return easing # --- diff --git a/js/mojs.babel.js b/js/mojs.babel.js index cf5e4cf3a..7f75f9b52 100644 --- a/js/mojs.babel.js +++ b/js/mojs.babel.js @@ -17,7 +17,7 @@ import tweener from './tween/tweener'; import easing from './easing/easing'; window.mojs = { - revision: '0.205.0', isDebug: true, helpers: h, + revision: '0.206.0', isDebug: true, helpers: h, Transit, Swirl, Burst, stagger, Spriter, MotionPath, Tween, Timeline, Tweenable, Thenable, Tunable, Module, tweener, easing, shapesMap @@ -27,6 +27,7 @@ window.mojs = { /* add then, generate to burst. randoms in then chains for transit and swirl. + module names parse rand(stagger(20, 10), 20) values perf optimizations. percentage for radius @@ -34,33 +35,38 @@ window.mojs = { var sw = new mojs.Burst({ left: '50%', top: '50%', - // delay: 'stagger(rand(20, 40))', - // degree: 170, - shape: ['cross', 'polygon', 'zigzag'], - stroke: 'cyan', - fill: 'none', - radius: {0: 150}, - angle: 190, - degreeShift: 'rand(-50,50)', - pathScale: 'rand(.5, 1)', - strokeWidth: { 2: 0 }, - childOptions: { - radius: 5, - isSwirl: 1, - swirlSize: 'rand(3, 6)', - swirlFrequency: 'rand(3, 10)', - angle: { 0: 200 } - } + duration: 2000, + easing: 'ease.out', + // shape: ['cross', 'polygon', 'zigzag'], + points: 'rand(3, 5)', + stroke: 'cyan', + fill: 'none', + radius: {0: 50}, + angle: 190, + degreeShift: 'rand(-50,50)', + pathScale: 'rand(.5, 1)', + // strokeWidth: { 2 : 0 } }); var playEl = document.querySelector('#js-play'), rangeSliderEl = document.querySelector('#js-range-slider'); document.body.addEventListener('click', function (e) { sw - // .tune(sw._o) + .tune({ + left: e.pageX, top: e.pageY, + duration: 250, + easing: 'ease.out', + isSwirl: 1, + timeline: { + onComplete: function () { console.log('comple'); } + } + // childOptions: { + // radius: 'rand(10, 50)' + // } + }) // .generate() // .tune({ swirlFrequency: 'rand(2, 20)' }) - .play(); + .replay(); // .run(); }); diff --git a/js/tween/timeline.babel.js b/js/tween/timeline.babel.js index bf36df22b..a9d7b3c24 100644 --- a/js/tween/timeline.babel.js +++ b/js/tween/timeline.babel.js @@ -131,6 +131,7 @@ class Timeline extends Tween { _recalcDuration (timeline) { var p = timeline._props, timelineTime = p.repeatTime/p.speed + (p.shiftTime || 0); + this._props.duration = Math.max(timelineTime, this._props.duration); } /* diff --git a/js/tween/tween.babel.js b/js/tween/tween.babel.js index 6251fc04e..380a1f70e 100644 --- a/js/tween/tween.babel.js +++ b/js/tween/tween.babel.js @@ -847,16 +847,16 @@ class Tween extends Module { @param {Any} Value for the property. */ _assignProp (key, value) { + // fallback to defaults + if ( value == null ) { value = this._defaults[key]; } // parse easing ( key === 'easing' ) && ( value = easing.parseEasing(value) ); - // handle control callbacks overrides var control = this._callbackOverrides[key], isntOverriden = (!value || (!value.isMojsCallbackOverride)); if ( control && isntOverriden ) { value = this._overrideCallback(value, control); } - // call super on Module super._assignProp(key, value); } diff --git a/karma.conf.js b/karma.conf.js index 1189daf76..9f5c83c82 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -112,6 +112,9 @@ module.exports = function(config) { 'build/stagger.js', 'spec/stagger.js', + // 'build/easing/easing.js', + // 'spec/easing/easing.js', + // 'build/timeline.js', // 'spec/timeline.js', // 'build/tween.js', diff --git a/lib/burst.js b/lib/burst.js index ed372ef16..2c3df255d 100644 --- a/lib/burst.js +++ b/lib/burst.js @@ -139,11 +139,8 @@ var Burst = (function (_Swirl) { prop = prop == null && !this._optionsIntersection[key] ? this._getPropByMod(key, i, this._o) : prop; // lastly fallback to defaults prop = prop == null ? this._getPropByMod(key, i, this._childDefaults) : prop; - - prop = _h2['default'].parseIfStagger(prop, i); - prop = _h2['default'].parseIfRand(prop); - - option[key] = prop; + // parse `stagger` and `rand` values if needed + option[key] = _h2['default'].parseStringOption(prop, i); } return this._addOptionalProperties(option, i); @@ -189,33 +186,28 @@ var Burst = (function (_Swirl) { */ }, { key: '_getBitAngle', - value: function _getBitAngle(angle, i) { + value: function _getBitAngle(angleProperty, i) { var p = this._props, - points = p.count, - degCnt = p.degree % 360 === 0 ? points : points - 1 || 1, + degCnt = p.degree % 360 === 0 ? p.count : p.count - 1 || 1, step = p.degree / degCnt, - angleAddition = i * step + 90; + angle = i * step + 90; // if not delta option - if (!this._isDelta(angle)) { - angle += angleAddition; + if (!this._isDelta(angleProperty)) { + angleProperty += angle; } else { var delta = {}, - keys = Object.keys(angle), + keys = Object.keys(angleProperty), start = keys[0], - end = angle[start]; - - start = _h2['default'].parseIfStagger(start, i); - start = _h2['default'].parseIfRand(start); - end = _h2['default'].parseIfStagger(end, i); - end = _h2['default'].parseIfRand(end); + end = angleProperty[start]; - var newStart = parseFloat(start) + angleAddition, - newEnd = parseFloat(end) + angleAddition; - delta[newStart] = newEnd; + start = _h2['default'].parseStringOption(start, i); + end = _h2['default'].parseStringOption(end, i); + // new start = newEnd + delta[parseFloat(start) + angle] = parseFloat(end) + angle; - angle = delta; + angleProperty = delta; } - return angle; + return angleProperty; } /* @@ -370,166 +362,113 @@ var Burst = (function (_Swirl) { }, { key: '_makeTween', value: function _makeTween() {} /* don't create any tween */ - - // /* - // Method to populate each transit with dedicated option. - // @private - // */ - // _addBitOptions () { - // var points = this._props.count; - // this.degreeCnt = (this._props.degree % 360 === 0) - // ? points - // : points-1 || 1; - - // var step = this._props.degree/this.degreeCnt; - // for (var i = 0; i < this._swirls.length; i++) { - // var transit = this._swirls[i], - // aShift = transit._props.angleShift || 0, - // pointStart = this._getSidePoint('start', i*step + aShift), - // pointEnd = this._getSidePoint('end', i*step + aShift); - - // transit._o.x = this._getDeltaFromPoints('x', pointStart, pointEnd); - // transit._o.y = this._getDeltaFromPoints('y', pointStart, pointEnd); - - // if ( !this._props.isResetAngles ) { - // transit._o.angle = this._getBitAngle(transit._o.angle, i) - // } - // transit._extendDefaults() - // } - // } - // /* - // Method to calculate module's size. - // @private - // @override Transit. - // */ - // _calcSize () { - // var largestSize = -1; - // for (var i = 0; i < this._swirls.length; i++) { - // var transit = this._swirls[i]; - // transit._calcSize(); - // if (largestSize < transit._props.size) { - // largestSize = transit._props.size; - // } - // } - // var radius = this._calcMaxShapeRadius(); - // this._props.size = largestSize + 2*radius; - // this._props.size += 2*this._props.sizeGap; - // this._props.center = this._props.size/2; - // this._addBitOptions() - // } - // /* - // Method to draw the burst. - // @private - // @override Transit. - // */ - // _draw () { this._drawEl(); } - // /* - // Method to get if need to update new transform. - // @private - // @returns {Boolean} If transform update needed. - // */ - // // _isNeedsTransform () { - // // return this._isPropChanged('x') || - // // this._isPropChanged('y') || - // // this._isPropChanged('angle'); - // // } - // /* - // Method to generate random angle. - // @private - // @returns {Number} Rundom angle. - // */ - // _generateRandomAngle ( ) { - // var randomness = parseFloat(this._props.randomAngle); - // if ( randomness > 1 ) { randdomness = 1 } - // else if ( randomness < 0 ) { randdomness = 0 } - // return h.rand(0, ( randomness ) ? randomness*360 : 180); - // } - // /* - // Method to get random radius. - // @private - // @returns {Number} Random radius. - // */ - // _generateRandomRadius () { - // var randomness = parseFloat(this._props.randomRadius); - // if ( randomness > 1 ) { randdomness = 1; } - // else if ( randomness < 0 ) { randdomness = 0; } - // var start = ( randomness ) ? (1-randomness) : .5; - // return h.rand(start, 1); - // } - /* - Method to run tween with new options. - @public - @param {Object} New options object. - @returns {Object} this. - */ - // run ( o ) { - // if ( o != null && Object.keys(o).length) { - // if ( o.count || ( o.childOptions && o.childOptions.count )) { - // h.warn('Sorry, count can not be changed on run'); - // } - // this._extendDefaults(o); - // // copy child options to options - // var keys = Object.keys(o.childOptions || {}); - - // if ( this._o.childOptions == null ) { this._o.childOptions = {}; } - - // for (var i = 0; i < keys.length; i++) { - // var key = keys[i]; - // this._o.childOptions[key] = o.childOptions[key]; - // } - // // tune transits - // var len = this._swirls.length; - // while(len--) { - // // we should keep transit's angle otherwise - // // it will fallback to default 0 value - // var option = this._getOption(len), - // ref; - - // if ( (((ref = o.childOptions) != null ? ref.angle : void 0) == null) && ( o.angleShift == null ) ) { - // option.angle = this._swirls[len]._o.angle; - // } - // // calculate bit angle if new angle related option passed - // // and not isResetAngles - // else if ( !o.isResetAngles ) { - // option.angle = this._getBitAngle(option.angle, len); - // } - // this._swirls[len]._tuneNewOption(option, true); - // } - // this.timeline._recalcTotalDuration() - // } - // if ( this._props.randomAngle || this._props.randomRadius ) { - // var len = this._swirls.length; - // while(len--) { - // var tr = this._swirls[len]; - // this._props.randomAngle && tr._setProp({angleShift: this._generateRandomAngle()}); - // this._props.randomRadius && tr._setProp({radiusScale: this._generateRandomRadius()}) - // } - // } - // this.play(); - // return this; - // } /* - Method to create then chain record. + Method to tune new history options to all the submodules. @private - returns {Object} this. + @override @ Tunable */ - // then (o) { - // h.error(`Burst's \"then\" method is under consideration, - // you can vote for it in github repo issues`); - // // 1. merge @o and o - // // 2. get i option from merged object - // // 3. pass the object to transit then - // // 4. transform self chain on run - // // i = this._swirls.length - // // while(i--) { this._swirls[i].then(o); } - // // - // return this; - // } + }, { + key: '_tuneSubModules', + value: function _tuneSubModules() { + // call _tuneSubModules on Tunable + _get(Object.getPrototypeOf(Burst.prototype), '_tuneSubModules', this).call(this); + + for (var index = 0; index < this._swirls.length; index++) { + var swirl = this._swirls[index], + options = this._getOption(index); + + swirl._tuneNewOptions(options); + // this._resetTween( swirl.tween, options ); + } + } + }, { + key: '_resetTweens', + value: function _resetTweens() {} }]); return Burst; })(_swirl2['default']); exports['default'] = Burst; + +// /* +// Method to get if need to update new transform. +// @private +// @returns {Boolean} If transform update needed. +// */ +// // _isNeedsTransform () { +// // return this._isPropChanged('x') || +// // this._isPropChanged('y') || +// // this._isPropChanged('angle'); +// // } +/* + Method to run tween with new options. + @public + @param {Object} New options object. + @returns {Object} this. +*/ +// run ( o ) { +// if ( o != null && Object.keys(o).length) { +// if ( o.count || ( o.childOptions && o.childOptions.count )) { +// h.warn('Sorry, count can not be changed on run'); +// } +// this._extendDefaults(o); +// // copy child options to options +// var keys = Object.keys(o.childOptions || {}); + +// if ( this._o.childOptions == null ) { this._o.childOptions = {}; } + +// for (var i = 0; i < keys.length; i++) { +// var key = keys[i]; +// this._o.childOptions[key] = o.childOptions[key]; +// } +// // tune transits +// var len = this._swirls.length; +// while(len--) { +// // we should keep transit's angle otherwise +// // it will fallback to default 0 value +// var option = this._getOption(len), +// ref; + +// if ( (((ref = o.childOptions) != null ? ref.angle : void 0) == null) && ( o.angleShift == null ) ) { +// option.angle = this._swirls[len]._o.angle; +// } +// // calculate bit angle if new angle related option passed +// // and not isResetAngles +// else if ( !o.isResetAngles ) { +// option.angle = this._getBitAngle(option.angle, len); +// } +// this._swirls[len]._tuneNewOption(option, true); +// } +// this.timeline._recalcTotalDuration() +// } +// if ( this._props.randomAngle || this._props.randomRadius ) { +// var len = this._swirls.length; +// while(len--) { +// var tr = this._swirls[len]; +// this._props.randomAngle && tr._setProp({angleShift: this._generateRandomAngle()}); +// this._props.randomRadius && tr._setProp({radiusScale: this._generateRandomRadius()}) +// } +// } +// this.play(); +// return this; +// } +/* + Method to create then chain record. + @private + returns {Object} this. +*/ +// then (o) { +// h.error(`Burst's \"then\" method is under consideration, +// you can vote for it in github repo issues`); +// // 1. merge @o and o +// // 2. get i option from merged object +// // 3. pass the object to transit then +// // 4. transform self chain on run +// // i = this._swirls.length +// // while(i--) { this._swirls[i].then(o); } +// // +// return this; +// } module.exports = exports['default']; \ No newline at end of file diff --git a/lib/easing/easing.js b/lib/easing/easing.js index b1ff28f7d..5cb66f1e7 100644 --- a/lib/easing/easing.js +++ b/lib/easing/easing.js @@ -244,6 +244,9 @@ Easing.prototype.parseEasing = function(easing) { var easingParent, type; + if (easing == null) { + easing = 'linear.none'; + } type = typeof easing; if (type === 'string') { if (easing.charAt(0).toLowerCase() === 'm') { diff --git a/lib/mojs.js b/lib/mojs.js index 4f47fa202..e6ab928f9 100644 --- a/lib/mojs.js +++ b/lib/mojs.js @@ -69,7 +69,7 @@ var _easingEasing = require('./easing/easing'); var _easingEasing2 = _interopRequireDefault(_easingEasing); window.mojs = { - revision: '0.204.0', isDebug: true, helpers: _h2['default'], + revision: '0.205.0', isDebug: true, helpers: _h2['default'], Transit: _transit2['default'], Swirl: _swirl2['default'], Burst: _burst2['default'], stagger: _stagger2['default'], Spriter: _spriter2['default'], MotionPath: _motionPath2['default'], Tween: _tweenTween2['default'], Timeline: _tweenTimeline2['default'], Tweenable: _tweenTweenable2['default'], Thenable: _thenable2['default'], Tunable: _tunable2['default'], Module: _module3['default'], tweener: _tweenTweener3['default'], easing: _easingEasing2['default'], shapesMap: _shapesShapesMap2['default'] @@ -78,42 +78,45 @@ window.mojs = { // TODO: /* add then, generate to burst. - angles randoms in then chains for transit and swirl. parse rand(stagger(20, 10), 20) values perf optimizations. percentage for radius */ -var sw = new mojs.Burst({ - left: '50%', top: '50%', - // delay: 'stagger(rand(20, 40))', - // degree: 170, - shape: ['cross', 'polygon', 'zigzag'], - stroke: 'cyan', - fill: 'none', - radius: { 0: 150 }, - angle: 190, - degreeShift: 'rand(-50,50)', - pathScale: 'rand(.5, 1)', - strokeWidth: { 2: 0 }, - childOptions: { - radius: 5, - isSwirl: 1, - swirlSize: 'rand(3, 6)', - swirlFrequency: 'rand(3, 10)', - angle: { 0: 200 } - } -}); +var sw = new mojs.Swirl({ left: '50%', top: '50%' }); + +// var sw = new mojs.Burst({ +// left: '50%', top: '50%', +// duration: 2000, +// easing: 'ease.out', +// // shape: ['cross', 'polygon', 'zigzag'], +// points: 'rand(3, 5)', +// stroke: 'cyan', +// fill: 'none', +// radius: {0: 150}, +// angle: 190, +// degreeShift: 'rand(-50,50)', +// pathScale: 'rand(.5, 1)', +// // strokeWidth: { 2 : 0 } +// }); var playEl = document.querySelector('#js-play'), rangeSliderEl = document.querySelector('#js-range-slider'); document.body.addEventListener('click', function (e) { sw - // .tune(sw._o) + // .tune({ + // left: e.pageX, top: e.pageY, + // degreeShift: 0, pathScale: 1, + // duration: 300, + // easing: 'ease.in', + // // childOptions: { + // // radius: 'rand(10, 50)' + // // } + // }) // .generate() // .tune({ swirlFrequency: 'rand(2, 20)' }) - .play(); + .replay(); // .run(); }); diff --git a/lib/tween/tween.js b/lib/tween/tween.js index 2c86d537b..9ecbabc11 100644 --- a/lib/tween/tween.js +++ b/lib/tween/tween.js @@ -1022,7 +1022,6 @@ var Tween = (function (_Module) { value: function _assignProp(key, value) { // parse easing key === 'easing' && (value = _easingEasing2['default'].parseEasing(value)); - // handle control callbacks overrides var control = this._callbackOverrides[key], isntOverriden = !value || !value.isMojsCallbackOverride; diff --git a/package.json b/package.json index 007bf907c..482f96b9b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mo-js", "description": "motion graphics toolbelt for the web", - "version": "0.205.0", + "version": "0.206.0", "license": "MIT", "private": false, "scripts": { diff --git a/spec/burst.coffee b/spec/burst.coffee index 47cfba80f..efba65db9 100644 --- a/spec/burst.coffee +++ b/spec/burst.coffee @@ -1,6 +1,7 @@ Transit = mojs.Transit Swirl = mojs.Swirl Burst = mojs.Burst +Tunable = mojs.Tunable t = mojs.tweener h = mojs.h @@ -284,6 +285,12 @@ describe 'Burst ->', -> bs._makeTimeline() expect(bs.timeline._timelines.length).toBe bs._defaults.count + it 'should reset _o.timeline object', -> + bs = new Burst timeline: { delay: 400 } + bs.timeline._timelines.length = 0 + bs._makeTimeline() + expect(bs._o.timeline).toBe null + describe '_makeTween method ->', -> it 'should override parent', -> bs = new Burst @@ -458,6 +465,68 @@ describe 'Burst ->', -> b._extendDefaults() expect(b._calcSize).toHaveBeenCalled() + describe '_tuneSubModules method ->', -> + it 'should call super', -> + b = new Burst + spyOn Tunable.prototype, '_tuneSubModules' + b._tuneSubModules() + expect(Tunable.prototype._tuneSubModules) + .toHaveBeenCalled() + it 'should call _tuneNewOptions on each swirl', -> + b = new Burst count: 2 + spyOn b._swirls[0], '_tuneNewOptions' + spyOn b._swirls[1], '_tuneNewOptions' + spyOn b, '_resetTween' + b._tuneSubModules() + expect(b._swirls[0]._tuneNewOptions.calls.first().args[0]) + .toEqual b._getOption(0) + expect(b._swirls[1]._tuneNewOptions.calls.first().args[0]) + .toEqual b._getOption(1) + + expect(b._resetTween.calls.argsFor(0)[0]).toBe b.timeline._timelines[0] + expect(b._resetTween.calls.argsFor(0)[1]).toEqual b._getOption(0) + + expect(b._resetTween.calls.argsFor(1)[0]).toBe b.timeline._timelines[1] + expect(b._resetTween.calls.argsFor(1)[1]).toEqual b._getOption(1) + + expect(b._resetTween.calls.count()).toBe 2 + + it 'should set prop on timeline', -> + isCalled = null + b = new Burst count: 2 + timelineOpts = { onComplete: null } + b._o.timeline = timelineOpts + spyOn b.timeline, '_setProp' + b._tuneSubModules() + expect(b.timeline._setProp).toHaveBeenCalledWith timelineOpts + + it 'should not set prop on timeline if no object', -> + isCalled = null + b = new Burst count: 2, isIt: 1 + timelineOpts = { onComplete: null } + spyOn b.timeline, '_setProp' + b._tuneSubModules() + expect(b.timeline._setProp).not.toHaveBeenCalled() + + it 'should call _recalcTotalDuration on timeline', -> + b = new Burst count: 2, isIt: 1 + spyOn b.timeline, '_recalcTotalDuration' + b._tuneSubModules() + expect(b.timeline._recalcTotalDuration.calls.count()).toBe 1 + + + + + + + + + + + + + + # it 'should have its own defaults', -> # burst = new Burst # # skip childOptions from _extendDefaults diff --git a/spec/burst.js b/spec/burst.js index e85599955..d5d20892b 100644 --- a/spec/burst.js +++ b/spec/burst.js @@ -1,5 +1,5 @@ (function() { - var Burst, Swirl, Transit, h, t; + var Burst, Swirl, Transit, Tunable, h, t; Transit = mojs.Transit; @@ -7,6 +7,8 @@ Burst = mojs.Burst; + Tunable = mojs.Tunable; + t = mojs.tweener; h = mojs.h; @@ -388,13 +390,24 @@ bs._makeTimeline(); return expect(Burst.prototype._makeTimeline).toHaveBeenCalled(); }); - return it('should add swirls to the timeline', function() { + it('should add swirls to the timeline', function() { var bs; bs = new Burst; bs.timeline._timelines.length = 0; bs._makeTimeline(); return expect(bs.timeline._timelines.length).toBe(bs._defaults.count); }); + return it('should reset _o.timeline object', function() { + var bs; + bs = new Burst({ + timeline: { + delay: 400 + } + }); + bs.timeline._timelines.length = 0; + bs._makeTimeline(); + return expect(bs._o.timeline).toBe(null); + }); }); describe('_makeTween method ->', function() { return it('should override parent', function() { @@ -661,7 +674,7 @@ return _results; }); }); - return describe('_extendDefaults method ->', function() { + describe('_extendDefaults method ->', function() { it('should call super', function() { var b; b = new Burst; @@ -677,6 +690,70 @@ return expect(b._calcSize).toHaveBeenCalled(); }); }); + return describe('_tuneSubModules method ->', function() { + it('should call super', function() { + var b; + b = new Burst; + spyOn(Tunable.prototype, '_tuneSubModules'); + b._tuneSubModules(); + return expect(Tunable.prototype._tuneSubModules).toHaveBeenCalled(); + }); + it('should call _tuneNewOptions on each swirl', function() { + var b; + b = new Burst({ + count: 2 + }); + spyOn(b._swirls[0], '_tuneNewOptions'); + spyOn(b._swirls[1], '_tuneNewOptions'); + spyOn(b, '_resetTween'); + b._tuneSubModules(); + expect(b._swirls[0]._tuneNewOptions.calls.first().args[0]).toEqual(b._getOption(0)); + expect(b._swirls[1]._tuneNewOptions.calls.first().args[0]).toEqual(b._getOption(1)); + expect(b._resetTween.calls.argsFor(0)[0]).toBe(b.timeline._timelines[0]); + expect(b._resetTween.calls.argsFor(0)[1]).toEqual(b._getOption(0)); + expect(b._resetTween.calls.argsFor(1)[0]).toBe(b.timeline._timelines[1]); + expect(b._resetTween.calls.argsFor(1)[1]).toEqual(b._getOption(1)); + return expect(b._resetTween.calls.count()).toBe(2); + }); + it('should set prop on timeline', function() { + var b, isCalled, timelineOpts; + isCalled = null; + b = new Burst({ + count: 2 + }); + timelineOpts = { + onComplete: null + }; + b._o.timeline = timelineOpts; + spyOn(b.timeline, '_setProp'); + b._tuneSubModules(); + return expect(b.timeline._setProp).toHaveBeenCalledWith(timelineOpts); + }); + it('should not set prop on timeline if no object', function() { + var b, isCalled, timelineOpts; + isCalled = null; + b = new Burst({ + count: 2, + isIt: 1 + }); + timelineOpts = { + onComplete: null + }; + spyOn(b.timeline, '_setProp'); + b._tuneSubModules(); + return expect(b.timeline._setProp).not.toHaveBeenCalled(); + }); + return it('should call _recalcTotalDuration on timeline', function() { + var b; + b = new Burst({ + count: 2, + isIt: 1 + }); + spyOn(b.timeline, '_recalcTotalDuration'); + b._tuneSubModules(); + return expect(b.timeline._recalcTotalDuration.calls.count()).toBe(1); + }); + }); }); }).call(this); diff --git a/spec/easing/easing.coffee b/spec/easing/easing.coffee index 4b34bf4e8..03986dbaa 100644 --- a/spec/easing/easing.coffee +++ b/spec/easing/easing.coffee @@ -134,6 +134,10 @@ describe 'easing ->', -> fun = -> expect(easing.parseEasing(fun)).toBe fun expect(typeof easing.parseEasing(fun)).toBe 'function' + it 'should parse null/undefined to liner.none', -> + fun = easing.parseEasing(null) + expect(fun).toBe mojs.easing.linear.none + describe 'easing name option ->', -> it 'should parse string easing', -> expect(typeof easing.parseEasing('cubic.in')).toBe 'function' diff --git a/spec/easing/easing.js b/spec/easing/easing.js index b3cfc1716..6f7d7c5b9 100644 --- a/spec/easing/easing.js +++ b/spec/easing/easing.js @@ -197,6 +197,11 @@ expect(easing.parseEasing(fun)).toBe(fun); return expect(typeof easing.parseEasing(fun)).toBe('function'); }); + it('should parse null/undefined to liner.none', function() { + var fun; + fun = easing.parseEasing(null); + return expect(fun).toBe(mojs.easing.linear.none); + }); return describe('easing name option ->', function() { it('should parse string easing', function() { return expect(typeof easing.parseEasing('cubic.in')).toBe('function'); diff --git a/spec/transit.coffee b/spec/transit.coffee index 8afe05d14..431bdfac5 100644 --- a/spec/transit.coffee +++ b/spec/transit.coffee @@ -645,7 +645,7 @@ describe 'Transit ->', -> byte.el = null expect(byte._drawEl()).toBe true it 'should set transform if angle changed', -> - byte = new Byte angle: 25, isIt: 1 + byte = new Byte angle: 25 byte._draw() byte._props.angle = 26 spyOn h, 'setPrefixedStyle' diff --git a/spec/transit.js b/spec/transit.js index b914bbbcc..8bd714934 100644 --- a/spec/transit.js +++ b/spec/transit.js @@ -997,8 +997,7 @@ it('should set transform if angle changed', function() { var byte; byte = new Byte({ - angle: 25, - isIt: 1 + angle: 25 }); byte._draw(); byte._props.angle = 26; diff --git a/spec/tween/tween.coffee b/spec/tween/tween.coffee index 2d1eb1e5e..cacf56dcf 100644 --- a/spec/tween/tween.coffee +++ b/spec/tween/tween.coffee @@ -6602,6 +6602,11 @@ describe 'Tween ->', -> tr._assignProp 'easing', 'ease.in' expect(typeof tr._props.easing).toBe 'function' + it 'should fallback to defaults for null values', -> + tr = new Tween + tr._assignProp 'speed', null + expect(tr._props.speed).toBe tr._defaults.speed + it 'should override callbacks if key in _callbackOverrides object', -> tr = new Tween funBefore = -> @@ -6635,9 +6640,9 @@ describe 'Tween ->', -> onStart: controlCallback } spyOn(tr, '_overrideCallback').and.callThrough() - tr._assignProp 'onStart', undefined + tr._assignProp 'onStart', null expect(typeof tr._props.onStart).toBe 'function' expect(tr._overrideCallback) - .toHaveBeenCalledWith undefined, controlCallback + .toHaveBeenCalledWith null, controlCallback diff --git a/spec/tween/tween.js b/spec/tween/tween.js index 7976f9750..6825cc6c4 100644 --- a/spec/tween/tween.js +++ b/spec/tween/tween.js @@ -6704,6 +6704,12 @@ tr._assignProp('easing', 'ease.in'); return expect(typeof tr._props.easing).toBe('function'); }); + it('should fallback to defaults for null values', function() { + var tr; + tr = new Tween; + tr._assignProp('speed', null); + return expect(tr._props.speed).toBe(tr._defaults.speed); + }); it('should override callbacks if key in _callbackOverrides object', function() { var controlCallback, funBefore, tr; tr = new Tween; @@ -6738,9 +6744,9 @@ onStart: controlCallback }; spyOn(tr, '_overrideCallback').and.callThrough(); - tr._assignProp('onStart', void 0); + tr._assignProp('onStart', null); expect(typeof tr._props.onStart).toBe('function'); - return expect(tr._overrideCallback).toHaveBeenCalledWith(void 0, controlCallback); + return expect(tr._overrideCallback).toHaveBeenCalledWith(null, controlCallback); }); }); });