diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..971a18a --- /dev/null +++ b/.eslintrc @@ -0,0 +1,37 @@ +{ + "extends": [ + // Extend the airbnb eslint config + "airbnb-base", + // Vue + "plugin:vue/vue3-recommended" + ], + "parser": "vue-eslint-parser", + "parserOptions": { + "sourceType": "module" + }, + // ESLint will not look in parent folders for eslint configs + "root": false, + // An environment defines global variables that are predefined. + "env": { + "browser": true, + "es6": true, + "node": true + }, + // Rule overrides + "rules": { + // Disable no-params-reassign for properties + "no-param-reassign": ["error", { "props": false }], + // Allow strict mode (we are not dealing with modules) + "strict": [0], + // Disable bitwise + "no-bitwise": 0, + // Allow use of "private methods" + "no-underscore-dangle": 0, + // Disable alert rule till we have a CE in place + "no-alert": 0, + // Allow extensions on imports + "import/extensions": 0, + // Allow exporting mutable 'let' binding + "import/no-mutable-exports": 0 + } +} diff --git a/demo/src/kute-base.js b/demo/src/kute-base.js index b4bc17a..32520a7 100644 --- a/demo/src/kute-base.js +++ b/demo/src/kute-base.js @@ -1,5 +1,5 @@ /*! -* KUTE.js Base v2.1.1-alpha1 (http://thednp.github.io/kute.js) +* KUTE.js Base v2.1.1-alpha2 (http://thednp.github.io/kute.js) * Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ @@ -9,7 +9,7 @@ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.KUTE = factory()); }(this, (function () { 'use strict'; - var version = "2.1.1-alpha1"; + var version = "2.1.1-alpha2"; var KUTE = {}; @@ -178,17 +178,20 @@ if (!KUTE[fnObj]) { KUTE[fnObj] = componentLink[fnObj]; } } else { Object.keys(this$1.valuesEnd).forEach(function (prop) { - Object.keys(this$1.valuesEnd[prop]).forEach(function (i) { - if (typeof (componentLink[i]) === 'function') { // transformCSS3 - if (!KUTE[i]) { KUTE[i] = componentLink[i]; } - } else { - Object.keys(componentLink[fnObj]).forEach(function (j) { - if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix - if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } - } - }); - } - }); + var propObject = this$1.valuesEnd[prop]; + if (propObject instanceof Object) { + Object.keys(propObject).forEach(function (i) { + if (typeof (componentLink[i]) === 'function') { // transformCSS3 + if (!KUTE[i]) { KUTE[i] = componentLink[i]; } + } else { + Object.keys(componentLink[fnObj]).forEach(function (j) { + if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix + if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } + } + }); + } + }); + } }); } }); diff --git a/demo/src/kute-base.min.js b/demo/src/kute-base.min.js index eaf4afd..ce4a8de 100644 --- a/demo/src/kute-base.min.js +++ b/demo/src/kute-base.min.js @@ -1,2 +1,2 @@ -// KUTE.js Base v2.1.1-alpha1 | thednp © 2021 | MIT-License -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=n()}(this,(function(){"use strict";var t={},n=[],e="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},i={},o={},r={},a=window.self||window||{};r.now=a.performance.now.bind(a.performance);var s=0,c=function(t){for(var e=0;e>0)/1e3;return i}T.prototype.start=function(n){return g(this),this.playing=!0,this._startTime=void 0!==n?n:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),j.call(this),this._startFired=!0),s||c(),this},T.prototype.stop=function(){return this.playing&&(E(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},T.prototype.close=function(){var t=this;Object.keys(p).forEach((function(n){Object.keys(p[n]).forEach((function(e){p[n][e].call(t,e)}))})),this._startFired=!1,u.call(this)},T.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},T.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.stop()}))},T.prototype.update=function(n){var e,i=this,o=void 0!==n?n:t.Time();if(o1?1:e;var r=this._easing(e);return Object.keys(this.valuesEnd).forEach((function(n){t[n](i.element,i.valuesStart[n],i.valuesEnd[n],r)})),this._onUpdate&&this._onUpdate.call(this),1!==e||(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)},v.tween=T;var C="undefined"!=typeof DOMMatrix?DOMMatrix:null,M={component:"transformMatrixBase",property:"transform",functions:{onStart:{transform:function(n){C&&this.valuesEnd[n]&&!t[n]&&(t[n]=function(t,e,i,o){var r=new C,a={};Object.keys(i).forEach((function(t){a[t]="perspective"===t?S(e[t],i[t],o):I(e[t],i[t],o)})),a.perspective&&(r.m34=-1/a.perspective),r=a.translate3d?r.translate(a.translate3d[0],a.translate3d[1],a.translate3d[2]):r,r=a.rotate3d?r.rotate(a.rotate3d[0],a.rotate3d[1],a.rotate3d[2]):r,a.skew&&(r=a.skew[0]?r.skewX(a.skew[0]):r,r=a.skew[1]?r.skewY(a.skew[1]):r),r=a.scale3d?r.scale(a.scale3d[0],a.scale3d[1],a.scale3d[2]):r,t.style[n]=r.toString()})},CSS3Matrix:function(n){C&&this.valuesEnd.transform&&(t[n]||(t[n]=C))}}},Interpolate:{perspective:S,translate3d:I,rotate3d:I,skew:I,scale3d:I}};function x(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(o>.99||o<.01?(10*S(e,i,o)>>0)/10:S(e,i,o)>>0)+"px"})}var U=["top","left","width","height"],A={};U.forEach((function(t){A[t]=x}));var q={component:"baseBoxModel",category:"boxModel",properties:U,Interpolate:{numbers:S},functions:{onStart:A}};var B={component:"baseOpacity",property:"opacity",Interpolate:{numbers:S},functions:{onStart:function(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(1e3*S(e,i,o)>>0)/1e3})}}},F=new w(M),K=new w(q),Q=new w(B);return{Animation:w,Components:{Transform:F,BoxModel:K,Opacity:Q},Tween:T,fromTo:function(t,n,e,i){var o=i||{};return new(0,v.tween)(k(t),n,e,o)},Objects:d,Easing:m,Util:y,Render:f,Interpolate:i,Internals:_,Selector:k,Version:"2.1.1-alpha1"}})); +// KUTE.js Base v2.1.1-alpha2 | thednp © 2021 | MIT-License +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=n()}(this,(function(){"use strict";var t={},n=[],e="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},i={},o={},r={},a=window.self||window||{};r.now=a.performance.now.bind(a.performance);var s=0,c=function(t){for(var e=0;e>0)/1e3;return i}T.prototype.start=function(n){return g(this),this.playing=!0,this._startTime=void 0!==n?n:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),j.call(this),this._startFired=!0),s||c(),this},T.prototype.stop=function(){return this.playing&&(E(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},T.prototype.close=function(){var t=this;Object.keys(p).forEach((function(n){Object.keys(p[n]).forEach((function(e){p[n][e].call(t,e)}))})),this._startFired=!1,u.call(this)},T.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},T.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.stop()}))},T.prototype.update=function(n){var e,i=this,o=void 0!==n?n:t.Time();if(o1?1:e;var r=this._easing(e);return Object.keys(this.valuesEnd).forEach((function(n){t[n](i.element,i.valuesStart[n],i.valuesEnd[n],r)})),this._onUpdate&&this._onUpdate.call(this),1!==e||(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)},v.tween=T;var C="undefined"!=typeof DOMMatrix?DOMMatrix:null,M={component:"transformMatrixBase",property:"transform",functions:{onStart:{transform:function(n){C&&this.valuesEnd[n]&&!t[n]&&(t[n]=function(t,e,i,o){var r=new C,a={};Object.keys(i).forEach((function(t){a[t]="perspective"===t?S(e[t],i[t],o):I(e[t],i[t],o)})),a.perspective&&(r.m34=-1/a.perspective),r=a.translate3d?r.translate(a.translate3d[0],a.translate3d[1],a.translate3d[2]):r,r=a.rotate3d?r.rotate(a.rotate3d[0],a.rotate3d[1],a.rotate3d[2]):r,a.skew&&(r=a.skew[0]?r.skewX(a.skew[0]):r,r=a.skew[1]?r.skewY(a.skew[1]):r),r=a.scale3d?r.scale(a.scale3d[0],a.scale3d[1],a.scale3d[2]):r,t.style[n]=r.toString()})},CSS3Matrix:function(n){C&&this.valuesEnd.transform&&(t[n]||(t[n]=C))}}},Interpolate:{perspective:S,translate3d:I,rotate3d:I,skew:I,scale3d:I}};function x(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(o>.99||o<.01?(10*S(e,i,o)>>0)/10:S(e,i,o)>>0)+"px"})}var U=["top","left","width","height"],A={};U.forEach((function(t){A[t]=x}));var q={component:"baseBoxModel",category:"boxModel",properties:U,Interpolate:{numbers:S},functions:{onStart:A}};var B={component:"baseOpacity",property:"opacity",Interpolate:{numbers:S},functions:{onStart:function(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(1e3*S(e,i,o)>>0)/1e3})}}},F=new w(M),K=new w(q),Q=new w(B);return{Animation:w,Components:{Transform:F,BoxModel:K,Opacity:Q},Tween:T,fromTo:function(t,n,e,i){var o=i||{};return new(0,v.tween)(k(t),n,e,o)},Objects:d,Easing:m,Util:y,Render:f,Interpolate:i,Internals:_,Selector:k,Version:"2.1.1-alpha2"}})); diff --git a/demo/src/kute-extra.js b/demo/src/kute-extra.js index 0dcb4d8..2777ba6 100644 --- a/demo/src/kute-extra.js +++ b/demo/src/kute-extra.js @@ -1,5 +1,5 @@ /*! -* KUTE.js Extra v2.1.1-alpha1 (http://thednp.github.io/kute.js) +* KUTE.js Extra v2.1.1-alpha2 (http://thednp.github.io/kute.js) * Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ @@ -82,7 +82,7 @@ return t2; }; - var version = "2.1.1-alpha1"; + var version = "2.1.1-alpha2"; var KUTE = {}; @@ -228,17 +228,20 @@ if (!KUTE[fnObj]) { KUTE[fnObj] = componentLink[fnObj]; } } else { Object.keys(this$1.valuesEnd).forEach(function (prop) { - Object.keys(this$1.valuesEnd[prop]).forEach(function (i) { - if (typeof (componentLink[i]) === 'function') { // transformCSS3 - if (!KUTE[i]) { KUTE[i] = componentLink[i]; } - } else { - Object.keys(componentLink[fnObj]).forEach(function (j) { - if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix - if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } - } - }); - } - }); + var propObject = this$1.valuesEnd[prop]; + if (propObject instanceof Object) { + Object.keys(propObject).forEach(function (i) { + if (typeof (componentLink[i]) === 'function') { // transformCSS3 + if (!KUTE[i]) { KUTE[i] = componentLink[i]; } + } else { + Object.keys(componentLink[fnObj]).forEach(function (j) { + if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix + if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } + } + }); + } + }); + } }); } }); @@ -1623,14 +1626,10 @@ } function prepareClip(tweenProp, value) { if (value instanceof Array) { - // return [trueDimension(value[0]), - // trueDimension(value[1]), trueDimension(value[2]), trueDimension(value[3])]; return value.map(function (x) { return trueDimension(x); }); } var clipValue = value.replace(/rect|\(|\)/g, ''); clipValue = /,/g.test(clipValue) ? clipValue.split(',') : clipValue.split(/\s/); - // return [trueDimension(clipValue[0]), - // trueDimension(clipValue[1]), trueDimension(clipValue[2]), trueDimension(clipValue[3])]; return clipValue.map(function (x) { return trueDimension(x); }); } diff --git a/demo/src/kute-extra.min.js b/demo/src/kute-extra.min.js index 8c8fcf1..30b94d3 100644 --- a/demo/src/kute-extra.min.js +++ b/demo/src/kute-extra.min.js @@ -1,2 +1,2 @@ -// KUTE.js Extra v2.1.1-alpha1 | thednp © 2021 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},I.tween=L,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var N=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];_.call(this,i,"end"),this._resetStart?this.valuesStart=a:_.call(this,a,"start"),this._resetStart||Object.keys(y).forEach((function(t){Object.keys(y[t]).forEach((function(n){y[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,C.call(this),Object.keys(y).forEach((function(t){Object.keys(y[t]).forEach((function(e){y[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),V.call(this),this._startTime+=e.Time()-this._pauseTime,x(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(L);I.tween=N;var U=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.apply(this,e),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.on=function(t,e){["start","stop","update","complete","pause","resume"].indexOf(t)>-1&&(this["_on"+(t.charAt(0).toUpperCase()+t.slice(1))]=e)},e.prototype.option=function(t,e){this["_"+t]=e},e}(N);I.tween=U;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=I.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof I.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var F=function(t,e){var n;if(this.element=P(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,n=this.element.parentNode.getElementsByTagName("OUTPUT"),this.element.output=n[0],!(this.element instanceof HTMLInputElement))throw TypeError("Target element is not [HTMLInputElement]");if("range"!==this.element.type)throw TypeError("Target element is not a range input");if(!(e instanceof I.tween))throw TypeError("tween parameter is not ["+I.tween+"]");this.element.setAttribute("value",0),this.element.setAttribute("min",0),this.element.setAttribute("max",1),this.element.setAttribute("step",1e-4),this.element.tween._onUpdate=this.updateBar,this.element.addEventListener("mousedown",this.downAction,!1)};F.prototype.updateBar=function(){var t,n=this.toolbar.output;(t=this.paused?this.toolbar.value:(e.Time()-this._startTime)/this._duration)>.9999&&(t=1),t<.01&&(t=0);var r=this._reversed?1-t:t;this.toolbar.value=r,n&&(n.value=(1e4*r>>0)/100+"%")},F.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},F.prototype.updateTween=function(){var t=(this.tween._reversed?1-this.value:this.value)*this.tween._duration-1e-4;this.tween._startTime=0,this.tween.update(t)},F.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},F.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),e.Tick=cancelAnimationFrame(e.Ticker))},F.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=e.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),e.Tick=requestAnimationFrame(e.Ticker))};var H=function(t){try{if(t.component in h)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:m,crossCheck:y},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return h[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){E[e]||(E[e]=t.Util[e])})),e};var R=function(t){function e(){for(var e,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),(e=this).setComponent.apply(e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setComponent=function(e){t.prototype.setComponent.call(this,e);var n=this,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:m,crossCheck:y},s=e.category,o=e.property,u=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;return"defaultValue"in e?(n.supports=o+" property",n.defaultValue=(""+e.defaultValue).length?"YES":"not set or incorrect"):e.defaultValues&&(n.supports=(u||o)+" "+(o||s)+" properties",n.defaultValues=Object.keys(e.defaultValues).length===u?"YES":"Not set or incomplete"),e.defaultOptions&&(n.extends=[],Object.keys(e.defaultOptions).forEach((function(t){n.extends.push(t)})),n.extends.length?n.extends="with <"+n.extends.join(", ")+"> new option(s)":delete n.extends),e.functions&&(n.interface=[],n.render=[],n.warning=[],Object.keys(r).forEach((function(t){t in e.functions?("prepareProperty"===t&&n.interface.push("fromTo()"),"prepareStart"===t&&n.interface.push("to()"),"onStart"===t&&(n.render="can render update")):("prepareProperty"===t&&n.warning.push("fromTo()"),"prepareStart"===t&&n.warning.push("to()"),"onStart"===t&&(n.render="no function to render update"))})),n.interface.length?n.interface=(s||o)+" can use ["+n.interface.join(", ")+"] method(s)":delete n.uses,n.warning.length?n.warning=(s||o)+" can't use ["+n.warning.join(", ")+"] method(s) because values aren't processed":delete n.warning),e.Interpolate?(n.uses=[],n.adds=[],Object.keys(e.Interpolate).forEach((function(t){var r=e.Interpolate[t];"function"==typeof r?(a[t]||n.adds.push(""+t),n.uses.push(""+t)):Object.keys(r).forEach((function(e){"function"!=typeof r[e]||a[t]||n.adds.push(""+e),n.uses.push(""+e)}))})),n.uses.length?n.uses="["+n.uses.join(", ")+"] interpolation function(s)":delete n.uses,n.adds.length?n.adds="new ["+n.adds.join(", ")+"] interpolation function(s)":delete n.adds):n.critical="For "+(o||s)+" no interpolation function[s] is set",e.Util&&(n.hasUtil=Object.keys(e.Util).join(",")),n},e}(H);function D(t,e,n){return+t+(e-t)*n}function B(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i>0)/100+"% "+(100*D(n[1],r[1],a)>>0)/100+"%"})}},z={component:"backgroundPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:D},functions:Q,Util:{trueDimension:B}};function X(t,e,n,r){return+t+(e-t)*r+n}function Y(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}var W=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],$={};W.forEach((function(t){$[t]=0}));var G={};W.forEach((function(t){G[t]=Y}));var Z={component:"borderRadiusProperties",category:"borderRadius",properties:W,defaultValues:$,Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:G},Util:{trueDimension:B}};function K(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(a>.99||a<.01?(10*D(n,r,a)>>0)/10:D(n,r,a)>>0)+"px"})}var J=["top","left","width","height","right","bottom","minWidth","minHeight","maxWidth","maxHeight","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","margin","marginTop","marginBottom","marginLeft","marginRight","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","outlineWidth"],tt={};J.forEach((function(t){tt[t]=0}));var et={};J.forEach((function(t){et[t]=K}));var nt={component:"boxModelProperties",category:"boxModel",properties:J,defaultValues:tt,Interpolate:{numbers:D},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){var n=B(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:et}};var rt={prepareStart:function(t){var e=M(this.element,t),n=M(this.element,"width"),r=M(this.element,"height");return/rect/.test(e)?e:[0,n,r,0]},prepareProperty:function(t,e){if(e instanceof Array)return e.map((function(t){return B(t)}));var n=e.replace(/rect|\(|\)/g,"");return(n=/,/g.test(n)?n.split(","):n.split(/\s/)).map((function(t){return B(t)}))},onStart:function(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(t,e,n,r){for(var a=0,i=[];a<4;a+=1){var s=e[a].v,o=n[a].v,u=n[a].u||"px";i[a]=(100*D(s,o,r)>>0)/100+u}t.style.clip="rect("+i+")"})}},at={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:D},functions:rt,Util:{trueDimension:B}};function it(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function st(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=D(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*D(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function ot(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=st(n,r,a)})}var ut=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],ct={};ut.forEach((function(t){ct[t]="#000"}));var lt={};ut.forEach((function(t){lt[t]=ot}));var pt={component:"colorProperties",category:"colors",properties:ut,defaultValues:ct,Interpolate:{numbers:D,colors:st},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return it(e)},onStart:lt},Util:{trueColor:it}};function ht(t,e,n){for(var r=[],a=0;a<3;a+=1)r[a]=(100*D(t[a],e[a],n)>>0)/100+"px";return"drop-shadow("+r.concat(st(t[3],e[3],n)).join(" ")+")"}function ft(t){return t.replace("-r","R").replace("-s","S")}function dt(t){var e;3===t.length?e=[t[0],t[1],0,t[2]]:4===t.length&&(e=[t[0],t[1],t[2],t[3]]);for(var n=0;n<3;n+=1)e[n]=parseFloat(e[n]);return e[3]=it(e[3]),e}function vt(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var a=0,i=r.length;a>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*D(n.blur,r.blur,a)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*D(n.saturate,r.saturate,a)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*D(n.invert,r.invert,a)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*D(n.grayscale,r.grayscale,a)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*D(n.hueRotate,r.hueRotate,a)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*D(n.sepia,r.sepia,a)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*D(n.brightness,r.brightness,a)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*D(n.contrast,r.contrast,a)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?ht(n.dropShadow,r.dropShadow,a):"")})},crossCheck:function(t){var e=this;this.valuesEnd[t]&&Object.keys(this.valuesStart[t]).forEach((function(n){e.valuesEnd[t][n]||(e.valuesEnd[t][n]=e.valuesStart[t][n])}))}},yt={component:"filterEffects",property:"filter",defaultValue:{opacity:100,blur:0,saturate:100,grayscale:0,brightness:100,contrast:100,sepia:0,invert:0,hueRotate:0,dropShadow:[0,0,0,{r:0,g:0,b:0}],url:""},Interpolate:{opacity:D,blur:D,saturate:D,grayscale:D,brightness:D,contrast:D,sepia:D,invert:D,hueRotate:D,dropShadow:{numbers:D,colors:st,dropShadow:ht}},functions:gt,Util:{parseDropShadow:dt,parseFilterString:vt,replaceDashNamespace:ft,trueColor:it}},mt={},bt="htmlAttributes",wt=["fill","stroke","stop-color"];function Et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var xt={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=Et(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=wt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=Et(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(wt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in mt)&&(mt[e]=function(t,e,n,r,a){t.setAttribute(e,st(n,r,a))})},r[s]=it(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=B(u).u||B(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in mt)&&(mt[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*D(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=B(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in mt)&&(mt[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*D(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=mt)}}},St={component:bt,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:D,colors:st},functions:xt,Util:{replaceUppercase:Et,trueColor:it,trueDimension:B}};var kt={prepareStart:function(t){return M(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*D(n,r,a)>>0)/1e3})}},Ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:D},functions:kt};function Tt(t,e){return parseFloat(t)/100*e}function Mt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function _t(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*D(e.s,n.s,r)>>0)/100,s=(100*D(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},Lt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:D},functions:Vt,Util:{getRectLength:Mt,getPolyLength:_t,getLineLength:Ct,getCircleLength:jt,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Pt,percent:Tt}};function Nt(t){return t.map((function(t){return Array.isArray(t)?Nt(t):Number.isNaN(+t)?t:+t}))}var Ut=4;function qt(t,e){var n=Number.isNaN(+e)?Ut:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):Nt(t)}var Ft={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ht(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Ft[n]&&(t.segments.push([e].concat(r.splice(0,Ft[n]))),Ft[n]););}var Rt="Invalid path value";function Dt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Rt+": invalid Arc flag "+e)}function Bt(t){return t>=48&&t<=57}function Qt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Rt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Yt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Ft[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,zt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Qt(t):Dt(t),t.err.length)return;t.data.push(t.param),zt(t),t.index=t.max)break;if(!Xt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=Rt+": "+t.pathValue[t.index]+" not a path command"}function Wt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function $t(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Gt(t,e){if($t(t))return Nt(t);var n=new Wt(t);for(zt(n);n.index7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function Jt(t,e,n){var r=t[0],a=t.slice(1),i=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===r)i=["L",t[1],e.y1];else if("V"===r)i=["L",e.x1,t[1]];else if("S"===r){var s=function(t,e,n,r,a){return"CS".indexOf(a)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,p=c.qy;e.qx=l,e.qy=p,i=["Q",l,p].concat(a)}else if("Q"===r){var h=a[0],f=a[1];e.qx=h,e.qy=f}return i}function te(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Nt(t);for(var n,r,a=Zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(x*=T=Math.sqrt(T),S*=T);var M=Math.pow(x,2),_=Math.pow(S,2),C=(i===s?-1:1)*Math.sqrt(Math.abs((M*_-M*O*O-_*k*k)/(M*O*O+_*k*k)));f=C*x*O/S+(m+b)/2,d=C*-S*k/x+(w+E)/2,p=Math.asin(((w-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((E-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),p=mh&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var j=h-p;if(Math.abs(j)>v){var I=h,A=b,P=E;h=p+v*(s&&h>p?1:-1),b=f+x*Math.cos(h),E=d+S*Math.sin(h),y=ne(b,E,x,S,a,0,s,A,P,[h,I,f,d])}j=h-p;var V=Math.cos(p),L=Math.sin(p),N=Math.cos(h),U=Math.sin(h),q=Math.tan(j/4),F=4/3*x*q,H=4/3*S*q,R=[m,w],D=[m+F*L,w-H*V],B=[b+F*U,E-H*N],Q=[b,E];return D[0]=2*R[0]-D[0],D[1]=2*R[1]-D[1],c?[D,B,Q].concat(y):(y=[D,B,Q].concat(y).join().split(",")).map((function(t,e){return e%2?ee(y[e-1],t,g).y:ee(t,y[e+1],g).x}))}function re(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function ae(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function ie(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function se(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=ie(i,s,a),u=ie(s,o,a),c=ie(o,u,a),l=ie(u,c,a),p=ie(c,l,a),h=ae.apply(0,i.concat(o,c,p,a)),f=ae.apply(0,p.concat(l,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function oe(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(ne.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(re.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(se(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(se(e.x1,e.y1,e.x,e.y))}return t}function ue(t,e){if(function(t){return $t(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Nt(t);for(var n,r,a=te(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c=0}function fe(t,e){var n=e||.5,r=t.slice(0,2),a=t.slice(2,4),i=t.slice(4,6),s=t.slice(6,8),o=ie(r,a,n),u=ie(a,i,n),c=ie(i,s,n),l=ie(o,u,n),p=ie(u,c,n),h=ie(l,p,n);return[["C"].concat(o,l,h),["C"].concat(p,c,s)]}function de(t,e,n,r,a){return a*(a*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ve(t,e,n,r,a,i,s,o,u){var c;(null===u||Number.isNaN(+u))&&(c=1),c>1&&(c=1),c<0&&(c=0);var l=c/2,p=0,h=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){h=de(t,n,a,s,p=l*u+l),f=de(e,r,i,o,p),d+=v[c]*Math.sqrt(h*h+f*f)})),l*d}function ge(t){return ue((e=ce(Zt(t)),ce(Zt(e,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0]).map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?ve.apply(0,r):0;return{s:t,ss:e?a?fe(r):[t,t]:[t],l:a}}));var e}function ye(t,e,n){var r=ge(t),a=ge(e),i=r.length,s=a.length,o=r.filter((function(t){return t.l})).length,u=a.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/o||0,l=a.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,p=n||Math.max(i,s),h=[c,l],f=[p-i,p-s],d=0,v=[r,a].map((function(t,e){return t.l===p?t.map((function(t){return t.s})):t.map((function(t,n){return d=n&&f[e]&&t.l>=h[e],f[e]-=d?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:ye(v[0],v[1],p)}function me(t){var e=t.length,n=e-1;return t.map((function(r,a){return t.map((function(r,i){var s,o=a+i;return 0===i||t[o]&&"M"===t[o][0]?(s=t[o],["M"].concat(s.slice(-2))):(o>=e&&(o-=n),t[o])}))}))}function be(t,e){var n=t.length-1,r=[],a=0,i=me(t);return i.forEach((function(i,s){t.slice(1).forEach((function(r,i){a+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(s+i)%n].slice(-2),e[i%n].slice(-2))})),r[s]=a,a=0})),i[r.indexOf(Math.min.apply(null,r))]}var we={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=P(e)),"object"==typeof e&&e.curve?e:(a&&/path|glyph/.test(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){for(var a=[],i=e.curve,s=n.curve,o=0,u=s.length;o>0)/1e3)}t.setAttribute("d",1===r?n.original:ce(a))})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].curve,n=this.valuesEnd[t].curve;if(!e||!n||e&&n&&"M"===e[0][0]&&e.length!==n.length){var r=ye(this.valuesStart[t].original,this.valuesEnd[t].original),a=he(r[0])!==he(r[1])?le(r[0]):Nt(r[0]);this.valuesStart[t].curve=a,this.valuesEnd[t].curve=be(r[1],a)}}}},Ee={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:D,pathToString:ce},functions:we,Util:{pathToCurve:ue,pathToAbsolute:Zt,pathToString:ce,parsePathString:Gt,getRotatedCurve:be,getRotations:me,equalizeSegments:ye,reverseCurve:le,clonePath:Nt,getDrawDirection:he,splitCubic:fe,getCurveArray:ge}};function xe(t,e){var n=e.x,r=e.width;return/[a-z]/i.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?n+parseFloat(t)*r/100:parseFloat(t)}function Se(t){var e={},n=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none";if(n instanceof Array)for(var r=0,a=n.length;r>0)/1e3+(i?","+(1e3*i>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(p?"skewX("+(1e3*p>>0)/1e3+")":"")+(h?"skewY("+(1e3*h>>0)/1e3+")":"")+(1!==o?"scale("+(1e3*o>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=ke.call(this,t,Se(this.element.getAttribute("transform")));Object.keys(r).forEach((function(t){e[t]=r[t]}));var a=this.element.ownerSVGElement,i=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));e.translate=[i.matrix.e,i.matrix.f],Object.keys(e).forEach((function(t){t in n&&"origin"!==t||(n[t]=e[t])}))}}},Te={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:D},functions:Oe,Util:{parseStringOrigin:xe,parseTransformString:Se,parseTransformSVG:ke}},Me=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){return t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){throw Error("Passive events are not supported")}return t}(),_e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ce="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",je=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Ie=!!Me&&{passive:!1};function Ae(t){this.scrolling&&t.preventDefault()}function Pe(){var t=this.element;return t===je?{el:document,st:document.body}:{el:t,st:t}}function Ve(t,e){e[t](_e[0],Ae,Ie),e[t](Ce,Ae,Ie)}function Le(){var t=Pe.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,Ve("addEventListener",t.el),t.st.style.pointerEvents="none")}function Ne(){var t=Pe.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,Ve("removeEventListener",t.el),t.st.style.pointerEvents="")}var Ue={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:je,this.element===je?window.pageYOffset||je.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e,10)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:je,Le.call(this),e[t]=function(t,e,n,r){t.scrollTop=D(e,n,r)>>0})},onComplete:function(){Ne.call(this)}},qe={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:D},functions:Ue,Util:{preventScroll:Ae,scrollIn:Le,scrollOut:Ne,getScrollTargets:Pe,toggleScrollEvents:Ve,supportPassive:Me}};function Fe(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){for(var i=[],s="textShadow"===t?3:4,o=3===s?n[3]:n[4],u=3===s?r[3]:r[4],c=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",l=0;l>0)/1e3+"px");e.style[t]=c?st(o,u,a)+i.join(" ")+c:st(o,u,a)+i.join(" ")})}var He=["boxShadow","textShadow"];function Re(t,e){var n;3===t.length?n=[t[0],t[1],0,0,t[2],"none"]:4===t.length?n=/inset|none/.test(t[3])?[t[0],t[1],0,0,t[2],t[3]]:[t[0],t[1],t[2],0,t[3],"none"]:5===t.length?n=/inset|none/.test(t[4])?[t[0],t[1],t[2],0,t[3],t[4]]:[t[0],t[1],t[2],t[3],t[4],"none"]:6===t.length&&(n=t);for(var r=0;r<4;r+=1)n[r]=parseFloat(n[r]);return n[4]=it(n[4]),n="boxShadow"===e?n:n.filter((function(t,e){return[0,1,2,4].includes(e)}))}var De={};He.forEach((function(t){De[t]=Fe}));var Be={component:"shadowProperties",properties:He,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:D,colors:st},functions:{prepareStart:function(t){var e=M(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(e)?f[t]:e},prepareProperty:function(t,e){var n=e;if("string"==typeof n){var r="none",a=n.match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi);r=/inset/.test(n)?"inset":r,n=Re(n=(n=/inset/.test(n)?n.replace(/(\s+inset|inset+\s)/g,""):n).replace(a[0],"").split(" ").concat([a[0].replace(/\s/g,"")],[r]),t)}else n instanceof Array&&(n=Re(n,t));return n},onStart:De},Util:{processShadowArray:Re,trueColor:it}};function Qe(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}var ze=["fontSize","lineHeight","letterSpacing","wordSpacing"],Xe={};ze.forEach((function(t){Xe[t]=Qe}));var Ye={component:"textProperties",category:"textProperties",properties:ze,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:Xe},Util:{trueDimension:B}},We=String("abcdefghijklmnopqrstuvwxyz").split(""),$e=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),Ge=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),Ze=String("0123456789").split(""),Ke=We.concat($e,Ze),Je=Ke.concat(Ge),tn={alpha:We,upper:$e,symbols:Ge,numeric:Ze,alphanumeric:Ke,all:Je},en={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=tn[d.textChars];n in tn?r=tn[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=D(e,n,r)>>0})}};function nn(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function rn(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3;return r}var sn="undefined"!=typeof DOMMatrix?DOMMatrix:null,on="transformMatrix";var un={BackgroundPosition:z,BorderRadius:Z,BoxModel:nt,ClipProperty:at,ColorProperties:pt,FilterEffects:yt,HTMLAttributes:St,OpacityProperty:Ot,SVGDraw:Lt,SVGCubicMorph:Ee,SVGTransform:Te,ScrollProperty:qe,ShadowProperties:Be,TextProperties:Ye,TextWriteProperties:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:D},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:en},Util:{charSet:tn,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=I.tween,i=function(t,e){var n=rn(t,"text-part"),r=rn(nn(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],p=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=p,r.onComplete=null,p+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=p,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,p+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},MatrixTransform:{component:on,property:"transform",defaultValue:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,skew:[0,0],skewX:0,skewY:0,scale3d:[1,1,1],scaleX:1,scaleY:1,scaleZ:1},functions:{prepareStart:function(t,e){var n={},r=this.element.transformMatrix;return r?Object.keys(r).forEach((function(t){n[t]=r[t]})):Object.keys(e).forEach((function(t){n[t]="perspective"===t?e[t]:f.transform[t]})),n},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n,r={},a={},i={},s={},o={},u=[{translate3d:a},{rotate3d:i},{skew:o},{scale3d:s}];return Object.keys(e).forEach((function(t){if(/3d/.test(t)&&"object"==typeof e[t]&&e[t].length)n=e[t].map((function(e){return"scale3d"===t?parseFloat(e):parseInt(e,10)})),r[t]="scale3d"===t?[n[0]||1,n[1]||1,n[2]||1]:[n[0]||0,n[1]||0,n[2]||0];else if(/[XYZ]/.test(t)){var u={};/translate/.test(t)?u=a:/rotate/.test(t)?u=i:/scale/.test(t)?u=s:/skew/.test(t)&&(u=o),u[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t],10)}else"skew"===t?(n=e[t].map((function(t){return parseInt(t,10)||0})),r[t]=[n[0]||0,n[1]||0]):r[t]=parseInt(e[t],10)})),u.forEach((function(t){var e=Object.keys(t)[0],n=t[e];Object.keys(n).length&&!r[e]&&(r[e]="scale3d"===e?[n.x||1,n.y||1,n.z||1]:"skew"===e?[n.x||0,n.y||0]:[n.x||0,n.y||0,n.z||0])})),r}throw Error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(t){sn&&this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){var i=new sn,s={};Object.keys(r).forEach((function(t){s[t]="perspective"===t?D(n[t],r[t],a):an(n[t],r[t],a)})),s.perspective&&(i.m34=-1/s.perspective),i=s.translate3d?i.translate(s.translate3d[0],s.translate3d[1],s.translate3d[2]):i,i=s.rotate3d?i.rotate(s.rotate3d[0],s.rotate3d[1],s.rotate3d[2]):i,s.skew&&(i=s.skew[0]?i.skewX(s.skew[0]):i,i=s.skew[1]?i.skewY(s.skew[1]):i),i=s.scale3d?i.scale(s.scale3d[0],s.scale3d[1],s.scale3d[2]):i,e.style[t]=i.toString()})},CSS3Matrix:function(t){sn&&this.valuesEnd.transform&&(e[t]||(e[t]=sn))}},onComplete:function(t){var e=this;this.valuesEnd[t]&&(this.element.transformMatrix={},Object.keys(this.valuesEnd[t]).forEach((function(n){e.element.transformMatrix[n]=e.valuesEnd[t][n]})))},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:D,translate3d:an,rotate3d:an,skew:an,scale3d:an}}};return Object.keys(un).forEach((function(t){var e=un[t];un[t]=new R(e)})),{Animation:R,Components:un,Tween:U,fromTo:function(t,e,n,r){var a=r||{};return new(0,I.tween)(P(t),e,n,a)},to:function(t,e,n){var r=n||{},a=I.tween;return r.resetStart=e,new a(P(t),e,e,r)},TweenCollection:q,ProgressBar:F,allFromTo:function(t,e,n,r){var a=r||{};return new q(P(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(P(t,!0),e,e,r)},Objects:w,Util:E,Easing:A,CubicBezier:t,Render:p,Interpolate:a,Process:j,Internals:O,Selector:P,Version:"2.1.1-alpha1"}})); +// KUTE.js Extra v2.1.1-alpha2 | thednp © 2021 | MIT-License +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},I.tween=L,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var N=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];_.call(this,i,"end"),this._resetStart?this.valuesStart=a:_.call(this,a,"start"),this._resetStart||Object.keys(y).forEach((function(t){Object.keys(y[t]).forEach((function(n){y[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,C.call(this),Object.keys(y).forEach((function(t){Object.keys(y[t]).forEach((function(e){y[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),V.call(this),this._startTime+=e.Time()-this._pauseTime,x(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(L);I.tween=N;var U=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.apply(this,e),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.on=function(t,e){["start","stop","update","complete","pause","resume"].indexOf(t)>-1&&(this["_on"+(t.charAt(0).toUpperCase()+t.slice(1))]=e)},e.prototype.option=function(t,e){this["_"+t]=e},e}(N);I.tween=U;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=I.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof I.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var F=function(t,e){var n;if(this.element=P(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,n=this.element.parentNode.getElementsByTagName("OUTPUT"),this.element.output=n[0],!(this.element instanceof HTMLInputElement))throw TypeError("Target element is not [HTMLInputElement]");if("range"!==this.element.type)throw TypeError("Target element is not a range input");if(!(e instanceof I.tween))throw TypeError("tween parameter is not ["+I.tween+"]");this.element.setAttribute("value",0),this.element.setAttribute("min",0),this.element.setAttribute("max",1),this.element.setAttribute("step",1e-4),this.element.tween._onUpdate=this.updateBar,this.element.addEventListener("mousedown",this.downAction,!1)};F.prototype.updateBar=function(){var t,n=this.toolbar.output;(t=this.paused?this.toolbar.value:(e.Time()-this._startTime)/this._duration)>.9999&&(t=1),t<.01&&(t=0);var r=this._reversed?1-t:t;this.toolbar.value=r,n&&(n.value=(1e4*r>>0)/100+"%")},F.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},F.prototype.updateTween=function(){var t=(this.tween._reversed?1-this.value:this.value)*this.tween._duration-1e-4;this.tween._startTime=0,this.tween.update(t)},F.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},F.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),e.Tick=cancelAnimationFrame(e.Ticker))},F.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=e.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),e.Tick=requestAnimationFrame(e.Ticker))};var H=function(t){try{if(t.component in h)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:m,crossCheck:y},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return h[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){E[e]||(E[e]=t.Util[e])})),e};var R=function(t){function e(){for(var e,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),(e=this).setComponent.apply(e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setComponent=function(e){t.prototype.setComponent.call(this,e);var n=this,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:m,crossCheck:y},s=e.category,o=e.property,u=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;return"defaultValue"in e?(n.supports=o+" property",n.defaultValue=(""+e.defaultValue).length?"YES":"not set or incorrect"):e.defaultValues&&(n.supports=(u||o)+" "+(o||s)+" properties",n.defaultValues=Object.keys(e.defaultValues).length===u?"YES":"Not set or incomplete"),e.defaultOptions&&(n.extends=[],Object.keys(e.defaultOptions).forEach((function(t){n.extends.push(t)})),n.extends.length?n.extends="with <"+n.extends.join(", ")+"> new option(s)":delete n.extends),e.functions&&(n.interface=[],n.render=[],n.warning=[],Object.keys(r).forEach((function(t){t in e.functions?("prepareProperty"===t&&n.interface.push("fromTo()"),"prepareStart"===t&&n.interface.push("to()"),"onStart"===t&&(n.render="can render update")):("prepareProperty"===t&&n.warning.push("fromTo()"),"prepareStart"===t&&n.warning.push("to()"),"onStart"===t&&(n.render="no function to render update"))})),n.interface.length?n.interface=(s||o)+" can use ["+n.interface.join(", ")+"] method(s)":delete n.uses,n.warning.length?n.warning=(s||o)+" can't use ["+n.warning.join(", ")+"] method(s) because values aren't processed":delete n.warning),e.Interpolate?(n.uses=[],n.adds=[],Object.keys(e.Interpolate).forEach((function(t){var r=e.Interpolate[t];"function"==typeof r?(a[t]||n.adds.push(""+t),n.uses.push(""+t)):Object.keys(r).forEach((function(e){"function"!=typeof r[e]||a[t]||n.adds.push(""+e),n.uses.push(""+e)}))})),n.uses.length?n.uses="["+n.uses.join(", ")+"] interpolation function(s)":delete n.uses,n.adds.length?n.adds="new ["+n.adds.join(", ")+"] interpolation function(s)":delete n.adds):n.critical="For "+(o||s)+" no interpolation function[s] is set",e.Util&&(n.hasUtil=Object.keys(e.Util).join(",")),n},e}(H);function D(t,e,n){return+t+(e-t)*n}function B(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i>0)/100+"% "+(100*D(n[1],r[1],a)>>0)/100+"%"})}},z={component:"backgroundPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:D},functions:Q,Util:{trueDimension:B}};function X(t,e,n,r){return+t+(e-t)*r+n}function Y(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}var W=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],$={};W.forEach((function(t){$[t]=0}));var G={};W.forEach((function(t){G[t]=Y}));var Z={component:"borderRadiusProperties",category:"borderRadius",properties:W,defaultValues:$,Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:G},Util:{trueDimension:B}};function K(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(a>.99||a<.01?(10*D(n,r,a)>>0)/10:D(n,r,a)>>0)+"px"})}var J=["top","left","width","height","right","bottom","minWidth","minHeight","maxWidth","maxHeight","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","margin","marginTop","marginBottom","marginLeft","marginRight","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","outlineWidth"],tt={};J.forEach((function(t){tt[t]=0}));var et={};J.forEach((function(t){et[t]=K}));var nt={component:"boxModelProperties",category:"boxModel",properties:J,defaultValues:tt,Interpolate:{numbers:D},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){var n=B(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:et}};var rt={prepareStart:function(t){var e=M(this.element,t),n=M(this.element,"width"),r=M(this.element,"height");return/rect/.test(e)?e:[0,n,r,0]},prepareProperty:function(t,e){if(e instanceof Array)return e.map((function(t){return B(t)}));var n=e.replace(/rect|\(|\)/g,"");return(n=/,/g.test(n)?n.split(","):n.split(/\s/)).map((function(t){return B(t)}))},onStart:function(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(t,e,n,r){for(var a=0,i=[];a<4;a+=1){var s=e[a].v,o=n[a].v,u=n[a].u||"px";i[a]=(100*D(s,o,r)>>0)/100+u}t.style.clip="rect("+i+")"})}},at={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:D},functions:rt,Util:{trueDimension:B}};function it(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function st(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=D(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*D(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function ot(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=st(n,r,a)})}var ut=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],ct={};ut.forEach((function(t){ct[t]="#000"}));var lt={};ut.forEach((function(t){lt[t]=ot}));var pt={component:"colorProperties",category:"colors",properties:ut,defaultValues:ct,Interpolate:{numbers:D,colors:st},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return it(e)},onStart:lt},Util:{trueColor:it}};function ht(t,e,n){for(var r=[],a=0;a<3;a+=1)r[a]=(100*D(t[a],e[a],n)>>0)/100+"px";return"drop-shadow("+r.concat(st(t[3],e[3],n)).join(" ")+")"}function ft(t){return t.replace("-r","R").replace("-s","S")}function dt(t){var e;3===t.length?e=[t[0],t[1],0,t[2]]:4===t.length&&(e=[t[0],t[1],t[2],t[3]]);for(var n=0;n<3;n+=1)e[n]=parseFloat(e[n]);return e[3]=it(e[3]),e}function vt(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var a=0,i=r.length;a>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*D(n.blur,r.blur,a)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*D(n.saturate,r.saturate,a)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*D(n.invert,r.invert,a)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*D(n.grayscale,r.grayscale,a)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*D(n.hueRotate,r.hueRotate,a)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*D(n.sepia,r.sepia,a)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*D(n.brightness,r.brightness,a)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*D(n.contrast,r.contrast,a)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?ht(n.dropShadow,r.dropShadow,a):"")})},crossCheck:function(t){var e=this;this.valuesEnd[t]&&Object.keys(this.valuesStart[t]).forEach((function(n){e.valuesEnd[t][n]||(e.valuesEnd[t][n]=e.valuesStart[t][n])}))}},yt={component:"filterEffects",property:"filter",defaultValue:{opacity:100,blur:0,saturate:100,grayscale:0,brightness:100,contrast:100,sepia:0,invert:0,hueRotate:0,dropShadow:[0,0,0,{r:0,g:0,b:0}],url:""},Interpolate:{opacity:D,blur:D,saturate:D,grayscale:D,brightness:D,contrast:D,sepia:D,invert:D,hueRotate:D,dropShadow:{numbers:D,colors:st,dropShadow:ht}},functions:gt,Util:{parseDropShadow:dt,parseFilterString:vt,replaceDashNamespace:ft,trueColor:it}},mt={},bt="htmlAttributes",wt=["fill","stroke","stop-color"];function Et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var xt={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=Et(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=wt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=Et(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(wt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in mt)&&(mt[e]=function(t,e,n,r,a){t.setAttribute(e,st(n,r,a))})},r[s]=it(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=B(u).u||B(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in mt)&&(mt[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*D(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=B(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in mt)&&(mt[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*D(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=mt)}}},St={component:bt,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:D,colors:st},functions:xt,Util:{replaceUppercase:Et,trueColor:it,trueDimension:B}};var kt={prepareStart:function(t){return M(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*D(n,r,a)>>0)/1e3})}},Ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:D},functions:kt};function Tt(t,e){return parseFloat(t)/100*e}function Mt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function _t(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*D(e.s,n.s,r)>>0)/100,s=(100*D(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},Lt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:D},functions:Vt,Util:{getRectLength:Mt,getPolyLength:_t,getLineLength:Ct,getCircleLength:jt,getEllipseLength:It,getTotalLength:At,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Pt,percent:Tt}};function Nt(t){return t.map((function(t){return Array.isArray(t)?Nt(t):Number.isNaN(+t)?t:+t}))}var Ut=4;function qt(t,e){var n=Number.isNaN(+e)?Ut:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):Nt(t)}var Ft={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ht(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Ft[n]&&(t.segments.push([e].concat(r.splice(0,Ft[n]))),Ft[n]););}var Rt="Invalid path value";function Dt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Rt+": invalid Arc flag "+e)}function Bt(t){return t>=48&&t<=57}function Qt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Rt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Yt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Ft[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,zt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Qt(t):Dt(t),t.err.length)return;t.data.push(t.param),zt(t),t.index=t.max)break;if(!Xt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=Rt+": "+t.pathValue[t.index]+" not a path command"}function Wt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function $t(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Gt(t,e){if($t(t))return Nt(t);var n=new Wt(t);for(zt(n);n.index7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function Jt(t,e,n){var r=t[0],a=t.slice(1),i=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===r)i=["L",t[1],e.y1];else if("V"===r)i=["L",e.x1,t[1]];else if("S"===r){var s=function(t,e,n,r,a){return"CS".indexOf(a)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,p=c.qy;e.qx=l,e.qy=p,i=["Q",l,p].concat(a)}else if("Q"===r){var h=a[0],f=a[1];e.qx=h,e.qy=f}return i}function te(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Nt(t);for(var n,r,a=Zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(x*=T=Math.sqrt(T),S*=T);var M=Math.pow(x,2),_=Math.pow(S,2),C=(i===s?-1:1)*Math.sqrt(Math.abs((M*_-M*O*O-_*k*k)/(M*O*O+_*k*k)));f=C*x*O/S+(m+b)/2,d=C*-S*k/x+(w+E)/2,p=Math.asin(((w-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((E-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),p=mh&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var j=h-p;if(Math.abs(j)>v){var I=h,A=b,P=E;h=p+v*(s&&h>p?1:-1),b=f+x*Math.cos(h),E=d+S*Math.sin(h),y=ne(b,E,x,S,a,0,s,A,P,[h,I,f,d])}j=h-p;var V=Math.cos(p),L=Math.sin(p),N=Math.cos(h),U=Math.sin(h),q=Math.tan(j/4),F=4/3*x*q,H=4/3*S*q,R=[m,w],D=[m+F*L,w-H*V],B=[b+F*U,E-H*N],Q=[b,E];return D[0]=2*R[0]-D[0],D[1]=2*R[1]-D[1],c?[D,B,Q].concat(y):(y=[D,B,Q].concat(y).join().split(",")).map((function(t,e){return e%2?ee(y[e-1],t,g).y:ee(t,y[e+1],g).x}))}function re(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function ae(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function ie(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function se(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=ie(i,s,a),u=ie(s,o,a),c=ie(o,u,a),l=ie(u,c,a),p=ie(c,l,a),h=ae.apply(0,i.concat(o,c,p,a)),f=ae.apply(0,p.concat(l,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function oe(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(ne.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(re.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(se(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(se(e.x1,e.y1,e.x,e.y))}return t}function ue(t,e){if(function(t){return $t(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Nt(t);for(var n,r,a=te(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c=0}function fe(t,e){var n=e||.5,r=t.slice(0,2),a=t.slice(2,4),i=t.slice(4,6),s=t.slice(6,8),o=ie(r,a,n),u=ie(a,i,n),c=ie(i,s,n),l=ie(o,u,n),p=ie(u,c,n),h=ie(l,p,n);return[["C"].concat(o,l,h),["C"].concat(p,c,s)]}function de(t,e,n,r,a){return a*(a*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ve(t,e,n,r,a,i,s,o,u){var c;(null===u||Number.isNaN(+u))&&(c=1),c>1&&(c=1),c<0&&(c=0);var l=c/2,p=0,h=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){h=de(t,n,a,s,p=l*u+l),f=de(e,r,i,o,p),d+=v[c]*Math.sqrt(h*h+f*f)})),l*d}function ge(t){return ue((e=ce(Zt(t)),ce(Zt(e,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0]).map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?ve.apply(0,r):0;return{s:t,ss:e?a?fe(r):[t,t]:[t],l:a}}));var e}function ye(t,e,n){var r=ge(t),a=ge(e),i=r.length,s=a.length,o=r.filter((function(t){return t.l})).length,u=a.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/o||0,l=a.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,p=n||Math.max(i,s),h=[c,l],f=[p-i,p-s],d=0,v=[r,a].map((function(t,e){return t.l===p?t.map((function(t){return t.s})):t.map((function(t,n){return d=n&&f[e]&&t.l>=h[e],f[e]-=d?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:ye(v[0],v[1],p)}function me(t){var e=t.length,n=e-1;return t.map((function(r,a){return t.map((function(r,i){var s,o=a+i;return 0===i||t[o]&&"M"===t[o][0]?(s=t[o],["M"].concat(s.slice(-2))):(o>=e&&(o-=n),t[o])}))}))}function be(t,e){var n=t.length-1,r=[],a=0,i=me(t);return i.forEach((function(i,s){t.slice(1).forEach((function(r,i){a+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(s+i)%n].slice(-2),e[i%n].slice(-2))})),r[s]=a,a=0})),i[r.indexOf(Math.min.apply(null,r))]}var we={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=P(e)),"object"==typeof e&&e.curve?e:(a&&/path|glyph/.test(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){for(var a=[],i=e.curve,s=n.curve,o=0,u=s.length;o>0)/1e3)}t.setAttribute("d",1===r?n.original:ce(a))})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].curve,n=this.valuesEnd[t].curve;if(!e||!n||e&&n&&"M"===e[0][0]&&e.length!==n.length){var r=ye(this.valuesStart[t].original,this.valuesEnd[t].original),a=he(r[0])!==he(r[1])?le(r[0]):Nt(r[0]);this.valuesStart[t].curve=a,this.valuesEnd[t].curve=be(r[1],a)}}}},Ee={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:D,pathToString:ce},functions:we,Util:{pathToCurve:ue,pathToAbsolute:Zt,pathToString:ce,parsePathString:Gt,getRotatedCurve:be,getRotations:me,equalizeSegments:ye,reverseCurve:le,clonePath:Nt,getDrawDirection:he,splitCubic:fe,getCurveArray:ge}};function xe(t,e){var n=e.x,r=e.width;return/[a-z]/i.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?n+parseFloat(t)*r/100:parseFloat(t)}function Se(t){var e={},n=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none";if(n instanceof Array)for(var r=0,a=n.length;r>0)/1e3+(i?","+(1e3*i>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(p?"skewX("+(1e3*p>>0)/1e3+")":"")+(h?"skewY("+(1e3*h>>0)/1e3+")":"")+(1!==o?"scale("+(1e3*o>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=ke.call(this,t,Se(this.element.getAttribute("transform")));Object.keys(r).forEach((function(t){e[t]=r[t]}));var a=this.element.ownerSVGElement,i=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));e.translate=[i.matrix.e,i.matrix.f],Object.keys(e).forEach((function(t){t in n&&"origin"!==t||(n[t]=e[t])}))}}},Te={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:D},functions:Oe,Util:{parseStringOrigin:xe,parseTransformString:Se,parseTransformSVG:ke}},Me=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){return t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){throw Error("Passive events are not supported")}return t}(),_e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ce="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",je=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Ie=!!Me&&{passive:!1};function Ae(t){this.scrolling&&t.preventDefault()}function Pe(){var t=this.element;return t===je?{el:document,st:document.body}:{el:t,st:t}}function Ve(t,e){e[t](_e[0],Ae,Ie),e[t](Ce,Ae,Ie)}function Le(){var t=Pe.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,Ve("addEventListener",t.el),t.st.style.pointerEvents="none")}function Ne(){var t=Pe.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,Ve("removeEventListener",t.el),t.st.style.pointerEvents="")}var Ue={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:je,this.element===je?window.pageYOffset||je.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e,10)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:je,Le.call(this),e[t]=function(t,e,n,r){t.scrollTop=D(e,n,r)>>0})},onComplete:function(){Ne.call(this)}},qe={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:D},functions:Ue,Util:{preventScroll:Ae,scrollIn:Le,scrollOut:Ne,getScrollTargets:Pe,toggleScrollEvents:Ve,supportPassive:Me}};function Fe(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){for(var i=[],s="textShadow"===t?3:4,o=3===s?n[3]:n[4],u=3===s?r[3]:r[4],c=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",l=0;l>0)/1e3+"px");e.style[t]=c?st(o,u,a)+i.join(" ")+c:st(o,u,a)+i.join(" ")})}var He=["boxShadow","textShadow"];function Re(t,e){var n;3===t.length?n=[t[0],t[1],0,0,t[2],"none"]:4===t.length?n=/inset|none/.test(t[3])?[t[0],t[1],0,0,t[2],t[3]]:[t[0],t[1],t[2],0,t[3],"none"]:5===t.length?n=/inset|none/.test(t[4])?[t[0],t[1],t[2],0,t[3],t[4]]:[t[0],t[1],t[2],t[3],t[4],"none"]:6===t.length&&(n=t);for(var r=0;r<4;r+=1)n[r]=parseFloat(n[r]);return n[4]=it(n[4]),n="boxShadow"===e?n:n.filter((function(t,e){return[0,1,2,4].includes(e)}))}var De={};He.forEach((function(t){De[t]=Fe}));var Be={component:"shadowProperties",properties:He,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:D,colors:st},functions:{prepareStart:function(t){var e=M(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(e)?f[t]:e},prepareProperty:function(t,e){var n=e;if("string"==typeof n){var r="none",a=n.match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi);r=/inset/.test(n)?"inset":r,n=Re(n=(n=/inset/.test(n)?n.replace(/(\s+inset|inset+\s)/g,""):n).replace(a[0],"").split(" ").concat([a[0].replace(/\s/g,"")],[r]),t)}else n instanceof Array&&(n=Re(n,t));return n},onStart:De},Util:{processShadowArray:Re,trueColor:it}};function Qe(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}var ze=["fontSize","lineHeight","letterSpacing","wordSpacing"],Xe={};ze.forEach((function(t){Xe[t]=Qe}));var Ye={component:"textProperties",category:"textProperties",properties:ze,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:Xe},Util:{trueDimension:B}},We=String("abcdefghijklmnopqrstuvwxyz").split(""),$e=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),Ge=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),Ze=String("0123456789").split(""),Ke=We.concat($e,Ze),Je=Ke.concat(Ge),tn={alpha:We,upper:$e,symbols:Ge,numeric:Ze,alphanumeric:Ke,all:Je},en={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=tn[d.textChars];n in tn?r=tn[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=D(e,n,r)>>0})}};function nn(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function rn(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3;return r}var sn="undefined"!=typeof DOMMatrix?DOMMatrix:null,on="transformMatrix";var un={BackgroundPosition:z,BorderRadius:Z,BoxModel:nt,ClipProperty:at,ColorProperties:pt,FilterEffects:yt,HTMLAttributes:St,OpacityProperty:Ot,SVGDraw:Lt,SVGCubicMorph:Ee,SVGTransform:Te,ScrollProperty:qe,ShadowProperties:Be,TextProperties:Ye,TextWriteProperties:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:D},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:en},Util:{charSet:tn,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=I.tween,i=function(t,e){var n=rn(t,"text-part"),r=rn(nn(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],p=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=p,r.onComplete=null,p+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=p,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,p+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},MatrixTransform:{component:on,property:"transform",defaultValue:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,skew:[0,0],skewX:0,skewY:0,scale3d:[1,1,1],scaleX:1,scaleY:1,scaleZ:1},functions:{prepareStart:function(t,e){var n={},r=this.element.transformMatrix;return r?Object.keys(r).forEach((function(t){n[t]=r[t]})):Object.keys(e).forEach((function(t){n[t]="perspective"===t?e[t]:f.transform[t]})),n},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n,r={},a={},i={},s={},o={},u=[{translate3d:a},{rotate3d:i},{skew:o},{scale3d:s}];return Object.keys(e).forEach((function(t){if(/3d/.test(t)&&"object"==typeof e[t]&&e[t].length)n=e[t].map((function(e){return"scale3d"===t?parseFloat(e):parseInt(e,10)})),r[t]="scale3d"===t?[n[0]||1,n[1]||1,n[2]||1]:[n[0]||0,n[1]||0,n[2]||0];else if(/[XYZ]/.test(t)){var u={};/translate/.test(t)?u=a:/rotate/.test(t)?u=i:/scale/.test(t)?u=s:/skew/.test(t)&&(u=o),u[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t],10)}else"skew"===t?(n=e[t].map((function(t){return parseInt(t,10)||0})),r[t]=[n[0]||0,n[1]||0]):r[t]=parseInt(e[t],10)})),u.forEach((function(t){var e=Object.keys(t)[0],n=t[e];Object.keys(n).length&&!r[e]&&(r[e]="scale3d"===e?[n.x||1,n.y||1,n.z||1]:"skew"===e?[n.x||0,n.y||0]:[n.x||0,n.y||0,n.z||0])})),r}throw Error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(t){sn&&this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){var i=new sn,s={};Object.keys(r).forEach((function(t){s[t]="perspective"===t?D(n[t],r[t],a):an(n[t],r[t],a)})),s.perspective&&(i.m34=-1/s.perspective),i=s.translate3d?i.translate(s.translate3d[0],s.translate3d[1],s.translate3d[2]):i,i=s.rotate3d?i.rotate(s.rotate3d[0],s.rotate3d[1],s.rotate3d[2]):i,s.skew&&(i=s.skew[0]?i.skewX(s.skew[0]):i,i=s.skew[1]?i.skewY(s.skew[1]):i),i=s.scale3d?i.scale(s.scale3d[0],s.scale3d[1],s.scale3d[2]):i,e.style[t]=i.toString()})},CSS3Matrix:function(t){sn&&this.valuesEnd.transform&&(e[t]||(e[t]=sn))}},onComplete:function(t){var e=this;this.valuesEnd[t]&&(this.element.transformMatrix={},Object.keys(this.valuesEnd[t]).forEach((function(n){e.element.transformMatrix[n]=e.valuesEnd[t][n]})))},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:D,translate3d:an,rotate3d:an,skew:an,scale3d:an}}};return Object.keys(un).forEach((function(t){var e=un[t];un[t]=new R(e)})),{Animation:R,Components:un,Tween:U,fromTo:function(t,e,n,r){var a=r||{};return new(0,I.tween)(P(t),e,n,a)},to:function(t,e,n){var r=n||{},a=I.tween;return r.resetStart=e,new a(P(t),e,e,r)},TweenCollection:q,ProgressBar:F,allFromTo:function(t,e,n,r){var a=r||{};return new q(P(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(P(t,!0),e,e,r)},Objects:w,Util:E,Easing:A,CubicBezier:t,Render:p,Interpolate:a,Process:j,Internals:O,Selector:P,Version:"2.1.1-alpha2"}})); diff --git a/demo/src/kute.min.js b/demo/src/kute.min.js index 44de7a4..3230752 100644 --- a/demo/src/kute.min.js +++ b/demo/src/kute.min.js @@ -1,2 +1,2 @@ -// KUTE.js Standard v2.1.1-alpha1 | thednp © 2021 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var D=["top","left","width","height"],R={};D.forEach((function(t){R[t]=U}));var X={component:"essentialBoxModel",category:"boxModel",properties:D,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:F}};function B(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function Z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function z(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=Z(n,r,a)})}var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],K={};Y.forEach((function(t){K[t]="#000"}));var $={};Y.forEach((function(t){$[t]=z}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:K,Interpolate:{numbers:Q,colors:Z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}},G={},J="htmlAttributes",tt=["fill","stroke","stop-color"];function et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=et(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=tt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=et(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(tt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,Z(n,r,a))})},r[s]=B(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=G)}}},rt={component:J,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:Q,colors:Z},functions:nt,Util:{replaceUppercase:et,trueColor:B,trueDimension:F}};var at={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at},st=String("abcdefghijklmnopqrstuvwxyz").split(""),ot=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ut=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),lt=st.concat(ot,ct),ht=lt.concat(ut),pt={alpha:st,upper:ot,symbols:ut,numeric:ct,alphanumeric:lt,all:ht},ft={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=pt[d.textChars];n in pt?r=pt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function dt(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,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=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function gt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function mt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function bt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function xt(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function wt(t,e){return parseFloat(t)/100*e}function Et(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Mt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},It=4;function At(t){return t.map((function(t){return Array.isArray(t)?At(t):Number.isNaN(+t)?t:+t}))}function jt(t,e){var n=Number.isNaN(+e)?It:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):At(t)}function Lt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Pt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Nt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Vt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Pt[n]&&(t.segments.push([e].concat(r.splice(0,Pt[n]))),Pt[n]););}var qt="Invalid path value";function Ht(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=qt+": invalid Arc flag "+e)}function Ft(t){return t>=48&&t<=57}function Qt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=qt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Dt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Rt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Pt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,Ut(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Qt(t):Ht(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index=t.max)break;if(!Dt(t.pathValue.charCodeAt(t.index)))break}Vt(t)}else Vt(t);else t.err=qt+": "+t.pathValue[t.index]+" not a path command"}function Xt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Bt(t,e){if(function(t){return Nt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return At(t);var n=function(t,e){if(Nt(t))return At(t);var n=new Xt(t);for(Ut(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function zt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return At(t);for(var n,r,a=Bt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Kt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,x],D=[m+F*N,x-Q*P],R=[b+F*q,w-Q*V],X=[b,w];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?Yt(g[e-1],t,y).y:Yt(t,g[e+1],y).x}))}function $t(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Wt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function Gt(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function Jt(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=Gt(i,s,a),u=Gt(s,o,a),c=Gt(o,u,a),l=Gt(u,c,a),h=Gt(c,l,a),p=Wt.apply(0,i.concat(o,c,h,a)),f=Wt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function te(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Kt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat($t.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Jt(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(Jt(e.x1,e.y1,e.x,e.y))}return t}function ee(t,e){if(function(t){return Nt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return At(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=re(t,n,a,s,h=l*u+l),f=re(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function ie(t,e){var n=0;return ee(t,e).forEach((function(t,e,r){n+="M"!==t[0]?ae.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function se(t,e){var n,r,a=0;return ee(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ae.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Wt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function oe(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function ue(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return ee(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=oe.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(ee(t,e))>=0}function ce(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function le(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function he(t){return t.reduce((function(e,n,r){return r?e+ce(t[r-1],n):0}),0)}function pe(t,e){var n,r,a=ee((n=ne(t),ne(Bt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=ie(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=he(n),!!r&&{ring:n,pathLength:e}}(n)||pe(n,e)}function de(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=Gt(n,r,.5),t.splice(a+1,0,r)}function ge(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function me(t,e){var n,r,a=t;if("string"==typeof a){var i=fe(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(qt+": "+a);var s=a.slice(0);if(s.pathLength=r,!ge(s))throw Error(qt+": "+s);return s.length>1&&ce(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&ye(s,e),s}function be(t,e,n){var r=n||d.morphPrecision,a=me(t,r),i=me(e,r),s=a.length-i.length;return ve(a,s<0?-1*s:0),ve(i,s>0?s:0),de(a,i),[jt(a),jt(i)]}var xe={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+le(a,i,s,r).join("L")+"Z")})},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=be(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},we={EssentialBoxModel:X,ColorsProperties:W,HTMLAttributes:rt,OpacityProperty:it,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:ft},Util:{charSet:pt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=vt(t,"text-part"),r=vt(dt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{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){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:bt,skew:xt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:St,Util:{getRectLength:Et,getPolyLength:Mt,getLineLength:_t,getCircleLength:kt,getEllipseLength:Ot,getTotalLength:Ct,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Tt,percent:wt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:le,defaultOptions:{morphPrecision:10,morphIndex:0},functions:xe,Util:{addPoints:ve,bisect:ye,normalizeRing:me,validRing:ge,getInterpolationPoints:be,pathStringToRing:fe,distanceSquareRoot:ce,midPoint:Gt,approximateRing:pe,rotateRing:de,pathToString:ne,pathToCurve:ee,getPathLength:ie,getPointAtLength:se,getDrawDirection:ue,roundPath:jt}}};return Object.keys(we).forEach((function(t){var e=we[t];we[t]=new H(e)})),{Animation:H,Components:we,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.1-alpha1"}})); +// KUTE.js Standard v2.1.1-alpha2 | thednp © 2021 | MIT-License +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var D=["top","left","width","height"],R={};D.forEach((function(t){R[t]=U}));var X={component:"essentialBoxModel",category:"boxModel",properties:D,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:F}};function B(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function Z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function z(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=Z(n,r,a)})}var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],K={};Y.forEach((function(t){K[t]="#000"}));var $={};Y.forEach((function(t){$[t]=z}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:K,Interpolate:{numbers:Q,colors:Z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}},G={},J="htmlAttributes",tt=["fill","stroke","stop-color"];function et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=et(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=tt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=et(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(tt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,Z(n,r,a))})},r[s]=B(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=G)}}},rt={component:J,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:Q,colors:Z},functions:nt,Util:{replaceUppercase:et,trueColor:B,trueDimension:F}};var at={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at},st=String("abcdefghijklmnopqrstuvwxyz").split(""),ot=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ut=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),lt=st.concat(ot,ct),ht=lt.concat(ut),pt={alpha:st,upper:ot,symbols:ut,numeric:ct,alphanumeric:lt,all:ht},ft={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=pt[d.textChars];n in pt?r=pt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function dt(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,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=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function gt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function mt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function bt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function xt(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function wt(t,e){return parseFloat(t)/100*e}function Et(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Mt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},It=4;function At(t){return t.map((function(t){return Array.isArray(t)?At(t):Number.isNaN(+t)?t:+t}))}function jt(t,e){var n=Number.isNaN(+e)?It:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):At(t)}function Lt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Pt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Nt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Vt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Pt[n]&&(t.segments.push([e].concat(r.splice(0,Pt[n]))),Pt[n]););}var qt="Invalid path value";function Ht(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=qt+": invalid Arc flag "+e)}function Ft(t){return t>=48&&t<=57}function Qt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=qt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Dt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Rt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Pt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,Ut(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Qt(t):Ht(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index=t.max)break;if(!Dt(t.pathValue.charCodeAt(t.index)))break}Vt(t)}else Vt(t);else t.err=qt+": "+t.pathValue[t.index]+" not a path command"}function Xt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Bt(t,e){if(function(t){return Nt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return At(t);var n=function(t,e){if(Nt(t))return At(t);var n=new Xt(t);for(Ut(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function zt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return At(t);for(var n,r,a=Bt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Kt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,x],D=[m+F*N,x-Q*P],R=[b+F*q,w-Q*V],X=[b,w];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?Yt(g[e-1],t,y).y:Yt(t,g[e+1],y).x}))}function $t(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Wt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function Gt(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function Jt(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=Gt(i,s,a),u=Gt(s,o,a),c=Gt(o,u,a),l=Gt(u,c,a),h=Gt(c,l,a),p=Wt.apply(0,i.concat(o,c,h,a)),f=Wt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function te(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Kt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat($t.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Jt(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(Jt(e.x1,e.y1,e.x,e.y))}return t}function ee(t,e){if(function(t){return Nt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return At(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=re(t,n,a,s,h=l*u+l),f=re(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function ie(t,e){var n=0;return ee(t,e).forEach((function(t,e,r){n+="M"!==t[0]?ae.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function se(t,e){var n,r,a=0;return ee(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ae.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Wt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function oe(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function ue(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return ee(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=oe.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(ee(t,e))>=0}function ce(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function le(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function he(t){return t.reduce((function(e,n,r){return r?e+ce(t[r-1],n):0}),0)}function pe(t,e){var n,r,a=ee((n=ne(t),ne(Bt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=ie(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=he(n),!!r&&{ring:n,pathLength:e}}(n)||pe(n,e)}function de(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=Gt(n,r,.5),t.splice(a+1,0,r)}function ge(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function me(t,e){var n,r,a=t;if("string"==typeof a){var i=fe(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(qt+": "+a);var s=a.slice(0);if(s.pathLength=r,!ge(s))throw Error(qt+": "+s);return s.length>1&&ce(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&ye(s,e),s}function be(t,e,n){var r=n||d.morphPrecision,a=me(t,r),i=me(e,r),s=a.length-i.length;return ve(a,s<0?-1*s:0),ve(i,s>0?s:0),de(a,i),[jt(a),jt(i)]}var xe={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+le(a,i,s,r).join("L")+"Z")})},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=be(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},we={EssentialBoxModel:X,ColorsProperties:W,HTMLAttributes:rt,OpacityProperty:it,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:ft},Util:{charSet:pt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=vt(t,"text-part"),r=vt(dt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{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){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:bt,skew:xt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:St,Util:{getRectLength:Et,getPolyLength:Mt,getLineLength:_t,getCircleLength:kt,getEllipseLength:Ot,getTotalLength:Ct,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Tt,percent:wt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:le,defaultOptions:{morphPrecision:10,morphIndex:0},functions:xe,Util:{addPoints:ve,bisect:ye,normalizeRing:me,validRing:ge,getInterpolationPoints:be,pathStringToRing:fe,distanceSquareRoot:ce,midPoint:Gt,approximateRing:pe,rotateRing:de,pathToString:ne,pathToCurve:ee,getPathLength:ie,getPointAtLength:se,getDrawDirection:ue,roundPath:jt}}};return Object.keys(we).forEach((function(t){var e=we[t];we[t]=new H(e)})),{Animation:H,Components:we,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.1-alpha2"}})); diff --git a/dist/kute.esm.js b/dist/kute.esm.js index 40e82ab..9ab933a 100644 --- a/dist/kute.esm.js +++ b/dist/kute.esm.js @@ -1,5 +1,5 @@ /*! -* KUTE.js Standard v2.1.1-alpha1 (http://thednp.github.io/kute.js) +* KUTE.js Standard v2.1.1-alpha2 (http://thednp.github.io/kute.js) * Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ @@ -76,7 +76,7 @@ CubicBezier.prototype.solveCurveX = function solveCurveX (x) { return t2; }; -var version = "2.1.1-alpha1"; +var version = "2.1.1-alpha2"; var KUTE = {}; @@ -222,17 +222,20 @@ function linkInterpolation() { if (!KUTE[fnObj]) { KUTE[fnObj] = componentLink[fnObj]; } } else { Object.keys(this$1.valuesEnd).forEach(function (prop) { - Object.keys(this$1.valuesEnd[prop]).forEach(function (i) { - if (typeof (componentLink[i]) === 'function') { // transformCSS3 - if (!KUTE[i]) { KUTE[i] = componentLink[i]; } - } else { - Object.keys(componentLink[fnObj]).forEach(function (j) { - if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix - if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } - } - }); - } - }); + var propObject = this$1.valuesEnd[prop]; + if (propObject instanceof Object) { + Object.keys(propObject).forEach(function (i) { + if (typeof (componentLink[i]) === 'function') { // transformCSS3 + if (!KUTE[i]) { KUTE[i] = componentLink[i]; } + } else { + Object.keys(componentLink[fnObj]).forEach(function (j) { + if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix + if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } + } + }); + } + }); + } }); } }); diff --git a/dist/kute.esm.min.js b/dist/kute.esm.min.js index 94d01b7..53502ff 100644 --- a/dist/kute.esm.min.js +++ b/dist/kute.esm.min.js @@ -1,2 +1,2 @@ -// KUTE.js Standard v2.1.1-alpha1 | thednp © 2021 | MIT-License -var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){x[e]||(x[e]=t.Util[e])})),e};var D=["top","left","width","height"],R={};D.forEach((function(t){R[t]=U}));var X={component:"essentialBoxModel",category:"boxModel",properties:D,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:F}};function B(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function Z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function z(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=Z(n,r,a)})}var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],K={};Y.forEach((function(t){K[t]="#000"}));var $={};Y.forEach((function(t){$[t]=z}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:K,Interpolate:{numbers:Q,colors:Z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}},G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=tt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=J.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=tt(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(J.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,Z(n,r,a))})},r[s]=B(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=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:Q,colors:Z},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:F}};var rt={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},at={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:rt},it=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),ct=it.concat(st,ut),lt=ct.concat(ot),ht={alpha:it,upper:st,symbols:ot,numeric:ut,alphanumeric:ct,all:lt},pt={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=ht[d.textChars];n in ht?r=ht[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,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=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function yt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function gt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function mt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function wt(t,e){return parseFloat(t)/100*e}function xt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Et(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},St=4;function It(t){return t.map((function(t){return Array.isArray(t)?It(t):Number.isNaN(+t)?t:+t}))}function At(t,e){var n=Number.isNaN(+e)?St:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):It(t)}function jt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Lt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Pt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Lt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Nt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Lt[n]&&(t.segments.push([e].concat(r.splice(0,Lt[n]))),Lt[n]););}var Vt="Invalid path value";function qt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Vt+": invalid Arc flag "+e)}function Ht(t){return t>=48&&t<=57}function Ft(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Vt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Ut(t){return t>=48&&t<=57||43===t||45===t||46===t}function Dt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Lt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,Qt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Ft(t):qt(t),t.err.length)return;t.data.push(t.param),Qt(t),t.index=t.max)break;if(!Ut(t.pathValue.charCodeAt(t.index)))break}Nt(t)}else Nt(t);else t.err=Vt+": "+t.pathValue[t.index]+" not a path command"}function Rt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Xt(t,e){if(function(t){return Pt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return It(t);var n=function(t,e){if(Pt(t))return It(t);var n=new Rt(t);for(Qt(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function Zt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Lt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return It(t);for(var n,r,a=Xt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(w+x)/2,h=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=x;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),x=d+M*Math.sin(p),g=Yt(b,x,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,w],D=[m+F*N,w-Q*P],R=[b+F*q,x-Q*V],X=[b,x];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?zt(g[e-1],t,y).y:zt(t,g[e+1],y).x}))}function Kt(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function $t(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function Wt(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function Gt(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=Wt(i,s,a),u=Wt(s,o,a),c=Wt(o,u,a),l=Wt(u,c,a),h=Wt(c,l,a),p=$t.apply(0,i.concat(o,c,h,a)),f=$t.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function Jt(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Yt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(Kt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Gt(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(Gt(e.x1,e.y1,e.x,e.y))}return t}function te(t,e){if(function(t){return Pt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return It(t);for(var n,r,a=Zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=ne(t,n,a,s,h=l*u+l),f=ne(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function ae(t,e){var n=0;return te(t,e).forEach((function(t,e,r){n+="M"!==t[0]?re.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function ie(t,e){var n,r,a=0;return te(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?re.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?$t.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function se(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function oe(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return te(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=se.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(te(t,e))>=0}function ue(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ce(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function le(t){return t.reduce((function(e,n,r){return r?e+ue(t[r-1],n):0}),0)}function he(t,e){var n,r,a=te((n=ee(t),ee(Xt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=ae(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=le(n),!!r&&{ring:n,pathLength:e}}(n)||he(n,e)}function fe(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=Wt(n,r,.5),t.splice(a+1,0,r)}function ye(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function ge(t,e){var n,r,a=t;if("string"==typeof a){var i=pe(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(Vt+": "+a);var s=a.slice(0);if(s.pathLength=r,!ye(s))throw Error(Vt+": "+s);return s.length>1&&ue(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&ve(s,e),s}function me(t,e,n){var r=n||d.morphPrecision,a=ge(t,r),i=ge(e,r),s=a.length-i.length;return de(a,s<0?-1*s:0),de(i,s>0?s:0),fe(a,i),[At(a),At(i)]}var be={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+ce(a,i,s,r).join("L")+"Z")})},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=me(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},we={EssentialBoxModel:X,ColorsProperties:W,HTMLAttributes:nt,OpacityProperty:at,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:pt},Util:{charSet:ht,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=dt(t,"text-part"),r=dt(ft(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{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){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:mt,skew:bt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Tt,Util:{getRectLength:xt,getPolyLength:Et,getLineLength:Mt,getCircleLength:_t,getEllipseLength:kt,getTotalLength:Ot,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Ct,percent:wt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:ce,defaultOptions:{morphPrecision:10,morphIndex:0},functions:be,Util:{addPoints:de,bisect:ve,normalizeRing:ge,validRing:ye,getInterpolationPoints:me,pathStringToRing:pe,distanceSquareRoot:ue,midPoint:Wt,approximateRing:he,rotateRing:fe,pathToString:ee,pathToCurve:te,getPathLength:ae,getPointAtLength:ie,getDrawDirection:oe,roundPath:At}}};Object.keys(we).forEach((function(t){var e=we[t];we[t]=new H(e)}));var xe={Animation:H,Components:we,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:w,Util:x,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.1-alpha1"};export default xe; +// KUTE.js Standard v2.1.1-alpha2 | thednp © 2021 | MIT-License +var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){x[e]||(x[e]=t.Util[e])})),e};var D=["top","left","width","height"],R={};D.forEach((function(t){R[t]=U}));var X={component:"essentialBoxModel",category:"boxModel",properties:D,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:F}};function B(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function Z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function z(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=Z(n,r,a)})}var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],K={};Y.forEach((function(t){K[t]="#000"}));var $={};Y.forEach((function(t){$[t]=z}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:K,Interpolate:{numbers:Q,colors:Z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}},G={},J=["fill","stroke","stop-color"];function tt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var et={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=tt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=J.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=tt(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(J.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,Z(n,r,a))})},r[s]=B(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=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:Q,colors:Z},functions:et,Util:{replaceUppercase:tt,trueColor:B,trueDimension:F}};var rt={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},at={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:rt},it=String("abcdefghijklmnopqrstuvwxyz").split(""),st=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ot=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ut=String("0123456789").split(""),ct=it.concat(st,ut),lt=ct.concat(ot),ht={alpha:it,upper:st,symbols:ot,numeric:ut,alphanumeric:ct,all:lt},pt={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=ht[d.textChars];n in ht?r=ht[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,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=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function yt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function gt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function mt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function bt(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function wt(t,e){return parseFloat(t)/100*e}function xt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Et(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},St=4;function It(t){return t.map((function(t){return Array.isArray(t)?It(t):Number.isNaN(+t)?t:+t}))}function At(t,e){var n=Number.isNaN(+e)?St:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):It(t)}function jt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Lt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Pt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Lt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Nt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Lt[n]&&(t.segments.push([e].concat(r.splice(0,Lt[n]))),Lt[n]););}var Vt="Invalid path value";function qt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Vt+": invalid Arc flag "+e)}function Ht(t){return t>=48&&t<=57}function Ft(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Vt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Ut(t){return t>=48&&t<=57||43===t||45===t||46===t}function Dt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Lt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,Qt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Ft(t):qt(t),t.err.length)return;t.data.push(t.param),Qt(t),t.index=t.max)break;if(!Ut(t.pathValue.charCodeAt(t.index)))break}Nt(t)}else Nt(t);else t.err=Vt+": "+t.pathValue[t.index]+" not a path command"}function Rt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Xt(t,e){if(function(t){return Pt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return It(t);var n=function(t,e){if(Pt(t))return It(t);var n=new Rt(t);for(Qt(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function Zt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Lt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return It(t);for(var n,r,a=Xt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(w+x)/2,h=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=x;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),x=d+M*Math.sin(p),g=Yt(b,x,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,w],D=[m+F*N,w-Q*P],R=[b+F*q,x-Q*V],X=[b,x];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?zt(g[e-1],t,y).y:zt(t,g[e+1],y).x}))}function Kt(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function $t(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function Wt(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function Gt(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=Wt(i,s,a),u=Wt(s,o,a),c=Wt(o,u,a),l=Wt(u,c,a),h=Wt(c,l,a),p=$t.apply(0,i.concat(o,c,h,a)),f=$t.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function Jt(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Yt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(Kt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Gt(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(Gt(e.x1,e.y1,e.x,e.y))}return t}function te(t,e){if(function(t){return Pt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return It(t);for(var n,r,a=Zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=ne(t,n,a,s,h=l*u+l),f=ne(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function ae(t,e){var n=0;return te(t,e).forEach((function(t,e,r){n+="M"!==t[0]?re.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function ie(t,e){var n,r,a=0;return te(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?re.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?$t.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function se(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function oe(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return te(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=se.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(te(t,e))>=0}function ue(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ce(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function le(t){return t.reduce((function(e,n,r){return r?e+ue(t[r-1],n):0}),0)}function he(t,e){var n,r,a=te((n=ee(t),ee(Xt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=ae(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=le(n),!!r&&{ring:n,pathLength:e}}(n)||he(n,e)}function fe(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=Wt(n,r,.5),t.splice(a+1,0,r)}function ye(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function ge(t,e){var n,r,a=t;if("string"==typeof a){var i=pe(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(Vt+": "+a);var s=a.slice(0);if(s.pathLength=r,!ye(s))throw Error(Vt+": "+s);return s.length>1&&ue(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&ve(s,e),s}function me(t,e,n){var r=n||d.morphPrecision,a=ge(t,r),i=ge(e,r),s=a.length-i.length;return de(a,s<0?-1*s:0),de(i,s>0?s:0),fe(a,i),[At(a),At(i)]}var be={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+ce(a,i,s,r).join("L")+"Z")})},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=me(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},we={EssentialBoxModel:X,ColorsProperties:W,HTMLAttributes:nt,OpacityProperty:at,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:pt},Util:{charSet:ht,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=dt(t,"text-part"),r=dt(ft(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{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){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:mt,skew:bt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Tt,Util:{getRectLength:xt,getPolyLength:Et,getLineLength:Mt,getCircleLength:_t,getEllipseLength:kt,getTotalLength:Ot,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Ct,percent:wt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:ce,defaultOptions:{morphPrecision:10,morphIndex:0},functions:be,Util:{addPoints:de,bisect:ve,normalizeRing:ge,validRing:ye,getInterpolationPoints:me,pathStringToRing:pe,distanceSquareRoot:ue,midPoint:Wt,approximateRing:he,rotateRing:fe,pathToString:ee,pathToCurve:te,getPathLength:ae,getPointAtLength:ie,getDrawDirection:oe,roundPath:At}}};Object.keys(we).forEach((function(t){var e=we[t];we[t]=new H(e)}));var xe={Animation:H,Components:we,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:w,Util:x,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.1-alpha2"};export default xe; diff --git a/dist/kute.js b/dist/kute.js index c9b64c2..ac16518 100644 --- a/dist/kute.js +++ b/dist/kute.js @@ -1,5 +1,5 @@ /*! -* KUTE.js Standard v2.1.1-alpha1 (http://thednp.github.io/kute.js) +* KUTE.js Standard v2.1.1-alpha2 (http://thednp.github.io/kute.js) * Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ @@ -82,7 +82,7 @@ return t2; }; - var version = "2.1.1-alpha1"; + var version = "2.1.1-alpha2"; var KUTE = {}; @@ -228,17 +228,20 @@ if (!KUTE[fnObj]) { KUTE[fnObj] = componentLink[fnObj]; } } else { Object.keys(this$1.valuesEnd).forEach(function (prop) { - Object.keys(this$1.valuesEnd[prop]).forEach(function (i) { - if (typeof (componentLink[i]) === 'function') { // transformCSS3 - if (!KUTE[i]) { KUTE[i] = componentLink[i]; } - } else { - Object.keys(componentLink[fnObj]).forEach(function (j) { - if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix - if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } - } - }); - } - }); + var propObject = this$1.valuesEnd[prop]; + if (propObject instanceof Object) { + Object.keys(propObject).forEach(function (i) { + if (typeof (componentLink[i]) === 'function') { // transformCSS3 + if (!KUTE[i]) { KUTE[i] = componentLink[i]; } + } else { + Object.keys(componentLink[fnObj]).forEach(function (j) { + if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix + if (!KUTE[j]) { KUTE[j] = componentLink[i][j]; } + } + }); + } + }); + } }); } }); diff --git a/dist/kute.min.js b/dist/kute.min.js index 44de7a4..3230752 100644 --- a/dist/kute.min.js +++ b/dist/kute.min.js @@ -1,2 +1,2 @@ -// KUTE.js Standard v2.1.1-alpha1 | thednp © 2021 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var D=["top","left","width","height"],R={};D.forEach((function(t){R[t]=U}));var X={component:"essentialBoxModel",category:"boxModel",properties:D,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:F}};function B(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function Z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function z(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=Z(n,r,a)})}var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],K={};Y.forEach((function(t){K[t]="#000"}));var $={};Y.forEach((function(t){$[t]=z}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:K,Interpolate:{numbers:Q,colors:Z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}},G={},J="htmlAttributes",tt=["fill","stroke","stop-color"];function et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=et(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=tt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=et(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(tt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,Z(n,r,a))})},r[s]=B(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=G)}}},rt={component:J,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:Q,colors:Z},functions:nt,Util:{replaceUppercase:et,trueColor:B,trueDimension:F}};var at={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at},st=String("abcdefghijklmnopqrstuvwxyz").split(""),ot=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ut=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),lt=st.concat(ot,ct),ht=lt.concat(ut),pt={alpha:st,upper:ot,symbols:ut,numeric:ct,alphanumeric:lt,all:ht},ft={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=pt[d.textChars];n in pt?r=pt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function dt(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,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=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function gt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function mt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function bt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function xt(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function wt(t,e){return parseFloat(t)/100*e}function Et(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Mt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},It=4;function At(t){return t.map((function(t){return Array.isArray(t)?At(t):Number.isNaN(+t)?t:+t}))}function jt(t,e){var n=Number.isNaN(+e)?It:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):At(t)}function Lt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Pt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Nt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Vt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Pt[n]&&(t.segments.push([e].concat(r.splice(0,Pt[n]))),Pt[n]););}var qt="Invalid path value";function Ht(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=qt+": invalid Arc flag "+e)}function Ft(t){return t>=48&&t<=57}function Qt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=qt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Dt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Rt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Pt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,Ut(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Qt(t):Ht(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index=t.max)break;if(!Dt(t.pathValue.charCodeAt(t.index)))break}Vt(t)}else Vt(t);else t.err=qt+": "+t.pathValue[t.index]+" not a path command"}function Xt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Bt(t,e){if(function(t){return Nt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return At(t);var n=function(t,e){if(Nt(t))return At(t);var n=new Xt(t);for(Ut(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function zt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return At(t);for(var n,r,a=Bt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Kt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,x],D=[m+F*N,x-Q*P],R=[b+F*q,w-Q*V],X=[b,w];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?Yt(g[e-1],t,y).y:Yt(t,g[e+1],y).x}))}function $t(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Wt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function Gt(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function Jt(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=Gt(i,s,a),u=Gt(s,o,a),c=Gt(o,u,a),l=Gt(u,c,a),h=Gt(c,l,a),p=Wt.apply(0,i.concat(o,c,h,a)),f=Wt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function te(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Kt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat($t.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Jt(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(Jt(e.x1,e.y1,e.x,e.y))}return t}function ee(t,e){if(function(t){return Nt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return At(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=re(t,n,a,s,h=l*u+l),f=re(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function ie(t,e){var n=0;return ee(t,e).forEach((function(t,e,r){n+="M"!==t[0]?ae.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function se(t,e){var n,r,a=0;return ee(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ae.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Wt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function oe(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function ue(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return ee(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=oe.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(ee(t,e))>=0}function ce(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function le(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function he(t){return t.reduce((function(e,n,r){return r?e+ce(t[r-1],n):0}),0)}function pe(t,e){var n,r,a=ee((n=ne(t),ne(Bt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=ie(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=he(n),!!r&&{ring:n,pathLength:e}}(n)||pe(n,e)}function de(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=Gt(n,r,.5),t.splice(a+1,0,r)}function ge(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function me(t,e){var n,r,a=t;if("string"==typeof a){var i=fe(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(qt+": "+a);var s=a.slice(0);if(s.pathLength=r,!ge(s))throw Error(qt+": "+s);return s.length>1&&ce(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&ye(s,e),s}function be(t,e,n){var r=n||d.morphPrecision,a=me(t,r),i=me(e,r),s=a.length-i.length;return ve(a,s<0?-1*s:0),ve(i,s>0?s:0),de(a,i),[jt(a),jt(i)]}var xe={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+le(a,i,s,r).join("L")+"Z")})},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=be(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},we={EssentialBoxModel:X,ColorsProperties:W,HTMLAttributes:rt,OpacityProperty:it,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:ft},Util:{charSet:pt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=vt(t,"text-part"),r=vt(dt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{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){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:bt,skew:xt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:St,Util:{getRectLength:Et,getPolyLength:Mt,getLineLength:_t,getCircleLength:kt,getEllipseLength:Ot,getTotalLength:Ct,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Tt,percent:wt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:le,defaultOptions:{morphPrecision:10,morphIndex:0},functions:xe,Util:{addPoints:ve,bisect:ye,normalizeRing:me,validRing:ge,getInterpolationPoints:be,pathStringToRing:fe,distanceSquareRoot:ce,midPoint:Gt,approximateRing:pe,rotateRing:de,pathToString:ne,pathToCurve:ee,getPathLength:ie,getPointAtLength:se,getDrawDirection:ue,roundPath:jt}}};return Object.keys(we).forEach((function(t){var e=we[t];we[t]=new H(e)})),{Animation:H,Components:we,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.1-alpha1"}})); +// KUTE.js Standard v2.1.1-alpha2 | thednp © 2021 | MIT-License +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),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.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var D=["top","left","width","height"],R={};D.forEach((function(t){R[t]=U}));var X={component:"essentialBoxModel",category:"boxModel",properties:D,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:R},Util:{trueDimension:F}};function B(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function Z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function z(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=Z(n,r,a)})}var Y=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],K={};Y.forEach((function(t){K[t]="#000"}));var $={};Y.forEach((function(t){$[t]=z}));var W={component:"colorProperties",category:"colors",properties:Y,defaultValues:K,Interpolate:{numbers:Q,colors:Z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:$},Util:{trueColor:B}},G={},J="htmlAttributes",tt=["fill","stroke","stop-color"];function et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=et(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=tt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=et(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(tt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,Z(n,r,a))})},r[s]=B(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in G)&&(G[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=G)}}},rt={component:J,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:Q,colors:Z},functions:nt,Util:{replaceUppercase:et,trueColor:B,trueDimension:F}};var at={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at},st=String("abcdefghijklmnopqrstuvwxyz").split(""),ot=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ut=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),lt=st.concat(ot,ct),ht=lt.concat(ut),pt={alpha:st,upper:ot,symbols:ut,numeric:ct,alphanumeric:lt,all:ht},ft={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=pt[d.textChars];n in pt?r=pt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function dt(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 a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,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=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function gt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function mt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function bt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function xt(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function wt(t,e){return parseFloat(t)/100*e}function Et(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Mt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},It=4;function At(t){return t.map((function(t){return Array.isArray(t)?At(t):Number.isNaN(+t)?t:+t}))}function jt(t,e){var n=Number.isNaN(+e)?It:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):At(t)}function Lt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Pt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Nt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Vt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Pt[n]&&(t.segments.push([e].concat(r.splice(0,Pt[n]))),Pt[n]););}var qt="Invalid path value";function Ht(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=qt+": invalid Arc flag "+e)}function Ft(t){return t>=48&&t<=57}function Qt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=qt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Dt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Rt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Pt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(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;default:return!1}}(n))if(t.index+=1,Ut(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Qt(t):Ht(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index=t.max)break;if(!Dt(t.pathValue.charCodeAt(t.index)))break}Vt(t)}else Vt(t);else t.err=qt+": "+t.pathValue[t.index]+" not a path command"}function Xt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Bt(t,e){if(function(t){return Nt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return At(t);var n=function(t,e){if(Nt(t))return At(t);var n=new Xt(t);for(Ut(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function zt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return At(t);for(var n,r,a=Bt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Kt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,x],D=[m+F*N,x-Q*P],R=[b+F*q,w-Q*V],X=[b,w];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?Yt(g[e-1],t,y).y:Yt(t,g[e+1],y).x}))}function $t(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Wt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function Gt(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function Jt(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=Gt(i,s,a),u=Gt(s,o,a),c=Gt(o,u,a),l=Gt(u,c,a),h=Gt(c,l,a),p=Wt.apply(0,i.concat(o,c,h,a)),f=Wt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function te(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Kt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat($t.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Jt(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(Jt(e.x1,e.y1,e.x,e.y))}return t}function ee(t,e){if(function(t){return Nt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return At(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=re(t,n,a,s,h=l*u+l),f=re(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function ie(t,e){var n=0;return ee(t,e).forEach((function(t,e,r){n+="M"!==t[0]?ae.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function se(t,e){var n,r,a=0;return ee(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ae.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Wt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function oe(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function ue(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return ee(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=oe.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(ee(t,e))>=0}function ce(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function le(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function he(t){return t.reduce((function(e,n,r){return r?e+ce(t[r-1],n):0}),0)}function pe(t,e){var n,r,a=ee((n=ne(t),ne(Bt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=ie(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=he(n),!!r&&{ring:n,pathLength:e}}(n)||pe(n,e)}function de(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=Gt(n,r,.5),t.splice(a+1,0,r)}function ge(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function me(t,e){var n,r,a=t;if("string"==typeof a){var i=fe(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(qt+": "+a);var s=a.slice(0);if(s.pathLength=r,!ge(s))throw Error(qt+": "+s);return s.length>1&&ce(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&ye(s,e),s}function be(t,e,n){var r=n||d.morphPrecision,a=me(t,r),i=me(e,r),s=a.length-i.length;return ve(a,s<0?-1*s:0),ve(i,s>0?s:0),de(a,i),[jt(a),jt(i)]}var xe={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+le(a,i,s,r).join("L")+"Z")})},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=be(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},we={EssentialBoxModel:X,ColorsProperties:W,HTMLAttributes:rt,OpacityProperty:it,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",numbers:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:ft},Util:{charSet:pt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=vt(t,"text-part"),r=vt(dt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{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){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:bt,skew:xt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:St,Util:{getRectLength:Et,getPolyLength:Mt,getLineLength:_t,getCircleLength:kt,getEllipseLength:Ot,getTotalLength:Ct,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Tt,percent:wt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:le,defaultOptions:{morphPrecision:10,morphIndex:0},functions:xe,Util:{addPoints:ve,bisect:ye,normalizeRing:me,validRing:ge,getInterpolationPoints:be,pathStringToRing:fe,distanceSquareRoot:ce,midPoint:Gt,approximateRing:pe,rotateRing:de,pathToString:ne,pathToCurve:ee,getPathLength:ie,getPointAtLength:se,getDrawDirection:ue,roundPath:jt}}};return Object.keys(we).forEach((function(t){var e=we[t];we[t]=new H(e)})),{Animation:H,Components:we,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.1-alpha2"}})); diff --git a/package.json b/package.json index 335055c..13751f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kute.js", - "version": "2.1.1-alpha1", + "version": "2.1.1-alpha2", "description": "JavaScript animation engine", "main": "dist/kute.min.js", "module": "dist/kute.esm.js", diff --git a/src/core/linkInterpolation.js b/src/core/linkInterpolation.js index e017ea7..0807350 100644 --- a/src/core/linkInterpolation.js +++ b/src/core/linkInterpolation.js @@ -14,17 +14,20 @@ export default function linkInterpolation() { // DON'T change if (!KUTE[fnObj]) KUTE[fnObj] = componentLink[fnObj]; } else { Object.keys(this.valuesEnd).forEach((prop) => { - Object.keys(this.valuesEnd[prop]).forEach((i) => { - if (typeof (componentLink[i]) === 'function') { // transformCSS3 - if (!KUTE[i]) KUTE[i] = componentLink[i]; - } else { - Object.keys(componentLink[fnObj]).forEach((j) => { - if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix - if (!KUTE[j]) KUTE[j] = componentLink[i][j]; - } - }); - } - }); + const propObject = this.valuesEnd[prop]; + if (propObject instanceof Object) { + Object.keys(propObject).forEach((i) => { + if (typeof (componentLink[i]) === 'function') { // transformCSS3 + if (!KUTE[i]) KUTE[i] = componentLink[i]; + } else { + Object.keys(componentLink[fnObj]).forEach((j) => { + if (componentLink[i] && typeof (componentLink[i][j]) === 'function') { // transformMatrix + if (!KUTE[j]) KUTE[j] = componentLink[i][j]; + } + }); + } + }); + } }); } });