// KUTE.js Base v2.0.0 | 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={},n={duration:700,delay:0,easing:"linear"},r={},o={},i={},s={},a={},u={defaultOptions:n,linkProperty:s,onComplete:o,onStart:i,supportedProperties:e};var l={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)}};a.processEasing=function(t){return"function"==typeof t?t:"string"==typeof t?l[t]:l.linear};var c="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},f={},p={};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=function(e){t.push(e)},m=function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)},y=0;function g(e){for(var n=0;n1?1:e,n=this._easing(e),this.valuesEnd)p[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)},f.Tween=O;var k=f.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 B(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 P(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 A(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){!p[t]&&this.valuesEnd[t]&&(p[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?U(n.translate,r.translate,"px",o):"")+(n.rotate3d?B(n.rotate3d,r.rotate3d,"deg",o):"")+(n.rotate||r.rotate?j(n.rotate,r.rotate,"deg",o):"")+(n.skew?P(n.skew,r.skew,"deg",o):"")+(n.scale||r.scale?A(n.scale,r.scale,o):"")})}},Interpolate:{perspective:M,translate3d:x,rotate3d:B,translate:U,rotate:j,scale:A,skew:P}};function F(t){t in this.valuesEnd&&!p[t]&&(p[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&&!p[t]&&(p[t]=function(e,n,r,o){e.style[t]=(1e3*d(n,r,o)>>0)/1e3})}}};function H(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(){},H(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"],N="ontouchstart"in window||navigator&&navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",G=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.getElementsByTagName("HTML")[0],R=!!Q&&{passive:!1};function V(t){this.scrolling&&t.preventDefault()}function z(){var t=this.element;return t===G?{el:document,st:document.body}:{el:t,st:t}}function J(){var t=z.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,K(t.el,Z[0],V,R),K(t.el,N,V,R),t.st.style.pointerEvents="")}var W={component:"scrollProperty",property:"scroll",Interpolate:{numbers:d},functions:{onStart:function(t){t in this.valuesEnd&&!p[t]&&(p[t]=function(t,e,n,r){t.scrollTop=d(e,n,r)>>0})},onComplete:function(t){J.call(this)}},Util:{preventScroll:V,scrollIn:function(){var t=z.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,H(t.el,Z[0],V,R),H(t.el,N,V,R),t.st.style.pointerEvents="none")},scrollOut:J,scrollContainer:G,passiveHandler:R,getScrollTargets:z}},$=new I(q),tt=new I(Y),et=new I(D),nt=new I(W);return{Animation:I,Components:{BaseTransform:$,BaseBoxModel:tt,BaseScroll:nt,BaseOpacity:et},TweenBase:O,fromTo:function(t,e,n,r){return r=r||{},new k(S(t),e,n,r)},Objects:u,Easing:l,Util:a,Render:T,Interpolate:v,Internals:C,Selector:S,Version:"2.0.0"}}));