diff --git a/demo/src/kute-base.js b/demo/src/kute-base.js index 966b258..9676670 100644 --- a/demo/src/kute-base.js +++ b/demo/src/kute-base.js @@ -366,10 +366,9 @@ }; TweenConstructor.Tween = TweenBase; - var TC = TweenConstructor.Tween; function fromTo(element, startObject, endObject, optionsObj) { optionsObj = optionsObj || {}; - return new TC(selector(element), startObject, endObject, optionsObj) + return new TweenConstructor.Tween(selector(element), startObject, endObject, optionsObj) } function perspective(a, b, u, v) { diff --git a/demo/src/kute-base.min.js b/demo/src/kute-base.min.js index 98ca310..9a8ad31 100644 --- a/demo/src/kute-base.min.js +++ b/demo/src/kute-base.min.js @@ -1,2 +1,2 @@ // KUTE.js Base v2.0.1 | thednp © 2020 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).KUTE=e()}(this,(function(){"use strict";var t={duration:700,delay:0,easing:"linear"},e={},n={},r={},o={},i={defaultOptions:t,linkProperty:e,onStart:n,onComplete:r,supportedProperties:o},s={};var a={linear:function(t){return t},easingQuadraticIn:function(t){return t*t},easingQuadraticOut:function(t){return t*(2-t)},easingQuadraticInOut:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easingCubicIn:function(t){return t*t*t},easingCubicOut:function(t){return--t*t*t+1},easingCubicInOut:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easingCircularIn:function(t){return-(Math.sqrt(1-t*t)-1)},easingCircularOut:function(t){return Math.sqrt(1-(t-=1)*t)},easingCircularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easingBackIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easingBackOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},easingBackInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}};s.processEasing=function(t){return"function"==typeof t?t:"string"==typeof t?a[t]:a.linear};var u=[];function l(t){return u.push(t)}function c(t){var e=u.indexOf(t);-1!==e&&u.splice(e,1)}var f={},p="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function d(t,e,n){return(t=+t)+(e-=t)*n}var v={numbers:d,units:function(t,e,n,r){return(t=+t)+(e-=t)*r+n},arrays:function(t,e,n){for(var r=[],o=0,i=e.length;o>0)/1e3;return r}},h={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?h.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(h.now=self.performance.now.bind(self.performance));var m=0,y=function(t){for(var e=0;e1?1:e,n=this._easing(e),this.valuesEnd)f[r](this.element,this.valuesStart[r],this.valuesEnd[r],n);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},O.Tween=S;var I=O.Tween;function M(t,e,n,r){return"perspective("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"}function x(t,e,n,r){for(var o=[],i=0;i<3;i++)o[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+o.join(",")+")"}function U(t,e,n,r){var o="";return o+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",o+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",o+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function j(t,e,n,r){var o=[];return o[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,o[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+o.join(",")+")"}function A(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"}function B(t,e,n,r){var o=[];return o[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,o[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+o.join(",")+")"}function P(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}var q={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],functions:{onStart:function(t){!f[t]&&this.valuesEnd[t]&&(f[t]=function(e,n,r,o){e.style[t]=(n.perspective||r.perspective?M(n.perspective,r.perspective,"px",o):"")+(n.translate3d?x(n.translate3d,r.translate3d,"px",o):"")+(n.translate?j(n.translate,r.translate,"px",o):"")+(n.rotate3d?U(n.rotate3d,r.rotate3d,"deg",o):"")+(n.rotate||r.rotate?A(n.rotate,r.rotate,"deg",o):"")+(n.skew?B(n.skew,r.skew,"deg",o):"")+(n.scale||r.scale?P(n.scale,r.scale,o):"")})}},Interpolate:{perspective:M,translate3d:x,rotate3d:U,translate:j,rotate:A,scale:P,skew:B}};function F(t){t in this.valuesEnd&&!f[t]&&(f[t]=function(e,n,r,o){e.style[t]=(o>.99||o<.01?(10*d(n,r,o)>>0)/10:d(n,r,o)>>0)+"px"})}var L=["top","left","width","height"],X={};L.map((function(t){return X[t]=F}));var Y={component:"boxModelProps",category:"boxModel",properties:L,Interpolate:{numbers:d},functions:{onStart:X}};var D={component:"opacityProperty",property:"opacity",Interpolate:{numbers:d},functions:{onStart:function(t){t in this.valuesEnd&&!f[t]&&(f[t]=function(e,n,r,o){e.style[t]=(1e3*d(n,r,o)>>0)/1e3})}}};function K(t,e,n,r){r=r||!1,t.addEventListener(e,n,r)}function Q(t,e,n,r){r=r||!1,t.removeEventListener(e,n,r)}var Z=function(){var t,e,n,r,o=!1;try{var i=Object.defineProperty({},"passive",{get:function(){o=!0}});t=document,n=function(){},K(t,e="DOMContentLoaded",(function o(i){i.target===t&&(n(i),Q(t,e,o,r))}),r=i)}catch(t){}return o}(),z="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],H="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",G=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,N=!!Z&&{passive:!1};function R(t){this.scrolling&&t.preventDefault()}function V(){var t=this.element;return t===G?{el:document,st:document.body}:{el:t,st:t}}function W(){var t=V.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,Q(t.el,z[0],R,N),Q(t.el,H,R,N),t.st.style.pointerEvents="")}var J={component:"scrollProperty",property:"scroll",Interpolate:{numbers:d},functions:{onStart:function(t){t in this.valuesEnd&&!f[t]&&(f[t]=function(t,e,n,r){t.scrollTop=d(e,n,r)>>0})},onComplete:function(t){W.call(this)}},Util:{preventScroll:R,scrollIn:function(){var t=V.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,K(t.el,z[0],R,N),K(t.el,H,R,N),t.st.style.pointerEvents="none")},scrollOut:W,scrollContainer:G,passiveHandler:N,getScrollTargets:V}};($="transform")in document.body.style||(function(){for(var t,e=["Moz","moz","Webkit","webkit","O","o","Ms","ms"],n=0,r=e.length;n>0)/1e3;return r}},h={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?h.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(h.now=self.performance.now.bind(self.performance));var m=0,y=function(t){for(var e=0;e>0)/1e3+n+")"}function M(t,e,n,r){for(var o=[],i=0;i<3;i++)o[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+o.join(",")+")"}function x(t,e,n,r){var o="";return o+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",o+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",o+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function U(t,e,n,r){var o=[];return o[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,o[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+o.join(",")+")"}function j(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"}function A(t,e,n,r){var o=[];return o[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,o[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+o.join(",")+")"}function B(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}S.prototype.start=function(t){if(l(this),this.playing=!0,this._startTime=t||f.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),n)if("function"==typeof n[e])n[e].call(this,e);else for(var r in n[e])n[e][r].call(this,r);E.call(this),this._startFired=!0}return!m&&y(),this},S.prototype.stop=function(){return this.playing&&(c(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},S.prototype.close=function(){for(var t in r)for(var e in r[t])r[t][e].call(this,e);this._startFired=!1,g.call(this)},S.prototype.update=function(t){var e,n;if((t=void 0!==t?t:f.Time())1?1:e,n=this._easing(e),this.valuesEnd)f[r](this.element,this.valuesStart[r],this.valuesEnd[r],n);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},O.Tween=S;var P={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],functions:{onStart:function(t){!f[t]&&this.valuesEnd[t]&&(f[t]=function(e,n,r,o){e.style[t]=(n.perspective||r.perspective?I(n.perspective,r.perspective,"px",o):"")+(n.translate3d?M(n.translate3d,r.translate3d,"px",o):"")+(n.translate?U(n.translate,r.translate,"px",o):"")+(n.rotate3d?x(n.rotate3d,r.rotate3d,"deg",o):"")+(n.rotate||r.rotate?j(n.rotate,r.rotate,"deg",o):"")+(n.skew?A(n.skew,r.skew,"deg",o):"")+(n.scale||r.scale?B(n.scale,r.scale,o):"")})}},Interpolate:{perspective:I,translate3d:M,rotate3d:x,translate:U,rotate:j,scale:B,skew:A}};function q(t){t in this.valuesEnd&&!f[t]&&(f[t]=function(e,n,r,o){e.style[t]=(o>.99||o<.01?(10*d(n,r,o)>>0)/10:d(n,r,o)>>0)+"px"})}var F=["top","left","width","height"],L={};F.map((function(t){return L[t]=q}));var X={component:"boxModelProps",category:"boxModel",properties:F,Interpolate:{numbers:d},functions:{onStart:L}};var Y={component:"opacityProperty",property:"opacity",Interpolate:{numbers:d},functions:{onStart:function(t){t in this.valuesEnd&&!f[t]&&(f[t]=function(e,n,r,o){e.style[t]=(1e3*d(n,r,o)>>0)/1e3})}}};function D(t,e,n,r){r=r||!1,t.addEventListener(e,n,r)}function K(t,e,n,r){r=r||!1,t.removeEventListener(e,n,r)}var Q=function(){var t,e,n,r,o=!1;try{var i=Object.defineProperty({},"passive",{get:function(){o=!0}});t=document,n=function(){},D(t,e="DOMContentLoaded",(function o(i){i.target===t&&(n(i),K(t,e,o,r))}),r=i)}catch(t){}return o}(),Z="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],z="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",H=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,G=!!Q&&{passive:!1};function N(t){this.scrolling&&t.preventDefault()}function R(){var t=this.element;return t===H?{el:document,st:document.body}:{el:t,st:t}}function V(){var t=R.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,K(t.el,Z[0],N,G),K(t.el,z,N,G),t.st.style.pointerEvents="")}var W={component:"scrollProperty",property:"scroll",Interpolate:{numbers:d},functions:{onStart:function(t){t in this.valuesEnd&&!f[t]&&(f[t]=function(t,e,n,r){t.scrollTop=d(e,n,r)>>0})},onComplete:function(t){V.call(this)}},Util:{preventScroll:N,scrollIn:function(){var t=R.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,D(t.el,Z[0],N,G),D(t.el,z,N,G),t.st.style.pointerEvents="none")},scrollOut:V,scrollContainer:H,passiveHandler:G,getScrollTargets:R}};(J="transform")in document.body.style||(function(){for(var t,e=["Moz","moz","Webkit","webkit","O","o","Ms","ms"],n=0,r=e.length;n>0)/1e3;return r}var v={numbers:h,units:f,arrays:d};function g(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),n={},r=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(n[i]=r.includes(i)?a.split(","):a)}))})),n}}function m(t,n){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[n]&&!/auto|initial|none|unset/.test(r[n])?r[n]:i[n];if("transform"!==n&&(n in i||n in r))return a||e[n]}function y(n,i){var a="start"===i?this.valuesStart:this.valuesEnd;for(var s in r){var o=r[s],l=t[s];for(var u in o){var p={};for(var c in n)e[c]&&o[c]?a[c]=o[c].call(this,c,n[c]):!e[u]&&"transform"===u&&l.includes(c)?p[c]=n[c]:!e[u]&&l&&l.includes(c)&&(a[c]=o[u].call(this,c,n[c]));Object.keys&&Object.keys(p).length&&(a[u]=o[u].call(this,u,p))}}}function b(){var n={},r=g(this.element);for(var a in this.valuesStart)for(var s in i){var o=i[s];for(var l in o)(l===a&&o[a]||t[s]&&t[s].includes(a))&&(n[a]=o[l].call(this,a,this.valuesStart[a]))}for(var u in r)u in this.valuesStart||(n[u]=r[u]||e[u]);this.valuesStart={},y.call(this,n,"start")}var w={getInlineStyle:g,getStyleForProperty:m,getStartValues:b,prepareObject:y},x=[];function S(t){return x.push(t)}function M(t){var e=x.indexOf(t);-1!==e&&x.splice(e,1)}var T={},E="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var C=0,k=function(t){for(var e=0;e(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var F={linear:new U(0,0,1,1,"linear"),easingSinusoidalIn:new U(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new U(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new U(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new U(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new U(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new U(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new U(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new U(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new U(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new U(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new U(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new U(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new U(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new U(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new U(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new U(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new U(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new U(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new U(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new U(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new U(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new U(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new U(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new U(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}p.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof F[t])return F[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new U(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),F.linear};var V={},R=function(t,e,r,i){for(var a in this.element=t,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=e,i=i||{},this._resetStart=i.resetStart||0,this._easing="function"==typeof i.easing?i.easing:p.processEasing(i.easing),this._duration=i.duration||n.duration,this._delay=i.delay||n.delay,i){var o="_"+a;o in this||(this[o]=i[a])}var l=this._easing.name;return s[l]||(s[l]=function(t){!T[t]&&t===this._easing.name&&(T[t]=this._easing)}),this};R.prototype.start=function(t){if(S(this),this.playing=!0,this._startTime=t||T.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),s)if("function"==typeof s[e])s[e].call(this,e);else for(var n in s[e])s[e][n].call(this,n);A.call(this),this._startFired=!0}return!C&&k(),this},R.prototype.stop=function(){return this.playing&&(M(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},R.prototype.close=function(){for(var t in o)for(var e in o[t])o[t][e].call(this,e);this._startFired=!1,I.call(this)},R.prototype.update=function(t){var e,n;if((t=void 0!==t?t:T.Time())1?1:e,n=this._easing(e),this.valuesEnd)T[r](this.element,this.valuesStart[r],this.valuesEnd[r],n);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},V.Tween=R,n.repeat=0,n.repeatDelay=0,n.yoyo=!1,n.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var i=e[1],s=e[2];if(y.call(this,s,"end"),this._resetStart?this.valuesStart=i:y.call(this,i,"start"),!this._resetStart)for(var o in a)for(var l in a[o])a[o][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||n.repeat,this._repeatDelay=u.repeatDelay||n.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||n.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,b.call(this),a)for(var r in a[n])a[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=T.Time()-this._pauseTime,S(this),!C&&k()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=T.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,n;if((t=void 0!==t?t:T.Time())1?1:e,n=this._easing(e),this.valuesEnd)T[r](this.element,this.valuesStart[r],this.valuesEnd[r],n);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(R);V.Tween=H;var N=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.apply(this,e),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.to=function(t,e){},e.prototype.fromTo=function(t,e){},e.prototype.getTotalDuration=function(){},e.prototype.callback=function(t,e){["start","stop","update","complete","pause","resume"].indexOf(t)>-1&&(this["_on"+(t.charAt(0).toUpperCase()+t.slice(1))]=e)},e.prototype.option=function(t,e){this["_"+t]=e},e}(H);V.Tween=N;var q=function(t,e,r,i){var a=this;this.tweens=[],!("offset"in n)&&(n.offset=0);var s=V.Tween;(i=i||{}).delay=i.delay||n.delay;var o=[];return Array.from(t).map((function(t,l){o[l]=i||{},o[l].delay=l>0?i.delay+(i.offset||n.offset):i.delay,t instanceof Element?a.tweens.push(new s(t,e,r,o[l])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};q.prototype.start=function(t){return t=void 0===t?T.Time():t,this.tweens.map((function(e){return e.start(t)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},q.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},q.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof V))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var D=function(t,e){if(this.element=j(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,this.element.output=this.element.parentNode.getElementsByTagName("OUTPUT")[0],!(this.element instanceof HTMLInputElement))throw TypeError("Target element is not [HTMLInputElement]");if("range"!==this.element.type)throw TypeError("Target element is not a range input");if(!(e instanceof V.Tween))throw TypeError("tween parameter is not ["+V+"]");this.element.setAttribute("value",0),this.element.setAttribute("min",0),this.element.setAttribute("max",1),this.element.setAttribute("step",1e-4),this.element.tween._onUpdate=this.updateBar,this.element.addEventListener("mousedown",this.downAction,!1)};D.prototype.updateBar=function(){var t=this.toolbar.output,e=this.paused?this.toolbar.value:(T.Time()-this._startTime)/this._duration;e=e>.9999?1:e<.01?0:e;var n=this._reversed?1-e:e;this.toolbar.value=n,t&&(t.value=(100*n).toFixed(2)+"%")},D.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},D.prototype.updateTween=function(){var t=(this.tween._reversed?1-this.value:this.value)*this.tween._duration-1e-4;this.tween._startTime=0,this.tween.update(t)},D.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},D.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),T.Tick=cancelAnimationFrame(T.Ticker))},D.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=T.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),T.Tick=requestAnimationFrame(T.Ticker))};var B=V.Tween;var X=V.Tween;var z=function(n){try{n.component in t?console.error("KUTE.js - "+n.component+" already registered"):n.property in e?console.error("KUTE.js - "+n.property+" already registered"):this.setComponent(n)}catch(t){console.error(t)}};z.prototype.setComponent=function(u){var c=u.component,h={prepareProperty:r,prepareStart:i,onStart:s,onComplete:o,crossCheck:a},f=u.category,d=u.property,g=u.properties&&u.properties.length||u.subProperties&&u.subProperties.length;if(t[c]=u.properties||u.subProperties||u.property,"defaultValue"in u)e[d]=u.defaultValue,this.supports=d+" property";else if(u.defaultValues){for(var m in u.defaultValues)e[m]=u.defaultValues[m];this.supports=(g||d)+" "+(d||f)+" properties"}if(u.defaultOptions)for(var y in u.defaultOptions)n[y]=u.defaultOptions[y];if(u.functions)for(var b in h)if(b in u.functions)if("function"==typeof u.functions[b])!h[b][c]&&(h[b][c]={}),!h[b][c][f||d]&&(h[b][c][f||d]=u.functions[b]);else for(var w in u.functions[b])!h[b][c]&&(h[b][c]={}),!h[b][c][w]&&(h[b][c][w]=u.functions[b][w]);if(u.Interpolate){for(var x in u.Interpolate){var S=u.Interpolate[x];if("function"!=typeof S||v[x])for(var M in S)"function"!=typeof S[M]||v[x]||(v[x]=S[M]);else v[x]=S}l[c]=u.Interpolate}if(u.Util)for(var T in u.Util)!p[T]&&(p[T]=u.Util[T]);return this};var Y=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];t.apply(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setComponent=function(e){t.prototype.setComponent.call(this,e);var n={prepareProperty:r,prepareStart:i,onStart:s,onComplete:o,crossCheck:a},l=e.category,u=e.property,p=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;if("defaultValue"in e?(this.supports=u+" property",this.defaultValue=(e.defaultValue+"").length?"YES":"not set or incorrect"):e.defaultValues&&(this.supports=(p||u)+" "+(u||l)+" properties",this.defaultValues=Object.keys(e.defaultValues).length===p?"YES":"Not set or incomplete"),e.defaultOptions){for(var c in this.extends=[],e.defaultOptions)this.extends.push(c);this.extends.length?this.extends="with <"+this.extends.join(", ")+"> new option(s)":delete this.extends}if(e.functions){for(var h in this.interface=[],this.render=[],this.warning=[],n)h in e.functions?("prepareProperty"===h&&this.interface.push("fromTo()"),"prepareStart"===h&&this.interface.push("to()"),"onStart"===h&&(this.render="can render update")):("prepareProperty"===h&&this.warning.push("fromTo()"),"prepareStart"===h&&this.warning.push("to()"),"onStart"===h&&(this.render="no function to render update"));this.interface.length?this.interface=(l||u)+" can use ["+this.interface.join(", ")+"] method(s)":delete this.uses,this.warning.length?this.warning=(l||u)+" can't use ["+this.warning.join(", ")+"] method(s) because values aren't processed":delete this.warning}if(e.Interpolate){for(var f in this.uses=[],this.adds=[],e.Interpolate){var d=e.Interpolate[f];if("function"==typeof d)v[f]||this.adds.push(""+f),this.uses.push(""+f);else for(var g in d)"function"!=typeof d[g]||v[f]||this.adds.push(""+g),this.uses.push(""+g)}this.uses.length?this.uses="["+this.uses.join(", ")+"] interpolation function(s)":delete this.uses,this.adds.length?this.adds="new ["+this.adds.join(", ")+"] interpolation function(s)":delete this.adds}else this.critical="For "+(u||l)+" no interpolation function[s] is set";return e.Util&&(this.hasUtil=Object.keys(e.Util).join(",")),this},e}(z);function Q(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a>0)/100+"% "+(100*h(n[1],r[1],i)>>0)/100+"%"})}},K={component:"BgPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:h},functions:W,Util:{trueDimension:Q}};c.BackgroundPositionProperty=K;var G=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],$={};function Z(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=f(n.v,r.v,r.u,i)})}G.map((function(t){return $[t]=0}));var J={};G.forEach((function(t){J[t]=Z}));var tt={component:"borderRadiusProps",category:"borderRadius",properties:G,defaultValues:$,Interpolate:{units:f},functions:{prepareStart:function(t){return m(this.element,t)||e[t]},prepareProperty:function(t,e){return Q(e)},onStart:J},Util:{trueDimension:Q}};c.BorderRadiusProperties=tt;var et=["top","left","width","height","right","bottom","minWidth","minHeight","maxWidth","maxHeight","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","margin","marginTop","marginBottom","marginLeft","marginRight","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","outlineWidth"],nt={};function rt(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=(i>.99||i<.01?(10*h(n,r,i)>>0)/10:h(n,r,i)>>0)+"px"})}et.map((function(t){return nt[t]=0}));var it={};et.map((function(t){return it[t]=rt}));var at={component:"boxModelProps",category:"boxModel",properties:et,defaultValues:nt,Interpolate:{numbers:h},functions:{prepareStart:function(t){return m(this.element,t)||e[t]},prepareProperty:function(t,e){var n=Q(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:it}};c.BoxModelProperties=at;var st={prepareStart:function(t,e){var n=m(this.element,t),r=m(this.element,"width"),i=m(this.element,"height");return/rect/.test(n)?n:[0,r,i,0]},prepareProperty:function(t,e){if(e instanceof Array)return[Q(e[0]),Q(e[1]),Q(e[2]),Q(e[3])];var n=e.replace(/rect|\(|\)/g,"");return[Q((n=/\,/g.test(n)?n.split(/\,/g):n.split(/\s/g))[0]),Q(n[1]),Q(n[2]),Q(n[3])]},onStart:function(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(t,e,n,r){for(var i=0,a=[];i<4;i++){var s=e[i].v,o=n[i].v,l=n[i].u||"px";a[i]=(100*h(s,o,r)>>0)/100+l}t.style.clip="rect("+a+")"})}},ot={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:h},functions:st,Util:{trueDimension:Q}};function lt(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function ut(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?h(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*h(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}c.ClipProperty=ot;var pt=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],ct={};function ht(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=ut(n,r,i)})}pt.forEach((function(t){ct[t]="#000"}));var ft={};pt.map((function(t){return ft[t]=ht}));var dt={component:"colorProps",category:"colors",properties:pt,defaultValues:ct,Interpolate:{numbers:h,colors:ut},functions:{prepareStart:function(t,n){return m(this.element,t)||e[t]},prepareProperty:function(t,e){return lt(e)},onStart:ft},Util:{trueColor:lt}};c.ColorProperties=dt;var vt=["fill","stroke","stop-color"],gt={};function mt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var yt={prepareStart:function(t,e){var n={};for(var r in e){var i=mt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=vt.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,n){var r={};for(var i in n){var a=mt(i),o=/(%|[a-z]+)$/,l=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(vt.includes(a))s.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in gt)&&(gt[e]=function(t,e,n,r,i){t.setAttribute(e,ut(n,r,i))})},r[a]=lt(n[i])||e.htmlAttributes[i];else if(null!==l&&o.test(l)){var u=Q(l).u||Q(n[i]).u,p=/%/.test(u)?"_percent":"_"+u;s.htmlAttributes[a+p]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in gt)&&(gt[e]=function(t,e,n,r,i){var a=e.replace(p,"");t.setAttribute(a,(1e3*h(n.v,r.v,i)>>0)/1e3+r.u)})},r[a+p]=Q(n[i])}else o.test(n[i])&&null!==l&&(null===l||o.test(l))||(s.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in gt)&&(gt[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*h(n,r,i)>>0)/1e3)})},r[a]=parseFloat(n[i]))}return r},onStart:{attr:function(t){!T[t]&&this.valuesEnd[t]&&(T[t]=function(t,e,n,r){for(var i in n)T.attributes[i](t,i,e[i],n[i],r)})},attributes:function(t){!T[t]&&this.valuesEnd.attr&&(T[t]=gt)}}},bt={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:h,colors:ut},functions:yt,Util:{replaceUppercase:mt,trueColor:lt,trueDimension:Q}};function wt(t,e,n){for(var r=[],i=0;i<3;i++)r[i]=(100*h(t[i],e[i],n)>>0)/100+"px";return"drop-shadow("+r.concat(ut(t[3],e[3],n)).join(" ")+")"}function xt(t){return t.replace("-r","R").replace("-s","S")}function St(t){var e;3===t.length?e=[t[0],t[1],0,t[2]]:4===t.length&&(e=[t[0],t[1],t[2],t[3]]);for(var n=0;n<3;n++)e[n]=parseFloat(e[n]);return e[3]=lt(e[3]),e}function Mt(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var i=0,a=r.length;i>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*h(n.blur,r.blur,i)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*h(n.saturate,r.saturate,i)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*h(n.invert,r.invert,i)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*h(n.grayscale,r.grayscale,i)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*h(n.hueRotate,r.hueRotate,i)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*h(n.sepia,r.sepia,i)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*h(n.brightness,r.brightness,i)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*h(n.contrast,r.contrast,i)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?wt(n.dropShadow,r.dropShadow,i):"")})},crossCheck:function(t){if(this.valuesEnd[t])for(var e in this.valuesStart[t])this.valuesEnd[t][e]||(this.valuesEnd[t][e]=this.valuesStart[t][e])}},Et={component:"filterEffects",property:"filter",defaultValue:{opacity:100,blur:0,saturate:100,grayscale:0,brightness:100,contrast:100,sepia:0,invert:0,hueRotate:0,dropShadow:[0,0,0,{r:0,g:0,b:0}],url:""},Interpolate:{opacity:h,blur:h,saturate:h,grayscale:h,brightness:h,contrast:h,sepia:h,invert:h,hueRotate:h,dropShadow:{numbers:h,colors:ut,dropShadow:wt}},functions:Tt,Util:{parseDropShadow:St,parseFilterString:Mt,replaceDashNamespace:xt,trueColor:lt}};c.FilterEffects=Et;var _t={prepareStart:function(t){return m(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=(1e3*h(n,r,i)>>0)/1e3})}},Ct={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:h},functions:_t};c.OpacityProperty=Ct;var kt=function(t,e){return parseFloat(t)/100*e},It=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},Pt=function(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*h(e.s,n.s,r)>>0)/100,s=(100*h(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var Vt={prepareStart:function(){return Ft(this.element)},prepareProperty:function(t,e){return Ft(this.element,e)},onStart:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(t,e,n,r){return jt(t,e,n,r)})}},Rt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:h,paintDraw:jt},functions:Vt,Util:{getRectLength:It,getPolyLength:Pt,getLineLength:Ot,getCircleLength:At,getEllipseLength:Lt,getTotalLength:Ut,getDraw:Ft,percent:kt}};c.SVGDraw=Rt;function Ht(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4==r?a[3]={x:+t[0],y:+t[1]}:i-2==r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4==r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}function Nt(t,e,n,r,i){var a;if(null==i&&null==r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!=i){var s=Math.PI/180,o=t+n*Math.cos(-r*s),l=t+n*Math.cos(-i*s);a=[["M",o,e+n*Math.sin(-r*s)],["A",n,n,0,+(i-r>180),0,l,e+n*Math.sin(-i*s)]]}else a=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return a}function qt(t){if(!t)return null;if(t instanceof Array)return t;var e="\\"+"x09|x0a|x0b|x0c|x0d|x20|xa0|u1680|u180e|u2000|u2001|u2002|u2003|u2004|u2005|u2006|u2007|u2008|u2009|u200a|u202f|u205f|u3000|u2028|u2029".split("|").join("\\"),n=new RegExp("([a-z])["+e+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+e+"]*,?["+e+"]*)+)","ig"),r=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+e+"]*,?["+e+"]*","ig"),i={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},a=[];return t.replace(n,(function(t,e,n){var s=[],o=e.toLowerCase();if(n.replace(r,(function(t,e){e&&s.push(+e)})),"m"==o&&s.length>2&&(a.push([e].concat(s.splice(0,2))),o="l",e="m"==e?"l":"L"),"o"==o&&1==s.length&&a.push([e,s[0]]),"r"==o)a.push([e].concat(s));else for(;s.length>=i[o]&&(a.push([e].concat(s.splice(0,i[o]))),i[o]););})),a}function Dt(t){if(!(t=qt(t))||!t.length)return[["M",0,0]];var e,n=[],r=0,i=0,a=0,s=0,o=0;"M"===t[0][0]&&(a=r=+t[0][1],s=i=+t[0][2],o++,n[0]=["M",r,i]);for(var l=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),u=void 0,p=void 0,c=o,h=t.length;c1&&(n*=x=Math.sqrt(x),r*=x);var S=n*n,M=r*r,T=(a==s?-1:1)*Math.sqrt(Math.abs((S*M-S*w*w-M*b*b)/(S*w*w+M*b*b)));f=T*n*w/r+(t+o)/2,d=T*-r*b/n+(e+l)/2,c=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((l-d)/r).toFixed(9)),c=th&&(c-=2*Math.PI),!s&&h>c&&(h-=2*Math.PI)}var E=h-c;if(Math.abs(E)>v){var _=h,C=o,k=l;h=c+v*(s&&h>c?1:-1),m=zt(o=f+n*Math.cos(h),l=d+r*Math.sin(h),n,r,i,0,s,C,k,[h,_,f,d])}E=h-c;var I=Math.cos(c),P=Math.sin(c),O=Math.cos(h),A=Math.sin(h),L=Math.tan(E/4),U=4/3*n*L,F=4/3*r*L,j=[t,e],V=[t+U*P,e-F*I],R=[o+U*A,l-F*O],H=[o,l];if(V[0]=2*j[0]-V[0],V[1]=2*j[1]-V[1],u)return[V,R,H].concat(m);for(var N=[],q=0,D=(m=[V,R,H].concat(m).join().split(",")).length;q7){t[i].shift();for(var a=t[i];a.length;)n[i]="A",e&&(r[i]="A"),t.splice(i++,0,["C"].concat(a.splice(0,6)));t.splice(i,1)}}function Kt(t,e){for(var n=Dt(t),r=e&&Dt(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],o=[],l="",u="",p=0,c=Math.max(n.length,r&&r.length||0);p0?r-s:r].seg,e[s]=[a[0],a[5],a[6],a[3],a[4],a[1],a[2]])})),e}function Jt(t,e){var n=[],r=t.length,i=r-1;return t.map((function(a,s){var o=e+s;0===s||t[o]&&"M"===t[o].seg[0]?n[s]=["M",t[o].x,t[o].y]:(o>=r&&(o-=i),n[s]=t[o].seg)})),n}function te(t){var e=$t(t),n=[];return e.map((function(t,r){n[r]=Jt(e,r)})),n}function ee(t,e){var n=$t(t),r=$t(e),i=n.length-1,a=[],s=[],o=te(t);return o.map((function(t,e){for(var o=0,l=Gt("M0,0L0,0"),u=0;u>0)/1e3)}t.setAttribute("d",1===r?n.original:ne(i))})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].curve,n=this.valuesEnd[t].curve;if(!e||!n||e&&n&&"M"===e[0][0]&&e.length!==n.length){var r=Kt(this.valuesStart[t].original,this.valuesEnd[t].original),i=this._reverseFirstPath?Zt.call(this,r[0]):r[0],a=this._reverseSecondPath?Zt.call(this,r[1]):r[1];i=ee.call(this,i,a),this.valuesStart[t].curve=i,this.valuesEnd[t].curve=a}}}},ie={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:h,toPathString:ne},functions:re,Util:{l2c:Bt,q2c:Xt,a2c:zt,catmullRom2bezier:Ht,ellipsePath:Nt,path2curve:Kt,pathToAbsolute:Dt,toPathString:ne,parsePathString:qt,getRotatedCurve:ee,getRotations:te,getRotationSegments:Jt,reverseCurve:Zt,getSegments:$t,createPath:Gt}};function ae(t,e){var n=e.x,r=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?n+parseFloat(t)*r/100:parseFloat(t)}function se(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",n={};if(e instanceof Array)for(var r=0,i=e.length;r>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(f?"skewX("+(1e3*f>>0)/1e3+")":"")+(d?"skewY("+(1e3*d>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=oe.call(this,t,se(this.element.getAttribute("transform")));for(var i in r)e[i]=r[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in n&&"origin"!==o||(n[o]=e[o])}}},ue={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:h},functions:le,Util:{parseStringOrigin:ae,parseTransformString:se,parseTransformSVG:oe}};function pe(t,e,n,r){r=r||!1,t.addEventListener(e,n,r)}function ce(t,e,n,r){r=r||!1,t.removeEventListener(e,n,r)}c.SVGTransformProperty=ue;var he=function(){var t,e,n,r,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,n=function(){},pe(t,e="DOMContentLoaded",(function i(a){a.target===t&&(n(a),ce(t,e,i,r))}),r=a)}catch(t){}return i}(),fe="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],de="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",ve=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,ge=!!he&&{passive:!1};function me(t){this.scrolling&&t.preventDefault()}function ye(){var t=this.element;return t===ve?{el:document,st:document.body}:{el:t,st:t}}function be(){var t=ye.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,pe(t.el,fe[0],me,ge),pe(t.el,de,me,ge),t.st.style.pointerEvents="none")}function we(){var t=ye.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,ce(t.el,fe[0],me,ge),ce(t.el,de,me,ge),t.st.style.pointerEvents="")}var xe={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:ve,be.call(this),this.element===ve?window.pageYOffset||ve.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(t,e,n,r){t.scrollTop=h(e,n,r)>>0})},onComplete:function(t){we.call(this)}},Se={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:h},functions:xe,Util:{preventScroll:me,scrollIn:be,scrollOut:we,scrollContainer:ve,passiveHandler:ge,getScrollTargets:ye}};c.ScrollProperty=Se;var Me=["boxShadow","textShadow"];function Te(t,e){var n,r;for(3===t.length?n=[t[0],t[1],0,0,t[2],"none"]:4===t.length?n=/inset|none/.test(t[3])?[t[0],t[1],0,0,t[2],t[3]]:[t[0],t[1],t[2],0,t[3],"none"]:5===t.length?n=/inset|none/.test(t[4])?[t[0],t[1],t[2],0,t[3],t[4]]:[t[0],t[1],t[2],t[3],t[4],"none"]:6===t.length&&(n=t),r=0;r<4;r++)n[r]=parseFloat(n[r]);return n[4]=lt(n[4]),n="boxShadow"===e?n:n.filter((function(t,e){return[0,1,2,4].indexOf(e)>-1}))}function Ee(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){for(var a=[],s="textShadow"===t?3:4,o=3===s?n[3]:n[4],l=3===s?r[3]:r[4],u=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",p=0;p>0)/1e3+"px");e.style[t]=u?ut(o,l,i)+a.join(" ")+u:ut(o,l,i)+a.join(" ")})}var _e={};Me.map((function(t){return _e[t]=Ee}));var Ce={component:"shadowProperties",properties:Me,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:h,colors:ut},functions:{prepareStart:function(t,n){var r=m(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(r)?e[t]:r},prepareProperty:function(t,e){if("string"==typeof e){var n,r="none";r=/inset/.test(e)?"inset":r,n=(e=/inset/.test(e)?e.replace(/(\s+inset|inset+\s)/g,""):e).match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi),e=Te(e=e.replace(n[0],"").split(" ").concat([n[0].replace(/\s/g,"")],[r]),t)}else e instanceof Array&&(e=Te(e,t));return e},onStart:_e},Util:{processShadowArray:Te,trueColor:lt}};c.ShadowProperties=Ce;var ke=["fontSize","lineHeight","letterSpacing","wordSpacing"],Ie={};function Pe(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=f(n.v,r.v,r.u,i)})}ke.forEach((function(t){Ie[t]=Pe}));var Oe={component:"textProperties",category:"textProps",properties:ke,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:f},functions:{prepareStart:function(t){return m(this.element,t)||e[t]},prepareProperty:function(t,e){return Q(e)},onStart:Ie},Util:{trueDimension:Q}};function Ae(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function Le(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,p=void 0;s,./?=-").split(""),Ve=String("0123456789").split(""),Re=Ue.concat(Fe,Ve),He=Re.concat(je),Ne={alpha:Ue,upper:Fe,symbols:je,numeric:Ve,alphanumeric:Re,all:He};var qe={text:function(t){if(!T[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in Ne?Ne[e]:e&&e.length?e:Ne[n.textChars];T[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(t,e,n,r){t.innerHTML=h(e,n,r)>>0})}},De={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:h},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:qe},Util:{charSet:Ne,createTextTweens:function(t,e,n){if(!t.playing){var r=V.Tween;(n=n||{}).duration="auto"===n.duration?"auto":isFinite(1*n.duration)?1*n.duration:1e3;var i=function(t,e){var n=Le(t,"text-part"),r=Le(Ae(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],p=0;return(u=(u=u.concat(o.map((function(t,e){return n.duration="auto"===n.duration?75*a[e].innerHTML.length:n.duration,n.delay=p,n.onComplete=null,p+=n.duration,new r(t,{text:t.innerHTML},{text:""},n)})))).concat(l.map((function(i,a){return n.duration="auto"===n.duration?75*s[a].innerHTML.length:n.duration,n.delay=p,n.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,p+=n.duration,new r(i,{text:""},{text:s[a].innerHTML},n)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};c.TextWriteProperties=De;var Be="undefined"!=typeof DOMMatrix?DOMMatrix:"undefined"!=typeof WebKitCSSMatrix?WebKitCSSMatrix:"undefined"!=typeof CSSMatrix?CSSMatrix:"undefined"!=typeof MSCSSMatrix?MSCSSMatrix:null;var Xe={component:"transformMatrix",property:"transform",defaultValue:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,skew:[0,0],skewX:0,skewY:0,scale3d:[1,1,1],scaleX:1,scaleY:1,scaleZ:1},functions:{prepareStart:function(t,n){var r={};if(this.element.transformMatrix){var i=this.element.transformMatrix;for(var a in i)r[a]=i[a]}else for(var s in n)r[s]="perspective"===s?n[s]:e.transform[s];return r},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n={},r={},i={},a={},s={},o=[{translate3d:r},{rotate3d:i},{skew:s},{scale3d:a}],l=function(t){if(/3d/.test(t)&&"object"==typeof e[t]&&e[t].length){var o=e[t].map((function(e){return"scale3d"===t?parseFloat(e):parseInt(e)}));n[t]="scale3d"===t?[o[0]||1,o[1]||1,o[2]||1]:[o[0]||0,o[1]||0,o[2]||0]}else if(/[XYZ]/.test(t)){(/translate/.test(t)?r:/rotate/.test(t)?i:/scale/.test(t)?a:/skew/.test(t)?s:{})[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t])}else if("skew"===t){var l=e[t].map((function(t){return parseInt(t)||0}));n[t]=[l[0]||0,l[1]||0]}else n[t]=parseInt(e[t])};for(var u in e)l(u);return o.map((function(t){var e=Object.keys(t)[0],r=t[e];Object.keys(r).length&&!n[e]&&(n[e]="scale3d"===e?[r.x||1,r.y||1,r.z||1]:"skew"===e?[r.x||0,r.y||0]:[r.x||0,r.y||0,r.z||0])})),n}console.error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){var a=new Be,s={};for(var o in r)s[o]="perspective"===o?h(n[o],r[o],i):d(n[o],r[o],i);s.perspective&&(a.m34=-1/s.perspective),a=s.translate3d?a.translate(s.translate3d[0],s.translate3d[1],s.translate3d[2]):a,a=s.rotate3d?a.rotate(s.rotate3d[0],s.rotate3d[1],s.rotate3d[2]):a,s.skew&&(a=s.skew[0]?a.skewX(s.skew[0]):a,a=s.skew[1]?a.skewY(s.skew[1]):a),a=s.scale3d?a.scale(s.scale3d[0],s.scale3d[1],s.scale3d[2]):a,e.style[t]=a.toString()})},CSS3Matrix:function(t){this.valuesEnd.transform&&!T[t]&&(T[t]=Be)}},onComplete:function(t){if(this.valuesEnd[t])for(var e in this.element.transformMatrix={},this.valuesEnd[t])this.element.transformMatrix[e]=this.valuesEnd[t][e]},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:h,translate3d:d,rotate3d:d,skew:d,scale3d:d}};for(var ze in c.TransformMatrix=Xe,c){var Ye=c[ze];c[ze]=new Y(Ye)}return{Animation:Y,Components:c,TweenExtra:N,fromTo:function(t,e,n,r){return r=r||{},new X(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new B(j(t),e,e,n)},TweenCollection:q,ProgressBar:D,allFromTo:function(t,e,n,r){return r=r||{},new q(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new q(j(t,!0),e,e,n)},Objects:u,Util:p,Easing:F,CubicBezier:U,Render:P,Interpolate:v,Process:w,Internals:L,Selector:j,Version:"2.0.1"}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).KUTE=e()}(this,(function(){"use strict";var t={},e={},n={duration:700,delay:0,easing:"linear"},r={},i={},a={},s={},o={},l={},u={supportedProperties:t,defaultValues:e,defaultOptions:n,prepareProperty:r,prepareStart:i,crossCheck:a,onStart:s,onComplete:o,linkProperty:l},p={},c={};function h(t,e,n){return(t=+t)+(e-=t)*n}function f(t,e,n,r){return(t=+t)+(e-=t)*r+n}function d(t,e,n){for(var r=[],i=0,a=e.length;i>0)/1e3;return r}var v={numbers:h,units:f,arrays:d};function g(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),n={},r=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(n[i]=r.includes(i)?a.split(","):a)}))})),n}}function m(t,n){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[n]&&!/auto|initial|none|unset/.test(r[n])?r[n]:i[n];if("transform"!==n&&(n in i||n in r))return a||e[n]}function y(n,i){var a="start"===i?this.valuesStart:this.valuesEnd;for(var s in r){var o=r[s],l=t[s];for(var u in o){var p={};for(var c in n)e[c]&&o[c]?a[c]=o[c].call(this,c,n[c]):!e[u]&&"transform"===u&&l.includes(c)?p[c]=n[c]:!e[u]&&l&&l.includes(c)&&(a[c]=o[u].call(this,c,n[c]));Object.keys&&Object.keys(p).length&&(a[u]=o[u].call(this,u,p))}}}function b(){var n={},r=g(this.element);for(var a in this.valuesStart)for(var s in i){var o=i[s];for(var l in o)(l===a&&o[a]||t[s]&&t[s].includes(a))&&(n[a]=o[l].call(this,a,this.valuesStart[a]))}for(var u in r)u in this.valuesStart||(n[u]=r[u]||e[u]);this.valuesStart={},y.call(this,n,"start")}var w={getInlineStyle:g,getStyleForProperty:m,getStartValues:b,prepareObject:y},x=[];function S(t){return x.push(t)}function M(t){var e=x.indexOf(t);-1!==e&&x.splice(e,1)}var T={},E="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var C=0,k=function(t){for(var e=0;e(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var F={linear:new U(0,0,1,1,"linear"),easingSinusoidalIn:new U(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new U(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new U(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new U(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new U(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new U(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new U(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new U(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new U(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new U(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new U(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new U(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new U(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new U(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new U(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new U(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new U(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new U(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new U(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new U(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new U(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new U(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new U(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new U(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}p.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof F[t])return F[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new U(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),F.linear};var V={},R=function(t,e,r,i){for(var a in this.element=t,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=e,i=i||{},this._resetStart=i.resetStart||0,this._easing="function"==typeof i.easing?i.easing:p.processEasing(i.easing),this._duration=i.duration||n.duration,this._delay=i.delay||n.delay,i){var o="_"+a;o in this||(this[o]=i[a])}var l=this._easing.name;return s[l]||(s[l]=function(t){!T[t]&&t===this._easing.name&&(T[t]=this._easing)}),this};R.prototype.start=function(t){if(S(this),this.playing=!0,this._startTime=t||T.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),s)if("function"==typeof s[e])s[e].call(this,e);else for(var n in s[e])s[e][n].call(this,n);A.call(this),this._startFired=!0}return!C&&k(),this},R.prototype.stop=function(){return this.playing&&(M(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},R.prototype.close=function(){for(var t in o)for(var e in o[t])o[t][e].call(this,e);this._startFired=!1,I.call(this)},R.prototype.update=function(t){var e,n;if((t=void 0!==t?t:T.Time())1?1:e,n=this._easing(e),this.valuesEnd)T[r](this.element,this.valuesStart[r],this.valuesEnd[r],n);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},V.Tween=R,n.repeat=0,n.repeatDelay=0,n.yoyo=!1,n.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var i=e[1],s=e[2];if(y.call(this,s,"end"),this._resetStart?this.valuesStart=i:y.call(this,i,"start"),!this._resetStart)for(var o in a)for(var l in a[o])a[o][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||n.repeat,this._repeatDelay=u.repeatDelay||n.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||n.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,b.call(this),a)for(var r in a[n])a[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=T.Time()-this._pauseTime,S(this),!C&&k()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=T.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,n;if((t=void 0!==t?t:T.Time())1?1:e,n=this._easing(e),this.valuesEnd)T[r](this.element,this.valuesStart[r],this.valuesEnd[r],n);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(R);V.Tween=H;var N=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.apply(this,e),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.to=function(t,e){},e.prototype.fromTo=function(t,e){},e.prototype.getTotalDuration=function(){},e.prototype.callback=function(t,e){["start","stop","update","complete","pause","resume"].indexOf(t)>-1&&(this["_on"+(t.charAt(0).toUpperCase()+t.slice(1))]=e)},e.prototype.option=function(t,e){this["_"+t]=e},e}(H);V.Tween=N;var q=V.Tween,D=function(t,e,r,i){var a=this;this.tweens=[],!("offset"in n)&&(n.offset=0),(i=i||{}).delay=i.delay||n.delay;var s=[];return Array.from(t).map((function(t,o){s[o]=i||{},s[o].delay=o>0?i.delay+(i.offset||n.offset):i.delay,t instanceof Element?a.tweens.push(new q(t,e,r,s[o])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};D.prototype.start=function(t){return t=void 0===t?T.Time():t,this.tweens.map((function(e){return e.start(t)})),this},D.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},D.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},D.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},D.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof D)e.chain(t.tweens);else{if(!(t instanceof q))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},D.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},D.prototype.removeTweens=function(){this.tweens=[]},D.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var B=function(t,e){if(this.element=j(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,this.element.output=this.element.parentNode.getElementsByTagName("OUTPUT")[0],!(this.element instanceof HTMLInputElement))throw TypeError("Target element is not [HTMLInputElement]");if("range"!==this.element.type)throw TypeError("Target element is not a range input");if(!(e instanceof V.Tween))throw TypeError("tween parameter is not ["+V+"]");this.element.setAttribute("value",0),this.element.setAttribute("min",0),this.element.setAttribute("max",1),this.element.setAttribute("step",1e-4),this.element.tween._onUpdate=this.updateBar,this.element.addEventListener("mousedown",this.downAction,!1)};B.prototype.updateBar=function(){var t=this.toolbar.output,e=this.paused?this.toolbar.value:(T.Time()-this._startTime)/this._duration;e=e>.9999?1:e<.01?0:e;var n=this._reversed?1-e:e;this.toolbar.value=n,t&&(t.value=(100*n).toFixed(2)+"%")},B.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},B.prototype.updateTween=function(){var t=(this.tween._reversed?1-this.value:this.value)*this.tween._duration-1e-4;this.tween._startTime=0,this.tween.update(t)},B.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},B.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),T.Tick=cancelAnimationFrame(T.Ticker))},B.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=T.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),T.Tick=requestAnimationFrame(T.Ticker))};var X=function(n){try{n.component in t?console.error("KUTE.js - "+n.component+" already registered"):n.property in e?console.error("KUTE.js - "+n.property+" already registered"):this.setComponent(n)}catch(t){console.error(t)}};X.prototype.setComponent=function(u){var c=u.component,h={prepareProperty:r,prepareStart:i,onStart:s,onComplete:o,crossCheck:a},f=u.category,d=u.property,g=u.properties&&u.properties.length||u.subProperties&&u.subProperties.length;if(t[c]=u.properties||u.subProperties||u.property,"defaultValue"in u)e[d]=u.defaultValue,this.supports=d+" property";else if(u.defaultValues){for(var m in u.defaultValues)e[m]=u.defaultValues[m];this.supports=(g||d)+" "+(d||f)+" properties"}if(u.defaultOptions)for(var y in u.defaultOptions)n[y]=u.defaultOptions[y];if(u.functions)for(var b in h)if(b in u.functions)if("function"==typeof u.functions[b])!h[b][c]&&(h[b][c]={}),!h[b][c][f||d]&&(h[b][c][f||d]=u.functions[b]);else for(var w in u.functions[b])!h[b][c]&&(h[b][c]={}),!h[b][c][w]&&(h[b][c][w]=u.functions[b][w]);if(u.Interpolate){for(var x in u.Interpolate){var S=u.Interpolate[x];if("function"!=typeof S||v[x])for(var M in S)"function"!=typeof S[M]||v[x]||(v[x]=S[M]);else v[x]=S}l[c]=u.Interpolate}if(u.Util)for(var T in u.Util)!p[T]&&(p[T]=u.Util[T]);return this};var z=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];t.apply(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setComponent=function(e){t.prototype.setComponent.call(this,e);var n={prepareProperty:r,prepareStart:i,onStart:s,onComplete:o,crossCheck:a},l=e.category,u=e.property,p=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;if("defaultValue"in e?(this.supports=u+" property",this.defaultValue=(e.defaultValue+"").length?"YES":"not set or incorrect"):e.defaultValues&&(this.supports=(p||u)+" "+(u||l)+" properties",this.defaultValues=Object.keys(e.defaultValues).length===p?"YES":"Not set or incomplete"),e.defaultOptions){for(var c in this.extends=[],e.defaultOptions)this.extends.push(c);this.extends.length?this.extends="with <"+this.extends.join(", ")+"> new option(s)":delete this.extends}if(e.functions){for(var h in this.interface=[],this.render=[],this.warning=[],n)h in e.functions?("prepareProperty"===h&&this.interface.push("fromTo()"),"prepareStart"===h&&this.interface.push("to()"),"onStart"===h&&(this.render="can render update")):("prepareProperty"===h&&this.warning.push("fromTo()"),"prepareStart"===h&&this.warning.push("to()"),"onStart"===h&&(this.render="no function to render update"));this.interface.length?this.interface=(l||u)+" can use ["+this.interface.join(", ")+"] method(s)":delete this.uses,this.warning.length?this.warning=(l||u)+" can't use ["+this.warning.join(", ")+"] method(s) because values aren't processed":delete this.warning}if(e.Interpolate){for(var f in this.uses=[],this.adds=[],e.Interpolate){var d=e.Interpolate[f];if("function"==typeof d)v[f]||this.adds.push(""+f),this.uses.push(""+f);else for(var g in d)"function"!=typeof d[g]||v[f]||this.adds.push(""+g),this.uses.push(""+g)}this.uses.length?this.uses="["+this.uses.join(", ")+"] interpolation function(s)":delete this.uses,this.adds.length?this.adds="new ["+this.adds.join(", ")+"] interpolation function(s)":delete this.adds}else this.critical="For "+(u||l)+" no interpolation function[s] is set";return e.Util&&(this.hasUtil=Object.keys(e.Util).join(",")),this},e}(X);function Y(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a>0)/100+"% "+(100*h(n[1],r[1],i)>>0)/100+"%"})}},W={component:"BgPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:h},functions:Q,Util:{trueDimension:Y}};c.BackgroundPositionProperty=W;var K=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],G={};function $(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=f(n.v,r.v,r.u,i)})}K.map((function(t){return G[t]=0}));var Z={};K.forEach((function(t){Z[t]=$}));var J={component:"borderRadiusProps",category:"borderRadius",properties:K,defaultValues:G,Interpolate:{units:f},functions:{prepareStart:function(t){return m(this.element,t)||e[t]},prepareProperty:function(t,e){return Y(e)},onStart:Z},Util:{trueDimension:Y}};c.BorderRadiusProperties=J;var tt=["top","left","width","height","right","bottom","minWidth","minHeight","maxWidth","maxHeight","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","margin","marginTop","marginBottom","marginLeft","marginRight","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","outlineWidth"],et={};function nt(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=(i>.99||i<.01?(10*h(n,r,i)>>0)/10:h(n,r,i)>>0)+"px"})}tt.map((function(t){return et[t]=0}));var rt={};tt.map((function(t){return rt[t]=nt}));var it={component:"boxModelProps",category:"boxModel",properties:tt,defaultValues:et,Interpolate:{numbers:h},functions:{prepareStart:function(t){return m(this.element,t)||e[t]},prepareProperty:function(t,e){var n=Y(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:rt}};c.BoxModelProperties=it;var at={prepareStart:function(t,e){var n=m(this.element,t),r=m(this.element,"width"),i=m(this.element,"height");return/rect/.test(n)?n:[0,r,i,0]},prepareProperty:function(t,e){if(e instanceof Array)return[Y(e[0]),Y(e[1]),Y(e[2]),Y(e[3])];var n=e.replace(/rect|\(|\)/g,"");return[Y((n=/\,/g.test(n)?n.split(/\,/g):n.split(/\s/g))[0]),Y(n[1]),Y(n[2]),Y(n[3])]},onStart:function(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(t,e,n,r){for(var i=0,a=[];i<4;i++){var s=e[i].v,o=n[i].v,l=n[i].u||"px";a[i]=(100*h(s,o,r)>>0)/100+l}t.style.clip="rect("+a+")"})}},st={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:h},functions:at,Util:{trueDimension:Y}};function ot(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function lt(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?h(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*h(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}c.ClipProperty=st;var ut=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],pt={};function ct(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=lt(n,r,i)})}ut.forEach((function(t){pt[t]="#000"}));var ht={};ut.map((function(t){return ht[t]=ct}));var ft={component:"colorProps",category:"colors",properties:ut,defaultValues:pt,Interpolate:{numbers:h,colors:lt},functions:{prepareStart:function(t,n){return m(this.element,t)||e[t]},prepareProperty:function(t,e){return ot(e)},onStart:ht},Util:{trueColor:ot}};c.ColorProperties=ft;var dt=["fill","stroke","stop-color"],vt={};function gt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var mt={prepareStart:function(t,e){var n={};for(var r in e){var i=gt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=dt.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,n){var r={};for(var i in n){var a=gt(i),o=/(%|[a-z]+)$/,l=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(dt.includes(a))s.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in vt)&&(vt[e]=function(t,e,n,r,i){t.setAttribute(e,lt(n,r,i))})},r[a]=ot(n[i])||e.htmlAttributes[i];else if(null!==l&&o.test(l)){var u=Y(l).u||Y(n[i]).u,p=/%/.test(u)?"_percent":"_"+u;s.htmlAttributes[a+p]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in vt)&&(vt[e]=function(t,e,n,r,i){var a=e.replace(p,"");t.setAttribute(a,(1e3*h(n.v,r.v,i)>>0)/1e3+r.u)})},r[a+p]=Y(n[i])}else o.test(n[i])&&null!==l&&(null===l||o.test(l))||(s.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in vt)&&(vt[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*h(n,r,i)>>0)/1e3)})},r[a]=parseFloat(n[i]))}return r},onStart:{attr:function(t){!T[t]&&this.valuesEnd[t]&&(T[t]=function(t,e,n,r){for(var i in n)T.attributes[i](t,i,e[i],n[i],r)})},attributes:function(t){!T[t]&&this.valuesEnd.attr&&(T[t]=vt)}}},yt={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:h,colors:lt},functions:mt,Util:{replaceUppercase:gt,trueColor:ot,trueDimension:Y}};function bt(t,e,n){for(var r=[],i=0;i<3;i++)r[i]=(100*h(t[i],e[i],n)>>0)/100+"px";return"drop-shadow("+r.concat(lt(t[3],e[3],n)).join(" ")+")"}function wt(t){return t.replace("-r","R").replace("-s","S")}function xt(t){var e;3===t.length?e=[t[0],t[1],0,t[2]]:4===t.length&&(e=[t[0],t[1],t[2],t[3]]);for(var n=0;n<3;n++)e[n]=parseFloat(e[n]);return e[3]=ot(e[3]),e}function St(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var i=0,a=r.length;i>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*h(n.blur,r.blur,i)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*h(n.saturate,r.saturate,i)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*h(n.invert,r.invert,i)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*h(n.grayscale,r.grayscale,i)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*h(n.hueRotate,r.hueRotate,i)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*h(n.sepia,r.sepia,i)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*h(n.brightness,r.brightness,i)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*h(n.contrast,r.contrast,i)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?bt(n.dropShadow,r.dropShadow,i):"")})},crossCheck:function(t){if(this.valuesEnd[t])for(var e in this.valuesStart[t])this.valuesEnd[t][e]||(this.valuesEnd[t][e]=this.valuesStart[t][e])}},Tt={component:"filterEffects",property:"filter",defaultValue:{opacity:100,blur:0,saturate:100,grayscale:0,brightness:100,contrast:100,sepia:0,invert:0,hueRotate:0,dropShadow:[0,0,0,{r:0,g:0,b:0}],url:""},Interpolate:{opacity:h,blur:h,saturate:h,grayscale:h,brightness:h,contrast:h,sepia:h,invert:h,hueRotate:h,dropShadow:{numbers:h,colors:lt,dropShadow:bt}},functions:Mt,Util:{parseDropShadow:xt,parseFilterString:St,replaceDashNamespace:wt,trueColor:ot}};c.FilterEffects=Tt;var Et={prepareStart:function(t){return m(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=(1e3*h(n,r,i)>>0)/1e3})}},_t={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:h},functions:Et};c.OpacityProperty=_t;var Ct=function(t,e){return parseFloat(t)/100*e},kt=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},It=function(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*h(e.s,n.s,r)>>0)/100,s=(100*h(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var jt={prepareStart:function(){return Ut(this.element)},prepareProperty:function(t,e){return Ut(this.element,e)},onStart:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(t,e,n,r){return Ft(t,e,n,r)})}},Vt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:h,paintDraw:Ft},functions:jt,Util:{getRectLength:kt,getPolyLength:It,getLineLength:Pt,getCircleLength:Ot,getEllipseLength:At,getTotalLength:Lt,getDraw:Ut,percent:Ct}};c.SVGDraw=Vt;function Rt(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4==r?a[3]={x:+t[0],y:+t[1]}:i-2==r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4==r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}function Ht(t,e,n,r,i){var a;if(null==i&&null==r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!=i){var s=Math.PI/180,o=t+n*Math.cos(-r*s),l=t+n*Math.cos(-i*s);a=[["M",o,e+n*Math.sin(-r*s)],["A",n,n,0,+(i-r>180),0,l,e+n*Math.sin(-i*s)]]}else a=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return a}function Nt(t){if(!t)return null;if(t instanceof Array)return t;var e="\\"+"x09|x0a|x0b|x0c|x0d|x20|xa0|u1680|u180e|u2000|u2001|u2002|u2003|u2004|u2005|u2006|u2007|u2008|u2009|u200a|u202f|u205f|u3000|u2028|u2029".split("|").join("\\"),n=new RegExp("([a-z])["+e+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+e+"]*,?["+e+"]*)+)","ig"),r=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+e+"]*,?["+e+"]*","ig"),i={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},a=[];return t.replace(n,(function(t,e,n){var s=[],o=e.toLowerCase();if(n.replace(r,(function(t,e){e&&s.push(+e)})),"m"==o&&s.length>2&&(a.push([e].concat(s.splice(0,2))),o="l",e="m"==e?"l":"L"),"o"==o&&1==s.length&&a.push([e,s[0]]),"r"==o)a.push([e].concat(s));else for(;s.length>=i[o]&&(a.push([e].concat(s.splice(0,i[o]))),i[o]););})),a}function qt(t){if(!(t=Nt(t))||!t.length)return[["M",0,0]];var e,n=[],r=0,i=0,a=0,s=0,o=0;"M"===t[0][0]&&(a=r=+t[0][1],s=i=+t[0][2],o++,n[0]=["M",r,i]);for(var l=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),u=void 0,p=void 0,c=o,h=t.length;c1&&(n*=x=Math.sqrt(x),r*=x);var S=n*n,M=r*r,T=(a==s?-1:1)*Math.sqrt(Math.abs((S*M-S*w*w-M*b*b)/(S*w*w+M*b*b)));f=T*n*w/r+(t+o)/2,d=T*-r*b/n+(e+l)/2,c=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((l-d)/r).toFixed(9)),c=th&&(c-=2*Math.PI),!s&&h>c&&(h-=2*Math.PI)}var E=h-c;if(Math.abs(E)>v){var _=h,C=o,k=l;h=c+v*(s&&h>c?1:-1),m=Xt(o=f+n*Math.cos(h),l=d+r*Math.sin(h),n,r,i,0,s,C,k,[h,_,f,d])}E=h-c;var I=Math.cos(c),P=Math.sin(c),O=Math.cos(h),A=Math.sin(h),L=Math.tan(E/4),U=4/3*n*L,F=4/3*r*L,j=[t,e],V=[t+U*P,e-F*I],R=[o+U*A,l-F*O],H=[o,l];if(V[0]=2*j[0]-V[0],V[1]=2*j[1]-V[1],u)return[V,R,H].concat(m);for(var N=[],q=0,D=(m=[V,R,H].concat(m).join().split(",")).length;q7){t[i].shift();for(var a=t[i];a.length;)n[i]="A",e&&(r[i]="A"),t.splice(i++,0,["C"].concat(a.splice(0,6)));t.splice(i,1)}}function Wt(t,e){for(var n=qt(t),r=e&&qt(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],o=[],l="",u="",p=0,c=Math.max(n.length,r&&r.length||0);p0?r-s:r].seg,e[s]=[a[0],a[5],a[6],a[3],a[4],a[1],a[2]])})),e}function Zt(t,e){var n=[],r=t.length,i=r-1;return t.map((function(a,s){var o=e+s;0===s||t[o]&&"M"===t[o].seg[0]?n[s]=["M",t[o].x,t[o].y]:(o>=r&&(o-=i),n[s]=t[o].seg)})),n}function Jt(t){var e=Gt(t),n=[];return e.map((function(t,r){n[r]=Zt(e,r)})),n}function te(t,e){var n=Gt(t),r=Gt(e),i=n.length-1,a=[],s=[],o=Jt(t);return o.map((function(t,e){for(var o=0,l=Kt("M0,0L0,0"),u=0;u>0)/1e3)}t.setAttribute("d",1===r?n.original:ee(i))})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].curve,n=this.valuesEnd[t].curve;if(!e||!n||e&&n&&"M"===e[0][0]&&e.length!==n.length){var r=Wt(this.valuesStart[t].original,this.valuesEnd[t].original),i=this._reverseFirstPath?$t.call(this,r[0]):r[0],a=this._reverseSecondPath?$t.call(this,r[1]):r[1];i=te.call(this,i,a),this.valuesStart[t].curve=i,this.valuesEnd[t].curve=a}}}},re={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:h,toPathString:ee},functions:ne,Util:{l2c:Dt,q2c:Bt,a2c:Xt,catmullRom2bezier:Rt,ellipsePath:Ht,path2curve:Wt,pathToAbsolute:qt,toPathString:ee,parsePathString:Nt,getRotatedCurve:te,getRotations:Jt,getRotationSegments:Zt,reverseCurve:$t,getSegments:Gt,createPath:Kt}};function ie(t,e){var n=e.x,r=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?n+parseFloat(t)*r/100:parseFloat(t)}function ae(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",n={};if(e instanceof Array)for(var r=0,i=e.length;r>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(f?"skewX("+(1e3*f>>0)/1e3+")":"")+(d?"skewY("+(1e3*d>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=se.call(this,t,ae(this.element.getAttribute("transform")));for(var i in r)e[i]=r[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in n&&"origin"!==o||(n[o]=e[o])}}},le={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:h},functions:oe,Util:{parseStringOrigin:ie,parseTransformString:ae,parseTransformSVG:se}};function ue(t,e,n,r){r=r||!1,t.addEventListener(e,n,r)}function pe(t,e,n,r){r=r||!1,t.removeEventListener(e,n,r)}c.SVGTransformProperty=le;var ce=function(){var t,e,n,r,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,n=function(){},ue(t,e="DOMContentLoaded",(function i(a){a.target===t&&(n(a),pe(t,e,i,r))}),r=a)}catch(t){}return i}(),he="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],fe="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",de=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,ve=!!ce&&{passive:!1};function ge(t){this.scrolling&&t.preventDefault()}function me(){var t=this.element;return t===de?{el:document,st:document.body}:{el:t,st:t}}function ye(){var t=me.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,ue(t.el,he[0],ge,ve),ue(t.el,fe,ge,ve),t.st.style.pointerEvents="none")}function be(){var t=me.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,pe(t.el,he[0],ge,ve),pe(t.el,fe,ge,ve),t.st.style.pointerEvents="")}var we={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:de,ye.call(this),this.element===de?window.pageYOffset||de.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(t,e,n,r){t.scrollTop=h(e,n,r)>>0})},onComplete:function(t){be.call(this)}},xe={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:h},functions:we,Util:{preventScroll:ge,scrollIn:ye,scrollOut:be,scrollContainer:de,passiveHandler:ve,getScrollTargets:me}};c.ScrollProperty=xe;var Se=["boxShadow","textShadow"];function Me(t,e){var n,r;for(3===t.length?n=[t[0],t[1],0,0,t[2],"none"]:4===t.length?n=/inset|none/.test(t[3])?[t[0],t[1],0,0,t[2],t[3]]:[t[0],t[1],t[2],0,t[3],"none"]:5===t.length?n=/inset|none/.test(t[4])?[t[0],t[1],t[2],0,t[3],t[4]]:[t[0],t[1],t[2],t[3],t[4],"none"]:6===t.length&&(n=t),r=0;r<4;r++)n[r]=parseFloat(n[r]);return n[4]=ot(n[4]),n="boxShadow"===e?n:n.filter((function(t,e){return[0,1,2,4].indexOf(e)>-1}))}function Te(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){for(var a=[],s="textShadow"===t?3:4,o=3===s?n[3]:n[4],l=3===s?r[3]:r[4],u=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",p=0;p>0)/1e3+"px");e.style[t]=u?lt(o,l,i)+a.join(" ")+u:lt(o,l,i)+a.join(" ")})}var Ee={};Se.map((function(t){return Ee[t]=Te}));var _e={component:"shadowProperties",properties:Se,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:h,colors:lt},functions:{prepareStart:function(t,n){var r=m(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(r)?e[t]:r},prepareProperty:function(t,e){if("string"==typeof e){var n,r="none";r=/inset/.test(e)?"inset":r,n=(e=/inset/.test(e)?e.replace(/(\s+inset|inset+\s)/g,""):e).match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi),e=Me(e=e.replace(n[0],"").split(" ").concat([n[0].replace(/\s/g,"")],[r]),t)}else e instanceof Array&&(e=Me(e,t));return e},onStart:Ee},Util:{processShadowArray:Me,trueColor:ot}};c.ShadowProperties=_e;var Ce=["fontSize","lineHeight","letterSpacing","wordSpacing"],ke={};function Ie(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){e.style[t]=f(n.v,r.v,r.u,i)})}Ce.forEach((function(t){ke[t]=Ie}));var Pe={component:"textProperties",category:"textProps",properties:Ce,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:f},functions:{prepareStart:function(t){return m(this.element,t)||e[t]},prepareProperty:function(t,e){return Y(e)},onStart:ke},Util:{trueDimension:Y}};function Oe(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function Ae(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,p=void 0;s,./?=-").split(""),je=String("0123456789").split(""),Ve=Le.concat(Ue,je),Re=Ve.concat(Fe),He={alpha:Le,upper:Ue,symbols:Fe,numeric:je,alphanumeric:Ve,all:Re};var Ne={text:function(t){if(!T[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in He?He[e]:e&&e.length?e:He[n.textChars];T[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!T[t]&&(T[t]=function(t,e,n,r){t.innerHTML=h(e,n,r)>>0})}},qe={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:h},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:Ne},Util:{charSet:He,createTextTweens:function(t,e,n){if(!t.playing){var r=V.Tween;(n=n||{}).duration="auto"===n.duration?"auto":isFinite(1*n.duration)?1*n.duration:1e3;var i=function(t,e){var n=Ae(t,"text-part"),r=Ae(Oe(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],p=0;return(u=(u=u.concat(o.map((function(t,e){return n.duration="auto"===n.duration?75*a[e].innerHTML.length:n.duration,n.delay=p,n.onComplete=null,p+=n.duration,new r(t,{text:t.innerHTML},{text:""},n)})))).concat(l.map((function(i,a){return n.duration="auto"===n.duration?75*s[a].innerHTML.length:n.duration,n.delay=p,n.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,p+=n.duration,new r(i,{text:""},{text:s[a].innerHTML},n)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};c.TextWriteProperties=qe;var De="undefined"!=typeof DOMMatrix?DOMMatrix:"undefined"!=typeof WebKitCSSMatrix?WebKitCSSMatrix:"undefined"!=typeof CSSMatrix?CSSMatrix:"undefined"!=typeof MSCSSMatrix?MSCSSMatrix:null;var Be={component:"transformMatrix",property:"transform",defaultValue:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,skew:[0,0],skewX:0,skewY:0,scale3d:[1,1,1],scaleX:1,scaleY:1,scaleZ:1},functions:{prepareStart:function(t,n){var r={};if(this.element.transformMatrix){var i=this.element.transformMatrix;for(var a in i)r[a]=i[a]}else for(var s in n)r[s]="perspective"===s?n[s]:e.transform[s];return r},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n={},r={},i={},a={},s={},o=[{translate3d:r},{rotate3d:i},{skew:s},{scale3d:a}],l=function(t){if(/3d/.test(t)&&"object"==typeof e[t]&&e[t].length){var o=e[t].map((function(e){return"scale3d"===t?parseFloat(e):parseInt(e)}));n[t]="scale3d"===t?[o[0]||1,o[1]||1,o[2]||1]:[o[0]||0,o[1]||0,o[2]||0]}else if(/[XYZ]/.test(t)){(/translate/.test(t)?r:/rotate/.test(t)?i:/scale/.test(t)?a:/skew/.test(t)?s:{})[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t])}else if("skew"===t){var l=e[t].map((function(t){return parseInt(t)||0}));n[t]=[l[0]||0,l[1]||0]}else n[t]=parseInt(e[t])};for(var u in e)l(u);return o.map((function(t){var e=Object.keys(t)[0],r=t[e];Object.keys(r).length&&!n[e]&&(n[e]="scale3d"===e?[r.x||1,r.y||1,r.z||1]:"skew"===e?[r.x||0,r.y||0]:[r.x||0,r.y||0,r.z||0])})),n}console.error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(t){this.valuesEnd[t]&&!T[t]&&(T[t]=function(e,n,r,i){var a=new De,s={};for(var o in r)s[o]="perspective"===o?h(n[o],r[o],i):d(n[o],r[o],i);s.perspective&&(a.m34=-1/s.perspective),a=s.translate3d?a.translate(s.translate3d[0],s.translate3d[1],s.translate3d[2]):a,a=s.rotate3d?a.rotate(s.rotate3d[0],s.rotate3d[1],s.rotate3d[2]):a,s.skew&&(a=s.skew[0]?a.skewX(s.skew[0]):a,a=s.skew[1]?a.skewY(s.skew[1]):a),a=s.scale3d?a.scale(s.scale3d[0],s.scale3d[1],s.scale3d[2]):a,e.style[t]=a.toString()})},CSS3Matrix:function(t){this.valuesEnd.transform&&!T[t]&&(T[t]=De)}},onComplete:function(t){if(this.valuesEnd[t])for(var e in this.element.transformMatrix={},this.valuesEnd[t])this.element.transformMatrix[e]=this.valuesEnd[t][e]},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:h,translate3d:d,rotate3d:d,skew:d,scale3d:d}};for(var Xe in c.TransformMatrix=Be,c){var ze=c[Xe];c[Xe]=new z(ze)}return{Animation:z,Components:c,TweenExtra:N,fromTo:function(t,e,n,r){return r=r||{},new V.Tween(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new V.Tween(j(t),e,e,n)},TweenCollection:D,ProgressBar:B,allFromTo:function(t,e,n,r){return r=r||{},new D(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new D(j(t,!0),e,e,n)},Objects:u,Util:p,Easing:F,CubicBezier:U,Render:P,Interpolate:v,Process:w,Internals:L,Selector:j,Version:"2.0.1"}})); diff --git a/demo/src/kute.min.js b/demo/src/kute.min.js index e9051a5..af59aa3 100644 --- a/demo/src/kute.min.js +++ b/demo/src/kute.min.js @@ -1,2 +1,2 @@ // KUTE.js Standard v2.0.1 | thednp © 2020 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).KUTE=e()}(this,(function(){"use strict";var t={},e={},r={},n={},i={duration:700,delay:0,easing:"linear"},a={},s={},o={},l={},u={},c={},p={supportedProperties:r,defaultValues:n,defaultOptions:i,prepareProperty:a,prepareStart:s,crossCheck:o,onStart:l,onComplete:u,linkProperty:c};function h(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),r={},n=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(r[i]=n.includes(i)?a.split(","):a)}))})),r}}function f(t,e){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[e]&&!/auto|initial|none|unset/.test(r[e])?r[e]:i[e];if("transform"!==e&&(e in i||e in r))return a||n[e]}function d(t,e){var i="start"===e?this.valuesStart:this.valuesEnd;for(var s in a){var o=a[s],l=r[s];for(var u in o){var c={};for(var p in t)n[p]&&o[p]?i[p]=o[p].call(this,p,t[p]):!n[u]&&"transform"===u&&l.includes(p)?c[p]=t[p]:!n[u]&&l&&l.includes(p)&&(i[p]=o[u].call(this,p,t[p]));Object.keys&&Object.keys(c).length&&(i[u]=o[u].call(this,u,c))}}}function v(){var t={},e=h(this.element);for(var i in this.valuesStart)for(var a in s){var o=s[a];for(var l in o)(l===i&&o[i]||r[a]&&r[a].includes(i))&&(t[i]=o[l].call(this,i,this.valuesStart[i]))}for(var u in e)u in this.valuesStart||(t[u]=e[u]||n[u]);this.valuesStart={},d.call(this,t,"start")}var g={getInlineStyle:h,getStyleForProperty:f,getStartValues:v,prepareObject:d},m=[];function y(t){return m.push(t)}function w(t){var e=m.indexOf(t);-1!==e&&m.splice(e,1)}var b={},T="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function S(t,e,r){return(t=+t)+(e-=t)*r}var x={numbers:S,units:function(t,e,r,n){return(t=+t)+(e-=t)*n+r},arrays:function(t,e,r){for(var n=[],i=0,a=e.length;i>0)/1e3;return n}},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var E=0,C=function(t){for(var e=0;e(r=1))return r;for(;ei?e=n:r=n,n=.5*(r-e)+e}return n};var L={linear:new P(0,0,1,1,"linear"),easingSinusoidalIn:new P(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new P(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new P(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new P(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new P(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new P(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new P(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new P(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new P(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new P(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new P(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new P(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new P(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new P(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new P(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new P(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new P(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new P(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new P(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new P(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new P(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new P(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new P(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new P(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}t.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof L[t])return L[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new P(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),L.linear};var U={},F=function(e,r,n,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=n,this.valuesStart=r,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:t.processEasing(a.easing),this._duration=a.duration||i.duration,this._delay=a.delay||i.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return l[u]||(l[u]=function(t){!b[t]&&t===this._easing.name&&(b[t]=this._easing)}),this};F.prototype.start=function(t){if(y(this),this.playing=!0,this._startTime=t||b.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),l)if("function"==typeof l[e])l[e].call(this,e);else for(var r in l[e])l[e][r].call(this,r);k.call(this),this._startFired=!0}return!E&&C(),this},F.prototype.stop=function(){return this.playing&&(w(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},F.prototype.close=function(){for(var t in u)for(var e in u[t])u[t][e].call(this,e);this._startFired=!1,A.call(this)},F.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},U.Tween=F,i.repeat=0,i.repeatDelay=0,i.yoyo=!1,i.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var n=e[1],a=e[2];if(d.call(this,a,"end"),this._resetStart?this.valuesStart=n:d.call(this,n,"start"),!this._resetStart)for(var s in o)for(var l in o[s])o[s][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||i.repeat,this._repeatDelay=u.repeatDelay||i.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||i.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var r in this.valuesStart=this._resetStart,v.call(this),o)for(var n in o[r])o[r][n].call(this,n);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=b.Time()-this._pauseTime,y(this),!E&&C()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(w(this),this.paused=!0,this._pauseTime=b.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(F);U.Tween=H;var N=function(t,e,r,n){var a=this;this.tweens=[],!("offset"in i)&&(i.offset=0);var s=U.Tween;(n=n||{}).delay=n.delay||i.delay;var o=[];return Array.from(t).map((function(t,l){o[l]=n||{},o[l].delay=l>0?n.delay+(n.offset||i.offset):n.delay,t instanceof Element?a.tweens.push(new s(t,e,r,o[l])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(t){return t=void 0===t?b.Time():t,this.tweens.map((function(e){return e.start(t)})),this},N.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},N.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},N.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},N.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof N)e.chain(t.tweens);else{if(!(t instanceof U))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},N.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},N.prototype.removeTweens=function(){this.tweens=[]},N.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var V=U.Tween;var X=U.Tween;var D=function(t){try{t.component in r?console.error("KUTE.js - "+t.component+" already registered"):t.property in n?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function z(t,e){for(var r,n=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*S(r,n,i)>>0)/10:S(r,n,i)>>0)+"px"})}B.map((function(t){return R[t]=0}));var Q={};B.map((function(t){return Q[t]=Y}));var K={component:"boxModelProps",category:"boxModel",properties:B,defaultValues:R,Interpolate:{numbers:S},functions:{prepareStart:function(t){return f(this.element,t)||n[t]},prepareProperty:function(t,e){var r=z(e),n="height"===t?"offsetHeight":"offsetWidth";return"%"===r.u?r.v*this.element[n]/100:r.v},onStart:Q}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),r=e[3]?e[3]:null;return r?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(r)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var n=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function q(t,e,r){var n,i={};for(n in e)i[n]="a"!==n?S(t[n],e[n],r)>>0||0:t[n]&&e[n]?(100*S(t[n],e[n],r)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}e.BoxModelProperties=K;var W=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],G={};function $(t){this.valuesEnd[t]&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=q(r,n,i)})}W.forEach((function(t){G[t]="#000"}));var J={};W.map((function(t){return J[t]=$}));var tt={component:"colorProps",category:"colors",properties:W,defaultValues:G,Interpolate:{numbers:S,colors:q},functions:{prepareStart:function(t,e){return f(this.element,t)||n[t]},prepareProperty:function(t,e){return Z(e)},onStart:J},Util:{trueColor:Z}};e.ColorProperties=tt;var et=["fill","stroke","stop-color"],rt={};function nt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var it={prepareStart:function(t,e){var r={};for(var n in e){var i=nt(n).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);r[i]=et.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(n)?1:0)}return r},prepareProperty:function(t,e){var r={};for(var i in e){var a=nt(i),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(et.includes(a))l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){t.setAttribute(e,q(r,n,i))})},r[a]=Z(e[i])||n.htmlAttributes[i];else if(null!==o&&s.test(o)){var u=z(o).u||z(e[i]).u,c=/%/.test(u)?"_percent":"_"+u;l.htmlAttributes[a+c]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){var a=e.replace(c,"");t.setAttribute(a,(1e3*S(r.v,n.v,i)>>0)/1e3+n.u)})},r[a+c]=z(e[i])}else s.test(e[i])&&null!==o&&(null===o||s.test(o))||(l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){t.setAttribute(e,(1e3*S(r,n,i)>>0)/1e3)})},r[a]=parseFloat(e[i]))}return r},onStart:{attr:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){for(var i in r)b.attributes[i](t,i,e[i],r[i],n)})},attributes:function(t){!b[t]&&this.valuesEnd.attr&&(b[t]=rt)}}},at={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:S,colors:q},functions:it,Util:{replaceUppercase:nt,trueColor:Z,trueDimension:z}};e.HTMLAttributes=at;var st={prepareStart:function(t){return f(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=(1e3*S(r,n,i)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:S},functions:st};function lt(t,e){var r,n;if("string"==typeof t)return(n=document.createElement("SPAN")).innerHTML=t,n.className=e,n;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(r=document.createElement("SPAN")).className=e,r.innerHTML=i,t.appendChild(r),t.innerHTML=r.outerHTML}else t.children.length&&t.children[0].className===e&&(r=t.children[0]);return r}function ut(t,e){var r=[];if(t.children.length){for(var n,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,c=void 0;s,./?=-").split(""),ft=String("0123456789").split(""),dt=ct.concat(pt,ft),vt=dt.concat(ht),gt={alpha:ct,upper:pt,symbols:ht,numeric:ft,alphanumeric:dt,all:vt};var mt={text:function(t){if(!b[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in gt?gt[e]:e&&e.length?e:gt[i.textChars];b[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.innerHTML=S(e,r,n)>>0})}},yt={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:S},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:mt},Util:{charSet:gt,createTextTweens:function(t,e,r){if(!t.playing){var n=U.Tween;(r=r||{}).duration="auto"===r.duration?"auto":isFinite(1*r.duration)?1*r.duration:1e3;var i=function(t,e){var r=ut(t,"text-part"),n=ut(lt(e),"text-part");return t.innerHTML="",t.innerHTML+=r.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=n.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[r,n]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],c=0;return(u=(u=u.concat(o.map((function(t,e){return r.duration="auto"===r.duration?75*a[e].innerHTML.length:r.duration,r.delay=c,r.onComplete=null,c+=r.duration,new n(t,{text:t.innerHTML},{text:""},r)})))).concat(l.map((function(i,a){return r.duration="auto"===r.duration?75*s[a].innerHTML.length:r.duration,r.delay=c,r.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,c+=r.duration,new n(i,{text:""},{text:s[a].innerHTML},r)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};function wt(t,e,r,n){return"perspective("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function bt(t,e,r,n){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*n)>>0)/1e3:0)+r;return"translate3d("+i.join(",")+")"}function Tt(t,e,r,n){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3+r+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3+r+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*n)>>0)/1e3+r+")":""}function St(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","translate("+i.join(",")+")"}function xt(t,e,r,n){return"rotate("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function _t(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","skew("+i.join(",")+")"}function Et(t,e,r){return"scale("+(1e3*(t+(e-t)*r)>>0)/1e3+")"}e.TextWriteProperties=yt;var Ct={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t,e){var r=h(this.element);return r[t]?r[t]:n[t]},prepareProperty:function(t,e){var r=["X","Y","Z"],n=[],i=[],a=[],s={},o=["translate3d","translate","rotate3d","skew"];for(var l in e)if(o.includes(l)){var u="object"==typeof e[l]?e[l].map((function(t){return parseInt(t)})):[parseInt(e[l]),0];s[l]="skew"===l||"translate"===l?[u[0]||0,u[1]||0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(l)){for(var c=l.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="translate"===c?n:"rotate"===c?i:"skew"===c?a:{},f=0;f<3;f++){var d=r[f];h[f]=""+c+d in e?parseInt(e[""+c+d]):0}s[p]=h}else s[l]="scale"===l?parseFloat(e[l]):parseInt(e[l]);return s},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(e,r,n,i){e.style[t]=(r.perspective||n.perspective?wt(r.perspective,n.perspective,"px",i):"")+(r.translate3d?bt(r.translate3d,n.translate3d,"px",i):"")+(r.translate?St(r.translate,n.translate,"px",i):"")+(r.rotate3d?Tt(r.rotate3d,n.rotate3d,"deg",i):"")+(r.rotate||n.rotate?xt(r.rotate,n.rotate,"deg",i):"")+(r.skew?_t(r.skew,n.skew,"deg",i):"")+(r.scale||n.scale?Et(r.scale,n.scale,i):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:wt,translate3d:bt,rotate3d:Tt,translate:St,rotate:xt,scale:Et,skew:_t}};function At(t,e,r,n){n=n||!1,t.addEventListener(e,r,n)}function It(t,e,r,n){n=n||!1,t.removeEventListener(e,r,n)}e.TransformFunctions=Ct;var Mt=function(){var t,e,r,n,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,r=function(){},At(t,e="DOMContentLoaded",(function i(a){a.target===t&&(r(a),It(t,e,i,n))}),n=a)}catch(t){}return i}(),kt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ot="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Pt=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Lt=!!Mt&&{passive:!1};function jt(t){this.scrolling&&t.preventDefault()}function Ut(){var t=this.element;return t===Pt?{el:document,st:document.body}:{el:t,st:t}}function Ft(){var t=Ut.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,At(t.el,kt[0],jt,Lt),At(t.el,Ot,jt,Lt),t.st.style.pointerEvents="none")}function Ht(){var t=Ut.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,It(t.el,kt[0],jt,Lt),It(t.el,Ot,jt,Lt),t.st.style.pointerEvents="")}var Nt={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Pt,Ft.call(this),this.element===Pt?window.pageYOffset||Pt.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.scrollTop=S(e,r,n)>>0})},onComplete:function(t){Ht.call(this)}},Vt={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:S},functions:Nt,Util:{preventScroll:jt,scrollIn:Ft,scrollOut:Ht,scrollContainer:Pt,passiveHandler:Lt,getScrollTargets:Ut}};e.ScrollProperty=Vt;var Xt=function(t,e){return parseFloat(t)/100*e},Dt=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},zt=function(t){var e=t.getAttribute("points").split(" "),r=0;if(e.length>1){var n=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*S(e.s,r.s,n)>>0)/100,s=(100*S(e.e,r.e,n)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var qt={prepareStart:function(){return Kt(this.element)},prepareProperty:function(t,e){return Kt(this.element,e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){return Zt(t,e,r,n)})}},Wt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:S,paintDraw:Zt},functions:qt,Util:{getRectLength:Dt,getPolyLength:zt,getLineLength:Bt,getCircleLength:Rt,getEllipseLength:Yt,getTotalLength:Qt,getDraw:Kt,percent:Xt}};function Gt(t,e,r,n){for(var i=[],a=0;a>0)/1e3)}return i}e.SVGDraw=Wt;var $t="Invalid path value";function Jt(t){return"number"==typeof t&&isFinite(t)}function te(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ee(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function re(t,e){return te(t,e)<1e-9}var ne={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},ie=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function ae(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&ie.indexOf(t)>=0}function se(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function oe(t){return 97==(32|t)}function le(t){return t>=48&&t<=57}function ue(t){return t>=48&&t<=57||43===t||45===t||46===t}function ce(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function pe(t){for(;t.index=i)t.err="KUTE.js - "+$t;else if(43!==(e=t.path.charCodeAt(n))&&45!==e||(e=++n2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(n));else for(;n.length>=ne[r]&&(t.result.push([e].concat(n.splice(0,ne[r]))),ne[r]););}function ve(t){var e,r,n,i,a,s=t.max;if(t.segmentStart=t.index,r=oe(e=t.path.charCodeAt(t.index)),se(e))if(i=ne[t.path[t.index].toLowerCase()],t.index++,pe(t),t.data=[],i){for(n=!1;;){for(a=i;a>0;a--){if(!r||3!==a&&4!==a?fe(t):he(t),t.err.length)return;t.data.push(t.param),pe(t),n=!1,t.index=t.max)break;if(!ue(t.path.charCodeAt(t.index)))break}}de(t)}else de(t);else t.err="KUTE.js - "+$t}function ge(t){var e=new ce(t),r=e.max;for(pe(e);e.index0&&(s=Math.max(s,Math.ceil(r/e)));for(var o=0;oe;)i=ee(n,i,.5),t.splice(r+1,0,i)}function Ie(t,e){var r,n;if("string"==typeof t){var i=we(t,e);t=i.ring,n=i.skipBisect}else if(!Array.isArray(t))throw new TypeError($t);if(!Me(r=t.slice(0)))throw new TypeError($t);return r.length>1&&re(r[0],r[r.length-1])&&r.pop(),Ee(r)>0&&r.reverse(),!n&&e&&Jt(e)&&e>0&&Ae(r,e),r}function Me(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&Jt(t[0])&&Jt(t[1])}))}function ke(t,e,r){var n=Ie(t,r=r||i.morphPrecision),a=Ie(e,r),s=n.length-a.length;return Ce(n,s<0?-1*s:0),Ce(a,s>0?s:0),xe(n,a),[n,a]}me.prototype.iterate=function(t){var e,r=this.segments,n={},i=!1,a=0,s=0,o=0,l=0;return r.map((function(e,r){var u=t(e,r,a,s);Array.isArray(u)&&(n[r]=u,i=!0);var c=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return a=e[1]+(c?a:0),s=e[2]+(c?s:0),o=a,void(l=s);case"h":case"H":return void(a=e[1]+(c?a:0));case"v":case"V":return void(s=e[1]+(c?s:0));case"z":case"Z":return a=o,void(s=l);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],r.map((function(t,r){void 0!==n[r]?n[r].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},me.prototype.abs=function(){return this.iterate((function(t,e,r,n){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=n);case"a":return t[6]+=r,void(t[7]+=n);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===r.segments[a-1][0],n=n.concat(t?i.slice(1):i)})),n.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var Oe={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var r={},n=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(n&&/path|glyph/.test(n.tagName)?r.original=n.getAttribute("d").replace(i,""):!n&&/[a-z][^a-z]*/gi.test(e)&&(r.original=e.replace(i,"")),r)},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){var i,a=e.pathArray,s=r.pathArray,o=s.length;i=1===n?r.original:"M"+Gt(a,s,o,n).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,r=this.valuesEnd[t].pathArray;if(!e||!r||e&&r&&e.length!==r.length){var n=ke(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):i.morphPrecision);this.valuesStart[t].pathArray=n[0],this.valuesEnd[t].pathArray=n[1]}}}},Pe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Gt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Oe,Util:{INVALID_INPUT:$t,isFiniteNumber:Jt,distance:te,pointAlong:ee,samePoint:re,paramCounts:ne,SPECIAL_SPACES:ie,isSpace:ae,isCommand:se,isArc:oe,isDigit:le,isDigitStart:ue,State:ce,skipSpaces:pe,scanFlag:he,scanParam:fe,finalizeSegment:de,scanSegment:ve,pathParse:ge,SvgPath:me,split:ye,pathStringToRing:we,exactRing:be,approximateRing:Te,measure:Se,rotateRing:xe,polygonLength:_e,polygonArea:Ee,addPoints:Ce,bisect:Ae,normalizeRing:Ie,validRing:Me,getInterpolationPoints:ke}};function Le(t,e){var r=e.x,n=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?r+parseFloat(t)*n/100:parseFloat(t)}function je(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",r={};if(e instanceof Array)for(var n=0,i=e.length;n>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],r=this.valuesEnd[t],n=Ue.call(this,t,je(this.element.getAttribute("transform")));for(var i in n)e[i]=n[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in r&&"origin"!==o||(r[o]=e[o])}}},He={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:S},functions:Fe,Util:{parseStringOrigin:Le,parseTransformString:je,parseTransformSVG:Ue}};for(var Ne in e.SVGTransformProperty=He,e){var Ve=e[Ne];e[Ne]=new D(Ve)}return{Animation:D,Components:e,Tween:H,fromTo:function(t,e,r,n){return n=n||{},new X(j(t),e,r,n)},to:function(t,e,r){return(r=r||{}).resetStart=e,new V(j(t),e,e,r)},TweenCollection:N,allFromTo:function(t,e,r,n){return n=n||{},new N(j(t,!0),e,r,n)},allTo:function(t,e,r){return(r=r||{}).resetStart=e,new N(j(t,!0),e,e,r)},Objects:p,Util:t,Easing:L,CubicBezier:P,Render:I,Interpolate:x,Process:g,Internals:O,Selector:j,Version:"2.0.1"}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).KUTE=e()}(this,(function(){"use strict";var t={},e={},r={},n={},i={duration:700,delay:0,easing:"linear"},a={},s={},o={},l={},u={},c={},p={supportedProperties:r,defaultValues:n,defaultOptions:i,prepareProperty:a,prepareStart:s,crossCheck:o,onStart:l,onComplete:u,linkProperty:c};function h(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),r={},n=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(r[i]=n.includes(i)?a.split(","):a)}))})),r}}function f(t,e){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[e]&&!/auto|initial|none|unset/.test(r[e])?r[e]:i[e];if("transform"!==e&&(e in i||e in r))return a||n[e]}function d(t,e){var i="start"===e?this.valuesStart:this.valuesEnd;for(var s in a){var o=a[s],l=r[s];for(var u in o){var c={};for(var p in t)n[p]&&o[p]?i[p]=o[p].call(this,p,t[p]):!n[u]&&"transform"===u&&l.includes(p)?c[p]=t[p]:!n[u]&&l&&l.includes(p)&&(i[p]=o[u].call(this,p,t[p]));Object.keys&&Object.keys(c).length&&(i[u]=o[u].call(this,u,c))}}}function v(){var t={},e=h(this.element);for(var i in this.valuesStart)for(var a in s){var o=s[a];for(var l in o)(l===i&&o[i]||r[a]&&r[a].includes(i))&&(t[i]=o[l].call(this,i,this.valuesStart[i]))}for(var u in e)u in this.valuesStart||(t[u]=e[u]||n[u]);this.valuesStart={},d.call(this,t,"start")}var g={getInlineStyle:h,getStyleForProperty:f,getStartValues:v,prepareObject:d},m=[];function y(t){return m.push(t)}function w(t){var e=m.indexOf(t);-1!==e&&m.splice(e,1)}var b={},T="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function S(t,e,r){return(t=+t)+(e-=t)*r}var x={numbers:S,units:function(t,e,r,n){return(t=+t)+(e-=t)*n+r},arrays:function(t,e,r){for(var n=[],i=0,a=e.length;i>0)/1e3;return n}},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var E=0,C=function(t){for(var e=0;e(r=1))return r;for(;ei?e=n:r=n,n=.5*(r-e)+e}return n};var L={linear:new P(0,0,1,1,"linear"),easingSinusoidalIn:new P(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new P(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new P(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new P(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new P(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new P(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new P(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new P(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new P(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new P(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new P(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new P(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new P(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new P(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new P(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new P(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new P(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new P(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new P(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new P(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new P(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new P(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new P(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new P(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}t.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof L[t])return L[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new P(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),L.linear};var U={},F=function(e,r,n,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=n,this.valuesStart=r,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:t.processEasing(a.easing),this._duration=a.duration||i.duration,this._delay=a.delay||i.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return l[u]||(l[u]=function(t){!b[t]&&t===this._easing.name&&(b[t]=this._easing)}),this};F.prototype.start=function(t){if(y(this),this.playing=!0,this._startTime=t||b.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),l)if("function"==typeof l[e])l[e].call(this,e);else for(var r in l[e])l[e][r].call(this,r);k.call(this),this._startFired=!0}return!E&&C(),this},F.prototype.stop=function(){return this.playing&&(w(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},F.prototype.close=function(){for(var t in u)for(var e in u[t])u[t][e].call(this,e);this._startFired=!1,A.call(this)},F.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},U.Tween=F,i.repeat=0,i.repeatDelay=0,i.yoyo=!1,i.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var n=e[1],a=e[2];if(d.call(this,a,"end"),this._resetStart?this.valuesStart=n:d.call(this,n,"start"),!this._resetStart)for(var s in o)for(var l in o[s])o[s][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||i.repeat,this._repeatDelay=u.repeatDelay||i.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||i.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var r in this.valuesStart=this._resetStart,v.call(this),o)for(var n in o[r])o[r][n].call(this,n);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=b.Time()-this._pauseTime,y(this),!E&&C()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(w(this),this.paused=!0,this._pauseTime=b.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(F);U.Tween=H;var N=U.Tween,V=function(t,e,r,n){var a=this;this.tweens=[],!("offset"in i)&&(i.offset=0),(n=n||{}).delay=n.delay||i.delay;var s=[];return Array.from(t).map((function(t,o){s[o]=n||{},s[o].delay=o>0?n.delay+(n.offset||i.offset):n.delay,t instanceof Element?a.tweens.push(new N(t,e,r,s[o])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};V.prototype.start=function(t){return t=void 0===t?b.Time():t,this.tweens.map((function(e){return e.start(t)})),this},V.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},V.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},V.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},V.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof V)e.chain(t.tweens);else{if(!(t instanceof N))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},V.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},V.prototype.removeTweens=function(){this.tweens=[]},V.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var X=function(t){try{t.component in r?console.error("KUTE.js - "+t.component+" already registered"):t.property in n?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var r,n=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*S(r,n,i)>>0)/10:S(r,n,i)>>0)+"px"})}z.map((function(t){return B[t]=0}));var Y={};z.map((function(t){return Y[t]=R}));var Q={component:"boxModelProps",category:"boxModel",properties:z,defaultValues:B,Interpolate:{numbers:S},functions:{prepareStart:function(t){return f(this.element,t)||n[t]},prepareProperty:function(t,e){var r=D(e),n="height"===t?"offsetHeight":"offsetWidth";return"%"===r.u?r.v*this.element[n]/100:r.v},onStart:Y}};function K(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),r=e[3]?e[3]:null;return r?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(r)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var n=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function Z(t,e,r){var n,i={};for(n in e)i[n]="a"!==n?S(t[n],e[n],r)>>0||0:t[n]&&e[n]?(100*S(t[n],e[n],r)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}e.BoxModelProperties=Q;var q=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],W={};function G(t){this.valuesEnd[t]&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=Z(r,n,i)})}q.forEach((function(t){W[t]="#000"}));var $={};q.map((function(t){return $[t]=G}));var J={component:"colorProps",category:"colors",properties:q,defaultValues:W,Interpolate:{numbers:S,colors:Z},functions:{prepareStart:function(t,e){return f(this.element,t)||n[t]},prepareProperty:function(t,e){return K(e)},onStart:$},Util:{trueColor:K}};e.ColorProperties=J;var tt=["fill","stroke","stop-color"],et={};function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var r={};for(var n in e){var i=rt(n).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);r[i]=tt.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(n)?1:0)}return r},prepareProperty:function(t,e){var r={};for(var i in e){var a=rt(i),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(tt.includes(a))l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){t.setAttribute(e,Z(r,n,i))})},r[a]=K(e[i])||n.htmlAttributes[i];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[i]).u,c=/%/.test(u)?"_percent":"_"+u;l.htmlAttributes[a+c]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){var a=e.replace(c,"");t.setAttribute(a,(1e3*S(r.v,n.v,i)>>0)/1e3+n.u)})},r[a+c]=D(e[i])}else s.test(e[i])&&null!==o&&(null===o||s.test(o))||(l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){t.setAttribute(e,(1e3*S(r,n,i)>>0)/1e3)})},r[a]=parseFloat(e[i]))}return r},onStart:{attr:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){for(var i in r)b.attributes[i](t,i,e[i],r[i],n)})},attributes:function(t){!b[t]&&this.valuesEnd.attr&&(b[t]=et)}}},it={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:S,colors:Z},functions:nt,Util:{replaceUppercase:rt,trueColor:K,trueDimension:D}};e.HTMLAttributes=it;var at={prepareStart:function(t){return f(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=(1e3*S(r,n,i)>>0)/1e3})}},st={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:S},functions:at};function ot(t,e){var r,n;if("string"==typeof t)return(n=document.createElement("SPAN")).innerHTML=t,n.className=e,n;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(r=document.createElement("SPAN")).className=e,r.innerHTML=i,t.appendChild(r),t.innerHTML=r.outerHTML}else t.children.length&&t.children[0].className===e&&(r=t.children[0]);return r}function lt(t,e){var r=[];if(t.children.length){for(var n,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,c=void 0;s,./?=-").split(""),ht=String("0123456789").split(""),ft=ut.concat(ct,ht),dt=ft.concat(pt),vt={alpha:ut,upper:ct,symbols:pt,numeric:ht,alphanumeric:ft,all:dt};var gt={text:function(t){if(!b[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in vt?vt[e]:e&&e.length?e:vt[i.textChars];b[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.innerHTML=S(e,r,n)>>0})}},mt={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:S},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:gt},Util:{charSet:vt,createTextTweens:function(t,e,r){if(!t.playing){var n=U.Tween;(r=r||{}).duration="auto"===r.duration?"auto":isFinite(1*r.duration)?1*r.duration:1e3;var i=function(t,e){var r=lt(t,"text-part"),n=lt(ot(e),"text-part");return t.innerHTML="",t.innerHTML+=r.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=n.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[r,n]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],c=0;return(u=(u=u.concat(o.map((function(t,e){return r.duration="auto"===r.duration?75*a[e].innerHTML.length:r.duration,r.delay=c,r.onComplete=null,c+=r.duration,new n(t,{text:t.innerHTML},{text:""},r)})))).concat(l.map((function(i,a){return r.duration="auto"===r.duration?75*s[a].innerHTML.length:r.duration,r.delay=c,r.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,c+=r.duration,new n(i,{text:""},{text:s[a].innerHTML},r)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};function yt(t,e,r,n){return"perspective("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function wt(t,e,r,n){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*n)>>0)/1e3:0)+r;return"translate3d("+i.join(",")+")"}function bt(t,e,r,n){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3+r+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3+r+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*n)>>0)/1e3+r+")":""}function Tt(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","translate("+i.join(",")+")"}function St(t,e,r,n){return"rotate("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function xt(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","skew("+i.join(",")+")"}function _t(t,e,r){return"scale("+(1e3*(t+(e-t)*r)>>0)/1e3+")"}e.TextWriteProperties=mt;var Et={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t,e){var r=h(this.element);return r[t]?r[t]:n[t]},prepareProperty:function(t,e){var r=["X","Y","Z"],n=[],i=[],a=[],s={},o=["translate3d","translate","rotate3d","skew"];for(var l in e)if(o.includes(l)){var u="object"==typeof e[l]?e[l].map((function(t){return parseInt(t)})):[parseInt(e[l]),0];s[l]="skew"===l||"translate"===l?[u[0]||0,u[1]||0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(l)){for(var c=l.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="translate"===c?n:"rotate"===c?i:"skew"===c?a:{},f=0;f<3;f++){var d=r[f];h[f]=""+c+d in e?parseInt(e[""+c+d]):0}s[p]=h}else s[l]="scale"===l?parseFloat(e[l]):parseInt(e[l]);return s},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(e,r,n,i){e.style[t]=(r.perspective||n.perspective?yt(r.perspective,n.perspective,"px",i):"")+(r.translate3d?wt(r.translate3d,n.translate3d,"px",i):"")+(r.translate?Tt(r.translate,n.translate,"px",i):"")+(r.rotate3d?bt(r.rotate3d,n.rotate3d,"deg",i):"")+(r.rotate||n.rotate?St(r.rotate,n.rotate,"deg",i):"")+(r.skew?xt(r.skew,n.skew,"deg",i):"")+(r.scale||n.scale?_t(r.scale,n.scale,i):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:yt,translate3d:wt,rotate3d:bt,translate:Tt,rotate:St,scale:_t,skew:xt}};function Ct(t,e,r,n){n=n||!1,t.addEventListener(e,r,n)}function At(t,e,r,n){n=n||!1,t.removeEventListener(e,r,n)}e.TransformFunctions=Et;var It=function(){var t,e,r,n,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,r=function(){},Ct(t,e="DOMContentLoaded",(function i(a){a.target===t&&(r(a),At(t,e,i,n))}),n=a)}catch(t){}return i}(),Mt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],kt="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Ot=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Pt=!!It&&{passive:!1};function Lt(t){this.scrolling&&t.preventDefault()}function jt(){var t=this.element;return t===Ot?{el:document,st:document.body}:{el:t,st:t}}function Ut(){var t=jt.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,Ct(t.el,Mt[0],Lt,Pt),Ct(t.el,kt,Lt,Pt),t.st.style.pointerEvents="none")}function Ft(){var t=jt.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,At(t.el,Mt[0],Lt,Pt),At(t.el,kt,Lt,Pt),t.st.style.pointerEvents="")}var Ht={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Ot,Ut.call(this),this.element===Ot?window.pageYOffset||Ot.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.scrollTop=S(e,r,n)>>0})},onComplete:function(t){Ft.call(this)}},Nt={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:S},functions:Ht,Util:{preventScroll:Lt,scrollIn:Ut,scrollOut:Ft,scrollContainer:Ot,passiveHandler:Pt,getScrollTargets:jt}};e.ScrollProperty=Nt;var Vt=function(t,e){return parseFloat(t)/100*e},Xt=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},Dt=function(t){var e=t.getAttribute("points").split(" "),r=0;if(e.length>1){var n=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*S(e.s,r.s,n)>>0)/100,s=(100*S(e.e,r.e,n)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var Zt={prepareStart:function(){return Qt(this.element)},prepareProperty:function(t,e){return Qt(this.element,e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){return Kt(t,e,r,n)})}},qt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:S,paintDraw:Kt},functions:Zt,Util:{getRectLength:Xt,getPolyLength:Dt,getLineLength:zt,getCircleLength:Bt,getEllipseLength:Rt,getTotalLength:Yt,getDraw:Qt,percent:Vt}};function Wt(t,e,r,n){for(var i=[],a=0;a>0)/1e3)}return i}e.SVGDraw=qt;var Gt="Invalid path value";function $t(t){return"number"==typeof t&&isFinite(t)}function Jt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function te(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function ee(t,e){return Jt(t,e)<1e-9}var re={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},ne=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function ie(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&ne.indexOf(t)>=0}function ae(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function se(t){return 97==(32|t)}function oe(t){return t>=48&&t<=57}function le(t){return t>=48&&t<=57||43===t||45===t||46===t}function ue(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function ce(t){for(;t.index=i)t.err="KUTE.js - "+Gt;else if(43!==(e=t.path.charCodeAt(n))&&45!==e||(e=++n2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(n));else for(;n.length>=re[r]&&(t.result.push([e].concat(n.splice(0,re[r]))),re[r]););}function de(t){var e,r,n,i,a,s=t.max;if(t.segmentStart=t.index,r=se(e=t.path.charCodeAt(t.index)),ae(e))if(i=re[t.path[t.index].toLowerCase()],t.index++,ce(t),t.data=[],i){for(n=!1;;){for(a=i;a>0;a--){if(!r||3!==a&&4!==a?he(t):pe(t),t.err.length)return;t.data.push(t.param),ce(t),n=!1,t.index=t.max)break;if(!le(t.path.charCodeAt(t.index)))break}}fe(t)}else fe(t);else t.err="KUTE.js - "+Gt}function ve(t){var e=new ue(t),r=e.max;for(ce(e);e.index0&&(s=Math.max(s,Math.ceil(r/e)));for(var o=0;oe;)i=te(n,i,.5),t.splice(r+1,0,i)}function Ae(t,e){var r,n;if("string"==typeof t){var i=ye(t,e);t=i.ring,n=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Gt);if(!Ie(r=t.slice(0)))throw new TypeError(Gt);return r.length>1&&ee(r[0],r[r.length-1])&&r.pop(),_e(r)>0&&r.reverse(),!n&&e&&$t(e)&&e>0&&Ce(r,e),r}function Ie(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&$t(t[0])&&$t(t[1])}))}function Me(t,e,r){var n=Ae(t,r=r||i.morphPrecision),a=Ae(e,r),s=n.length-a.length;return Ee(n,s<0?-1*s:0),Ee(a,s>0?s:0),Se(n,a),[n,a]}ge.prototype.iterate=function(t){var e,r=this.segments,n={},i=!1,a=0,s=0,o=0,l=0;return r.map((function(e,r){var u=t(e,r,a,s);Array.isArray(u)&&(n[r]=u,i=!0);var c=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return a=e[1]+(c?a:0),s=e[2]+(c?s:0),o=a,void(l=s);case"h":case"H":return void(a=e[1]+(c?a:0));case"v":case"V":return void(s=e[1]+(c?s:0));case"z":case"Z":return a=o,void(s=l);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],r.map((function(t,r){void 0!==n[r]?n[r].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},ge.prototype.abs=function(){return this.iterate((function(t,e,r,n){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=n);case"a":return t[6]+=r,void(t[7]+=n);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===r.segments[a-1][0],n=n.concat(t?i.slice(1):i)})),n.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var ke={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var r={},n=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(n&&/path|glyph/.test(n.tagName)?r.original=n.getAttribute("d").replace(i,""):!n&&/[a-z][^a-z]*/gi.test(e)&&(r.original=e.replace(i,"")),r)},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){var i,a=e.pathArray,s=r.pathArray,o=s.length;i=1===n?r.original:"M"+Wt(a,s,o,n).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,r=this.valuesEnd[t].pathArray;if(!e||!r||e&&r&&e.length!==r.length){var n=Me(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):i.morphPrecision);this.valuesStart[t].pathArray=n[0],this.valuesEnd[t].pathArray=n[1]}}}},Oe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Wt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:ke,Util:{INVALID_INPUT:Gt,isFiniteNumber:$t,distance:Jt,pointAlong:te,samePoint:ee,paramCounts:re,SPECIAL_SPACES:ne,isSpace:ie,isCommand:ae,isArc:se,isDigit:oe,isDigitStart:le,State:ue,skipSpaces:ce,scanFlag:pe,scanParam:he,finalizeSegment:fe,scanSegment:de,pathParse:ve,SvgPath:ge,split:me,pathStringToRing:ye,exactRing:we,approximateRing:be,measure:Te,rotateRing:Se,polygonLength:xe,polygonArea:_e,addPoints:Ee,bisect:Ce,normalizeRing:Ae,validRing:Ie,getInterpolationPoints:Me}};function Pe(t,e){var r=e.x,n=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?r+parseFloat(t)*n/100:parseFloat(t)}function Le(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",r={};if(e instanceof Array)for(var n=0,i=e.length;n>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],r=this.valuesEnd[t],n=je.call(this,t,Le(this.element.getAttribute("transform")));for(var i in n)e[i]=n[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in r&&"origin"!==o||(r[o]=e[o])}}},Fe={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:S},functions:Ue,Util:{parseStringOrigin:Pe,parseTransformString:Le,parseTransformSVG:je}};for(var He in e.SVGTransformProperty=Fe,e){var Ne=e[He];e[He]=new X(Ne)}return{Animation:X,Components:e,Tween:H,fromTo:function(t,e,r,n){return n=n||{},new U.Tween(j(t),e,r,n)},to:function(t,e,r){return(r=r||{}).resetStart=e,new U.Tween(j(t),e,e,r)},TweenCollection:V,allFromTo:function(t,e,r,n){return n=n||{},new V(j(t,!0),e,r,n)},allTo:function(t,e,r){return(r=r||{}).resetStart=e,new V(j(t,!0),e,e,r)},Objects:p,Util:t,Easing:L,CubicBezier:P,Render:I,Interpolate:x,Process:g,Internals:O,Selector:j,Version:"2.0.1"}})); diff --git a/dist/kute.esm.js b/dist/kute.esm.js index a8e6af6..7ae33ed 100644 --- a/dist/kute.esm.js +++ b/dist/kute.esm.js @@ -620,11 +620,11 @@ var Tween = (function (TweenBase) { }(TweenBase)); TweenConstructor.Tween = Tween; +var TC = TweenConstructor.Tween; var TweenCollection = function TweenCollection(els,vS,vE,Ops){ var this$1 = this; this.tweens = []; !('offset' in defaultOptions) && (defaultOptions.offset = 0); - var TC = TweenConstructor.Tween; Ops = Ops || {}; Ops.delay = Ops.delay || defaultOptions.delay; var options = []; @@ -661,7 +661,7 @@ TweenCollection.prototype.chain = function chain (args) { var lastTween = this.tweens[this.length-1]; if (args instanceof TweenCollection){ lastTween.chain(args.tweens); - } else if (args instanceof TweenConstructor){ + } else if (args instanceof TC){ lastTween.chain(args); } else { throw new TypeError('KUTE.js - invalid chain value') @@ -682,17 +682,15 @@ TweenCollection.prototype.getMaxDuration = function getMaxDuration (){ return Math.max(durations) }; -var TC = TweenConstructor.Tween; function to(element, endObject, optionsObj) { optionsObj = optionsObj || {}; optionsObj.resetStart = endObject; - return new TC(selector(element), endObject, endObject, optionsObj) + return new TweenConstructor.Tween(selector(element), endObject, endObject, optionsObj) } -var TC$1 = TweenConstructor.Tween; function fromTo(element, startObject, endObject, optionsObj) { optionsObj = optionsObj || {}; - return new TC$1(selector(element), startObject, endObject, optionsObj) + return new TweenConstructor.Tween(selector(element), startObject, endObject, optionsObj) } function allTo(elements, endObject, optionsObj) { diff --git a/dist/kute.esm.min.js b/dist/kute.esm.min.js index c0efc1b..16165cd 100644 --- a/dist/kute.esm.min.js +++ b/dist/kute.esm.min.js @@ -1,2 +1,2 @@ // KUTE.js Standard v2.0.1 | thednp © 2020 | MIT-License -var t={},e={},r={},n={},i={duration:700,delay:0,easing:"linear"},a={},s={},o={},l={},u={},c={},p={supportedProperties:r,defaultValues:n,defaultOptions:i,prepareProperty:a,prepareStart:s,crossCheck:o,onStart:l,onComplete:u,linkProperty:c};function h(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),r={},n=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(r[i]=n.includes(i)?a.split(","):a)}))})),r}}function f(t,e){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[e]&&!/auto|initial|none|unset/.test(r[e])?r[e]:i[e];if("transform"!==e&&(e in i||e in r))return a||n[e]}function v(t,e){var i="start"===e?this.valuesStart:this.valuesEnd;for(var s in a){var o=a[s],l=r[s];for(var u in o){var c={};for(var p in t)n[p]&&o[p]?i[p]=o[p].call(this,p,t[p]):!n[u]&&"transform"===u&&l.includes(p)?c[p]=t[p]:!n[u]&&l&&l.includes(p)&&(i[p]=o[u].call(this,p,t[p]));Object.keys&&Object.keys(c).length&&(i[u]=o[u].call(this,u,c))}}}function d(){var t={},e=h(this.element);for(var i in this.valuesStart)for(var a in s){var o=s[a];for(var l in o)(l===i&&o[i]||r[a]&&r[a].includes(i))&&(t[i]=o[l].call(this,i,this.valuesStart[i]))}for(var u in e)u in this.valuesStart||(t[u]=e[u]||n[u]);this.valuesStart={},v.call(this,t,"start")}var g={getInlineStyle:h,getStyleForProperty:f,getStartValues:d,prepareObject:v},m=[];function y(t){return m.push(t)}function w(t){var e=m.indexOf(t);-1!==e&&m.splice(e,1)}var b={},T="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function S(t,e,r){return(t=+t)+(e-=t)*r}var x={numbers:S,units:function(t,e,r,n){return(t=+t)+(e-=t)*n+r},arrays:function(t,e,r){for(var n=[],i=0,a=e.length;i>0)/1e3;return n}},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var E=0,C=function(t){for(var e=0;e(r=1))return r;for(;ei?e=n:r=n,n=.5*(r-e)+e}return n};var L={linear:new P(0,0,1,1,"linear"),easingSinusoidalIn:new P(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new P(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new P(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new P(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new P(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new P(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new P(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new P(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new P(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new P(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new P(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new P(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new P(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new P(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new P(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new P(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new P(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new P(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new P(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new P(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new P(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new P(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new P(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new P(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}t.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof L[t])return L[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new P(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),L.linear};var U={},F=function(e,r,n,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=n,this.valuesStart=r,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:t.processEasing(a.easing),this._duration=a.duration||i.duration,this._delay=a.delay||i.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return l[u]||(l[u]=function(t){!b[t]&&t===this._easing.name&&(b[t]=this._easing)}),this};F.prototype.start=function(t){if(y(this),this.playing=!0,this._startTime=t||b.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),l)if("function"==typeof l[e])l[e].call(this,e);else for(var r in l[e])l[e][r].call(this,r);k.call(this),this._startFired=!0}return!E&&C(),this},F.prototype.stop=function(){return this.playing&&(w(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},F.prototype.close=function(){for(var t in u)for(var e in u[t])u[t][e].call(this,e);this._startFired=!1,A.call(this)},F.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},U.Tween=F,i.repeat=0,i.repeatDelay=0,i.yoyo=!1,i.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var n=e[1],a=e[2];if(v.call(this,a,"end"),this._resetStart?this.valuesStart=n:v.call(this,n,"start"),!this._resetStart)for(var s in o)for(var l in o[s])o[s][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||i.repeat,this._repeatDelay=u.repeatDelay||i.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||i.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var r in this.valuesStart=this._resetStart,d.call(this),o)for(var n in o[r])o[r][n].call(this,n);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=b.Time()-this._pauseTime,y(this),!E&&C()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(w(this),this.paused=!0,this._pauseTime=b.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(F);U.Tween=H;var N=function(t,e,r,n){var a=this;this.tweens=[],!("offset"in i)&&(i.offset=0);var s=U.Tween;(n=n||{}).delay=n.delay||i.delay;var o=[];return Array.from(t).map((function(t,l){o[l]=n||{},o[l].delay=l>0?n.delay+(n.offset||i.offset):n.delay,t instanceof Element?a.tweens.push(new s(t,e,r,o[l])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(t){return t=void 0===t?b.Time():t,this.tweens.map((function(e){return e.start(t)})),this},N.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},N.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},N.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},N.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof N)e.chain(t.tweens);else{if(!(t instanceof U))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},N.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},N.prototype.removeTweens=function(){this.tweens=[]},N.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var V=U.Tween;var X=U.Tween;var D=function(t){try{t.component in r?console.error("KUTE.js - "+t.component+" already registered"):t.property in n?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function z(t,e){for(var r,n=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*S(r,n,i)>>0)/10:S(r,n,i)>>0)+"px"})}B.map((function(t){return R[t]=0}));var Q={};B.map((function(t){return Q[t]=Y}));var K={component:"boxModelProps",category:"boxModel",properties:B,defaultValues:R,Interpolate:{numbers:S},functions:{prepareStart:function(t){return f(this.element,t)||n[t]},prepareProperty:function(t,e){var r=z(e),n="height"===t?"offsetHeight":"offsetWidth";return"%"===r.u?r.v*this.element[n]/100:r.v},onStart:Q}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),r=e[3]?e[3]:null;return r?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(r)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var n=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function q(t,e,r){var n,i={};for(n in e)i[n]="a"!==n?S(t[n],e[n],r)>>0||0:t[n]&&e[n]?(100*S(t[n],e[n],r)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}e.BoxModelProperties=K;var W=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],G={};function $(t){this.valuesEnd[t]&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=q(r,n,i)})}W.forEach((function(t){G[t]="#000"}));var J={};W.map((function(t){return J[t]=$}));var tt={component:"colorProps",category:"colors",properties:W,defaultValues:G,Interpolate:{numbers:S,colors:q},functions:{prepareStart:function(t,e){return f(this.element,t)||n[t]},prepareProperty:function(t,e){return Z(e)},onStart:J},Util:{trueColor:Z}};e.ColorProperties=tt;var et=["fill","stroke","stop-color"],rt={};function nt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var it={prepareStart:function(t,e){var r={};for(var n in e){var i=nt(n).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);r[i]=et.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(n)?1:0)}return r},prepareProperty:function(t,e){var r={};for(var i in e){var a=nt(i),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(et.includes(a))l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){t.setAttribute(e,q(r,n,i))})},r[a]=Z(e[i])||n.htmlAttributes[i];else if(null!==o&&s.test(o)){var u=z(o).u||z(e[i]).u,c=/%/.test(u)?"_percent":"_"+u;l.htmlAttributes[a+c]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){var a=e.replace(c,"");t.setAttribute(a,(1e3*S(r.v,n.v,i)>>0)/1e3+n.u)})},r[a+c]=z(e[i])}else s.test(e[i])&&null!==o&&(null===o||s.test(o))||(l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){t.setAttribute(e,(1e3*S(r,n,i)>>0)/1e3)})},r[a]=parseFloat(e[i]))}return r},onStart:{attr:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){for(var i in r)b.attributes[i](t,i,e[i],r[i],n)})},attributes:function(t){!b[t]&&this.valuesEnd.attr&&(b[t]=rt)}}},at={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:S,colors:q},functions:it,Util:{replaceUppercase:nt,trueColor:Z,trueDimension:z}};e.HTMLAttributes=at;var st={prepareStart:function(t){return f(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=(1e3*S(r,n,i)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:S},functions:st};function lt(t,e){var r,n;if("string"==typeof t)return(n=document.createElement("SPAN")).innerHTML=t,n.className=e,n;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(r=document.createElement("SPAN")).className=e,r.innerHTML=i,t.appendChild(r),t.innerHTML=r.outerHTML}else t.children.length&&t.children[0].className===e&&(r=t.children[0]);return r}function ut(t,e){var r=[];if(t.children.length){for(var n,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,c=void 0;s,./?=-").split(""),ft=String("0123456789").split(""),vt=ct.concat(pt,ft),dt=vt.concat(ht),gt={alpha:ct,upper:pt,symbols:ht,numeric:ft,alphanumeric:vt,all:dt};var mt={text:function(t){if(!b[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in gt?gt[e]:e&&e.length?e:gt[i.textChars];b[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.innerHTML=S(e,r,n)>>0})}},yt={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:S},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:mt},Util:{charSet:gt,createTextTweens:function(t,e,r){if(!t.playing){var n=U.Tween;(r=r||{}).duration="auto"===r.duration?"auto":isFinite(1*r.duration)?1*r.duration:1e3;var i=function(t,e){var r=ut(t,"text-part"),n=ut(lt(e),"text-part");return t.innerHTML="",t.innerHTML+=r.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=n.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[r,n]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],c=0;return(u=(u=u.concat(o.map((function(t,e){return r.duration="auto"===r.duration?75*a[e].innerHTML.length:r.duration,r.delay=c,r.onComplete=null,c+=r.duration,new n(t,{text:t.innerHTML},{text:""},r)})))).concat(l.map((function(i,a){return r.duration="auto"===r.duration?75*s[a].innerHTML.length:r.duration,r.delay=c,r.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,c+=r.duration,new n(i,{text:""},{text:s[a].innerHTML},r)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};function wt(t,e,r,n){return"perspective("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function bt(t,e,r,n){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*n)>>0)/1e3:0)+r;return"translate3d("+i.join(",")+")"}function Tt(t,e,r,n){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3+r+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3+r+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*n)>>0)/1e3+r+")":""}function St(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","translate("+i.join(",")+")"}function xt(t,e,r,n){return"rotate("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function _t(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","skew("+i.join(",")+")"}function Et(t,e,r){return"scale("+(1e3*(t+(e-t)*r)>>0)/1e3+")"}e.TextWriteProperties=yt;var Ct={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t,e){var r=h(this.element);return r[t]?r[t]:n[t]},prepareProperty:function(t,e){var r=["X","Y","Z"],n=[],i=[],a=[],s={},o=["translate3d","translate","rotate3d","skew"];for(var l in e)if(o.includes(l)){var u="object"==typeof e[l]?e[l].map((function(t){return parseInt(t)})):[parseInt(e[l]),0];s[l]="skew"===l||"translate"===l?[u[0]||0,u[1]||0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(l)){for(var c=l.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="translate"===c?n:"rotate"===c?i:"skew"===c?a:{},f=0;f<3;f++){var v=r[f];h[f]=""+c+v in e?parseInt(e[""+c+v]):0}s[p]=h}else s[l]="scale"===l?parseFloat(e[l]):parseInt(e[l]);return s},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(e,r,n,i){e.style[t]=(r.perspective||n.perspective?wt(r.perspective,n.perspective,"px",i):"")+(r.translate3d?bt(r.translate3d,n.translate3d,"px",i):"")+(r.translate?St(r.translate,n.translate,"px",i):"")+(r.rotate3d?Tt(r.rotate3d,n.rotate3d,"deg",i):"")+(r.rotate||n.rotate?xt(r.rotate,n.rotate,"deg",i):"")+(r.skew?_t(r.skew,n.skew,"deg",i):"")+(r.scale||n.scale?Et(r.scale,n.scale,i):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:wt,translate3d:bt,rotate3d:Tt,translate:St,rotate:xt,scale:Et,skew:_t}};function At(t,e,r,n){n=n||!1,t.addEventListener(e,r,n)}function It(t,e,r,n){n=n||!1,t.removeEventListener(e,r,n)}e.TransformFunctions=Ct;var Mt=function(){var t,e,r,n,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,r=function(){},At(t,e="DOMContentLoaded",(function i(a){a.target===t&&(r(a),It(t,e,i,n))}),n=a)}catch(t){}return i}(),kt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ot="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Pt=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Lt=!!Mt&&{passive:!1};function jt(t){this.scrolling&&t.preventDefault()}function Ut(){var t=this.element;return t===Pt?{el:document,st:document.body}:{el:t,st:t}}function Ft(){var t=Ut.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,At(t.el,kt[0],jt,Lt),At(t.el,Ot,jt,Lt),t.st.style.pointerEvents="none")}function Ht(){var t=Ut.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,It(t.el,kt[0],jt,Lt),It(t.el,Ot,jt,Lt),t.st.style.pointerEvents="")}var Nt={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Pt,Ft.call(this),this.element===Pt?window.pageYOffset||Pt.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.scrollTop=S(e,r,n)>>0})},onComplete:function(t){Ht.call(this)}},Vt={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:S},functions:Nt,Util:{preventScroll:jt,scrollIn:Ft,scrollOut:Ht,scrollContainer:Pt,passiveHandler:Lt,getScrollTargets:Ut}};e.ScrollProperty=Vt;var Xt=function(t,e){return parseFloat(t)/100*e},Dt=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},zt=function(t){var e=t.getAttribute("points").split(" "),r=0;if(e.length>1){var n=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*S(e.s,r.s,n)>>0)/100,s=(100*S(e.e,r.e,n)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var qt={prepareStart:function(){return Kt(this.element)},prepareProperty:function(t,e){return Kt(this.element,e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){return Zt(t,e,r,n)})}},Wt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:S,paintDraw:Zt},functions:qt,Util:{getRectLength:Dt,getPolyLength:zt,getLineLength:Bt,getCircleLength:Rt,getEllipseLength:Yt,getTotalLength:Qt,getDraw:Kt,percent:Xt}};function Gt(t,e,r,n){for(var i=[],a=0;a>0)/1e3)}return i}e.SVGDraw=Wt;var $t="Invalid path value";function Jt(t){return"number"==typeof t&&isFinite(t)}function te(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ee(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function re(t,e){return te(t,e)<1e-9}var ne={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},ie=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function ae(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&ie.indexOf(t)>=0}function se(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function oe(t){return 97==(32|t)}function le(t){return t>=48&&t<=57}function ue(t){return t>=48&&t<=57||43===t||45===t||46===t}function ce(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function pe(t){for(;t.index=i)t.err="KUTE.js - "+$t;else if(43!==(e=t.path.charCodeAt(n))&&45!==e||(e=++n2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(n));else for(;n.length>=ne[r]&&(t.result.push([e].concat(n.splice(0,ne[r]))),ne[r]););}function de(t){var e,r,n,i,a,s=t.max;if(t.segmentStart=t.index,r=oe(e=t.path.charCodeAt(t.index)),se(e))if(i=ne[t.path[t.index].toLowerCase()],t.index++,pe(t),t.data=[],i){for(n=!1;;){for(a=i;a>0;a--){if(!r||3!==a&&4!==a?fe(t):he(t),t.err.length)return;t.data.push(t.param),pe(t),n=!1,t.index=t.max)break;if(!ue(t.path.charCodeAt(t.index)))break}}ve(t)}else ve(t);else t.err="KUTE.js - "+$t}function ge(t){var e=new ce(t),r=e.max;for(pe(e);e.index0&&(s=Math.max(s,Math.ceil(r/e)));for(var o=0;oe;)i=ee(n,i,.5),t.splice(r+1,0,i)}function Ie(t,e){var r,n;if("string"==typeof t){var i=we(t,e);t=i.ring,n=i.skipBisect}else if(!Array.isArray(t))throw new TypeError($t);if(!Me(r=t.slice(0)))throw new TypeError($t);return r.length>1&&re(r[0],r[r.length-1])&&r.pop(),Ee(r)>0&&r.reverse(),!n&&e&&Jt(e)&&e>0&&Ae(r,e),r}function Me(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&Jt(t[0])&&Jt(t[1])}))}function ke(t,e,r){var n=Ie(t,r=r||i.morphPrecision),a=Ie(e,r),s=n.length-a.length;return Ce(n,s<0?-1*s:0),Ce(a,s>0?s:0),xe(n,a),[n,a]}me.prototype.iterate=function(t){var e,r=this.segments,n={},i=!1,a=0,s=0,o=0,l=0;return r.map((function(e,r){var u=t(e,r,a,s);Array.isArray(u)&&(n[r]=u,i=!0);var c=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return a=e[1]+(c?a:0),s=e[2]+(c?s:0),o=a,void(l=s);case"h":case"H":return void(a=e[1]+(c?a:0));case"v":case"V":return void(s=e[1]+(c?s:0));case"z":case"Z":return a=o,void(s=l);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],r.map((function(t,r){void 0!==n[r]?n[r].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},me.prototype.abs=function(){return this.iterate((function(t,e,r,n){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=n);case"a":return t[6]+=r,void(t[7]+=n);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===r.segments[a-1][0],n=n.concat(t?i.slice(1):i)})),n.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var Oe={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var r={},n=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(n&&/path|glyph/.test(n.tagName)?r.original=n.getAttribute("d").replace(i,""):!n&&/[a-z][^a-z]*/gi.test(e)&&(r.original=e.replace(i,"")),r)},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){var i,a=e.pathArray,s=r.pathArray,o=s.length;i=1===n?r.original:"M"+Gt(a,s,o,n).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,r=this.valuesEnd[t].pathArray;if(!e||!r||e&&r&&e.length!==r.length){var n=ke(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):i.morphPrecision);this.valuesStart[t].pathArray=n[0],this.valuesEnd[t].pathArray=n[1]}}}},Pe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Gt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Oe,Util:{INVALID_INPUT:$t,isFiniteNumber:Jt,distance:te,pointAlong:ee,samePoint:re,paramCounts:ne,SPECIAL_SPACES:ie,isSpace:ae,isCommand:se,isArc:oe,isDigit:le,isDigitStart:ue,State:ce,skipSpaces:pe,scanFlag:he,scanParam:fe,finalizeSegment:ve,scanSegment:de,pathParse:ge,SvgPath:me,split:ye,pathStringToRing:we,exactRing:be,approximateRing:Te,measure:Se,rotateRing:xe,polygonLength:_e,polygonArea:Ee,addPoints:Ce,bisect:Ae,normalizeRing:Ie,validRing:Me,getInterpolationPoints:ke}};function Le(t,e){var r=e.x,n=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?r+parseFloat(t)*n/100:parseFloat(t)}function je(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",r={};if(e instanceof Array)for(var n=0,i=e.length;n>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],r=this.valuesEnd[t],n=Ue.call(this,t,je(this.element.getAttribute("transform")));for(var i in n)e[i]=n[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in r&&"origin"!==o||(r[o]=e[o])}}},He={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:S},functions:Fe,Util:{parseStringOrigin:Le,parseTransformString:je,parseTransformSVG:Ue}};for(var Ne in e.SVGTransformProperty=He,e){var Ve=e[Ne];e[Ne]=new D(Ve)}var Xe={Animation:D,Components:e,Tween:H,fromTo:function(t,e,r,n){return n=n||{},new X(j(t),e,r,n)},to:function(t,e,r){return(r=r||{}).resetStart=e,new V(j(t),e,e,r)},TweenCollection:N,allFromTo:function(t,e,r,n){return n=n||{},new N(j(t,!0),e,r,n)},allTo:function(t,e,r){return(r=r||{}).resetStart=e,new N(j(t,!0),e,e,r)},Objects:p,Util:t,Easing:L,CubicBezier:P,Render:I,Interpolate:x,Process:g,Internals:O,Selector:j,Version:"2.0.1"};export default Xe; +var t={},e={},r={},n={},i={duration:700,delay:0,easing:"linear"},a={},s={},o={},l={},u={},c={},p={supportedProperties:r,defaultValues:n,defaultOptions:i,prepareProperty:a,prepareStart:s,crossCheck:o,onStart:l,onComplete:u,linkProperty:c};function h(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),r={},n=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(r[i]=n.includes(i)?a.split(","):a)}))})),r}}function f(t,e){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[e]&&!/auto|initial|none|unset/.test(r[e])?r[e]:i[e];if("transform"!==e&&(e in i||e in r))return a||n[e]}function d(t,e){var i="start"===e?this.valuesStart:this.valuesEnd;for(var s in a){var o=a[s],l=r[s];for(var u in o){var c={};for(var p in t)n[p]&&o[p]?i[p]=o[p].call(this,p,t[p]):!n[u]&&"transform"===u&&l.includes(p)?c[p]=t[p]:!n[u]&&l&&l.includes(p)&&(i[p]=o[u].call(this,p,t[p]));Object.keys&&Object.keys(c).length&&(i[u]=o[u].call(this,u,c))}}}function v(){var t={},e=h(this.element);for(var i in this.valuesStart)for(var a in s){var o=s[a];for(var l in o)(l===i&&o[i]||r[a]&&r[a].includes(i))&&(t[i]=o[l].call(this,i,this.valuesStart[i]))}for(var u in e)u in this.valuesStart||(t[u]=e[u]||n[u]);this.valuesStart={},d.call(this,t,"start")}var g={getInlineStyle:h,getStyleForProperty:f,getStartValues:v,prepareObject:d},m=[];function y(t){return m.push(t)}function w(t){var e=m.indexOf(t);-1!==e&&m.splice(e,1)}var b={},T="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function S(t,e,r){return(t=+t)+(e-=t)*r}var x={numbers:S,units:function(t,e,r,n){return(t=+t)+(e-=t)*n+r},arrays:function(t,e,r){for(var n=[],i=0,a=e.length;i>0)/1e3;return n}},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var E=0,C=function(t){for(var e=0;e(r=1))return r;for(;ei?e=n:r=n,n=.5*(r-e)+e}return n};var L={linear:new P(0,0,1,1,"linear"),easingSinusoidalIn:new P(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new P(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new P(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new P(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new P(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new P(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new P(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new P(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new P(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new P(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new P(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new P(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new P(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new P(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new P(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new P(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new P(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new P(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new P(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new P(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new P(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new P(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new P(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new P(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}t.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof L[t])return L[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new P(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),L.linear};var U={},F=function(e,r,n,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=n,this.valuesStart=r,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:t.processEasing(a.easing),this._duration=a.duration||i.duration,this._delay=a.delay||i.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return l[u]||(l[u]=function(t){!b[t]&&t===this._easing.name&&(b[t]=this._easing)}),this};F.prototype.start=function(t){if(y(this),this.playing=!0,this._startTime=t||b.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),l)if("function"==typeof l[e])l[e].call(this,e);else for(var r in l[e])l[e][r].call(this,r);k.call(this),this._startFired=!0}return!E&&C(),this},F.prototype.stop=function(){return this.playing&&(w(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},F.prototype.close=function(){for(var t in u)for(var e in u[t])u[t][e].call(this,e);this._startFired=!1,A.call(this)},F.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},U.Tween=F,i.repeat=0,i.repeatDelay=0,i.yoyo=!1,i.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var n=e[1],a=e[2];if(d.call(this,a,"end"),this._resetStart?this.valuesStart=n:d.call(this,n,"start"),!this._resetStart)for(var s in o)for(var l in o[s])o[s][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||i.repeat,this._repeatDelay=u.repeatDelay||i.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||i.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var r in this.valuesStart=this._resetStart,v.call(this),o)for(var n in o[r])o[r][n].call(this,n);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=b.Time()-this._pauseTime,y(this),!E&&C()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(w(this),this.paused=!0,this._pauseTime=b.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(F);U.Tween=H;var N=U.Tween,V=function(t,e,r,n){var a=this;this.tweens=[],!("offset"in i)&&(i.offset=0),(n=n||{}).delay=n.delay||i.delay;var s=[];return Array.from(t).map((function(t,o){s[o]=n||{},s[o].delay=o>0?n.delay+(n.offset||i.offset):n.delay,t instanceof Element?a.tweens.push(new N(t,e,r,s[o])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};V.prototype.start=function(t){return t=void 0===t?b.Time():t,this.tweens.map((function(e){return e.start(t)})),this},V.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},V.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},V.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},V.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof V)e.chain(t.tweens);else{if(!(t instanceof N))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},V.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},V.prototype.removeTweens=function(){this.tweens=[]},V.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var X=function(t){try{t.component in r?console.error("KUTE.js - "+t.component+" already registered"):t.property in n?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var r,n=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*S(r,n,i)>>0)/10:S(r,n,i)>>0)+"px"})}z.map((function(t){return B[t]=0}));var Y={};z.map((function(t){return Y[t]=R}));var Q={component:"boxModelProps",category:"boxModel",properties:z,defaultValues:B,Interpolate:{numbers:S},functions:{prepareStart:function(t){return f(this.element,t)||n[t]},prepareProperty:function(t,e){var r=D(e),n="height"===t?"offsetHeight":"offsetWidth";return"%"===r.u?r.v*this.element[n]/100:r.v},onStart:Y}};function K(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),r=e[3]?e[3]:null;return r?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(r)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var n=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function Z(t,e,r){var n,i={};for(n in e)i[n]="a"!==n?S(t[n],e[n],r)>>0||0:t[n]&&e[n]?(100*S(t[n],e[n],r)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}e.BoxModelProperties=Q;var q=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],W={};function G(t){this.valuesEnd[t]&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=Z(r,n,i)})}q.forEach((function(t){W[t]="#000"}));var $={};q.map((function(t){return $[t]=G}));var J={component:"colorProps",category:"colors",properties:q,defaultValues:W,Interpolate:{numbers:S,colors:Z},functions:{prepareStart:function(t,e){return f(this.element,t)||n[t]},prepareProperty:function(t,e){return K(e)},onStart:$},Util:{trueColor:K}};e.ColorProperties=J;var tt=["fill","stroke","stop-color"],et={};function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var r={};for(var n in e){var i=rt(n).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);r[i]=tt.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(n)?1:0)}return r},prepareProperty:function(t,e){var r={};for(var i in e){var a=rt(i),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(tt.includes(a))l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){t.setAttribute(e,Z(r,n,i))})},r[a]=K(e[i])||n.htmlAttributes[i];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[i]).u,c=/%/.test(u)?"_percent":"_"+u;l.htmlAttributes[a+c]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){var a=e.replace(c,"");t.setAttribute(a,(1e3*S(r.v,n.v,i)>>0)/1e3+n.u)})},r[a+c]=D(e[i])}else s.test(e[i])&&null!==o&&(null===o||s.test(o))||(l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){t.setAttribute(e,(1e3*S(r,n,i)>>0)/1e3)})},r[a]=parseFloat(e[i]))}return r},onStart:{attr:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){for(var i in r)b.attributes[i](t,i,e[i],r[i],n)})},attributes:function(t){!b[t]&&this.valuesEnd.attr&&(b[t]=et)}}},it={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:S,colors:Z},functions:nt,Util:{replaceUppercase:rt,trueColor:K,trueDimension:D}};e.HTMLAttributes=it;var at={prepareStart:function(t){return f(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=(1e3*S(r,n,i)>>0)/1e3})}},st={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:S},functions:at};function ot(t,e){var r,n;if("string"==typeof t)return(n=document.createElement("SPAN")).innerHTML=t,n.className=e,n;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(r=document.createElement("SPAN")).className=e,r.innerHTML=i,t.appendChild(r),t.innerHTML=r.outerHTML}else t.children.length&&t.children[0].className===e&&(r=t.children[0]);return r}function lt(t,e){var r=[];if(t.children.length){for(var n,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,c=void 0;s,./?=-").split(""),ht=String("0123456789").split(""),ft=ut.concat(ct,ht),dt=ft.concat(pt),vt={alpha:ut,upper:ct,symbols:pt,numeric:ht,alphanumeric:ft,all:dt};var gt={text:function(t){if(!b[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in vt?vt[e]:e&&e.length?e:vt[i.textChars];b[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.innerHTML=S(e,r,n)>>0})}},mt={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:S},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:gt},Util:{charSet:vt,createTextTweens:function(t,e,r){if(!t.playing){var n=U.Tween;(r=r||{}).duration="auto"===r.duration?"auto":isFinite(1*r.duration)?1*r.duration:1e3;var i=function(t,e){var r=lt(t,"text-part"),n=lt(ot(e),"text-part");return t.innerHTML="",t.innerHTML+=r.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=n.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[r,n]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],c=0;return(u=(u=u.concat(o.map((function(t,e){return r.duration="auto"===r.duration?75*a[e].innerHTML.length:r.duration,r.delay=c,r.onComplete=null,c+=r.duration,new n(t,{text:t.innerHTML},{text:""},r)})))).concat(l.map((function(i,a){return r.duration="auto"===r.duration?75*s[a].innerHTML.length:r.duration,r.delay=c,r.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,c+=r.duration,new n(i,{text:""},{text:s[a].innerHTML},r)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};function yt(t,e,r,n){return"perspective("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function wt(t,e,r,n){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*n)>>0)/1e3:0)+r;return"translate3d("+i.join(",")+")"}function bt(t,e,r,n){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3+r+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3+r+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*n)>>0)/1e3+r+")":""}function Tt(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","translate("+i.join(",")+")"}function St(t,e,r,n){return"rotate("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function xt(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","skew("+i.join(",")+")"}function _t(t,e,r){return"scale("+(1e3*(t+(e-t)*r)>>0)/1e3+")"}e.TextWriteProperties=mt;var Et={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t,e){var r=h(this.element);return r[t]?r[t]:n[t]},prepareProperty:function(t,e){var r=["X","Y","Z"],n=[],i=[],a=[],s={},o=["translate3d","translate","rotate3d","skew"];for(var l in e)if(o.includes(l)){var u="object"==typeof e[l]?e[l].map((function(t){return parseInt(t)})):[parseInt(e[l]),0];s[l]="skew"===l||"translate"===l?[u[0]||0,u[1]||0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(l)){for(var c=l.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="translate"===c?n:"rotate"===c?i:"skew"===c?a:{},f=0;f<3;f++){var d=r[f];h[f]=""+c+d in e?parseInt(e[""+c+d]):0}s[p]=h}else s[l]="scale"===l?parseFloat(e[l]):parseInt(e[l]);return s},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(e,r,n,i){e.style[t]=(r.perspective||n.perspective?yt(r.perspective,n.perspective,"px",i):"")+(r.translate3d?wt(r.translate3d,n.translate3d,"px",i):"")+(r.translate?Tt(r.translate,n.translate,"px",i):"")+(r.rotate3d?bt(r.rotate3d,n.rotate3d,"deg",i):"")+(r.rotate||n.rotate?St(r.rotate,n.rotate,"deg",i):"")+(r.skew?xt(r.skew,n.skew,"deg",i):"")+(r.scale||n.scale?_t(r.scale,n.scale,i):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:yt,translate3d:wt,rotate3d:bt,translate:Tt,rotate:St,scale:_t,skew:xt}};function Ct(t,e,r,n){n=n||!1,t.addEventListener(e,r,n)}function At(t,e,r,n){n=n||!1,t.removeEventListener(e,r,n)}e.TransformFunctions=Et;var It=function(){var t,e,r,n,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,r=function(){},Ct(t,e="DOMContentLoaded",(function i(a){a.target===t&&(r(a),At(t,e,i,n))}),n=a)}catch(t){}return i}(),Mt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],kt="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Ot=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Pt=!!It&&{passive:!1};function Lt(t){this.scrolling&&t.preventDefault()}function jt(){var t=this.element;return t===Ot?{el:document,st:document.body}:{el:t,st:t}}function Ut(){var t=jt.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,Ct(t.el,Mt[0],Lt,Pt),Ct(t.el,kt,Lt,Pt),t.st.style.pointerEvents="none")}function Ft(){var t=jt.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,At(t.el,Mt[0],Lt,Pt),At(t.el,kt,Lt,Pt),t.st.style.pointerEvents="")}var Ht={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Ot,Ut.call(this),this.element===Ot?window.pageYOffset||Ot.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.scrollTop=S(e,r,n)>>0})},onComplete:function(t){Ft.call(this)}},Nt={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:S},functions:Ht,Util:{preventScroll:Lt,scrollIn:Ut,scrollOut:Ft,scrollContainer:Ot,passiveHandler:Pt,getScrollTargets:jt}};e.ScrollProperty=Nt;var Vt=function(t,e){return parseFloat(t)/100*e},Xt=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},Dt=function(t){var e=t.getAttribute("points").split(" "),r=0;if(e.length>1){var n=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*S(e.s,r.s,n)>>0)/100,s=(100*S(e.e,r.e,n)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var Zt={prepareStart:function(){return Qt(this.element)},prepareProperty:function(t,e){return Qt(this.element,e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){return Kt(t,e,r,n)})}},qt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:S,paintDraw:Kt},functions:Zt,Util:{getRectLength:Xt,getPolyLength:Dt,getLineLength:zt,getCircleLength:Bt,getEllipseLength:Rt,getTotalLength:Yt,getDraw:Qt,percent:Vt}};function Wt(t,e,r,n){for(var i=[],a=0;a>0)/1e3)}return i}e.SVGDraw=qt;var Gt="Invalid path value";function $t(t){return"number"==typeof t&&isFinite(t)}function Jt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function te(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function ee(t,e){return Jt(t,e)<1e-9}var re={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},ne=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function ie(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&ne.indexOf(t)>=0}function ae(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function se(t){return 97==(32|t)}function oe(t){return t>=48&&t<=57}function le(t){return t>=48&&t<=57||43===t||45===t||46===t}function ue(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function ce(t){for(;t.index=i)t.err="KUTE.js - "+Gt;else if(43!==(e=t.path.charCodeAt(n))&&45!==e||(e=++n2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(n));else for(;n.length>=re[r]&&(t.result.push([e].concat(n.splice(0,re[r]))),re[r]););}function de(t){var e,r,n,i,a,s=t.max;if(t.segmentStart=t.index,r=se(e=t.path.charCodeAt(t.index)),ae(e))if(i=re[t.path[t.index].toLowerCase()],t.index++,ce(t),t.data=[],i){for(n=!1;;){for(a=i;a>0;a--){if(!r||3!==a&&4!==a?he(t):pe(t),t.err.length)return;t.data.push(t.param),ce(t),n=!1,t.index=t.max)break;if(!le(t.path.charCodeAt(t.index)))break}}fe(t)}else fe(t);else t.err="KUTE.js - "+Gt}function ve(t){var e=new ue(t),r=e.max;for(ce(e);e.index0&&(s=Math.max(s,Math.ceil(r/e)));for(var o=0;oe;)i=te(n,i,.5),t.splice(r+1,0,i)}function Ae(t,e){var r,n;if("string"==typeof t){var i=ye(t,e);t=i.ring,n=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Gt);if(!Ie(r=t.slice(0)))throw new TypeError(Gt);return r.length>1&&ee(r[0],r[r.length-1])&&r.pop(),_e(r)>0&&r.reverse(),!n&&e&&$t(e)&&e>0&&Ce(r,e),r}function Ie(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&$t(t[0])&&$t(t[1])}))}function Me(t,e,r){var n=Ae(t,r=r||i.morphPrecision),a=Ae(e,r),s=n.length-a.length;return Ee(n,s<0?-1*s:0),Ee(a,s>0?s:0),Se(n,a),[n,a]}ge.prototype.iterate=function(t){var e,r=this.segments,n={},i=!1,a=0,s=0,o=0,l=0;return r.map((function(e,r){var u=t(e,r,a,s);Array.isArray(u)&&(n[r]=u,i=!0);var c=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return a=e[1]+(c?a:0),s=e[2]+(c?s:0),o=a,void(l=s);case"h":case"H":return void(a=e[1]+(c?a:0));case"v":case"V":return void(s=e[1]+(c?s:0));case"z":case"Z":return a=o,void(s=l);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],r.map((function(t,r){void 0!==n[r]?n[r].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},ge.prototype.abs=function(){return this.iterate((function(t,e,r,n){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=n);case"a":return t[6]+=r,void(t[7]+=n);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===r.segments[a-1][0],n=n.concat(t?i.slice(1):i)})),n.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var ke={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var r={},n=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(n&&/path|glyph/.test(n.tagName)?r.original=n.getAttribute("d").replace(i,""):!n&&/[a-z][^a-z]*/gi.test(e)&&(r.original=e.replace(i,"")),r)},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){var i,a=e.pathArray,s=r.pathArray,o=s.length;i=1===n?r.original:"M"+Wt(a,s,o,n).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,r=this.valuesEnd[t].pathArray;if(!e||!r||e&&r&&e.length!==r.length){var n=Me(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):i.morphPrecision);this.valuesStart[t].pathArray=n[0],this.valuesEnd[t].pathArray=n[1]}}}},Oe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Wt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:ke,Util:{INVALID_INPUT:Gt,isFiniteNumber:$t,distance:Jt,pointAlong:te,samePoint:ee,paramCounts:re,SPECIAL_SPACES:ne,isSpace:ie,isCommand:ae,isArc:se,isDigit:oe,isDigitStart:le,State:ue,skipSpaces:ce,scanFlag:pe,scanParam:he,finalizeSegment:fe,scanSegment:de,pathParse:ve,SvgPath:ge,split:me,pathStringToRing:ye,exactRing:we,approximateRing:be,measure:Te,rotateRing:Se,polygonLength:xe,polygonArea:_e,addPoints:Ee,bisect:Ce,normalizeRing:Ae,validRing:Ie,getInterpolationPoints:Me}};function Pe(t,e){var r=e.x,n=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?r+parseFloat(t)*n/100:parseFloat(t)}function Le(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",r={};if(e instanceof Array)for(var n=0,i=e.length;n>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],r=this.valuesEnd[t],n=je.call(this,t,Le(this.element.getAttribute("transform")));for(var i in n)e[i]=n[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in r&&"origin"!==o||(r[o]=e[o])}}},Fe={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:S},functions:Ue,Util:{parseStringOrigin:Pe,parseTransformString:Le,parseTransformSVG:je}};for(var He in e.SVGTransformProperty=Fe,e){var Ne=e[He];e[He]=new X(Ne)}var Ve={Animation:X,Components:e,Tween:H,fromTo:function(t,e,r,n){return n=n||{},new U.Tween(j(t),e,r,n)},to:function(t,e,r){return(r=r||{}).resetStart=e,new U.Tween(j(t),e,e,r)},TweenCollection:V,allFromTo:function(t,e,r,n){return n=n||{},new V(j(t,!0),e,r,n)},allTo:function(t,e,r){return(r=r||{}).resetStart=e,new V(j(t,!0),e,e,r)},Objects:p,Util:t,Easing:L,CubicBezier:P,Render:I,Interpolate:x,Process:g,Internals:O,Selector:j,Version:"2.0.1"};export default Ve; diff --git a/dist/kute.js b/dist/kute.js index 93ef0dd..5d5f905 100644 --- a/dist/kute.js +++ b/dist/kute.js @@ -626,11 +626,11 @@ }(TweenBase)); TweenConstructor.Tween = Tween; + var TC = TweenConstructor.Tween; var TweenCollection = function TweenCollection(els,vS,vE,Ops){ var this$1 = this; this.tweens = []; !('offset' in defaultOptions) && (defaultOptions.offset = 0); - var TC = TweenConstructor.Tween; Ops = Ops || {}; Ops.delay = Ops.delay || defaultOptions.delay; var options = []; @@ -667,7 +667,7 @@ var lastTween = this.tweens[this.length-1]; if (args instanceof TweenCollection){ lastTween.chain(args.tweens); - } else if (args instanceof TweenConstructor){ + } else if (args instanceof TC){ lastTween.chain(args); } else { throw new TypeError('KUTE.js - invalid chain value') @@ -688,17 +688,15 @@ return Math.max(durations) }; - var TC = TweenConstructor.Tween; function to(element, endObject, optionsObj) { optionsObj = optionsObj || {}; optionsObj.resetStart = endObject; - return new TC(selector(element), endObject, endObject, optionsObj) + return new TweenConstructor.Tween(selector(element), endObject, endObject, optionsObj) } - var TC$1 = TweenConstructor.Tween; function fromTo(element, startObject, endObject, optionsObj) { optionsObj = optionsObj || {}; - return new TC$1(selector(element), startObject, endObject, optionsObj) + return new TweenConstructor.Tween(selector(element), startObject, endObject, optionsObj) } function allTo(elements, endObject, optionsObj) { diff --git a/dist/kute.min.js b/dist/kute.min.js index e9051a5..af59aa3 100644 --- a/dist/kute.min.js +++ b/dist/kute.min.js @@ -1,2 +1,2 @@ // KUTE.js Standard v2.0.1 | thednp © 2020 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).KUTE=e()}(this,(function(){"use strict";var t={},e={},r={},n={},i={duration:700,delay:0,easing:"linear"},a={},s={},o={},l={},u={},c={},p={supportedProperties:r,defaultValues:n,defaultOptions:i,prepareProperty:a,prepareStart:s,crossCheck:o,onStart:l,onComplete:u,linkProperty:c};function h(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),r={},n=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(r[i]=n.includes(i)?a.split(","):a)}))})),r}}function f(t,e){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[e]&&!/auto|initial|none|unset/.test(r[e])?r[e]:i[e];if("transform"!==e&&(e in i||e in r))return a||n[e]}function d(t,e){var i="start"===e?this.valuesStart:this.valuesEnd;for(var s in a){var o=a[s],l=r[s];for(var u in o){var c={};for(var p in t)n[p]&&o[p]?i[p]=o[p].call(this,p,t[p]):!n[u]&&"transform"===u&&l.includes(p)?c[p]=t[p]:!n[u]&&l&&l.includes(p)&&(i[p]=o[u].call(this,p,t[p]));Object.keys&&Object.keys(c).length&&(i[u]=o[u].call(this,u,c))}}}function v(){var t={},e=h(this.element);for(var i in this.valuesStart)for(var a in s){var o=s[a];for(var l in o)(l===i&&o[i]||r[a]&&r[a].includes(i))&&(t[i]=o[l].call(this,i,this.valuesStart[i]))}for(var u in e)u in this.valuesStart||(t[u]=e[u]||n[u]);this.valuesStart={},d.call(this,t,"start")}var g={getInlineStyle:h,getStyleForProperty:f,getStartValues:v,prepareObject:d},m=[];function y(t){return m.push(t)}function w(t){var e=m.indexOf(t);-1!==e&&m.splice(e,1)}var b={},T="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function S(t,e,r){return(t=+t)+(e-=t)*r}var x={numbers:S,units:function(t,e,r,n){return(t=+t)+(e-=t)*n+r},arrays:function(t,e,r){for(var n=[],i=0,a=e.length;i>0)/1e3;return n}},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var E=0,C=function(t){for(var e=0;e(r=1))return r;for(;ei?e=n:r=n,n=.5*(r-e)+e}return n};var L={linear:new P(0,0,1,1,"linear"),easingSinusoidalIn:new P(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new P(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new P(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new P(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new P(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new P(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new P(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new P(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new P(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new P(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new P(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new P(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new P(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new P(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new P(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new P(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new P(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new P(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new P(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new P(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new P(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new P(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new P(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new P(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}t.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof L[t])return L[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new P(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),L.linear};var U={},F=function(e,r,n,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=n,this.valuesStart=r,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:t.processEasing(a.easing),this._duration=a.duration||i.duration,this._delay=a.delay||i.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return l[u]||(l[u]=function(t){!b[t]&&t===this._easing.name&&(b[t]=this._easing)}),this};F.prototype.start=function(t){if(y(this),this.playing=!0,this._startTime=t||b.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),l)if("function"==typeof l[e])l[e].call(this,e);else for(var r in l[e])l[e][r].call(this,r);k.call(this),this._startFired=!0}return!E&&C(),this},F.prototype.stop=function(){return this.playing&&(w(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},F.prototype.close=function(){for(var t in u)for(var e in u[t])u[t][e].call(this,e);this._startFired=!1,A.call(this)},F.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},U.Tween=F,i.repeat=0,i.repeatDelay=0,i.yoyo=!1,i.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var n=e[1],a=e[2];if(d.call(this,a,"end"),this._resetStart?this.valuesStart=n:d.call(this,n,"start"),!this._resetStart)for(var s in o)for(var l in o[s])o[s][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||i.repeat,this._repeatDelay=u.repeatDelay||i.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||i.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var r in this.valuesStart=this._resetStart,v.call(this),o)for(var n in o[r])o[r][n].call(this,n);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=b.Time()-this._pauseTime,y(this),!E&&C()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(w(this),this.paused=!0,this._pauseTime=b.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(F);U.Tween=H;var N=function(t,e,r,n){var a=this;this.tweens=[],!("offset"in i)&&(i.offset=0);var s=U.Tween;(n=n||{}).delay=n.delay||i.delay;var o=[];return Array.from(t).map((function(t,l){o[l]=n||{},o[l].delay=l>0?n.delay+(n.offset||i.offset):n.delay,t instanceof Element?a.tweens.push(new s(t,e,r,o[l])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(t){return t=void 0===t?b.Time():t,this.tweens.map((function(e){return e.start(t)})),this},N.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},N.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},N.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},N.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof N)e.chain(t.tweens);else{if(!(t instanceof U))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},N.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},N.prototype.removeTweens=function(){this.tweens=[]},N.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var V=U.Tween;var X=U.Tween;var D=function(t){try{t.component in r?console.error("KUTE.js - "+t.component+" already registered"):t.property in n?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function z(t,e){for(var r,n=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*S(r,n,i)>>0)/10:S(r,n,i)>>0)+"px"})}B.map((function(t){return R[t]=0}));var Q={};B.map((function(t){return Q[t]=Y}));var K={component:"boxModelProps",category:"boxModel",properties:B,defaultValues:R,Interpolate:{numbers:S},functions:{prepareStart:function(t){return f(this.element,t)||n[t]},prepareProperty:function(t,e){var r=z(e),n="height"===t?"offsetHeight":"offsetWidth";return"%"===r.u?r.v*this.element[n]/100:r.v},onStart:Q}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),r=e[3]?e[3]:null;return r?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(r)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var n=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function q(t,e,r){var n,i={};for(n in e)i[n]="a"!==n?S(t[n],e[n],r)>>0||0:t[n]&&e[n]?(100*S(t[n],e[n],r)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}e.BoxModelProperties=K;var W=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],G={};function $(t){this.valuesEnd[t]&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=q(r,n,i)})}W.forEach((function(t){G[t]="#000"}));var J={};W.map((function(t){return J[t]=$}));var tt={component:"colorProps",category:"colors",properties:W,defaultValues:G,Interpolate:{numbers:S,colors:q},functions:{prepareStart:function(t,e){return f(this.element,t)||n[t]},prepareProperty:function(t,e){return Z(e)},onStart:J},Util:{trueColor:Z}};e.ColorProperties=tt;var et=["fill","stroke","stop-color"],rt={};function nt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var it={prepareStart:function(t,e){var r={};for(var n in e){var i=nt(n).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);r[i]=et.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(n)?1:0)}return r},prepareProperty:function(t,e){var r={};for(var i in e){var a=nt(i),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(et.includes(a))l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){t.setAttribute(e,q(r,n,i))})},r[a]=Z(e[i])||n.htmlAttributes[i];else if(null!==o&&s.test(o)){var u=z(o).u||z(e[i]).u,c=/%/.test(u)?"_percent":"_"+u;l.htmlAttributes[a+c]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){var a=e.replace(c,"");t.setAttribute(a,(1e3*S(r.v,n.v,i)>>0)/1e3+n.u)})},r[a+c]=z(e[i])}else s.test(e[i])&&null!==o&&(null===o||s.test(o))||(l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in rt)&&(rt[e]=function(t,e,r,n,i){t.setAttribute(e,(1e3*S(r,n,i)>>0)/1e3)})},r[a]=parseFloat(e[i]))}return r},onStart:{attr:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){for(var i in r)b.attributes[i](t,i,e[i],r[i],n)})},attributes:function(t){!b[t]&&this.valuesEnd.attr&&(b[t]=rt)}}},at={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:S,colors:q},functions:it,Util:{replaceUppercase:nt,trueColor:Z,trueDimension:z}};e.HTMLAttributes=at;var st={prepareStart:function(t){return f(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=(1e3*S(r,n,i)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:S},functions:st};function lt(t,e){var r,n;if("string"==typeof t)return(n=document.createElement("SPAN")).innerHTML=t,n.className=e,n;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(r=document.createElement("SPAN")).className=e,r.innerHTML=i,t.appendChild(r),t.innerHTML=r.outerHTML}else t.children.length&&t.children[0].className===e&&(r=t.children[0]);return r}function ut(t,e){var r=[];if(t.children.length){for(var n,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,c=void 0;s,./?=-").split(""),ft=String("0123456789").split(""),dt=ct.concat(pt,ft),vt=dt.concat(ht),gt={alpha:ct,upper:pt,symbols:ht,numeric:ft,alphanumeric:dt,all:vt};var mt={text:function(t){if(!b[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in gt?gt[e]:e&&e.length?e:gt[i.textChars];b[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.innerHTML=S(e,r,n)>>0})}},yt={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:S},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:mt},Util:{charSet:gt,createTextTweens:function(t,e,r){if(!t.playing){var n=U.Tween;(r=r||{}).duration="auto"===r.duration?"auto":isFinite(1*r.duration)?1*r.duration:1e3;var i=function(t,e){var r=ut(t,"text-part"),n=ut(lt(e),"text-part");return t.innerHTML="",t.innerHTML+=r.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=n.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[r,n]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],c=0;return(u=(u=u.concat(o.map((function(t,e){return r.duration="auto"===r.duration?75*a[e].innerHTML.length:r.duration,r.delay=c,r.onComplete=null,c+=r.duration,new n(t,{text:t.innerHTML},{text:""},r)})))).concat(l.map((function(i,a){return r.duration="auto"===r.duration?75*s[a].innerHTML.length:r.duration,r.delay=c,r.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,c+=r.duration,new n(i,{text:""},{text:s[a].innerHTML},r)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};function wt(t,e,r,n){return"perspective("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function bt(t,e,r,n){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*n)>>0)/1e3:0)+r;return"translate3d("+i.join(",")+")"}function Tt(t,e,r,n){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3+r+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3+r+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*n)>>0)/1e3+r+")":""}function St(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","translate("+i.join(",")+")"}function xt(t,e,r,n){return"rotate("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function _t(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","skew("+i.join(",")+")"}function Et(t,e,r){return"scale("+(1e3*(t+(e-t)*r)>>0)/1e3+")"}e.TextWriteProperties=yt;var Ct={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t,e){var r=h(this.element);return r[t]?r[t]:n[t]},prepareProperty:function(t,e){var r=["X","Y","Z"],n=[],i=[],a=[],s={},o=["translate3d","translate","rotate3d","skew"];for(var l in e)if(o.includes(l)){var u="object"==typeof e[l]?e[l].map((function(t){return parseInt(t)})):[parseInt(e[l]),0];s[l]="skew"===l||"translate"===l?[u[0]||0,u[1]||0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(l)){for(var c=l.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="translate"===c?n:"rotate"===c?i:"skew"===c?a:{},f=0;f<3;f++){var d=r[f];h[f]=""+c+d in e?parseInt(e[""+c+d]):0}s[p]=h}else s[l]="scale"===l?parseFloat(e[l]):parseInt(e[l]);return s},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(e,r,n,i){e.style[t]=(r.perspective||n.perspective?wt(r.perspective,n.perspective,"px",i):"")+(r.translate3d?bt(r.translate3d,n.translate3d,"px",i):"")+(r.translate?St(r.translate,n.translate,"px",i):"")+(r.rotate3d?Tt(r.rotate3d,n.rotate3d,"deg",i):"")+(r.rotate||n.rotate?xt(r.rotate,n.rotate,"deg",i):"")+(r.skew?_t(r.skew,n.skew,"deg",i):"")+(r.scale||n.scale?Et(r.scale,n.scale,i):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:wt,translate3d:bt,rotate3d:Tt,translate:St,rotate:xt,scale:Et,skew:_t}};function At(t,e,r,n){n=n||!1,t.addEventListener(e,r,n)}function It(t,e,r,n){n=n||!1,t.removeEventListener(e,r,n)}e.TransformFunctions=Ct;var Mt=function(){var t,e,r,n,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,r=function(){},At(t,e="DOMContentLoaded",(function i(a){a.target===t&&(r(a),It(t,e,i,n))}),n=a)}catch(t){}return i}(),kt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ot="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Pt=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Lt=!!Mt&&{passive:!1};function jt(t){this.scrolling&&t.preventDefault()}function Ut(){var t=this.element;return t===Pt?{el:document,st:document.body}:{el:t,st:t}}function Ft(){var t=Ut.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,At(t.el,kt[0],jt,Lt),At(t.el,Ot,jt,Lt),t.st.style.pointerEvents="none")}function Ht(){var t=Ut.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,It(t.el,kt[0],jt,Lt),It(t.el,Ot,jt,Lt),t.st.style.pointerEvents="")}var Nt={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Pt,Ft.call(this),this.element===Pt?window.pageYOffset||Pt.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.scrollTop=S(e,r,n)>>0})},onComplete:function(t){Ht.call(this)}},Vt={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:S},functions:Nt,Util:{preventScroll:jt,scrollIn:Ft,scrollOut:Ht,scrollContainer:Pt,passiveHandler:Lt,getScrollTargets:Ut}};e.ScrollProperty=Vt;var Xt=function(t,e){return parseFloat(t)/100*e},Dt=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},zt=function(t){var e=t.getAttribute("points").split(" "),r=0;if(e.length>1){var n=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*S(e.s,r.s,n)>>0)/100,s=(100*S(e.e,r.e,n)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var qt={prepareStart:function(){return Kt(this.element)},prepareProperty:function(t,e){return Kt(this.element,e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){return Zt(t,e,r,n)})}},Wt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:S,paintDraw:Zt},functions:qt,Util:{getRectLength:Dt,getPolyLength:zt,getLineLength:Bt,getCircleLength:Rt,getEllipseLength:Yt,getTotalLength:Qt,getDraw:Kt,percent:Xt}};function Gt(t,e,r,n){for(var i=[],a=0;a>0)/1e3)}return i}e.SVGDraw=Wt;var $t="Invalid path value";function Jt(t){return"number"==typeof t&&isFinite(t)}function te(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ee(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function re(t,e){return te(t,e)<1e-9}var ne={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},ie=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function ae(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&ie.indexOf(t)>=0}function se(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function oe(t){return 97==(32|t)}function le(t){return t>=48&&t<=57}function ue(t){return t>=48&&t<=57||43===t||45===t||46===t}function ce(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function pe(t){for(;t.index=i)t.err="KUTE.js - "+$t;else if(43!==(e=t.path.charCodeAt(n))&&45!==e||(e=++n2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(n));else for(;n.length>=ne[r]&&(t.result.push([e].concat(n.splice(0,ne[r]))),ne[r]););}function ve(t){var e,r,n,i,a,s=t.max;if(t.segmentStart=t.index,r=oe(e=t.path.charCodeAt(t.index)),se(e))if(i=ne[t.path[t.index].toLowerCase()],t.index++,pe(t),t.data=[],i){for(n=!1;;){for(a=i;a>0;a--){if(!r||3!==a&&4!==a?fe(t):he(t),t.err.length)return;t.data.push(t.param),pe(t),n=!1,t.index=t.max)break;if(!ue(t.path.charCodeAt(t.index)))break}}de(t)}else de(t);else t.err="KUTE.js - "+$t}function ge(t){var e=new ce(t),r=e.max;for(pe(e);e.index0&&(s=Math.max(s,Math.ceil(r/e)));for(var o=0;oe;)i=ee(n,i,.5),t.splice(r+1,0,i)}function Ie(t,e){var r,n;if("string"==typeof t){var i=we(t,e);t=i.ring,n=i.skipBisect}else if(!Array.isArray(t))throw new TypeError($t);if(!Me(r=t.slice(0)))throw new TypeError($t);return r.length>1&&re(r[0],r[r.length-1])&&r.pop(),Ee(r)>0&&r.reverse(),!n&&e&&Jt(e)&&e>0&&Ae(r,e),r}function Me(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&Jt(t[0])&&Jt(t[1])}))}function ke(t,e,r){var n=Ie(t,r=r||i.morphPrecision),a=Ie(e,r),s=n.length-a.length;return Ce(n,s<0?-1*s:0),Ce(a,s>0?s:0),xe(n,a),[n,a]}me.prototype.iterate=function(t){var e,r=this.segments,n={},i=!1,a=0,s=0,o=0,l=0;return r.map((function(e,r){var u=t(e,r,a,s);Array.isArray(u)&&(n[r]=u,i=!0);var c=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return a=e[1]+(c?a:0),s=e[2]+(c?s:0),o=a,void(l=s);case"h":case"H":return void(a=e[1]+(c?a:0));case"v":case"V":return void(s=e[1]+(c?s:0));case"z":case"Z":return a=o,void(s=l);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],r.map((function(t,r){void 0!==n[r]?n[r].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},me.prototype.abs=function(){return this.iterate((function(t,e,r,n){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=n);case"a":return t[6]+=r,void(t[7]+=n);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===r.segments[a-1][0],n=n.concat(t?i.slice(1):i)})),n.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var Oe={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var r={},n=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(n&&/path|glyph/.test(n.tagName)?r.original=n.getAttribute("d").replace(i,""):!n&&/[a-z][^a-z]*/gi.test(e)&&(r.original=e.replace(i,"")),r)},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){var i,a=e.pathArray,s=r.pathArray,o=s.length;i=1===n?r.original:"M"+Gt(a,s,o,n).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,r=this.valuesEnd[t].pathArray;if(!e||!r||e&&r&&e.length!==r.length){var n=ke(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):i.morphPrecision);this.valuesStart[t].pathArray=n[0],this.valuesEnd[t].pathArray=n[1]}}}},Pe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Gt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Oe,Util:{INVALID_INPUT:$t,isFiniteNumber:Jt,distance:te,pointAlong:ee,samePoint:re,paramCounts:ne,SPECIAL_SPACES:ie,isSpace:ae,isCommand:se,isArc:oe,isDigit:le,isDigitStart:ue,State:ce,skipSpaces:pe,scanFlag:he,scanParam:fe,finalizeSegment:de,scanSegment:ve,pathParse:ge,SvgPath:me,split:ye,pathStringToRing:we,exactRing:be,approximateRing:Te,measure:Se,rotateRing:xe,polygonLength:_e,polygonArea:Ee,addPoints:Ce,bisect:Ae,normalizeRing:Ie,validRing:Me,getInterpolationPoints:ke}};function Le(t,e){var r=e.x,n=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?r+parseFloat(t)*n/100:parseFloat(t)}function je(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",r={};if(e instanceof Array)for(var n=0,i=e.length;n>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],r=this.valuesEnd[t],n=Ue.call(this,t,je(this.element.getAttribute("transform")));for(var i in n)e[i]=n[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in r&&"origin"!==o||(r[o]=e[o])}}},He={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:S},functions:Fe,Util:{parseStringOrigin:Le,parseTransformString:je,parseTransformSVG:Ue}};for(var Ne in e.SVGTransformProperty=He,e){var Ve=e[Ne];e[Ne]=new D(Ve)}return{Animation:D,Components:e,Tween:H,fromTo:function(t,e,r,n){return n=n||{},new X(j(t),e,r,n)},to:function(t,e,r){return(r=r||{}).resetStart=e,new V(j(t),e,e,r)},TweenCollection:N,allFromTo:function(t,e,r,n){return n=n||{},new N(j(t,!0),e,r,n)},allTo:function(t,e,r){return(r=r||{}).resetStart=e,new N(j(t,!0),e,e,r)},Objects:p,Util:t,Easing:L,CubicBezier:P,Render:I,Interpolate:x,Process:g,Internals:O,Selector:j,Version:"2.0.1"}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).KUTE=e()}(this,(function(){"use strict";var t={},e={},r={},n={},i={duration:700,delay:0,easing:"linear"},a={},s={},o={},l={},u={},c={},p={supportedProperties:r,defaultValues:n,defaultOptions:i,prepareProperty:a,prepareStart:s,crossCheck:o,onStart:l,onComplete:u,linkProperty:c};function h(t){if(t.style){var e=t.style.cssText.replace(/\s/g,"").split(";"),r={},n=["translate3d","translate","scale3d","skew"];return e.map((function(t){/transform/i.test(t)&&t.split(":")[1].split(")").map((function(t){var e=t.split("("),i=e[0],a=e[1];/matrix/.test(i)||(r[i]=n.includes(i)?a.split(","):a)}))})),r}}function f(t,e){var r=t.style,i=getComputedStyle(t)||t.currentStyle,a=r[e]&&!/auto|initial|none|unset/.test(r[e])?r[e]:i[e];if("transform"!==e&&(e in i||e in r))return a||n[e]}function d(t,e){var i="start"===e?this.valuesStart:this.valuesEnd;for(var s in a){var o=a[s],l=r[s];for(var u in o){var c={};for(var p in t)n[p]&&o[p]?i[p]=o[p].call(this,p,t[p]):!n[u]&&"transform"===u&&l.includes(p)?c[p]=t[p]:!n[u]&&l&&l.includes(p)&&(i[p]=o[u].call(this,p,t[p]));Object.keys&&Object.keys(c).length&&(i[u]=o[u].call(this,u,c))}}}function v(){var t={},e=h(this.element);for(var i in this.valuesStart)for(var a in s){var o=s[a];for(var l in o)(l===i&&o[i]||r[a]&&r[a].includes(i))&&(t[i]=o[l].call(this,i,this.valuesStart[i]))}for(var u in e)u in this.valuesStart||(t[u]=e[u]||n[u]);this.valuesStart={},d.call(this,t,"start")}var g={getInlineStyle:h,getStyleForProperty:f,getStartValues:v,prepareObject:d},m=[];function y(t){return m.push(t)}function w(t){var e=m.indexOf(t);-1!==e&&m.splice(e,1)}var b={},T="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function S(t,e,r){return(t=+t)+(e-=t)*r}var x={numbers:S,units:function(t,e,r,n){return(t=+t)+(e-=t)*n+r},arrays:function(t,e,r){for(var n=[],i=0,a=e.length;i>0)/1e3;return n}},_={};"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?_.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now&&(_.now=self.performance.now.bind(self.performance));var E=0,C=function(t){for(var e=0;e(r=1))return r;for(;ei?e=n:r=n,n=.5*(r-e)+e}return n};var L={linear:new P(0,0,1,1,"linear"),easingSinusoidalIn:new P(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new P(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new P(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new P(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new P(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new P(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new P(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new P(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new P(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new P(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new P(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new P(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new P(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new P(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new P(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new P(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new P(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new P(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new P(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new P(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new P(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new P(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new P(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new P(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t[0]instanceof Element?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}t.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof L[t])return L[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new P(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),L.linear};var U={},F=function(e,r,n,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=n,this.valuesStart=r,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:t.processEasing(a.easing),this._duration=a.duration||i.duration,this._delay=a.delay||i.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return l[u]||(l[u]=function(t){!b[t]&&t===this._easing.name&&(b[t]=this._easing)}),this};F.prototype.start=function(t){if(y(this),this.playing=!0,this._startTime=t||b.Time(),this._startTime+=this._delay,!this._startFired){for(var e in this._onStart&&this._onStart.call(this),l)if("function"==typeof l[e])l[e].call(this,e);else for(var r in l[e])l[e][r].call(this,r);k.call(this),this._startFired=!0}return!E&&C(),this},F.prototype.stop=function(){return this.playing&&(w(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},F.prototype.close=function(){for(var t in u)for(var e in u[t])u[t][e].call(this,e);this._startFired=!1,A.call(this)},F.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),!1)},U.Tween=F,i.repeat=0,i.repeatDelay=0,i.yoyo=!1,i.resetStart=!1;var H=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];t.apply(this,e),this.valuesStart={},this.valuesEnd={};var n=e[1],a=e[2];if(d.call(this,a,"end"),this._resetStart?this.valuesStart=n:d.call(this,n,"start"),!this._resetStart)for(var s in o)for(var l in o[s])o[s][l].call(this,l);this.paused=!1,this._pauseTime=null;var u=e[3];return this._repeat=u.repeat||i.repeat,this._repeatDelay=u.repeatDelay||i.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=u.yoyo||i.yoyo,this._reversed=!1,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(e){if(this._resetStart)for(var r in this.valuesStart=this._resetStart,v.call(this),o)for(var n in o[r])o[r][n].call(this,n);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return t.prototype.start.call(this,e),this},e.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},e.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},e.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),this._startTime+=b.Time()-this._pauseTime,y(this),!E&&C()),this},e.prototype.pause=function(){return!this.paused&&this.playing&&(w(this),this.paused=!0,this._pauseTime=b.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},e.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},e.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},e.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},e.prototype.update=function(t){var e,r;if((t=void 0!==t?t:b.Time())1?1:e,r=this._easing(e),this.valuesEnd)b[n](this.element,this.valuesStart[n],this.valuesEnd[n],r);return this._onUpdate&&this._onUpdate.call(this),1!==e||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?t+this._repeatDelay:t,this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1))},e}(F);U.Tween=H;var N=U.Tween,V=function(t,e,r,n){var a=this;this.tweens=[],!("offset"in i)&&(i.offset=0),(n=n||{}).delay=n.delay||i.delay;var s=[];return Array.from(t).map((function(t,o){s[o]=n||{},s[o].delay=o>0?n.delay+(n.offset||i.offset):n.delay,t instanceof Element?a.tweens.push(new N(t,e,r,s[o])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};V.prototype.start=function(t){return t=void 0===t?b.Time():t,this.tweens.map((function(e){return e.start(t)})),this},V.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},V.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},V.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},V.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof V)e.chain(t.tweens);else{if(!(t instanceof N))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},V.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},V.prototype.removeTweens=function(){this.tweens=[]},V.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var X=function(t){try{t.component in r?console.error("KUTE.js - "+t.component+" already registered"):t.property in n?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var r,n=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*S(r,n,i)>>0)/10:S(r,n,i)>>0)+"px"})}z.map((function(t){return B[t]=0}));var Y={};z.map((function(t){return Y[t]=R}));var Q={component:"boxModelProps",category:"boxModel",properties:z,defaultValues:B,Interpolate:{numbers:S},functions:{prepareStart:function(t){return f(this.element,t)||n[t]},prepareProperty:function(t,e){var r=D(e),n="height"===t?"offsetHeight":"offsetWidth";return"%"===r.u?r.v*this.element[n]/100:r.v},onStart:Y}};function K(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),r=e[3]?e[3]:null;return r?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(r)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var n=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function Z(t,e,r){var n,i={};for(n in e)i[n]="a"!==n?S(t[n],e[n],r)>>0||0:t[n]&&e[n]?(100*S(t[n],e[n],r)>>0)/100:null;return i.a?"rgba("+i.r+","+i.g+","+i.b+","+i.a+")":"rgb("+i.r+","+i.g+","+i.b+")"}e.BoxModelProperties=Q;var q=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],W={};function G(t){this.valuesEnd[t]&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=Z(r,n,i)})}q.forEach((function(t){W[t]="#000"}));var $={};q.map((function(t){return $[t]=G}));var J={component:"colorProps",category:"colors",properties:q,defaultValues:W,Interpolate:{numbers:S,colors:Z},functions:{prepareStart:function(t,e){return f(this.element,t)||n[t]},prepareProperty:function(t,e){return K(e)},onStart:$},Util:{trueColor:K}};e.ColorProperties=J;var tt=["fill","stroke","stop-color"],et={};function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var r={};for(var n in e){var i=rt(n).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);r[i]=tt.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(n)?1:0)}return r},prepareProperty:function(t,e){var r={};for(var i in e){var a=rt(i),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(tt.includes(a))l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){t.setAttribute(e,Z(r,n,i))})},r[a]=K(e[i])||n.htmlAttributes[i];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[i]).u,c=/%/.test(u)?"_percent":"_"+u;l.htmlAttributes[a+c]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){var a=e.replace(c,"");t.setAttribute(a,(1e3*S(r.v,n.v,i)>>0)/1e3+n.u)})},r[a+c]=D(e[i])}else s.test(e[i])&&null!==o&&(null===o||s.test(o))||(l.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=function(t,e,r,n,i){t.setAttribute(e,(1e3*S(r,n,i)>>0)/1e3)})},r[a]=parseFloat(e[i]))}return r},onStart:{attr:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){for(var i in r)b.attributes[i](t,i,e[i],r[i],n)})},attributes:function(t){!b[t]&&this.valuesEnd.attr&&(b[t]=et)}}},it={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:S,colors:Z},functions:nt,Util:{replaceUppercase:rt,trueColor:K,trueDimension:D}};e.HTMLAttributes=it;var at={prepareStart:function(t){return f(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(e,r,n,i){e.style[t]=(1e3*S(r,n,i)>>0)/1e3})}},st={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:S},functions:at};function ot(t,e){var r,n;if("string"==typeof t)return(n=document.createElement("SPAN")).innerHTML=t,n.className=e,n;if(!t.children.length||t.children.length&&t.children[0].className!==e){var i=t.innerHTML;(r=document.createElement("SPAN")).className=e,r.innerHTML=i,t.appendChild(r),t.innerHTML=r.outerHTML}else t.children.length&&t.children[0].className===e&&(r=t.children[0]);return r}function lt(t,e){var r=[];if(t.children.length){for(var n,i=[],a=t.innerHTML,s=0,o=t.children.length,l=void 0,u=void 0,c=void 0;s,./?=-").split(""),ht=String("0123456789").split(""),ft=ut.concat(ct,ht),dt=ft.concat(pt),vt={alpha:ut,upper:ct,symbols:pt,numeric:ht,alphanumeric:ft,all:dt};var gt={text:function(t){if(!b[t]&&this.valuesEnd[t]){var e=this._textChars,r=e in vt?vt[e]:e&&e.length?e:vt[i.textChars];b[t]=function(t,e,n,i){var a="",s="",o=e.substring(0),l=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(s=l.substring(Math.min(i*l.length,l.length)>>0,0),t.innerHTML=i<1?s+u:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+u:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=l.substring(0,Math.min(i*l.length,l.length)>>0),t.innerHTML=i<1?s+u+a:""===n?" ":n)}}},number:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.innerHTML=S(e,r,n)>>0})}},mt={component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:S},functions:{prepareStart:function(t,e){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:gt},Util:{charSet:vt,createTextTweens:function(t,e,r){if(!t.playing){var n=U.Tween;(r=r||{}).duration="auto"===r.duration?"auto":isFinite(1*r.duration)?1*r.duration:1e3;var i=function(t,e){var r=lt(t,"text-part"),n=lt(ot(e),"text-part");return t.innerHTML="",t.innerHTML+=r.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=n.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[r,n]}(t,e),a=i[0],s=i[1],o=[].slice.call(t.getElementsByClassName("oldText")).reverse(),l=[].slice.call(t.getElementsByClassName("newText")),u=[],c=0;return(u=(u=u.concat(o.map((function(t,e){return r.duration="auto"===r.duration?75*a[e].innerHTML.length:r.duration,r.delay=c,r.onComplete=null,c+=r.duration,new n(t,{text:t.innerHTML},{text:""},r)})))).concat(l.map((function(i,a){return r.duration="auto"===r.duration?75*s[a].innerHTML.length:r.duration,r.delay=c,r.onComplete=a===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,c+=r.duration,new n(i,{text:""},{text:s[a].innerHTML},r)})))).start=function(){!t.playing&&u.map((function(t){return t.start()}))&&(t.playing=!0)},u}}}};function yt(t,e,r,n){return"perspective("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function wt(t,e,r,n){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*n)>>0)/1e3:0)+r;return"translate3d("+i.join(",")+")"}function bt(t,e,r,n){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3+r+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3+r+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*n)>>0)/1e3+r+")":""}function Tt(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","translate("+i.join(",")+")"}function St(t,e,r,n){return"rotate("+(1e3*(t+(e-t)*n)>>0)/1e3+r+")"}function xt(t,e,r,n){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*n)>>0)/1e3)+r,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*n)>>0)/1e3)+r:"0","skew("+i.join(",")+")"}function _t(t,e,r){return"scale("+(1e3*(t+(e-t)*r)>>0)/1e3+")"}e.TextWriteProperties=mt;var Et={component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t,e){var r=h(this.element);return r[t]?r[t]:n[t]},prepareProperty:function(t,e){var r=["X","Y","Z"],n=[],i=[],a=[],s={},o=["translate3d","translate","rotate3d","skew"];for(var l in e)if(o.includes(l)){var u="object"==typeof e[l]?e[l].map((function(t){return parseInt(t)})):[parseInt(e[l]),0];s[l]="skew"===l||"translate"===l?[u[0]||0,u[1]||0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(l)){for(var c=l.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="translate"===c?n:"rotate"===c?i:"skew"===c?a:{},f=0;f<3;f++){var d=r[f];h[f]=""+c+d in e?parseInt(e[""+c+d]):0}s[p]=h}else s[l]="scale"===l?parseFloat(e[l]):parseInt(e[l]);return s},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(e,r,n,i){e.style[t]=(r.perspective||n.perspective?yt(r.perspective,n.perspective,"px",i):"")+(r.translate3d?wt(r.translate3d,n.translate3d,"px",i):"")+(r.translate?Tt(r.translate,n.translate,"px",i):"")+(r.rotate3d?bt(r.rotate3d,n.rotate3d,"deg",i):"")+(r.rotate||n.rotate?St(r.rotate,n.rotate,"deg",i):"")+(r.skew?xt(r.skew,n.skew,"deg",i):"")+(r.scale||n.scale?_t(r.scale,n.scale,i):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:yt,translate3d:wt,rotate3d:bt,translate:Tt,rotate:St,scale:_t,skew:xt}};function Ct(t,e,r,n){n=n||!1,t.addEventListener(e,r,n)}function At(t,e,r,n){n=n||!1,t.removeEventListener(e,r,n)}e.TransformFunctions=Et;var It=function(){var t,e,r,n,i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){i=!0}});t=document,r=function(){},Ct(t,e="DOMContentLoaded",(function i(a){a.target===t&&(r(a),At(t,e,i,n))}),n=a)}catch(t){}return i}(),Mt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],kt="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Ot=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Pt=!!It&&{passive:!1};function Lt(t){this.scrolling&&t.preventDefault()}function jt(){var t=this.element;return t===Ot?{el:document,st:document.body}:{el:t,st:t}}function Ut(){var t=jt.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,Ct(t.el,Mt[0],Lt,Pt),Ct(t.el,kt,Lt,Pt),t.st.style.pointerEvents="none")}function Ft(){var t=jt.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,At(t.el,Mt[0],Lt,Pt),At(t.el,kt,Lt,Pt),t.st.style.pointerEvents="")}var Ht={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Ot,Ut.call(this),this.element===Ot?window.pageYOffset||Ot.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){t.scrollTop=S(e,r,n)>>0})},onComplete:function(t){Ft.call(this)}},Nt={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:S},functions:Ht,Util:{preventScroll:Lt,scrollIn:Ut,scrollOut:Ft,scrollContainer:Ot,passiveHandler:Pt,getScrollTargets:jt}};e.ScrollProperty=Nt;var Vt=function(t,e){return parseFloat(t)/100*e},Xt=function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")},Dt=function(t){var e=t.getAttribute("points").split(" "),r=0;if(e.length>1){var n=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a>0)/100,a=0-(100*S(e.s,r.s,n)>>0)/100,s=(100*S(e.e,r.e,n)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"}var Zt={prepareStart:function(){return Qt(this.element)},prepareProperty:function(t,e){return Qt(this.element,e)},onStart:function(t){t in this.valuesEnd&&!b[t]&&(b[t]=function(t,e,r,n){return Kt(t,e,r,n)})}},qt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:S,paintDraw:Kt},functions:Zt,Util:{getRectLength:Xt,getPolyLength:Dt,getLineLength:zt,getCircleLength:Bt,getEllipseLength:Rt,getTotalLength:Yt,getDraw:Qt,percent:Vt}};function Wt(t,e,r,n){for(var i=[],a=0;a>0)/1e3)}return i}e.SVGDraw=qt;var Gt="Invalid path value";function $t(t){return"number"==typeof t&&isFinite(t)}function Jt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function te(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function ee(t,e){return Jt(t,e)<1e-9}var re={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},ne=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function ie(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&ne.indexOf(t)>=0}function ae(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function se(t){return 97==(32|t)}function oe(t){return t>=48&&t<=57}function le(t){return t>=48&&t<=57||43===t||45===t||46===t}function ue(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function ce(t){for(;t.index=i)t.err="KUTE.js - "+Gt;else if(43!==(e=t.path.charCodeAt(n))&&45!==e||(e=++n2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(n));else for(;n.length>=re[r]&&(t.result.push([e].concat(n.splice(0,re[r]))),re[r]););}function de(t){var e,r,n,i,a,s=t.max;if(t.segmentStart=t.index,r=se(e=t.path.charCodeAt(t.index)),ae(e))if(i=re[t.path[t.index].toLowerCase()],t.index++,ce(t),t.data=[],i){for(n=!1;;){for(a=i;a>0;a--){if(!r||3!==a&&4!==a?he(t):pe(t),t.err.length)return;t.data.push(t.param),ce(t),n=!1,t.index=t.max)break;if(!le(t.path.charCodeAt(t.index)))break}}fe(t)}else fe(t);else t.err="KUTE.js - "+Gt}function ve(t){var e=new ue(t),r=e.max;for(ce(e);e.index0&&(s=Math.max(s,Math.ceil(r/e)));for(var o=0;oe;)i=te(n,i,.5),t.splice(r+1,0,i)}function Ae(t,e){var r,n;if("string"==typeof t){var i=ye(t,e);t=i.ring,n=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Gt);if(!Ie(r=t.slice(0)))throw new TypeError(Gt);return r.length>1&&ee(r[0],r[r.length-1])&&r.pop(),_e(r)>0&&r.reverse(),!n&&e&&$t(e)&&e>0&&Ce(r,e),r}function Ie(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&$t(t[0])&&$t(t[1])}))}function Me(t,e,r){var n=Ae(t,r=r||i.morphPrecision),a=Ae(e,r),s=n.length-a.length;return Ee(n,s<0?-1*s:0),Ee(a,s>0?s:0),Se(n,a),[n,a]}ge.prototype.iterate=function(t){var e,r=this.segments,n={},i=!1,a=0,s=0,o=0,l=0;return r.map((function(e,r){var u=t(e,r,a,s);Array.isArray(u)&&(n[r]=u,i=!0);var c=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return a=e[1]+(c?a:0),s=e[2]+(c?s:0),o=a,void(l=s);case"h":case"H":return void(a=e[1]+(c?a:0));case"v":case"V":return void(s=e[1]+(c?s:0));case"z":case"Z":return a=o,void(s=l);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],r.map((function(t,r){void 0!==n[r]?n[r].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},ge.prototype.abs=function(){return this.iterate((function(t,e,r,n){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=n);case"a":return t[6]+=r,void(t[7]+=n);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===r.segments[a-1][0],n=n.concat(t?i.slice(1):i)})),n.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var ke={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var r={},n=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(n&&/path|glyph/.test(n.tagName)?r.original=n.getAttribute("d").replace(i,""):!n&&/[a-z][^a-z]*/gi.test(e)&&(r.original=e.replace(i,"")),r)},onStart:function(t){!b[t]&&this.valuesEnd[t]&&(b[t]=function(t,e,r,n){var i,a=e.pathArray,s=r.pathArray,o=s.length;i=1===n?r.original:"M"+Wt(a,s,o,n).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,r=this.valuesEnd[t].pathArray;if(!e||!r||e&&r&&e.length!==r.length){var n=Me(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):i.morphPrecision);this.valuesStart[t].pathArray=n[0],this.valuesEnd[t].pathArray=n[1]}}}},Oe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Wt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:ke,Util:{INVALID_INPUT:Gt,isFiniteNumber:$t,distance:Jt,pointAlong:te,samePoint:ee,paramCounts:re,SPECIAL_SPACES:ne,isSpace:ie,isCommand:ae,isArc:se,isDigit:oe,isDigitStart:le,State:ue,skipSpaces:ce,scanFlag:pe,scanParam:he,finalizeSegment:fe,scanSegment:de,pathParse:ve,SvgPath:ge,split:me,pathStringToRing:ye,exactRing:we,approximateRing:be,measure:Te,rotateRing:Se,polygonLength:xe,polygonArea:_e,addPoints:Ee,bisect:Ce,normalizeRing:Ae,validRing:Ie,getInterpolationPoints:Me}};function Pe(t,e){var r=e.x,n=e.width;return/[a-zA-Z]/.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?r+parseFloat(t)*n/100:parseFloat(t)}function Le(t){var e=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",r={};if(e instanceof Array)for(var n=0,i=e.length;n>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==l?"scale("+(1e3*l>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],r=this.valuesEnd[t],n=je.call(this,t,Le(this.element.getAttribute("transform")));for(var i in n)e[i]=n[i];var a=this.element.ownerSVGElement,s=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in r&&"origin"!==o||(r[o]=e[o])}}},Fe={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:S},functions:Ue,Util:{parseStringOrigin:Pe,parseTransformString:Le,parseTransformSVG:je}};for(var He in e.SVGTransformProperty=Fe,e){var Ne=e[He];e[He]=new X(Ne)}return{Animation:X,Components:e,Tween:H,fromTo:function(t,e,r,n){return n=n||{},new U.Tween(j(t),e,r,n)},to:function(t,e,r){return(r=r||{}).resetStart=e,new U.Tween(j(t),e,e,r)},TweenCollection:V,allFromTo:function(t,e,r,n){return n=n||{},new V(j(t,!0),e,r,n)},allTo:function(t,e,r){return(r=r||{}).resetStart=e,new V(j(t,!0),e,e,r)},Objects:p,Util:t,Easing:L,CubicBezier:P,Render:I,Interpolate:x,Process:g,Internals:O,Selector:j,Version:"2.0.1"}})); diff --git a/src/interface/fromTo.js b/src/interface/fromTo.js index 01a820c..1a4549c 100644 --- a/src/interface/fromTo.js +++ b/src/interface/fromTo.js @@ -1,9 +1,7 @@ import selector from '../util/selector.js' import TweenConstructor from '../objects/TweenConstructor.js' -const TC = TweenConstructor.Tween - export default function fromTo(element, startObject, endObject, optionsObj) { optionsObj = optionsObj || {} - return new TC(selector(element), startObject, endObject, optionsObj) + return new TweenConstructor.Tween(selector(element), startObject, endObject, optionsObj) } \ No newline at end of file diff --git a/src/interface/to.js b/src/interface/to.js index e6f9114..df44a97 100644 --- a/src/interface/to.js +++ b/src/interface/to.js @@ -1,10 +1,9 @@ import selector from '../util/selector.js' import TweenConstructor from '../objects/TweenConstructor.js' -const TC = TweenConstructor.Tween export default function to(element, endObject, optionsObj) { optionsObj = optionsObj || {} optionsObj.resetStart = endObject - return new TC(selector(element), endObject, endObject, optionsObj) + return new TweenConstructor.Tween(selector(element), endObject, endObject, optionsObj) } \ No newline at end of file diff --git a/src/tween/tweenCollection.js b/src/tween/tweenCollection.js index c5c1f48..f33cd90 100644 --- a/src/tween/tweenCollection.js +++ b/src/tween/tweenCollection.js @@ -2,6 +2,8 @@ import KUTE from '../objects/KUTE.js' import TweenConstructor from '../objects/TweenConstructor.js' import defaultOptions from '../objects/defaultOptions.js' +let TC = TweenConstructor.Tween + // KUTE.js Tween Collection // ======================== @@ -13,7 +15,6 @@ export default class TweenCollection { !('offset' in defaultOptions) && (defaultOptions.offset = 0); // call in the tween constructor - const TC = TweenConstructor.Tween Ops = Ops || {} Ops.delay = Ops.delay || defaultOptions.delay; @@ -55,7 +56,7 @@ export default class TweenCollection { let lastTween = this.tweens[this.length-1] if (args instanceof TweenCollection){ lastTween.chain(args.tweens); - } else if (args instanceof TweenConstructor){ + } else if (args instanceof TC){ lastTween.chain(args); } else { throw new TypeError('KUTE.js - invalid chain value')