diff --git a/demo/src/kute.min.js b/demo/src/kute.min.js index 6eef738..9de307e 100644 --- a/demo/src/kute.min.js +++ b/demo/src/kute.min.js @@ -1,2 +1,2 @@ // KUTE.js Standard v2.0.11 | 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="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t 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+".")}}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(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."),P.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){if(x(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,!this._startFired){for(var n in this._onStart&&this._onStart.call(this),i)if("function"==typeof i[n])i[n].call(this,n);else for(var r in i[n])i[n][r].call(this,r);T.call(this),this._startFired=!0}return!s&&o(),this},U.prototype.stop=function(){return this.playing&&(S(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},L.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,M.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.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,x(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.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]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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))},n}(U);L.tween=F;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),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 L.tween))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 H=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*V(n,r,i)>>0)/10:V(n,r,i)>>0)+"px"})}H.prototype.setComponent=function(t){var e=t.component,n={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},a=t.category,s=t.property,o=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[e]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[s]=t.defaultValue,this.supports=s+" property";else if(t.defaultValues){for(var u in t.defaultValues)h[u]=t.defaultValues[u];this.supports=(o||s)+" "+(s||a)+" properties"}if(t.defaultOptions)for(var l in t.defaultOptions)f[l]=t.defaultOptions[l];if(t.functions)for(var c in n)if(c in t.functions)if("function"==typeof t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][a||s]&&(n[c][e][a||s]=t.functions[c]);else for(var w in t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][w]&&(n[c][e][w]=t.functions[c][w]);if(t.Interpolate){for(var _ in t.Interpolate){var x=t.Interpolate[_];if("function"!=typeof x||r[_])for(var S in x)"function"!=typeof x[S]||r[_]||(r[_]=x[S]);else r[_]=x}y[e]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return this};var Q=["top","left","width","height"],R={};Q.map((function(t){return R[t]=z}));var X={component:"essentialBoxModel",category:"boxModel",properties:Q,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:V},functions:{prepareStart:function(t){return I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:D}};function B(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 K(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?V(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*V(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+")"}function q(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=K(n,r,i)})}_.BoxModelEssential=X;var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],Z={};Y.map((function(t){Z[t]="#000"}));var $={};Y.map((function(t){return $[t]=q}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:Z,Interpolate:{numbers:V,colors:K},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}};_.ColorProperties=W;var G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n={};for(var r in e){var i=tt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=J.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=tt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(J.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,K(n,r,i))})},n[a]=B(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*V(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=D(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*V(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=G)}}},nt={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:V,colors:K},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:D}};_.HTMLAttributes=nt;var rt={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*V(n,r,i)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:V},functions:rt};_.OpacityProperty=it;var at=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),lt=at.concat(st,ut),ct=lt.concat(ot),pt={alpha:at,upper:st,symbols:ot,numeric:ut,alphanumeric:lt,all:ct},ht={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in pt?pt[n]:n&&n.length?n:pt[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=V(e,n,r)>>0})}};function ft(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 dt(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function yt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}_.TextWriteProperties=vt;var _t={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 n=C(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0];else if(/[XYZ]/.test(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:bt}};function xt(t,e){return parseFloat(t)/100*e}function St(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(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*V(e.s,n.s,r)>>0)/100,s=(100*V(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"})}},Ot={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:V},functions:kt,Util:{getRectLength:St,getPolyLength:Tt,getLineLength:Et,getCircleLength:Ct,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Mt,percent:xt}};_.SVGDraw=Ot;var Lt="Invalid path value";function Pt(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 Ut(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Ft(t,e){return jt(t,e)<1e-9}var Nt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Ht=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Dt(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Ht.indexOf(t)>=0}function Vt(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 zt(t){return 97==(32|t)}function Qt(t){return t>=48&&t<=57}function Rt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Xt(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Bt(t){for(;t.index=i)t.err="KUTE.js - "+Lt;else if(43!==(e=t.path.charCodeAt(r))&&45!==e||(e=++r2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Nt[n]&&(t.result.push([e].concat(r.splice(0,Nt[n]))),Nt[n]););}function Zt(t){var e,n,r,i,a,s=t.max;if(t.segmentStart=t.index,n=zt(e=t.path.charCodeAt(t.index)),Vt(e))if(i=Nt[t.path[t.index].toLowerCase()],t.index++,Bt(t),t.data=[],i){for(r=!1;;){for(a=i;a>0;a--){if(!n||3!==a&&4!==a?qt(t):Kt(t),t.err.length)return;t.data.push(t.param),Bt(t),r=!1,t.index=t.max)break;if(!Rt(t.path.charCodeAt(t.index)))break}}Yt(t)}else Yt(t);else t.err="KUTE.js - "+Lt}function $t(t){var e=new Xt(t),n=e.max;for(Bt(e);e.index0&&(s=Math.max(s,Math.ceil(n/e)));for(var o=0;oe;)i=Ut(r,i,.5),t.splice(n+1,0,i)}function ue(t,e){var n,r;if("string"==typeof t){var i=Jt(t,e);t=i.ring,r=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Lt);if(!le(n=t.slice(0)))throw new TypeError(Lt);return n.length>1&&Ft(n[0],n[n.length-1])&&n.pop(),ae(n)>0&&n.reverse(),!r&&e&&Pt(e)&&e>0&&oe(n,e),n}function le(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&Pt(t[0])&&Pt(t[1])}))}function ce(t,e,n){var r=ue(t,n=n||f.morphPrecision),i=ue(e,n),a=r.length-i.length;return se(r,a<0?-1*a:0),se(i,a>0?a:0),re(r,i),[r,i]}Wt.prototype.iterate=function(t){var e,n=this.segments,r={},i=!1,a=0,s=0,o=0,u=0;return n.map((function(e,n){var l=t(e,n,a,s);Array.isArray(l)&&(r[n]=l,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(u=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=u);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],n.map((function(t,n){void 0!==r[n]?r[n].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},Wt.prototype.abs=function(){return this.iterate((function(t,e,n,r){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===n.segments[a-1][0],r=r.concat(t?i.slice(1):i)})),r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var pe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:V,defaultOptions:{morphPrecision:10,morphIndex:0},functions:{prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):!r&&/[a-z][^a-z]*/gi.test(e)&&(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i,a=e.pathArray,s=n.pathArray,o=s.length;i=1===r?n.original:"M"+function(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}(a,s,o,r).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=ce(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Util:{INVALID_INPUT:Lt,isFiniteNumber:Pt,distance:jt,pointAlong:Ut,samePoint:Ft,paramCounts:Nt,SPECIAL_SPACES:Ht,isSpace:Dt,isCommand:Vt,isArc:zt,isDigit:Qt,isDigitStart:Rt,State:Xt,skipSpaces:Bt,scanFlag:Kt,scanParam:qt,finalizeSegment:Yt,scanSegment:Zt,pathParse:$t,SvgPath:Wt,split:Gt,pathStringToRing:Jt,exactRing:te,approximateRing:ee,measure:ne,rotateRing:re,polygonLength:ie,polygonArea:ae,addPoints:se,bisect:oe,normalizeRing:ue,validRing:le,getInterpolationPoints:ce}};for(var he in _.SVGMorph=pe,_){var fe=_[he];_[he]=new H(fe)}return{Animation:H,Components:_,Tween:F,fromTo:function(t,e,n,r){return r=r||{},new L.tween(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(j(t),e,e,n)},TweenCollection:N,allFromTo:function(t,e,n,r){return r=r||{},new N(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(j(t,!0),e,e,n)},Objects:w,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:E,Selector:j,Version:"2.0.11"}})); +!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="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t 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+".")}}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(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."),P.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){if(x(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,!this._startFired){for(var n in this._onStart&&this._onStart.call(this),i)if("function"==typeof i[n])i[n].call(this,n);else for(var r in i[n])i[n][r].call(this,r);T.call(this),this._startFired=!0}return!s&&o(),this},U.prototype.stop=function(){return this.playing&&(S(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},L.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,M.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.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,x(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.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]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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))},n}(U);L.tween=F;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),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 L.tween))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 H=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*V(n,r,i)>>0)/10:V(n,r,i)>>0)+"px"})}H.prototype.setComponent=function(t){var e=t.component,n={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},a=t.category,s=t.property,o=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[e]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[s]=t.defaultValue,this.supports=s+" property";else if(t.defaultValues){for(var u in t.defaultValues)h[u]=t.defaultValues[u];this.supports=(o||s)+" "+(s||a)+" properties"}if(t.defaultOptions)for(var l in t.defaultOptions)f[l]=t.defaultOptions[l];if(t.functions)for(var c in n)if(c in t.functions)if("function"==typeof t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][a||s]&&(n[c][e][a||s]=t.functions[c]);else for(var w in t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][w]&&(n[c][e][w]=t.functions[c][w]);if(t.Interpolate){for(var _ in t.Interpolate){var x=t.Interpolate[_];if("function"!=typeof x||r[_])for(var S in x)"function"!=typeof x[S]||r[_]||(r[_]=x[S]);else r[_]=x}y[e]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return this};var Q=["top","left","width","height"],R={};Q.map((function(t){return R[t]=z}));var X={component:"essentialBoxModel",category:"boxModel",properties:Q,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:V},functions:{prepareStart:function(t){return I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:D}};function B(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 K(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?V(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*V(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+")"}function q(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=K(n,r,i)})}_.BoxModelEssential=X;var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],Z={};Y.map((function(t){Z[t]="#000"}));var $={};Y.map((function(t){return $[t]=q}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:Z,Interpolate:{numbers:V,colors:K},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}};_.ColorProperties=W;var G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n={};for(var r in e){var i=tt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=J.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=tt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(J.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,K(n,r,i))})},n[a]=B(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*V(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=D(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*V(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=G)}}},nt={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:V,colors:K},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:D}};_.HTMLAttributes=nt;var rt={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*V(n,r,i)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:V},functions:rt};_.OpacityProperty=it;var at=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),lt=at.concat(st,ut),ct=lt.concat(ot),pt={alpha:at,upper:st,symbols:ot,numeric:ut,alphanumeric:lt,all:ct},ht={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in pt?pt[n]:n&&n.length?n:pt[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=V(e,n,r)>>0})}};function ft(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 dt(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function yt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}_.TextWriteProperties=vt;var _t={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 n=C(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0];else if(/[XYZ]/.test(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:bt}};function xt(t,e){return parseFloat(t)/100*e}function St(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(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*V(e.s,n.s,r)>>0)/100,s=(100*V(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"})}},Ot={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:V},functions:kt,Util:{getRectLength:St,getPolyLength:Tt,getLineLength:Et,getCircleLength:Ct,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Mt,percent:xt}};function Lt(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}_.SVGDraw=Ot;var Pt="Invalid path value";function jt(t){return"number"==typeof t&&isFinite(t)}function Ut(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ft(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Nt(t,e){return Ut(t,e)<1e-9}var Ht={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Dt=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Vt(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Dt.indexOf(t)>=0}function zt(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 Qt(t){return 97==(32|t)}function Rt(t){return t>=48&&t<=57}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Bt(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Kt(t){for(;t.index=i)t.err="KUTE.js - "+Pt;else if(43!==(e=t.path.charCodeAt(r))&&45!==e||(e=++r2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Ht[n]&&(t.result.push([e].concat(r.splice(0,Ht[n]))),Ht[n]););}function $t(t){var e,n,r,i,a,s=t.max;if(t.segmentStart=t.index,n=Qt(e=t.path.charCodeAt(t.index)),zt(e))if(i=Ht[t.path[t.index].toLowerCase()],t.index++,Kt(t),t.data=[],i){for(r=!1;;){for(a=i;a>0;a--){if(!n||3!==a&&4!==a?Yt(t):qt(t),t.err.length)return;t.data.push(t.param),Kt(t),r=!1,t.index=t.max)break;if(!Xt(t.path.charCodeAt(t.index)))break}}Zt(t)}else Zt(t);else t.err="KUTE.js - "+Pt}function Wt(t){var e=new Bt(t),n=e.max;for(Kt(e);e.index0&&(s=Math.max(s,Math.ceil(n/e)));for(var o=0;oe;)i=Ft(r,i,.5),t.splice(n+1,0,i)}function le(t,e){var n,r;if("string"==typeof t){var i=te(t,e);t=i.ring,r=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Pt);if(!ce(n=t.slice(0)))throw new TypeError(Pt);return n.length>1&&Nt(n[0],n[n.length-1])&&n.pop(),se(n)>0&&n.reverse(),!r&&e&&jt(e)&&e>0&&ue(n,e),n}function ce(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&jt(t[0])&&jt(t[1])}))}function pe(t,e,n){var r=le(t,n=n||f.morphPrecision),i=le(e,n),a=r.length-i.length;return oe(r,a<0?-1*a:0),oe(i,a>0?a:0),ie(r,i),[r,i]}Gt.prototype.iterate=function(t){var e,n=this.segments,r={},i=!1,a=0,s=0,o=0,u=0;return n.map((function(e,n){var l=t(e,n,a,s);Array.isArray(l)&&(r[n]=l,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(u=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=u);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],n.map((function(t,n){void 0!==r[n]?r[n].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},Gt.prototype.abs=function(){return this.iterate((function(t,e,n,r){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===n.segments[a-1][0],r=r.concat(t?i.slice(1):i)})),r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var he={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):!r&&/[a-z][^a-z]*/gi.test(e)&&(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i,a=e.pathArray,s=n.pathArray,o=s.length;i=1===r?n.original:"M"+Lt(a,s,o,r).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=pe(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},fe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Lt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:he,Util:{INVALID_INPUT:Pt,isFiniteNumber:jt,distance:Ut,pointAlong:Ft,samePoint:Nt,paramCounts:Ht,SPECIAL_SPACES:Dt,isSpace:Vt,isCommand:zt,isArc:Qt,isDigit:Rt,isDigitStart:Xt,State:Bt,skipSpaces:Kt,scanFlag:qt,scanParam:Yt,finalizeSegment:Zt,scanSegment:$t,pathParse:Wt,SvgPath:Gt,split:Jt,pathStringToRing:te,exactRing:ee,approximateRing:ne,measure:re,rotateRing:ie,polygonLength:ae,polygonArea:se,addPoints:oe,bisect:ue,normalizeRing:le,validRing:ce,getInterpolationPoints:pe}};for(var de in _.SVGMorph=fe,_){var ve=_[de];_[de]=new H(ve)}return{Animation:H,Components:_,Tween:F,fromTo:function(t,e,n,r){return r=r||{},new L.tween(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(j(t),e,e,n)},TweenCollection:N,allFromTo:function(t,e,n,r){return r=r||{},new N(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(j(t,!0),e,e,n)},Objects:w,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:E,Selector:j,Version:"2.0.11"}})); diff --git a/dist/kute.esm.js b/dist/kute.esm.js index 891a82a..4b8d7da 100644 --- a/dist/kute.esm.js +++ b/dist/kute.esm.js @@ -768,14 +768,14 @@ function trueDimension (dimValue, isAngle) { return { v: intValue, u: theUnit }; } -function coords(a, b, v) { +function numbers(a, b, v) { a = +a; b -= a; return a + b * v; } function boxModelOnStart(tweenProp){ if (tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem, a, b, v) { - elem.style[tweenProp] = (v > 0.99 || v < 0.01 ? ((coords(a,b,v)*10)>>0)/10 : (coords(a,b,v) ) >> 0) + "px"; + elem.style[tweenProp] = (v > 0.99 || v < 0.01 ? ((numbers(a,b,v)*10)>>0)/10 : (numbers(a,b,v) ) >> 0) + "px"; }; } } @@ -801,7 +801,7 @@ var essentialBoxModel = { category: 'boxModel', properties: essentialBoxProps, defaultValues: essentialBoxPropsValues, - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: essentialBoxModelFunctions, Util:{trueDimension: trueDimension} }; @@ -845,7 +845,7 @@ function colors(a, b, v) { cm =',', rgb = 'rgb(', rgba = 'rgba('; - for (c in b) { _c[c] = c !== 'a' ? (coords(a[c],b[c],v)>>0 || 0) : (a[c] && b[c]) ? (coords(a[c],b[c],v) * 100 >> 0 )/100 : null; } + for (c in b) { _c[c] = c !== 'a' ? (numbers(a[c],b[c],v)>>0 || 0) : (a[c] && b[c]) ? (numbers(a[c],b[c],v) * 100 >> 0 )/100 : null; } return !_c.a ? rgb + _c.r + cm + _c.g + cm + _c.b + ep : rgba + _c.r + cm + _c.g + cm + _c.b + cm + _c.a + ep; } @@ -880,7 +880,7 @@ var colorProperties = { category: 'colors', properties: supportedColors, defaultValues: defaultColors, - Interpolate: {numbers: coords,colors: colors}, + Interpolate: {numbers: numbers,colors: colors}, functions: colorFunctions, Util: {trueColor: trueColor} }; @@ -930,7 +930,7 @@ function prepareAttr(tweenProp,attrObj){ if ( this.valuesEnd[tweenProp] && this.valuesEnd[tweenProp][tp] && !(tp in attributes) ) { attributes[tp] = function (elem, p, a, b, v) { var _p = p.replace(suffix,''); - elem.setAttribute(_p, ( (coords(a.v,b.v,v)*1000>>0)/1000) + b.u ); + elem.setAttribute(_p, ( (numbers(a.v,b.v,v)*1000>>0)/1000) + b.u ); }; } }; @@ -939,7 +939,7 @@ function prepareAttr(tweenProp,attrObj){ onStart[ComponentName][prop] = function(tp) { if ( this.valuesEnd[tweenProp] && this.valuesEnd[tweenProp][tp] && !(tp in attributes) ) { attributes[tp] = function (elem, oneAttr, a, b, v) { - elem.setAttribute(oneAttr, (coords(a,b,v) * 1000 >> 0) / 1000 ); + elem.setAttribute(oneAttr, (numbers(a,b,v) * 1000 >> 0) / 1000 ); }; } }; @@ -968,7 +968,7 @@ var 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: coords,colors: colors }, + Interpolate: { numbers: numbers,colors: colors }, functions: attrFunctions, Util: { replaceUppercase: replaceUppercase, trueColor: trueColor, trueDimension: trueDimension } }; @@ -977,7 +977,7 @@ Components.HTMLAttributes = htmlAttributes; function onStartOpacity(tweenProp){ if ( tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem, a, b, v) { - elem.style[tweenProp] = ((coords(a,b,v) * 1000)>>0)/1000; + elem.style[tweenProp] = ((numbers(a,b,v) * 1000)>>0)/1000; }; } } @@ -997,7 +997,7 @@ var opacityProperty = { component: 'opacityProperty', property: 'opacity', defaultValue: 1, - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: opacityFunctions }; Components.OpacityProperty = opacityProperty; @@ -1046,7 +1046,7 @@ var onStartWrite = { number: function(tweenProp) { if ( tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem, a, b, v) { - elem.innerHTML = coords(a, b, v)>>0; + elem.innerHTML = numbers(a, b, v)>>0; }; } } @@ -1164,7 +1164,7 @@ var textWrite = { properties: ['text','number'], defaultValues: {text: ' ',numbers:'0'}, defaultOptions: { textChars: 'alpha' }, - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: textWriteFunctions, Util: { charSet: charSet, createTextTweens: createTextTweens } }; @@ -1309,8 +1309,8 @@ function onStartDraw(tweenProp){ if ( tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem,a,b,v) { var pathLength = (a.l*100>>0)/100, - start = (coords(a.s,b.s,v)*100>>0)/100, - end = (coords(a.e,b.e,v)*100>>0)/100, + start = (numbers(a.s,b.s,v)*100>>0)/100, + end = (numbers(a.e,b.e,v)*100>>0)/100, offset = 0 - start, dashOne = end+offset; elem.style.strokeDashoffset = offset + "px"; @@ -1416,7 +1416,7 @@ var svgDraw = { component: 'svgDraw', property: 'draw', defaultValue: '0% 0%', - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: svgDrawFunctions, Util: { getRectLength: getRectLength, @@ -1432,7 +1432,7 @@ var svgDraw = { }; Components.SVGDraw = svgDraw; -function coords$1(a, b, l, v) { +function coords(a, b, l, v) { var points = []; for(var i=0;i(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t 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+".")}}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(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."),P.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){if(x(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,!this._startFired){for(var n in this._onStart&&this._onStart.call(this),i)if("function"==typeof i[n])i[n].call(this,n);else for(var r in i[n])i[n][r].call(this,r);T.call(this),this._startFired=!0}return!s&&o(),this},U.prototype.stop=function(){return this.playing&&(S(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},L.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,M.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.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,x(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.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]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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))},n}(U);L.tween=F;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),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 L.tween))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 H=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*V(n,r,i)>>0)/10:V(n,r,i)>>0)+"px"})}H.prototype.setComponent=function(t){var e=t.component,n={prepareProperty:v,prepareStart:d,onStart:i,onComplete:m,crossCheck:g},a=t.category,s=t.property,o=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[e]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[s]=t.defaultValue,this.supports=s+" property";else if(t.defaultValues){for(var u in t.defaultValues)h[u]=t.defaultValues[u];this.supports=(o||s)+" "+(s||a)+" properties"}if(t.defaultOptions)for(var l in t.defaultOptions)f[l]=t.defaultOptions[l];if(t.functions)for(var c in n)if(c in t.functions)if("function"==typeof t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][a||s]&&(n[c][e][a||s]=t.functions[c]);else for(var w in t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][w]&&(n[c][e][w]=t.functions[c][w]);if(t.Interpolate){for(var _ in t.Interpolate){var x=t.Interpolate[_];if("function"!=typeof x||r[_])for(var S in x)"function"!=typeof x[S]||r[_]||(r[_]=x[S]);else r[_]=x}y[e]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return this};var Q=["top","left","width","height"],R={};Q.map((function(t){return R[t]=z}));var X={component:"essentialBoxModel",category:"boxModel",properties:Q,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:V},functions:{prepareStart:function(t){return I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:D}};function B(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 K(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?V(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*V(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+")"}function q(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=K(n,r,i)})}_.BoxModelEssential=X;var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],Z={};Y.map((function(t){Z[t]="#000"}));var $={};Y.map((function(t){return $[t]=q}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:Z,Interpolate:{numbers:V,colors:K},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}};_.ColorProperties=W;var G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n={};for(var r in e){var i=tt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=J.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=tt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(J.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,K(n,r,i))})},n[a]=B(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*V(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=D(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*V(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=G)}}},nt={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:V,colors:K},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:D}};_.HTMLAttributes=nt;var rt={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*V(n,r,i)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:V},functions:rt};_.OpacityProperty=it;var at=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),lt=at.concat(st,ut),ct=lt.concat(ot),pt={alpha:at,upper:st,symbols:ot,numeric:ut,alphanumeric:lt,all:ct},ht={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in pt?pt[n]:n&&n.length?n:pt[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=V(e,n,r)>>0})}};function ft(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 vt(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function yt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}_.TextWriteProperties=dt;var _t={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 n=E(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0];else if(/[XYZ]/.test(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},v=0;v>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:bt}};function xt(t,e){return parseFloat(t)/100*e}function St(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(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*V(e.s,n.s,r)>>0)/100,s=(100*V(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"})}},Ot={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:V},functions:kt,Util:{getRectLength:St,getPolyLength:Tt,getLineLength:Ct,getCircleLength:Et,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Mt,percent:xt}};_.SVGDraw=Ot;var Lt="Invalid path value";function Pt(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 Ut(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Ft(t,e){return jt(t,e)<1e-9}var Nt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Ht=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Dt(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Ht.indexOf(t)>=0}function Vt(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 zt(t){return 97==(32|t)}function Qt(t){return t>=48&&t<=57}function Rt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Xt(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Bt(t){for(;t.index=i)t.err="KUTE.js - "+Lt;else if(43!==(e=t.path.charCodeAt(r))&&45!==e||(e=++r2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Nt[n]&&(t.result.push([e].concat(r.splice(0,Nt[n]))),Nt[n]););}function Zt(t){var e,n,r,i,a,s=t.max;if(t.segmentStart=t.index,n=zt(e=t.path.charCodeAt(t.index)),Vt(e))if(i=Nt[t.path[t.index].toLowerCase()],t.index++,Bt(t),t.data=[],i){for(r=!1;;){for(a=i;a>0;a--){if(!n||3!==a&&4!==a?qt(t):Kt(t),t.err.length)return;t.data.push(t.param),Bt(t),r=!1,t.index=t.max)break;if(!Rt(t.path.charCodeAt(t.index)))break}}Yt(t)}else Yt(t);else t.err="KUTE.js - "+Lt}function $t(t){var e=new Xt(t),n=e.max;for(Bt(e);e.index0&&(s=Math.max(s,Math.ceil(n/e)));for(var o=0;oe;)i=Ut(r,i,.5),t.splice(n+1,0,i)}function ue(t,e){var n,r;if("string"==typeof t){var i=Jt(t,e);t=i.ring,r=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Lt);if(!le(n=t.slice(0)))throw new TypeError(Lt);return n.length>1&&Ft(n[0],n[n.length-1])&&n.pop(),ae(n)>0&&n.reverse(),!r&&e&&Pt(e)&&e>0&&oe(n,e),n}function le(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&Pt(t[0])&&Pt(t[1])}))}function ce(t,e,n){var r=ue(t,n=n||f.morphPrecision),i=ue(e,n),a=r.length-i.length;return se(r,a<0?-1*a:0),se(i,a>0?a:0),re(r,i),[r,i]}Wt.prototype.iterate=function(t){var e,n=this.segments,r={},i=!1,a=0,s=0,o=0,u=0;return n.map((function(e,n){var l=t(e,n,a,s);Array.isArray(l)&&(r[n]=l,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(u=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=u);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],n.map((function(t,n){void 0!==r[n]?r[n].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},Wt.prototype.abs=function(){return this.iterate((function(t,e,n,r){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===n.segments[a-1][0],r=r.concat(t?i.slice(1):i)})),r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var pe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:V,defaultOptions:{morphPrecision:10,morphIndex:0},functions:{prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):!r&&/[a-z][^a-z]*/gi.test(e)&&(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i,a=e.pathArray,s=n.pathArray,o=s.length;i=1===r?n.original:"M"+function(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}(a,s,o,r).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=ce(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Util:{INVALID_INPUT:Lt,isFiniteNumber:Pt,distance:jt,pointAlong:Ut,samePoint:Ft,paramCounts:Nt,SPECIAL_SPACES:Ht,isSpace:Dt,isCommand:Vt,isArc:zt,isDigit:Qt,isDigitStart:Rt,State:Xt,skipSpaces:Bt,scanFlag:Kt,scanParam:qt,finalizeSegment:Yt,scanSegment:Zt,pathParse:$t,SvgPath:Wt,split:Gt,pathStringToRing:Jt,exactRing:te,approximateRing:ee,measure:ne,rotateRing:re,polygonLength:ie,polygonArea:ae,addPoints:se,bisect:oe,normalizeRing:ue,validRing:le,getInterpolationPoints:ce}};for(var he in _.SVGMorph=pe,_){var fe=_[he];_[he]=new H(fe)}var ve={Animation:H,Components:_,Tween:F,fromTo:function(t,e,n,r){return r=r||{},new L.tween(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(j(t),e,e,n)},TweenCollection:N,allFromTo:function(t,e,n,r){return r=r||{},new N(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(j(t,!0),e,e,n)},Objects:w,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:C,Selector:j,Version:"2.0.11"};export default ve; +var t={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t 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+".")}}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(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."),P.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){if(x(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,!this._startFired){for(var n in this._onStart&&this._onStart.call(this),i)if("function"==typeof i[n])i[n].call(this,n);else for(var r in i[n])i[n][r].call(this,r);T.call(this),this._startFired=!0}return!s&&o(),this},U.prototype.stop=function(){return this.playing&&(S(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},L.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,M.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.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,x(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.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]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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))},n}(U);L.tween=F;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),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 L.tween))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 H=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*V(n,r,i)>>0)/10:V(n,r,i)>>0)+"px"})}H.prototype.setComponent=function(t){var e=t.component,n={prepareProperty:v,prepareStart:d,onStart:i,onComplete:m,crossCheck:g},a=t.category,s=t.property,o=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[e]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[s]=t.defaultValue,this.supports=s+" property";else if(t.defaultValues){for(var u in t.defaultValues)h[u]=t.defaultValues[u];this.supports=(o||s)+" "+(s||a)+" properties"}if(t.defaultOptions)for(var l in t.defaultOptions)f[l]=t.defaultOptions[l];if(t.functions)for(var c in n)if(c in t.functions)if("function"==typeof t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][a||s]&&(n[c][e][a||s]=t.functions[c]);else for(var w in t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][w]&&(n[c][e][w]=t.functions[c][w]);if(t.Interpolate){for(var _ in t.Interpolate){var x=t.Interpolate[_];if("function"!=typeof x||r[_])for(var S in x)"function"!=typeof x[S]||r[_]||(r[_]=x[S]);else r[_]=x}y[e]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return this};var Q=["top","left","width","height"],R={};Q.map((function(t){return R[t]=z}));var X={component:"essentialBoxModel",category:"boxModel",properties:Q,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:V},functions:{prepareStart:function(t){return I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:D}};function B(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 K(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?V(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*V(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+")"}function q(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=K(n,r,i)})}_.BoxModelEssential=X;var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],Z={};Y.map((function(t){Z[t]="#000"}));var $={};Y.map((function(t){return $[t]=q}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:Z,Interpolate:{numbers:V,colors:K},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}};_.ColorProperties=W;var G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n={};for(var r in e){var i=tt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=J.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=tt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(J.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,K(n,r,i))})},n[a]=B(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*V(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=D(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*V(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=G)}}},nt={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:V,colors:K},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:D}};_.HTMLAttributes=nt;var rt={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*V(n,r,i)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:V},functions:rt};_.OpacityProperty=it;var at=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),lt=at.concat(st,ut),ct=lt.concat(ot),pt={alpha:at,upper:st,symbols:ot,numeric:ut,alphanumeric:lt,all:ct},ht={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in pt?pt[n]:n&&n.length?n:pt[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=V(e,n,r)>>0})}};function ft(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 vt(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function yt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}_.TextWriteProperties=dt;var _t={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 n=E(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0];else if(/[XYZ]/.test(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},v=0;v>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:bt}};function xt(t,e){return parseFloat(t)/100*e}function St(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(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*V(e.s,n.s,r)>>0)/100,s=(100*V(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"})}},Ot={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:V},functions:kt,Util:{getRectLength:St,getPolyLength:Tt,getLineLength:Ct,getCircleLength:Et,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Mt,percent:xt}};function Lt(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}_.SVGDraw=Ot;var Pt="Invalid path value";function jt(t){return"number"==typeof t&&isFinite(t)}function Ut(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ft(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Nt(t,e){return Ut(t,e)<1e-9}var Ht={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Dt=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Vt(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Dt.indexOf(t)>=0}function zt(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 Qt(t){return 97==(32|t)}function Rt(t){return t>=48&&t<=57}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Bt(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Kt(t){for(;t.index=i)t.err="KUTE.js - "+Pt;else if(43!==(e=t.path.charCodeAt(r))&&45!==e||(e=++r2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Ht[n]&&(t.result.push([e].concat(r.splice(0,Ht[n]))),Ht[n]););}function $t(t){var e,n,r,i,a,s=t.max;if(t.segmentStart=t.index,n=Qt(e=t.path.charCodeAt(t.index)),zt(e))if(i=Ht[t.path[t.index].toLowerCase()],t.index++,Kt(t),t.data=[],i){for(r=!1;;){for(a=i;a>0;a--){if(!n||3!==a&&4!==a?Yt(t):qt(t),t.err.length)return;t.data.push(t.param),Kt(t),r=!1,t.index=t.max)break;if(!Xt(t.path.charCodeAt(t.index)))break}}Zt(t)}else Zt(t);else t.err="KUTE.js - "+Pt}function Wt(t){var e=new Bt(t),n=e.max;for(Kt(e);e.index0&&(s=Math.max(s,Math.ceil(n/e)));for(var o=0;oe;)i=Ft(r,i,.5),t.splice(n+1,0,i)}function le(t,e){var n,r;if("string"==typeof t){var i=te(t,e);t=i.ring,r=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Pt);if(!ce(n=t.slice(0)))throw new TypeError(Pt);return n.length>1&&Nt(n[0],n[n.length-1])&&n.pop(),se(n)>0&&n.reverse(),!r&&e&&jt(e)&&e>0&&ue(n,e),n}function ce(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&jt(t[0])&&jt(t[1])}))}function pe(t,e,n){var r=le(t,n=n||f.morphPrecision),i=le(e,n),a=r.length-i.length;return oe(r,a<0?-1*a:0),oe(i,a>0?a:0),ie(r,i),[r,i]}Gt.prototype.iterate=function(t){var e,n=this.segments,r={},i=!1,a=0,s=0,o=0,u=0;return n.map((function(e,n){var l=t(e,n,a,s);Array.isArray(l)&&(r[n]=l,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(u=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=u);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],n.map((function(t,n){void 0!==r[n]?r[n].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},Gt.prototype.abs=function(){return this.iterate((function(t,e,n,r){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===n.segments[a-1][0],r=r.concat(t?i.slice(1):i)})),r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var he={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):!r&&/[a-z][^a-z]*/gi.test(e)&&(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i,a=e.pathArray,s=n.pathArray,o=s.length;i=1===r?n.original:"M"+Lt(a,s,o,r).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=pe(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},fe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Lt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:he,Util:{INVALID_INPUT:Pt,isFiniteNumber:jt,distance:Ut,pointAlong:Ft,samePoint:Nt,paramCounts:Ht,SPECIAL_SPACES:Dt,isSpace:Vt,isCommand:zt,isArc:Qt,isDigit:Rt,isDigitStart:Xt,State:Bt,skipSpaces:Kt,scanFlag:qt,scanParam:Yt,finalizeSegment:Zt,scanSegment:$t,pathParse:Wt,SvgPath:Gt,split:Jt,pathStringToRing:te,exactRing:ee,approximateRing:ne,measure:re,rotateRing:ie,polygonLength:ae,polygonArea:se,addPoints:oe,bisect:ue,normalizeRing:le,validRing:ce,getInterpolationPoints:pe}};for(var ve in _.SVGMorph=fe,_){var de=_[ve];_[ve]=new H(de)}var ge={Animation:H,Components:_,Tween:F,fromTo:function(t,e,n,r){return r=r||{},new L.tween(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(j(t),e,e,n)},TweenCollection:N,allFromTo:function(t,e,n,r){return r=r||{},new N(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(j(t,!0),e,e,n)},Objects:w,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:C,Selector:j,Version:"2.0.11"};export default ge; diff --git a/dist/kute.js b/dist/kute.js index 0023676..2baba37 100644 --- a/dist/kute.js +++ b/dist/kute.js @@ -774,14 +774,14 @@ return { v: intValue, u: theUnit }; } - function coords(a, b, v) { + function numbers(a, b, v) { a = +a; b -= a; return a + b * v; } function boxModelOnStart(tweenProp){ if (tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem, a, b, v) { - elem.style[tweenProp] = (v > 0.99 || v < 0.01 ? ((coords(a,b,v)*10)>>0)/10 : (coords(a,b,v) ) >> 0) + "px"; + elem.style[tweenProp] = (v > 0.99 || v < 0.01 ? ((numbers(a,b,v)*10)>>0)/10 : (numbers(a,b,v) ) >> 0) + "px"; }; } } @@ -807,7 +807,7 @@ category: 'boxModel', properties: essentialBoxProps, defaultValues: essentialBoxPropsValues, - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: essentialBoxModelFunctions, Util:{trueDimension: trueDimension} }; @@ -851,7 +851,7 @@ cm =',', rgb = 'rgb(', rgba = 'rgba('; - for (c in b) { _c[c] = c !== 'a' ? (coords(a[c],b[c],v)>>0 || 0) : (a[c] && b[c]) ? (coords(a[c],b[c],v) * 100 >> 0 )/100 : null; } + for (c in b) { _c[c] = c !== 'a' ? (numbers(a[c],b[c],v)>>0 || 0) : (a[c] && b[c]) ? (numbers(a[c],b[c],v) * 100 >> 0 )/100 : null; } return !_c.a ? rgb + _c.r + cm + _c.g + cm + _c.b + ep : rgba + _c.r + cm + _c.g + cm + _c.b + cm + _c.a + ep; } @@ -886,7 +886,7 @@ category: 'colors', properties: supportedColors, defaultValues: defaultColors, - Interpolate: {numbers: coords,colors: colors}, + Interpolate: {numbers: numbers,colors: colors}, functions: colorFunctions, Util: {trueColor: trueColor} }; @@ -936,7 +936,7 @@ if ( this.valuesEnd[tweenProp] && this.valuesEnd[tweenProp][tp] && !(tp in attributes) ) { attributes[tp] = function (elem, p, a, b, v) { var _p = p.replace(suffix,''); - elem.setAttribute(_p, ( (coords(a.v,b.v,v)*1000>>0)/1000) + b.u ); + elem.setAttribute(_p, ( (numbers(a.v,b.v,v)*1000>>0)/1000) + b.u ); }; } }; @@ -945,7 +945,7 @@ onStart[ComponentName][prop] = function(tp) { if ( this.valuesEnd[tweenProp] && this.valuesEnd[tweenProp][tp] && !(tp in attributes) ) { attributes[tp] = function (elem, oneAttr, a, b, v) { - elem.setAttribute(oneAttr, (coords(a,b,v) * 1000 >> 0) / 1000 ); + elem.setAttribute(oneAttr, (numbers(a,b,v) * 1000 >> 0) / 1000 ); }; } }; @@ -974,7 +974,7 @@ 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: coords,colors: colors }, + Interpolate: { numbers: numbers,colors: colors }, functions: attrFunctions, Util: { replaceUppercase: replaceUppercase, trueColor: trueColor, trueDimension: trueDimension } }; @@ -983,7 +983,7 @@ function onStartOpacity(tweenProp){ if ( tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem, a, b, v) { - elem.style[tweenProp] = ((coords(a,b,v) * 1000)>>0)/1000; + elem.style[tweenProp] = ((numbers(a,b,v) * 1000)>>0)/1000; }; } } @@ -1003,7 +1003,7 @@ component: 'opacityProperty', property: 'opacity', defaultValue: 1, - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: opacityFunctions }; Components.OpacityProperty = opacityProperty; @@ -1052,7 +1052,7 @@ number: function(tweenProp) { if ( tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem, a, b, v) { - elem.innerHTML = coords(a, b, v)>>0; + elem.innerHTML = numbers(a, b, v)>>0; }; } } @@ -1170,7 +1170,7 @@ properties: ['text','number'], defaultValues: {text: ' ',numbers:'0'}, defaultOptions: { textChars: 'alpha' }, - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: textWriteFunctions, Util: { charSet: charSet, createTextTweens: createTextTweens } }; @@ -1315,8 +1315,8 @@ if ( tweenProp in this.valuesEnd && !KUTE[tweenProp]) { KUTE[tweenProp] = function (elem,a,b,v) { var pathLength = (a.l*100>>0)/100, - start = (coords(a.s,b.s,v)*100>>0)/100, - end = (coords(a.e,b.e,v)*100>>0)/100, + start = (numbers(a.s,b.s,v)*100>>0)/100, + end = (numbers(a.e,b.e,v)*100>>0)/100, offset = 0 - start, dashOne = end+offset; elem.style.strokeDashoffset = offset + "px"; @@ -1422,7 +1422,7 @@ component: 'svgDraw', property: 'draw', defaultValue: '0% 0%', - Interpolate: {numbers: coords}, + Interpolate: {numbers: numbers}, functions: svgDrawFunctions, Util: { getRectLength: getRectLength, @@ -1438,7 +1438,7 @@ }; Components.SVGDraw = svgDraw; - function coords$1(a, b, l, v) { + function coords(a, b, l, v) { var points = []; for(var i=0;i(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t 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+".")}}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(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."),P.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){if(x(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,!this._startFired){for(var n in this._onStart&&this._onStart.call(this),i)if("function"==typeof i[n])i[n].call(this,n);else for(var r in i[n])i[n][r].call(this,r);T.call(this),this._startFired=!0}return!s&&o(),this},U.prototype.stop=function(){return this.playing&&(S(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},L.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,M.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.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,x(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.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]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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))},n}(U);L.tween=F;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),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 L.tween))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 H=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*V(n,r,i)>>0)/10:V(n,r,i)>>0)+"px"})}H.prototype.setComponent=function(t){var e=t.component,n={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},a=t.category,s=t.property,o=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[e]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[s]=t.defaultValue,this.supports=s+" property";else if(t.defaultValues){for(var u in t.defaultValues)h[u]=t.defaultValues[u];this.supports=(o||s)+" "+(s||a)+" properties"}if(t.defaultOptions)for(var l in t.defaultOptions)f[l]=t.defaultOptions[l];if(t.functions)for(var c in n)if(c in t.functions)if("function"==typeof t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][a||s]&&(n[c][e][a||s]=t.functions[c]);else for(var w in t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][w]&&(n[c][e][w]=t.functions[c][w]);if(t.Interpolate){for(var _ in t.Interpolate){var x=t.Interpolate[_];if("function"!=typeof x||r[_])for(var S in x)"function"!=typeof x[S]||r[_]||(r[_]=x[S]);else r[_]=x}y[e]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return this};var Q=["top","left","width","height"],R={};Q.map((function(t){return R[t]=z}));var X={component:"essentialBoxModel",category:"boxModel",properties:Q,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:V},functions:{prepareStart:function(t){return I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:D}};function B(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 K(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?V(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*V(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+")"}function q(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=K(n,r,i)})}_.BoxModelEssential=X;var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],Z={};Y.map((function(t){Z[t]="#000"}));var $={};Y.map((function(t){return $[t]=q}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:Z,Interpolate:{numbers:V,colors:K},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}};_.ColorProperties=W;var G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n={};for(var r in e){var i=tt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=J.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=tt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(J.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,K(n,r,i))})},n[a]=B(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*V(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=D(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*V(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=G)}}},nt={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:V,colors:K},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:D}};_.HTMLAttributes=nt;var rt={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*V(n,r,i)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:V},functions:rt};_.OpacityProperty=it;var at=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),lt=at.concat(st,ut),ct=lt.concat(ot),pt={alpha:at,upper:st,symbols:ot,numeric:ut,alphanumeric:lt,all:ct},ht={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in pt?pt[n]:n&&n.length?n:pt[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=V(e,n,r)>>0})}};function ft(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 dt(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function yt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}_.TextWriteProperties=vt;var _t={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 n=C(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0];else if(/[XYZ]/.test(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:bt}};function xt(t,e){return parseFloat(t)/100*e}function St(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(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*V(e.s,n.s,r)>>0)/100,s=(100*V(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"})}},Ot={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:V},functions:kt,Util:{getRectLength:St,getPolyLength:Tt,getLineLength:Et,getCircleLength:Ct,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Mt,percent:xt}};_.SVGDraw=Ot;var Lt="Invalid path value";function Pt(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 Ut(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Ft(t,e){return jt(t,e)<1e-9}var Nt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Ht=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Dt(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Ht.indexOf(t)>=0}function Vt(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 zt(t){return 97==(32|t)}function Qt(t){return t>=48&&t<=57}function Rt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Xt(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Bt(t){for(;t.index=i)t.err="KUTE.js - "+Lt;else if(43!==(e=t.path.charCodeAt(r))&&45!==e||(e=++r2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Nt[n]&&(t.result.push([e].concat(r.splice(0,Nt[n]))),Nt[n]););}function Zt(t){var e,n,r,i,a,s=t.max;if(t.segmentStart=t.index,n=zt(e=t.path.charCodeAt(t.index)),Vt(e))if(i=Nt[t.path[t.index].toLowerCase()],t.index++,Bt(t),t.data=[],i){for(r=!1;;){for(a=i;a>0;a--){if(!n||3!==a&&4!==a?qt(t):Kt(t),t.err.length)return;t.data.push(t.param),Bt(t),r=!1,t.index=t.max)break;if(!Rt(t.path.charCodeAt(t.index)))break}}Yt(t)}else Yt(t);else t.err="KUTE.js - "+Lt}function $t(t){var e=new Xt(t),n=e.max;for(Bt(e);e.index0&&(s=Math.max(s,Math.ceil(n/e)));for(var o=0;oe;)i=Ut(r,i,.5),t.splice(n+1,0,i)}function ue(t,e){var n,r;if("string"==typeof t){var i=Jt(t,e);t=i.ring,r=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Lt);if(!le(n=t.slice(0)))throw new TypeError(Lt);return n.length>1&&Ft(n[0],n[n.length-1])&&n.pop(),ae(n)>0&&n.reverse(),!r&&e&&Pt(e)&&e>0&&oe(n,e),n}function le(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&Pt(t[0])&&Pt(t[1])}))}function ce(t,e,n){var r=ue(t,n=n||f.morphPrecision),i=ue(e,n),a=r.length-i.length;return se(r,a<0?-1*a:0),se(i,a>0?a:0),re(r,i),[r,i]}Wt.prototype.iterate=function(t){var e,n=this.segments,r={},i=!1,a=0,s=0,o=0,u=0;return n.map((function(e,n){var l=t(e,n,a,s);Array.isArray(l)&&(r[n]=l,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(u=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=u);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],n.map((function(t,n){void 0!==r[n]?r[n].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},Wt.prototype.abs=function(){return this.iterate((function(t,e,n,r){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===n.segments[a-1][0],r=r.concat(t?i.slice(1):i)})),r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var pe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:V,defaultOptions:{morphPrecision:10,morphIndex:0},functions:{prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):!r&&/[a-z][^a-z]*/gi.test(e)&&(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i,a=e.pathArray,s=n.pathArray,o=s.length;i=1===r?n.original:"M"+function(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}(a,s,o,r).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=ce(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Util:{INVALID_INPUT:Lt,isFiniteNumber:Pt,distance:jt,pointAlong:Ut,samePoint:Ft,paramCounts:Nt,SPECIAL_SPACES:Ht,isSpace:Dt,isCommand:Vt,isArc:zt,isDigit:Qt,isDigitStart:Rt,State:Xt,skipSpaces:Bt,scanFlag:Kt,scanParam:qt,finalizeSegment:Yt,scanSegment:Zt,pathParse:$t,SvgPath:Wt,split:Gt,pathStringToRing:Jt,exactRing:te,approximateRing:ee,measure:ne,rotateRing:re,polygonLength:ie,polygonArea:ae,addPoints:se,bisect:oe,normalizeRing:ue,validRing:le,getInterpolationPoints:ce}};for(var he in _.SVGMorph=pe,_){var fe=_[he];_[he]=new H(fe)}return{Animation:H,Components:_,Tween:F,fromTo:function(t,e,n,r){return r=r||{},new L.tween(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(j(t),e,e,n)},TweenCollection:N,allFromTo:function(t,e,n,r){return r=r||{},new N(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(j(t,!0),e,e,n)},Objects:w,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:E,Selector:j,Version:"2.0.11"}})); +!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="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function j(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t 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+".")}}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(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."),P.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){if(x(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,!this._startFired){for(var n in this._onStart&&this._onStart.call(this),i)if("function"==typeof i[n])i[n].call(this,n);else for(var r in i[n])i[n][r].call(this,r);T.call(this),this._startFired=!0}return!s&&o(),this},U.prototype.stop=function(){return this.playing&&(S(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},L.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,M.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.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,x(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.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]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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))},n}(U);L.tween=F;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),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 L.tween))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 H=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function D(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*V(n,r,i)>>0)/10:V(n,r,i)>>0)+"px"})}H.prototype.setComponent=function(t){var e=t.component,n={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},a=t.category,s=t.property,o=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[e]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[s]=t.defaultValue,this.supports=s+" property";else if(t.defaultValues){for(var u in t.defaultValues)h[u]=t.defaultValues[u];this.supports=(o||s)+" "+(s||a)+" properties"}if(t.defaultOptions)for(var l in t.defaultOptions)f[l]=t.defaultOptions[l];if(t.functions)for(var c in n)if(c in t.functions)if("function"==typeof t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][a||s]&&(n[c][e][a||s]=t.functions[c]);else for(var w in t.functions[c])!n[c][e]&&(n[c][e]={}),!n[c][e][w]&&(n[c][e][w]=t.functions[c][w]);if(t.Interpolate){for(var _ in t.Interpolate){var x=t.Interpolate[_];if("function"!=typeof x||r[_])for(var S in x)"function"!=typeof x[S]||r[_]||(r[_]=x[S]);else r[_]=x}y[e]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return this};var Q=["top","left","width","height"],R={};Q.map((function(t){return R[t]=z}));var X={component:"essentialBoxModel",category:"boxModel",properties:Q,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:V},functions:{prepareStart:function(t){return I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:D}};function B(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 K(t,e,n){var r,i={};for(r in e)i[r]="a"!==r?V(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*V(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+")"}function q(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=K(n,r,i)})}_.BoxModelEssential=X;var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],Z={};Y.map((function(t){Z[t]="#000"}));var $={};Y.map((function(t){return $[t]=q}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:Z,Interpolate:{numbers:V,colors:K},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}};_.ColorProperties=W;var G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n={};for(var r in e){var i=tt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=J.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=tt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(J.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,K(n,r,i))})},n[a]=B(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=D(o).u||D(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*V(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=D(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*V(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=G)}}},nt={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:V,colors:K},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:D}};_.HTMLAttributes=nt;var rt={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*V(n,r,i)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:V},functions:rt};_.OpacityProperty=it;var at=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),lt=at.concat(st,ut),ct=lt.concat(ot),pt={alpha:at,upper:st,symbols:ot,numeric:ut,alphanumeric:lt,all:ct},ht={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in pt?pt[n]:n&&n.length?n:pt[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=V(e,n,r)>>0})}};function ft(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 dt(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function yt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}_.TextWriteProperties=vt;var _t={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 n=C(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0];else if(/[XYZ]/.test(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:bt}};function xt(t,e){return parseFloat(t)/100*e}function St(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(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*V(e.s,n.s,r)>>0)/100,s=(100*V(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"})}},Ot={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:V},functions:kt,Util:{getRectLength:St,getPolyLength:Tt,getLineLength:Et,getCircleLength:Ct,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Mt,percent:xt}};function Lt(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}_.SVGDraw=Ot;var Pt="Invalid path value";function jt(t){return"number"==typeof t&&isFinite(t)}function Ut(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ft(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Nt(t,e){return Ut(t,e)<1e-9}var Ht={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Dt=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Vt(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&Dt.indexOf(t)>=0}function zt(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 Qt(t){return 97==(32|t)}function Rt(t){return t>=48&&t<=57}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Bt(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Kt(t){for(;t.index=i)t.err="KUTE.js - "+Pt;else if(43!==(e=t.path.charCodeAt(r))&&45!==e||(e=++r2&&(t.result.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(r));else for(;r.length>=Ht[n]&&(t.result.push([e].concat(r.splice(0,Ht[n]))),Ht[n]););}function $t(t){var e,n,r,i,a,s=t.max;if(t.segmentStart=t.index,n=Qt(e=t.path.charCodeAt(t.index)),zt(e))if(i=Ht[t.path[t.index].toLowerCase()],t.index++,Kt(t),t.data=[],i){for(r=!1;;){for(a=i;a>0;a--){if(!n||3!==a&&4!==a?Yt(t):qt(t),t.err.length)return;t.data.push(t.param),Kt(t),r=!1,t.index=t.max)break;if(!Xt(t.path.charCodeAt(t.index)))break}}Zt(t)}else Zt(t);else t.err="KUTE.js - "+Pt}function Wt(t){var e=new Bt(t),n=e.max;for(Kt(e);e.index0&&(s=Math.max(s,Math.ceil(n/e)));for(var o=0;oe;)i=Ft(r,i,.5),t.splice(n+1,0,i)}function le(t,e){var n,r;if("string"==typeof t){var i=te(t,e);t=i.ring,r=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Pt);if(!ce(n=t.slice(0)))throw new TypeError(Pt);return n.length>1&&Nt(n[0],n[n.length-1])&&n.pop(),se(n)>0&&n.reverse(),!r&&e&&jt(e)&&e>0&&ue(n,e),n}function ce(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&jt(t[0])&&jt(t[1])}))}function pe(t,e,n){var r=le(t,n=n||f.morphPrecision),i=le(e,n),a=r.length-i.length;return oe(r,a<0?-1*a:0),oe(i,a>0?a:0),ie(r,i),[r,i]}Gt.prototype.iterate=function(t){var e,n=this.segments,r={},i=!1,a=0,s=0,o=0,u=0;return n.map((function(e,n){var l=t(e,n,a,s);Array.isArray(l)&&(r[n]=l,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(u=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=u);default:a=e[e.length-2]+(c?a:0),s=e[e.length-1]+(c?s:0)}})),i?(e=[],n.map((function(t,n){void 0!==r[n]?r[n].map((function(t){e.push(t)})):e.push(t)})),this.segments=e,this):this},Gt.prototype.abs=function(){return this.iterate((function(t,e,n,r){var i,a=t[0],s=a.toUpperCase();if(a!==s)switch(t[0]=s,a){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(i=1;i0&&"m"!==e&&"M"!==e&&e===n.segments[a-1][0],r=r.concat(t?i.slice(1):i)})),r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")};var he={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof Element?e:/^\.|^\#/.test(e)?j(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):!r&&/[a-z][^a-z]*/gi.test(e)&&(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i,a=e.pathArray,s=n.pathArray,o=s.length;i=1===r?n.original:"M"+Lt(a,s,o,r).join("L")+"Z",t.setAttribute("d",i)})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=pe(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},fe={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Lt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:he,Util:{INVALID_INPUT:Pt,isFiniteNumber:jt,distance:Ut,pointAlong:Ft,samePoint:Nt,paramCounts:Ht,SPECIAL_SPACES:Dt,isSpace:Vt,isCommand:zt,isArc:Qt,isDigit:Rt,isDigitStart:Xt,State:Bt,skipSpaces:Kt,scanFlag:qt,scanParam:Yt,finalizeSegment:Zt,scanSegment:$t,pathParse:Wt,SvgPath:Gt,split:Jt,pathStringToRing:te,exactRing:ee,approximateRing:ne,measure:re,rotateRing:ie,polygonLength:ae,polygonArea:se,addPoints:oe,bisect:ue,normalizeRing:le,validRing:ce,getInterpolationPoints:pe}};for(var de in _.SVGMorph=fe,_){var ve=_[de];_[de]=new H(ve)}return{Animation:H,Components:_,Tween:F,fromTo:function(t,e,n,r){return r=r||{},new L.tween(j(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(j(t),e,e,n)},TweenCollection:N,allFromTo:function(t,e,n,r){return r=r||{},new N(j(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(j(t,!0),e,e,n)},Objects:w,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:E,Selector:j,Version:"2.0.11"}})); diff --git a/src/components/svgMorph.js b/src/components/svgMorph.js index 5e714ac..ea4c0cf 100644 --- a/src/components/svgMorph.js +++ b/src/components/svgMorph.js @@ -1,7 +1,7 @@ import selector from '../util/selector.js' import defaultOptions from '../objects/defaultOptions.js' import Components from '../objects/components.js' -import coords from '../interpolation/numbers.js' +import coords from '../interpolation/coords.js' import {onStartSVGMorph} from './svgMorphBase.js' // const SVGMorph = { property : 'path', defaultValue: [], interpolators: {numbers,coords} }, functions = { prepareStart, prepareProperty, onStart, crossCheck } diff --git a/src/components/svgMorphBase.js b/src/components/svgMorphBase.js index f97a197..92fcc60 100644 --- a/src/components/svgMorphBase.js +++ b/src/components/svgMorphBase.js @@ -1,5 +1,5 @@ import KUTE from '../objects/kute.js' -import coords from '../Interpolation/coords.js' +import coords from '../interpolation/coords.js' // const SVGMorph = { property : 'path', defaultValue: [], interpolators: {numbers,coords} }, functions = { prepareStart, prepareProperty, onStart, crossCheck }