kute.js/dist/kute.esm.min.js
thednp e5456b86e9 Changes:
* added a more consistent Typescript generate tsconfig.json
* in regards to Typescript, all internals/externals well defined
2021-11-13 18:51:59 +02:00

3 lines
38 KiB
JavaScript

// KUTE.js Standard v2.1.3 | thednp © 2021 | MIT-License
class t{constructor(t,e,n,r,s){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;const a=t=>this.sampleCurveY(this.solveCurveX(t));return Object.defineProperty(a,"name",{writable:!0}),a.name=s||`cubic-bezier(${[t,e,n,r]})`,a}sampleCurveX(t){return((this.ax*t+this.bx)*t+this.cx)*t}sampleCurveY(t){return((this.ay*t+this.by)*t+this.cy)*t}sampleCurveDerivativeX(t){return(3*this.ax*t+2*this.bx)*t+this.cx}solveCurveX(t){let e,n,r,s,a,i;const o=1e-5;for(r=t,i=0;i<32;i+=1){if(s=this.sampleCurveX(r)-t,Math.abs(s)<o)return r;if(a=this.sampleCurveDerivativeX(r),Math.abs(a)<o)break;r-=s/a}if(e=0,n=1,r=t,r<e)return e;if(r>n)return n;for(;e<n;){if(s=this.sampleCurveX(r),Math.abs(s-t)<o)return r;t>s?e=r:n=r,r=.5*(n-e)+e}return r}}var e={},n=[];let r;r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{};var s=r,a={},i={};let o;o="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?()=>{const t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):"undefined"!=typeof Date&&Date.now?Date.now:()=>(new Date).getTime();var l=o;const c={};c.now=l;let u=0;const h=t=>{let e=0;for(;e<n.length;)n[e].update(t)?e+=1:n.splice(e,1);u=requestAnimationFrame(h)};function p(){setTimeout((()=>{!n.length&&u&&(cancelAnimationFrame(u),u=null,Object.keys(i).forEach((t=>{"function"==typeof i[t]?e[t]&&delete e[t]:Object.keys(i[t]).forEach((t=>{e[t]&&delete e[t]}))})),Object.keys(a).forEach((t=>{e[t]&&delete e[t]})))}),64)}const f={Tick:u,Ticker:h,Tweens:n,Time:c};Object.keys(f).forEach((t=>{e[t]||(e[t]="Time"===t?c.now:f[t])})),s._KUTE=e;var d={},g={};const y={duration:700,delay:0,easing:"linear"};var m={},b={},v={},x={},E={},w={supportedProperties:d,defaultValues:g,defaultOptions:y,prepareProperty:m,prepareStart:b,crossCheck:v,onStart:i,onComplete:x,linkProperty:E},k={},C=t=>n.push(t),O=t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)};function _(){Object.keys(E).forEach((t=>{const n=E[t],r=d[t];Object.keys(n).forEach((t=>{"function"==typeof n[t]&&Object.keys(this.valuesEnd).some((t=>r&&r.includes(t)||"attr"===t&&Object.keys(this.valuesEnd[t]).some((t=>r&&r.includes(t)))))?e[t]||(e[t]=n[t]):Object.keys(this.valuesEnd).forEach((r=>{const s=this.valuesEnd[r];s instanceof Object&&Object.keys(s).forEach((r=>{"function"==typeof n[r]?e[r]||(e[r]=n[r]):Object.keys(n[t]).forEach((t=>{n[r]&&"function"==typeof n[r][t]&&(e[t]||(e[t]=n[r][t]))}))}))}))}))}))}var M={add:C,remove:O,getAll:()=>n,removeAll:()=>{n.length=0},stop:p,linkInterpolation:_};function T(t){if(!t.style)return!1;const e=t.style.cssText.replace(/\s/g,"").split(";"),n={},r=["translate3d","translate","scale3d","skew"];return e.forEach((t=>{if(/transform/i.test(t)){t.split(":")[1].split(")").forEach((t=>{const e=t.split("("),s=e[0],a=e[1];/matrix/.test(s)||(n[s]=r.includes(s)?a.split(","):a)}))}})),n}function I(t,e){const n=t.style,r=getComputedStyle(t)||t.currentStyle,s=n[e]&&!/auto|initial|none|unset/.test(n[e])?n[e]:r[e];let a=g[e];return"transform"!==e&&(e in r||e in n)&&(a=s),a}function S(t,e){const n="start"===e?this.valuesStart:this.valuesEnd;Object.keys(m).forEach((e=>{const r=m[e],s=d[e];Object.keys(r).forEach((e=>{const a={};Object.keys(t).forEach((i=>{g[i]&&r[i]?n[i]=r[i].call(this,i,t[i]):!g[e]&&"transform"===e&&s.includes(i)?a[i]=t[i]:g[i]||"transform"!==i?!g[e]&&s&&s.includes(i)&&(n[i]=r[e].call(this,i,t[i])):n[i]=t[i]})),Object.keys(a).length&&(n[e]=r[e].call(this,e,a))}))}))}function A(){const t={},e=T(this.element);Object.keys(this.valuesStart).forEach((e=>{Object.keys(b).forEach((n=>{const r=b[n];Object.keys(r).forEach((s=>{(s===e&&r[e]||d[n]&&d[n].includes(e))&&(t[e]=r[s].call(this,e,this.valuesStart[e]))}))}))})),Object.keys(e).forEach((n=>{n in this.valuesStart||(t[n]=e[n]||g[n])})),this.valuesStart={},S.call(this,t,"start")}var j={getInlineStyle:T,getStyleForProperty:I,getStartValues:A,prepareObject:S},L={};const P={linear:new t(0,0,1,1,"linear"),easingSinusoidalIn:new t(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new t(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new t(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new t(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new t(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new t(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new t(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new t(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new t(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new t(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new t(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new t(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new t(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new t(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new t(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new t(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new t(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new t(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new t(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new t(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new t(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new t(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new t(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new t(.68,-.55,.265,1.55,"easingBackInOut")};function N(t,e){try{let n,r;return e?(r=t instanceof Array&&t.every((t=>t instanceof Element)),n=t instanceof HTMLCollection||t instanceof NodeList||r?t:document.querySelectorAll(t)):n=t instanceof Element||t===window?t:document.querySelector(t),n}catch(e){throw TypeError(`KUTE.js - Element(s) not found: ${t}.`)}}function $(){Object.keys(i).forEach((t=>{"function"==typeof i[t]?i[t].call(this,t):Object.keys(i[t]).forEach((e=>{i[t][e].call(this,e)}))})),_.call(this)}L.processEasing=function(e){if("function"==typeof e)return e;if("function"==typeof P[e])return P[e];if(/bezier/.test(e)){const n=e.replace(/bezier|\s|\(|\)/g,"").split(",");return new t(1*n[0],1*n[1],1*n[2],1*n[3])}return P.linear};class V{constructor(t,n,r,s){this.element=t,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n;const a=s||{};this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||y.duration,this._delay=a.delay||y.delay,Object.keys(a).forEach((t=>{const e=`_${t}`;e in this||(this[e]=a[t])}));const o=this._easing.name;return i[o]||(i[o]=function(t){e[t]||t!==this._easing.name||(e[t]=this._easing)}),this}start(t){return C(this),this.playing=!0,this._startTime=void 0!==t?t:e.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),$.call(this),this._startFired=!0),u||h(),this}stop(){return this.playing&&(O(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this}close(){Object.keys(x).forEach((t=>{Object.keys(x[t]).forEach((e=>{x[t][e].call(this,e)}))})),this._startFired=!1,p.call(this)}chain(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this}stopChainedTweens(){this._chain&&this._chain.length&&this._chain.forEach((t=>t.stop()))}update(t){const n=void 0!==t?t:e.Time();let r;if(n<this._startTime&&this.playing)return!0;r=(n-this._startTime)/this._duration,r=0===this._duration||r>1?1:r;const s=this._easing(r);return Object.keys(this.valuesEnd).forEach((t=>{e[t](this.element,this.valuesStart[t],this.valuesEnd[t],s)})),this._onUpdate&&this._onUpdate.call(this),1!==r||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((t=>t.start())),!1)}}L.tween=V,y.repeat=0,y.repeatDelay=0,y.yoyo=!1,y.resetStart=!1;class q extends V{constructor(...t){super(...t),this.valuesStart={},this.valuesEnd={};const e=t[1],n=t[2];S.call(this,n,"end"),this._resetStart?this.valuesStart=e:S.call(this,e,"start"),this._resetStart||Object.keys(v).forEach((t=>{Object.keys(v[t]).forEach((e=>{v[t][e].call(this,e)}))})),this.paused=!1,this._pauseTime=null;const r=t[3];return this._repeat=r.repeat||y.repeat,this._repeatDelay=r.repeatDelay||y.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=r.yoyo||y.yoyo,this._reversed=!1,this}start(t){return this._resetStart&&(this.valuesStart=this._resetStart,A.call(this),Object.keys(v).forEach((t=>{Object.keys(v[t]).forEach((e=>{v[t][e].call(this,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((t=>{this.valuesRepeat[t]=this.valuesStart[t]})),super.start(t),this}stop(){return super.stop(),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this}close(){return super.close(),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this}resume(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),$.call(this),this._startTime+=e.Time()-this._pauseTime,C(this),u||h()),this}pause(){return!this.paused&&this.playing&&(O(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this}reverse(){Object.keys(this.valuesEnd).forEach((t=>{const e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}))}update(t){const n=void 0!==t?t:e.Time();let r;if(n<this._startTime&&this.playing)return!0;r=(n-this._startTime)/this._duration,r=0===this._duration||r>1?1:r;const s=this._easing(r);return Object.keys(this.valuesEnd).forEach((t=>{e[t](this.element,this.valuesStart[t],this.valuesEnd[t],s)})),this._onUpdate&&this._onUpdate.call(this),1!==r||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=n,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((t=>t.start())),!1))}}L.tween=q;class H{constructor(t,e,n,r){this.tweens=[],"offset"in y||(y.offset=0);const s=r||{};s.delay=s.delay||y.delay;const a=[];return Array.from(t).forEach(((t,r)=>{const i=L.tween;if(a[r]=s||{},a[r].delay=r>0?s.delay+(s.offset||y.offset):s.delay,!(t instanceof Element))throw Error(`KUTE.js - ${t} not instanceof [Element]`);this.tweens.push(new i(t,e,n,a[r]))})),this.length=this.tweens.length,this}start(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.start(n))),this}stop(){return this.tweens.map((t=>t.stop())),this}pause(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.pause(n))),this}resume(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.resume(n))),this}chain(t){const e=this.tweens[this.length-1];if(t instanceof H)e.chain(t.tweens);else{if(!(t instanceof L.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this}playing(){return this.tweens.some((t=>t.playing))}removeTweens(){this.tweens=[]}getMaxDuration(){const t=[];return this.tweens.forEach((e=>{t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)}}class D{constructor(t){try{if(t.component in d)throw Error(`KUTE.js - ${t.component} already registered`);if(t.property in g)throw Error(`KUTE.js - ${t.property} already registered`);this.setComponent(t)}catch(t){throw Error(t)}}setComponent(t){const e=this,n=t.component,r={prepareProperty:m,prepareStart:b,onStart:i,onComplete:x,crossCheck:v},s=t.category,o=t.property,l=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return d[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(g[o]=t.defaultValue,e.supports=`${o} property`):t.defaultValues&&(Object.keys(t.defaultValues).forEach((e=>{g[e]=t.defaultValues[e]})),e.supports=`${l||o} ${o||s} properties`),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((e=>{y[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((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((s=>{r[e][n]||(r[e][n]={}),r[e][n][s]||(r[e][n][s]=t.functions[e][s])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((e=>{const n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((t=>{"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),E[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((e=>{k[e]||(k[e]=t.Util[e])})),e}}function F(t,e){const n=parseInt(t,10)||0,r=["px","%","deg","rad","em","rem","vh","vw"];let s;for(let e=0;e<r.length;e+=1)if("string"==typeof t&&t.includes(r[e])){s=r[e];break}return void 0===s&&(s=e?"deg":"px"),{v:n,u:s}}function Q(t,e,n){return+t+(e-t)*n}function U(t){t in this.valuesEnd&&!e[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=(s>.99||s<.01?(10*Q(n,r,s)>>0)/10:Q(n,r,s)>>0)+"px"})}const R={};["top","left","width","height"].forEach((t=>{R[t]=U}));const X=["top","left","width","height"],B={};X.forEach((t=>{B[t]=U}));const Z={component:"essentialBoxModel",category:"boxModel",properties:X,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return I(this.element,t)||g[t]},prepareProperty:function(t,e){const n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:B},Util:{trueDimension:F}};function z(t){let e;if(/rgb|rgba/.test(t)){const 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)){const n=(t=>{const e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,n,r)=>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:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){const n=document.getElementsByTagName("head")[0];n.style.color=t;let r=getComputedStyle(n,null).color;r=/rgb/.test(r)?r.replace(/[^\d,]/g,"").split(","):[0,0,0],n.style.color="",e={r:parseInt(r[0],10),g:parseInt(r[1],10),b:parseInt(r[2],10)}}return e}function Y(t,e,n){const r={},s=",";return Object.keys(e).forEach((s=>{"a"!==s?r[s]=Q(t[s],e[s],n)>>0||0:t[s]&&e[s]&&(r[s]=(100*Q(t[s],e[s],n)>>0)/100)})),r.a?"rgba("+r.r+s+r.g+s+r.b+s+r.a+")":"rgb("+r.r+s+r.g+s+r.b+")"}function K(t){this.valuesEnd[t]&&!e[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=Y(n,r,s)})}const W={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((t=>{W[t]=K}));const G=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],J={};G.forEach((t=>{J[t]="#000"}));const tt={};G.forEach((t=>{tt[t]=K}));const et={component:"colorProperties",category:"colors",properties:G,defaultValues:J,Interpolate:{numbers:Q,colors:Y},functions:{prepareStart:function(t){return I(this.element,t)||g[t]},prepareProperty:function(t,e){return z(e)},onStart:tt},Util:{trueColor:z}},nt={},rt=["fill","stroke","stop-color"];function st(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}const at={prepareStart:function(t,e){const n={};return Object.keys(e).forEach((t=>{const e=st(t).replace(/_+[a-z]+/,""),r=this.element.getAttribute(e);n[e]=rt.includes(e)?r||"rgba(0,0,0,0)":r||(/opacity/i.test(t)?1:0)})),n},prepareProperty:function(t,e){const n={};return Object.keys(e).forEach((r=>{const s=st(r),a=/(%|[a-z]+)$/,o=this.element.getAttribute(s.replace(/_+[a-z]+/,""));if(rt.includes(s))i.htmlAttributes[s]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in nt)&&(nt[e]=(t,e,n,r,s)=>{t.setAttribute(e,Y(n,r,s))})},n[s]=z(e[r])||g.htmlAttributes[r];else if(null!==o&&a.test(o)){const a=F(o).u||F(e[r]).u,l=/%/.test(a)?"_percent":`_${a}`;i.htmlAttributes[s+l]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in nt)&&(nt[e]=(t,e,n,r,s)=>{const a=e.replace(l,"");t.setAttribute(a,(1e3*Q(n.v,r.v,s)>>0)/1e3+r.u)})},n[s+l]=F(e[r])}else a.test(e[r])&&null!==o&&(null===o||a.test(o))||(i.htmlAttributes[s]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in nt)&&(nt[e]=(t,e,n,r,s)=>{t.setAttribute(e,(1e3*Q(n,r,s)>>0)/1e3)})},n[s]=parseFloat(e[r]))})),n},onStart:{attr(t){!e[t]&&this.valuesEnd[t]&&(e[t]=(t,n,r,s)=>{Object.keys(r).forEach((a=>{e.attributes[a](t,a,n[a],r[a],s)}))})},attributes(t){!e[t]&&this.valuesEnd.attr&&(e[t]=nt)}}},it={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:Q,colors:Y},functions:at,Util:{replaceUppercase:st,trueColor:z,trueDimension:F}};const ot={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=(1e3*Q(n,r,s)>>0)/1e3})}},lt={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:ot},ct=String("abcdefghijklmnopqrstuvwxyz").split(""),ut=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ht=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),pt=String("0123456789").split(""),ft=ct.concat(ut,pt),dt=ft.concat(ht),gt={alpha:ct,upper:ut,symbols:ht,numeric:pt,alphanumeric:ft,all:dt},yt={text(t){if(!e[t]&&this.valuesEnd[t]){const n=this._textChars;let r=gt[y.textChars];n in gt?r=gt[n]:n&&n.length&&(r=n),e[t]=(t,e,n,s)=>{let a="",i="";const o=""===n?" ":n,l=e.substring(0),c=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(i=c.substring(Math.min(s*c.length,c.length)>>0,0),t.innerHTML=s<1?i+u:o):" "===n?(a=l.substring(0,Math.min((1-s)*l.length,l.length)>>0),t.innerHTML=s<1?a+u:o):(a=l.substring(l.length,Math.min(s*l.length,l.length)>>0),i=c.substring(0,Math.min(s*c.length,c.length)>>0),t.innerHTML=s<1?i+u+a:o)}}},number(t){t in this.valuesEnd&&!e[t]&&(e[t]=(t,e,n,r)=>{t.innerHTML=Q(e,n,r)>>0})}};function mt(t,e){let n,r;if("string"==typeof t)return r=document.createElement("SPAN"),r.innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){const r=t.innerHTML;n=document.createElement("SPAN"),n.className=e,n.innerHTML=r,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&([n]=t.children);return n}function bt(t,e){let n=[];const r=t.children.length;if(r){const s=[];let a,i=t.innerHTML;for(let n,o,l,c=0;c<r;c+=1)n=t.children[c],o=n.outerHTML,a=i.split(o),""!==a[0]?(l=mt(a[0],e),s.push(l),i=i.replace(a[0],"")):""!==a[1]&&(l=mt(a[1].split("<")[0],e),s.push(l),i=i.replace(a[0].split("<")[0],"")),n.classList.contains(e)||n.classList.add(e),s.push(n),i=i.replace(o,"");if(""!==i){const t=mt(i,e);s.push(t)}n=n.concat(s)}else n=n.concat([mt(t,e)]);return n}function vt(t,e,n,r){return`perspective(${(1e3*(t+(e-t)*r)>>0)/1e3}${n})`}function xt(t,e,n,r){const s=[];for(let a=0;a<3;a+=1)s[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return`translate3d(${s.join(",")})`}function Et(t,e,n,r){let s="";return s+=t[0]||e[0]?`rotateX(${(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3}${n})`:"",s+=t[1]||e[1]?`rotateY(${(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3}${n})`:"",s+=t[2]||e[2]?`rotateZ(${(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3}${n})`:"",s}function wt(t,e,n){return`scale(${(1e3*(t+(e-t)*n)>>0)/1e3})`}function kt(t,e,n,r){const s=[];return s[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,s[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0",`skew(${s.join(",")})`}function Ct(t,e){return parseFloat(t)/100*e}function Ot(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function _t(t){const e=t.getAttribute("points").split(" ");let n=0;if(e.length>1){const r=t=>{const e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},s=(t,e)=>void 0!==t&&void 0!==e?Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2):0;if(e.length>2)for(let t=0;t<e.length-1;t+=1)n+=s(r(e[t]),r(e[t+1]));n+="polygon"===t.tagName?s(r(e[0]),r(e[e.length-1])):0}return n}function Mt(t){const e=t.getAttribute("x1"),n=t.getAttribute("x2"),r=t.getAttribute("y1"),s=t.getAttribute("y2");return Math.sqrt((n-e)**2+(s-r)**2)}function Tt(t){const e=t.getAttribute("r");return 2*Math.PI*e}function It(t){const e=2*t.getAttribute("rx"),n=2*t.getAttribute("ry");return Math.sqrt(.5*(e*e+n*n))*(2*Math.PI)/2}function St(t){return"rect"===t.tagName?Ot(t):"circle"===t.tagName?Tt(t):"ellipse"===t.tagName?It(t):["polygon","polyline"].includes(t.tagName)?_t(t):"line"===t.tagName?Mt(t):0}function At(t,e){const n=/path|glyph/.test(t.tagName)?t.getTotalLength():St(t);let r,s,a,i;if(e instanceof Object)return e;if("string"==typeof e){const t=e.split(/,|\s/);r=/%/.test(t[0])?Ct(t[0].trim(),n):parseFloat(t[0]),s=/%/.test(t[1])?Ct(t[1].trim(),n):parseFloat(t[1])}else void 0===e&&(i=parseFloat(I(t,"stroke-dashoffset")),a=I(t,"stroke-dasharray").split(","),r=0-i,s=parseFloat(a[0])+r||n);return{s:r,e:s,l:n}}const jt={prepareStart:function(){return At(this.element)},prepareProperty:function(t,e){return At(this.element,e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=(t,e,n,r)=>{const s=(100*e.l>>0)/100,a=0-(100*Q(e.s,n.s,r)>>0)/100,i=(100*Q(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=`${a}px`,t.style.strokeDasharray=`${(100*(i<1?0:i)>>0)/100}px, ${s}px`})}},Lt=4;function Pt(t){return t.map((t=>Array.isArray(t)?Pt(t):Number.isNaN(+t)?t:+t))}function Nt(t,e){const n=Number.isNaN(+e)?Lt:+e;let r;return r=n?t.map((t=>t.map((t=>{const e=+t,r=10**n;return e?e%1==0?e:Math.round(e*r)/r:t})))):Pt(t),r}function $t(t,e,n){if(t[n].length>7){t[n].shift();const r=t[n];let s=n;for(;r.length;)e[n]="A",t.splice(s+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Vt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qt(t){return Array.isArray(t)&&t.every((t=>{const e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ht(t){let 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>=Vt[n]&&(t.segments.push([e].concat(r.splice(0,Vt[n]))),Vt[n]););}function Dt(t){const 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=`Invalid path value: invalid Arc flag ${e}`)}function Ft(t){return t>=48&&t<=57}function Qt(t){const e=t.index,{max:n}=t;let r,s=e,a=!1,i=!1,o=!1,l=!1;if(s>=n)t.err=`Invalid path value: missing param ${t.pathValue[s]}`;else if(r=t.pathValue.charCodeAt(s),43!==r&&45!==r||(s+=1,r=s<n?t.pathValue.charCodeAt(s):0),Ft(r)||46===r){if(46!==r){if(a=48===r,s+=1,r=s<n?t.pathValue.charCodeAt(s):0,a&&s<n&&r&&Ft(r))return void(t.err=`Invalid path value: ${t.pathValue[e]} illegal number`);for(;s<n&&Ft(t.pathValue.charCodeAt(s));)s+=1,i=!0;r=s<n?t.pathValue.charCodeAt(s):0}if(46===r){for(l=!0,s+=1;Ft(t.pathValue.charCodeAt(s));)s+=1,o=!0;r=s<n?t.pathValue.charCodeAt(s):0}if(101===r||69===r){if(l&&!i&&!o)return void(t.err=`Invalid path value: ${t.pathValue[s]} invalid float exponent`);if(s+=1,r=s<n?t.pathValue.charCodeAt(s):0,43!==r&&45!==r||(s+=1),!(s<n&&Ft(t.pathValue.charCodeAt(s))))return void(t.err=`Invalid path value: ${t.pathValue[s]} invalid float exponent`);for(;s<n&&Ft(t.pathValue.charCodeAt(s));)s+=1}t.index=s,t.param=+t.pathValue.slice(e,s)}else t.err=`Invalid path value at index ${s}: ${t.pathValue[s]} is not a number`}function Ut(t){for(;t.index<t.max&&(10===(e=t.pathValue.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=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 Rt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Xt(t){const{max:e}=t,n=t.pathValue.charCodeAt(t.index),r=Vt[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(let s=r;s>0;s-=1){if(97!=(32|n)||3!==s&&4!==s?Qt(t):Dt(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index<e&&44===t.pathValue.charCodeAt(t.index)&&(t.index+=1,Ut(t))}if(t.index>=t.max)break;if(!Rt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=`Invalid path value: ${t.pathValue[t.index]} not a path command`}function Bt(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function Zt(t,e){if(function(t){return qt(t)&&t.every((t=>t[0]===t[0].toUpperCase()))}(t))return Pt(t);const n=function(t,e){if(qt(t))return Pt(t);const n=new Bt(t);for(Ut(n);n.index<n.max&&!n.err.length;)Xt(n);return n.err.length?n.segments=[]:n.segments.length&&("mM".indexOf(n.segments[0][0])<0?(n.err="Invalid path value: missing M/m",n.segments=[]):n.segments[0][0]="M"),Nt(n.segments,e)}(t,e),r=n.length,s=[];let a=0,i=0,o=0,l=0,c=0;"M"===n[0][0]&&(a=+n[0][1],i=+n[0][2],o=a,l=i,c+=1,s.push(["M",a,i]));for(let t=c;t<r;t+=1){const e=n[t],[r]=e,c=r.toUpperCase(),u=[];let h=[];if(s.push(u),r!==c)switch(u[0]=c,c){case"A":h=e.slice(1,-2).concat([+e[6]+a,+e[7]+i]);for(let t=0;t<h.length;t+=1)u.push(h[t]);break;case"V":u[1]=+e[1]+i;break;case"H":u[1]=+e[1]+a;break;default:"M"===c&&(o=+e[1]+a,l=+e[2]+i);for(let t=1;t<e.length;t+=1)u.push(+e[t]+(t%2?a:i))}else for(let t=0;t<e.length;t+=1)u.push(e[t]);const p=u.length;switch(c){case"Z":a=o,i=l;break;case"H":a=+u[1];break;case"V":i=+u[1];break;default:a=+u[p-2],i=+u[p-1],"M"===c&&(o=a,l=i)}}return Nt(s,e)}function zt(t,e,n){const[r]=t,s=t.slice(1);let a=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===r)a=["L",t[1],e.y1];else if("V"===r)a=["L",e.x1,t[1]];else if("S"===r){const{x1:t,y1:r}=function(t,e,n,r,s){return"CS".indexOf(s)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n);e.x1=t,e.y1=r,a=["C",t,r].concat(s)}else if("T"===r){const{qx:t,qy:r}=function(t,e,n,r,s){return"QT".indexOf(s)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n);e.qx=t,e.qy=r,a=["Q",t,r].concat(s)}else if("Q"===r){const[t,n]=s;e.qx=t,e.qy=n}return a}function Yt(t,e){if(function(t){return Array.isArray(t)&&t.every((t=>{const e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Pt(t);const n=Zt(t,e),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],a=n.length;let i,o,l="";for(let t=0;t<a;t+=1){const[e]=n[t];s[t]=e,t&&(l=s[t-1]),n[t]=zt(n[t],r,l),i=n[t],o=i.length,r.x1=+i[o-2],r.y1=+i[o-1],r.x2=+i[o-4]||r.x1,r.y2=+i[o-3]||r.y1}return Nt(n,e)}function Kt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Wt(t,e,n,r,s,a,i,o,l,c){const u=120*Math.PI/180,h=Math.PI/180*(s||0);let p,f,d,g,y,m=[],b=t,v=o,x=e,E=l,w=n,k=r;if(c){const[t,e,n,r]=c;f=t,d=e,g=n,y=r}else{p=Kt(b,x,-h),b=p.x,x=p.y,p=Kt(v,E,-h),v=p.x,E=p.y;const t=(b-v)/2,e=(x-E)/2;let n=t*t/(w*k)+e**2/k**2;n>1&&(n=Math.sqrt(n),w*=n,k*=n);const r=w**2,s=k**2,o=(a===i?-1:1)*Math.sqrt(Math.abs((r*s-r*e*e-s*t*t)/(r*e*e+s*t*t)));g=o*w*e/k+(b+v)/2,y=o*-k*t/w+(x+E)/2,f=Math.asin(((x-y)/k*10**9>>0)/10**9),d=Math.asin(((E-y)/k*10**9>>0)/10**9),f=b<g?Math.PI-f:f,d=v<g?Math.PI-d:d,f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),i&&f>d&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let C=d-f;if(Math.abs(C)>u){const t=d,e=v,n=E;d=f+u*(i&&d>f?1:-1),v=g+w*Math.cos(d),E=y+k*Math.sin(d),m=Wt(v,E,w,k,s,0,i,e,n,[d,t,g,y])}C=d-f;const O=Math.cos(f),_=Math.sin(f),M=Math.cos(d),T=Math.sin(d),I=Math.tan(C/4),S=4/3*w*I,A=4/3*k*I,j=[b,x],L=[b+S*_,x-A*O],P=[v+S*T,E-A*M],N=[v,E];return L[0]=2*j[0]-L[0],L[1]=2*j[1]-L[1],c?[L,P,N].concat(m):(m=[L,P,N].concat(m).join().split(","),m.map(((t,e)=>e%2?Kt(m[e-1],t,h).y:Kt(t,m[e+1],h).x)))}function Gt(t,e,n,r,s,a){const i=1/3,o=2/3;return[i*t+o*n,i*e+o*r,i*s+o*n,i*a+o*r,s,a]}function Jt(t,e,n,r,s,a,i,o,l){const c=1-l;return{x:c**3*t+c*c*3*l*n+3*c*l*l*s+l**3*i,y:c**3*e+c*c*3*l*r+3*c*l*l*a+l**3*o}}function te(t,e,n){const r=t[0],s=t[1];return[r+(e[0]-r)*n,s+(e[1]-s)*n]}function ee(t,e,n,r){const s=.5,a=[t,e],i=[n,r],o=te(a,i,s),l=te(i,o,s),c=te(o,l,s),u=te(l,c,s),h=te(c,u,s),p=Jt.apply(0,a.concat(o,c,h,s)),f=Jt.apply(0,h.concat(u,l,i,0));return[p.x,p.y,f.x,f.y,n,r]}function ne(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);const[n,r]=t.slice(1);switch(t[0]){case"M":return e.x=n,e.y=r,t;case"A":return["C"].concat(Wt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=n,e.qy=r,["C"].concat(Gt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ee(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ee(e.x1,e.y1,e.x,e.y))}return t}function re(t,e){if(function(t){return qt(t)&&t.slice(1).every((t=>"C"===t[0]))}(t))return Pt(t);const n=Yt(t,e),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[];let a,i,o="",l=n.length;for(let t=0;t<l;t+=1)n[t]&&([o]=n[t]),s[t]=o,n[t]=ne(n[t],r),$t(n,s,t),l=n.length,a=n[t],i=a.length,r.x1=+a[i-2],r.y1=+a[i-1],r.x2=+a[i-4]||r.x1,r.y2=+a[i-3]||r.y1;return Nt(n,e)}function se(t){return t.map((t=>t[0].concat(t.slice(1).join(" ")))).join("")}function ae(t,e,n,r,s){return s*(s*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ie(t,e,n,r,s,a,i,o,l){let c;(null===l||Number.isNaN(+l))&&(c=1),c>1&&(c=1),c<0&&(c=0);const u=c/2;let h=0,p=0,f=0,d=0;const g=[.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(((l,c)=>{h=u*l+u,p=ae(t,n,s,i,h),f=ae(e,r,a,o,h),d+=g[c]*Math.sqrt(p*p+f*f)})),u*d}function oe(t,e){let n=0;return re(t,e).forEach(((t,e,r)=>{n+="M"!==t[0]?ie.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function le(t,e){let n,r,s,a=0;return re(t,9).map(((t,i,o)=>(r=i?o[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ie.apply(0,r):0,a+=n,s=0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Jt.apply(0,r.concat(1-(a-e)/n)):null,s))).filter((t=>t)).slice(-1)[0]}function ce(t,e,n,r,s,a,i,o){return 3*((o-e)*(n+s)-(i-t)*(r+a)+r*(t-s)-n*(e-a)+o*(s+t/3)-i*(a+e/3))/20}function ue(t,e){return function(t,e){let n=0,r=0,s=0,a=0,i=0;return re(t,e).map((t=>{switch(t[0]){case"M":case"Z":return s="M"===t[0]?t[1]:s,a="M"===t[0]?t[2]:a,n=s,r=a,0;default:return i=ce.apply(0,[n,r].concat(t.slice(1))),[n,r]=t.slice(-2),i}})).reduce(((t,e)=>t+e),0)}(re(t,e))>=0}function he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function pe(t,e,n,r){const s=[];for(let a=0;a<n;a+=1){s[a]=[];for(let n=0;n<2;n+=1)s[a].push((1e3*(t[a][n]+(e[a][n]-t[a][n])*r)>>0)/1e3)}return s}function fe(t){return t.reduce(((e,n,r)=>r?e+he(t[r-1],n):0),0)}function de(t,e){var n;const r=re((n=se(t),se(Zt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((t=>t.trim())).filter((t=>t)))[0],4),s=oe(r),a=[];let i,o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(s/e)));for(let t=0;t<o;t+=1)i=le(r,s*t/o),a.push([i.x,i.y]);return ue(r)||a.reverse(),{pathLength:s,ring:a,skipBisect:!0}}function ge(t,e){const n=Yt(t,0);return function(t){const e=[],n=t.length;let r=[],s="",a=0;if(!t.length||"M"!==t[0][0])return!1;for(let a=0;a<n&&(r=t[a],[s]=r,!("M"===s&&a||"Z"===s));a+=1){if(!("ML".indexOf(s)>-1))return!1;e.push([r[1],r[2]])}return a=fe(e),!!n&&{ring:e,pathLength:a}}(n)||de(n,e)}function ye(t,e){const n=t.length;let r,s,a,i,o=1/0,l=0;for(let s=0;s<n;s+=1){l=0;for(let r=0;r<e.length;r+=1)i=e[r],a=he(t[(s+r)%n],i),l+=a*a;l<o&&(o=l,r=s)}r&&(s=t.splice(0,r),t.splice(t.length,0,...s))}function me(t,e){const n=t.length+e,r=fe(t)/e;let s,a,i,o=0,l=0,c=r/2;for(;t.length<n;)s=t[o],a=t[(o+1)%t.length],i=he(s,a),c<=l+i?(t.splice(o+1,0,i?te(s,a,(c-l)/i):s.slice(0)),c+=r):(l+=i,o+=1)}function be(t,e=1/0){let n=[],r=[];for(let s=0;s<t.length;s+=1)for(n=t[s],r=s===t.length-1?t[0]:t[s+1];he(n,r)>e;)r=te(n,r,.5),t.splice(s+1,0,r)}function ve(t){return Array.isArray(t)&&t.every((t=>Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])))}function xe(t,e){let n,r,s=t;if("string"==typeof s){const t=ge(s,e);s=t.ring,n=t.skipBisect,r=t.pathLength}else if(!Array.isArray(s))throw Error(`Invalid path value: ${s}`);const a=s.slice(0);if(a.pathLength=r,!ve(a))throw Error(`Invalid path value: ${a}`);return a.length>1&&he(a[0],a[a.length-1])<1e-9&&a.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&be(a,e),a}function Ee(t,e,n){const r=n||y.morphPrecision,s=xe(t,r),a=xe(e,r),i=s.length-a.length;return me(s,i<0?-1*i:0),me(a,i>0?i:0),ye(s,a),[Nt(s),Nt(a)]}const we={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){const n={},r=new RegExp("\\n","ig");let s=null;return e instanceof SVGElement?s=e:/^\.|^#/.test(e)&&(s=N(e)),"object"==typeof e&&e.pathArray?e:(s&&["path","glyph"].includes(s.tagName)?n.original=s.getAttribute("d").replace(r,""):s||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=(t,e,n,r)=>{const s=e.pathArray,a=n.pathArray,i=a.length;t.setAttribute("d",1===r?n.original:`M${pe(s,a,i,r).join("L")}Z`)})},crossCheck:function(t){if(this.valuesEnd[t]){const e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){const e=this.valuesStart[t].original,n=this.valuesEnd[t].original,r=this._morphPrecision?parseInt(this._morphPrecision,10):y.morphPrecision,[s,a]=Ee(e,n,r);this.valuesStart[t].pathArray=s,this.valuesEnd[t].pathArray=a}}}},ke={EssentialBoxModel:Z,ColorsProperties:et,HTMLAttributes:it,OpacityProperty:lt,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"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:yt},Util:{charSet:gt,createTextTweens:function(t,e,n){if(t.playing)return!1;const r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);const s=L.tween,a=function(t,e){const n=bt(t,"text-part"),r=bt(mt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((t=>(t.className+=" oldText",t.outerHTML))).join(""),t.innerHTML+=r.map((t=>(t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")))).join(""),[n,r]}(t,e),i=a[0],o=a[1],l=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText"));let u=[],h=0;return u=u.concat(l.map(((t,e)=>(r.duration="auto"===r.duration?75*i[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new s(t,{text:t.innerHTML},{text:""},r))))),u=u.concat(c.map(((n,a)=>(r.duration="auto"===r.duration?75*o[a].innerHTML.length:r.duration,r.delay=h,r.onComplete=a===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new s(n,{text:""},{text:o[a].innerHTML},r))))),u.start=function(){t.playing||(u.forEach((t=>t.start())),t.playing=!0)},u}}},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){const e=T(this.element);return e[t]?e[t]:g[t]},prepareProperty:function(t,e){const n=["X","Y","Z"],r={},s=[],a=[],i=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((t=>{const l="object"==typeof e[t]&&e[t].length?e[t].map((t=>parseInt(t,10))):parseInt(e[t],10);if(o.includes(t)){const e="translate"===t||"rotate"===t?`${t}3d`:t;r[e]="skew"===t?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===t?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0]}else if(/[XYZ]/.test(t)){const o=t.replace(/[XYZ]/,""),l="skew"===o?o:`${o}3d`,c="skew"===o?2:3;let u=[];"translate"===o?u=s:"rotate"===o?u=a:"skew"===o&&(u=i);for(let t=0;t<c;t+=1){const r=n[t];u[t]=`${o}${r}`in e?parseInt(e[`${o}${r}`],10):0}r[l]=u}else"rotate"===t?r.rotate3d=[0,0,l]:r[t]="scale"===t?parseFloat(e[t]):l})),r},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=(n.perspective||r.perspective?vt(n.perspective,r.perspective,"px",s):"")+(n.translate3d?xt(n.translate3d,r.translate3d,"px",s):"")+(n.rotate3d?Et(n.rotate3d,r.rotate3d,"deg",s):"")+(n.skew?kt(n.skew,r.skew,"deg",s):"")+(n.scale||r.scale?wt(n.scale,r.scale,s):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:vt,translate3d:xt,rotate3d:Et,translate:function(t,e,n,r){const s=[];return s[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,s[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0",`translate(${s.join(",")})`},rotate:function(t,e,n,r){return`rotate(${(1e3*(t+(e-t)*r)>>0)/1e3}${n})`},scale:wt,skew:kt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:jt,Util:{getRectLength:Ot,getPolyLength:_t,getLineLength:Mt,getCircleLength:Tt,getEllipseLength:It,getTotalLength:St,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:At,percent:Ct}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:pe,defaultOptions:{morphPrecision:10,morphIndex:0},functions:we,Util:{addPoints:me,bisect:be,normalizeRing:xe,validRing:ve,getInterpolationPoints:Ee,pathStringToRing:ge,distanceSquareRoot:he,midPoint:te,approximateRing:de,rotateRing:ye,pathToString:se,pathToCurve:re,getPathLength:oe,getPointAtLength:le,getDrawDirection:ue,roundPath:Nt}}};Object.keys(ke).forEach((t=>{const e=ke[t];ke[t]=new D(e)}));const Ce={Animation:D,Components:ke,Tween:q,fromTo:function(t,e,n,r){const s=r||{};return new(0,L.tween)(N(t),e,n,s)},to:function(t,e,n){const r=n||{},s=L.tween;return r.resetStart=e,new s(N(t),e,e,r)},TweenCollection:H,allFromTo:function(t,e,n,r){const s=r||{};return new H(N(t,!0),e,n,s)},allTo:function(t,e,n){const r=n||{};return n.resetStart=e,new H(N(t,!0),e,e,r)},Objects:w,Util:k,Easing:P,CubicBezier:t,Render:f,Interpolate:a,Process:j,Internals:M,Selector:N,Version:"2.1.3"};export{Ce as default};