alrdy-animate
Version:
A library to handle animations on scroll with GSAP integration.
2 lines • 24.2 kB
JavaScript
/*! For license information please see gsap-flip.b8b47ddd29764d257005.js.LICENSE.txt */
"use strict";(this.webpackChunkAlrdyAnimate=this.webpackChunkAlrdyAnimate||[]).push([[638],{863:(t,e,n)=>{n.r(e),n.d(e,{Flip:()=>st,default:()=>st});var i,r,s,a,o,l,u,h,c=n(335),p=1,f=function(t,e){return t.actions.forEach((function(t){return t.vars[e]&&t.vars[e](t)}))},d={},m=180/Math.PI,g=Math.PI/180,v={},y={},b={},w=function(t){return"string"==typeof t?t.split(" ").join("").split(","):t},x=w("onStart,onUpdate,onComplete,onReverseComplete,onInterrupt"),S=w("transform,transformOrigin,width,height,position,top,left,opacity,zIndex,maxWidth,maxHeight,minWidth,minHeight"),C=function(t){return i(t)[0]||console.warn("Element not found:",t)},k=function(t){return Math.round(1e4*t)/1e4||0},V=function(t,e,n){return t.forEach((function(t){return t.classList[n](e)}))},E={zIndex:1,kill:1,simple:1,spin:1,clearProps:1,targets:1,toggleClass:1,onComplete:1,onUpdate:1,onInterrupt:1,onStart:1,delay:1,repeat:1,repeatDelay:1,yoyo:1,scale:1,fade:1,absolute:1,props:1,onEnter:1,onLeave:1,custom:1,paused:1,nested:1,prune:1,absoluteOnLeave:1},L={zIndex:1,simple:1,clearProps:1,scale:1,absolute:1,fitChild:1,getVars:1,props:1},_=function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()},B=function(t,e){var n,i={};for(n in t)e[n]||(i[n]=t[n]);return i},I={},M=function(t){var e=I[t]=w(t);return b[t]=e.concat(S),e},P=function t(e,n,i){void 0===i&&(i=0);for(var r=e.parentNode,s=1e3*Math.pow(10,i)*(n?-1:1),a=n?900*-s:0;e;)a+=s,e=e.previousSibling;return r?a+t(r,n,i+1):a},T=function(t,e,n){return t.forEach((function(t){return t.d=P(n?t.element:t.t,e)})),t.sort((function(t,e){return t.d-e.d})),t},A=function(t,e){for(var n,i,r=t.element.style,s=t.css=t.css||[],a=e.length;a--;)i=r[n=e[a]]||r.getPropertyValue(n),s.push(i?n:y[n]||(y[n]=_(n)),i);return r},N=function(t){var e=t.css,n=t.element.style,i=0;for(t.cache.uncache=1;i<e.length;i+=2)e[i+1]?n[e[i]]=e[i+1]:n.removeProperty(e[i]);!e[e.indexOf("transform")+1]&&n.translate&&(n.removeProperty("translate"),n.removeProperty("scale"),n.removeProperty("rotate"))},X=function(t,e){t.forEach((function(t){return t.a.cache.uncache=1})),e||t.finalStates.forEach(N)},O="paddingTop,paddingRight,paddingBottom,paddingLeft,gridArea,transition".split(","),Y=function(t,e,n){var i,r,a,o=t.element,u=t.width,h=t.height,p=t.uncache,f=t.getProp,d=o.style,m=4;if("object"!=typeof e&&(e=t),s&&1!==n)return s._abs.push({t:o,b:t,a:t,sd:0}),s._final.push((function(){return(t.cache.uncache=1)&&N(t)})),o;for(r="none"===f("display"),t.isVisible&&!r||(r&&(A(t,["display"]).display=e.display),t.matrix=e.matrix,t.width=u=t.width||e.width,t.height=h=t.height||e.height),A(t,O),a=window.getComputedStyle(o);m--;)d[O[m]]=a[O[m]];if(d.gridArea="1 / 1 / 1 / 1",d.transition="none",d.position="absolute",d.width=u+"px",d.height=h+"px",d.top||(d.top="0px"),d.left||(d.left="0px"),p)i=new nt(o);else if((i=B(t,v)).position="absolute",t.simple){var g=o.getBoundingClientRect();i.matrix=new c.cA(1,0,0,1,g.left+(0,c.Mt)(),g.top+(0,c.eK)())}else i.matrix=(0,c.hK)(o,!1,!1,!0);return i=W(i,t,!0),t.x=l(i.x,.01),t.y=l(i.y,.01),o},R=function(t,e){return!0!==e&&(e=i(e),t=t.filter((function(t){if(-1!==e.indexOf((t.sd<0?t.b:t.a).element))return!0;t.t._gsap.renderTransform(1),t.b.isVisible&&(t.t.style.width=t.b.width+"px",t.t.style.height=t.b.height+"px")}))),t},K=function(t){return T(t,!0).forEach((function(t){return(t.a.isVisible||t.b.isVisible)&&Y(t.sd<0?t.b:t.a,t.b,1)}))},z=function(t,e,n,i){return t instanceof nt?t:t instanceof et?function(t,e){return e&&t.idLookup[z(e).id]||t.elementStates[0]}(t,i):new nt("string"==typeof t?C(t)||console.warn(t+" not found"):t,e,n)},D=function(t,e){var n,i=t.style||t;for(n in e)i[n]=e[n]},F=function(t){return t.map((function(t){return t.element}))},H=function(t,e,n){return t&&e.length&&n.add(t(F(e),n,new et(e,0,!0)),0)},W=function(t,e,n,s,a,o){var h,p,f,d,v,y,b,w=t.element,x=t.cache,S=t.parent,C=t.x,V=t.y,E=e.width,L=e.height,_=e.scaleX,B=e.scaleY,I=e.rotation,M=e.bounds,P=o&&u&&u(w,"transform,width,height"),T=t,A=e.matrix,N=A.e,X=A.f,O=t.bounds.width!==M.width||t.bounds.height!==M.height||t.scaleX!==_||t.scaleY!==B||t.rotation!==I,Y=!O&&t.simple&&e.simple&&!a;return Y||!S?(_=B=1,I=h=0):(v=function(t){var e=t._gsap||r.core.getCache(t);return e.gmCache===r.ticker.frame?e.gMatrix:(e.gmCache=r.ticker.frame,e.gMatrix=(0,c.hK)(t,!0,!1,!0))}(S),y=v.clone().multiply(e.ctm?e.matrix.clone().multiply(e.ctm):e.matrix),I=k(Math.atan2(y.b,y.a)*m),h=k(Math.atan2(y.c,y.d)*m+I)%360,_=Math.sqrt(Math.pow(y.a,2)+Math.pow(y.b,2)),B=Math.sqrt(Math.pow(y.c,2)+Math.pow(y.d,2))*Math.cos(h*g),a&&(a=i(a)[0],d=r.getProperty(a),b=a.getBBox&&"function"==typeof a.getBBox&&a.getBBox(),T={scaleX:d("scaleX"),scaleY:d("scaleY"),width:b?b.width:Math.ceil(parseFloat(d("width","px"))),height:b?b.height:parseFloat(d("height","px"))}),x.rotation=I+"deg",x.skewX=h+"deg"),n?(_*=E!==T.width&&T.width?E/T.width:1,B*=L!==T.height&&T.height?L/T.height:1,x.scaleX=_,x.scaleY=B):(E=l(E*_/T.scaleX,0),L=l(L*B/T.scaleY,0),w.style.width=E+"px",w.style.height=L+"px"),s&&D(w,e.props),Y||!S?(C+=N-t.matrix.e,V+=X-t.matrix.f):O||S!==e.parent?(x.renderTransform(1,x),y=(0,c.hK)(a||w,!1,!1,!0),p=v.apply({x:y.e,y:y.f}),C+=(f=v.apply({x:N,y:X})).x-p.x,V+=f.y-p.y):(v.e=v.f=0,C+=(f=v.apply({x:N-t.matrix.e,y:X-t.matrix.f})).x,V+=f.y),C=l(C,.02),V=l(V,.02),!o||o instanceof nt?(x.x=C+"px",x.y=V+"px",x.renderTransform(1,x)):P&&P.revert(),o&&(o.x=C,o.y=V,o.rotation=I,o.skewX=h,n?(o.scaleX=_,o.scaleY=B):(o.width=E,o.height=L)),o||x},j=function(t,e){return t instanceof et?t:new et(t,e)},q=function(t,e,n){var i=t.idLookup[n],r=t.alt[n];return!r.isVisible||(e.getElementState(r.element)||r).isVisible&&i.isVisible?i:r},J=[],Q="width,height,overflowX,overflowY".split(","),U=function(t){if(t!==h){var e=o.style,n=o.clientWidth===window.outerWidth,i=o.clientHeight===window.outerHeight,r=4;if(t&&(n||i)){for(;r--;)J[r]=e[Q[r]];n&&(e.width=o.clientWidth+"px",e.overflowY="hidden"),i&&(e.height=o.clientHeight+"px",e.overflowX="hidden"),h=t}else if(h){for(;r--;)J[r]?e[Q[r]]=J[r]:e.removeProperty(_(Q[r]));h=t}}},Z=function(t,e,n,i){t instanceof et&&e instanceof et||console.warn("Not a valid state object.");var a,o,l,u,h,p,f,d,m,g,v,y,w,C,k,_=n=n||{},P=_.clearProps,N=_.onEnter,O=_.onLeave,Y=_.absolute,z=_.absoluteOnLeave,D=_.custom,F=_.delay,j=_.paused,J=_.repeat,Q=_.repeatDelay,Z=_.yoyo,$=_.toggleClass,tt=_.nested,it=_.zIndex,rt=_.scale,st=_.fade,at=_.stagger,ot=_.spin,lt=_.prune,ut=("props"in n?n:t).props,ht=B(n,E),ct=r.timeline({delay:F,paused:j,repeat:J,repeatDelay:Q,yoyo:Z,data:"isFlip"}),pt=ht,ft=[],dt=[],mt=[],gt=[],vt=!0===ot?1:ot||0,yt="function"==typeof ot?ot:function(){return vt},bt=t.interrupted||e.interrupted,wt=ct[1!==i?"to":"from"];for(o in e.idLookup)v=e.alt[o]?q(e,t,o):e.idLookup[o],h=v.element,g=t.idLookup[o],t.alt[o]&&h===g.element&&(t.alt[o].isVisible||!v.isVisible)&&(g=t.alt[o]),g?(p={t:h,b:g,a:v,sd:g.element===h?0:v.isVisible?1:-1},mt.push(p),p.sd&&(p.sd<0&&(p.b=v,p.a=g),bt&&A(p.b,ut?b[ut]:S),st&&mt.push(p.swap={t:g.element,b:p.b,a:p.a,sd:-p.sd,swap:p})),h._flip=g.element._flip=s?s.timeline:ct):v.isVisible&&(mt.push({t:h,b:B(v,{isVisible:1}),a:v,sd:0,entering:1}),h._flip=s?s.timeline:ct);ut&&(I[ut]||M(ut)).forEach((function(t){return ht[t]=function(e){return mt[e].a.props[t]}})),mt.finalStates=m=[],y=function(){for(T(mt),U(!0),u=0;u<mt.length;u++)p=mt[u],w=p.a,C=p.b,!lt||w.isDifferent(C)||p.entering?(h=p.t,tt&&!(p.sd<0)&&u&&(w.matrix=(0,c.hK)(h,!1,!1,!0)),C.isVisible&&w.isVisible?(p.sd<0?(f=new nt(h,ut,t.simple),W(f,w,rt,0,0,f),f.matrix=(0,c.hK)(h,!1,!1,!0),f.css=p.b.css,p.a=w=f,st&&(h.style.opacity=bt?C.opacity:w.opacity),at&>.push(h)):p.sd>0&&st&&(h.style.opacity=bt?w.opacity-C.opacity:"0"),W(w,C,rt,ut)):C.isVisible!==w.isVisible&&(C.isVisible?w.isVisible||(C.css=w.css,dt.push(C),mt.splice(u--,1),Y&&tt&&W(w,C,rt,ut)):(w.isVisible&&ft.push(w),mt.splice(u--,1))),rt||(h.style.maxWidth=Math.max(w.width,C.width)+"px",h.style.maxHeight=Math.max(w.height,C.height)+"px",h.style.minWidth=Math.min(w.width,C.width)+"px",h.style.minHeight=Math.min(w.height,C.height)+"px"),tt&&$&&h.classList.add($)):mt.splice(u--,1),m.push(w);var e;if($&&(e=m.map((function(t){return t.element})),tt&&e.forEach((function(t){return t.classList.remove($)}))),U(!1),rt?(ht.scaleX=function(t){return mt[t].a.scaleX},ht.scaleY=function(t){return mt[t].a.scaleY}):(ht.width=function(t){return mt[t].a.width+"px"},ht.height=function(t){return mt[t].a.height+"px"},ht.autoRound=n.autoRound||!1),ht.x=function(t){return mt[t].a.x+"px"},ht.y=function(t){return mt[t].a.y+"px"},ht.rotation=function(t){return mt[t].a.rotation+(ot?360*yt(t,d[t],d):0)},ht.skewX=function(t){return mt[t].a.skewX},d=mt.map((function(t){return t.t})),(it||0===it)&&(ht.modifiers={zIndex:function(){return it}},ht.zIndex=it,ht.immediateRender=!1!==n.immediateRender),st&&(ht.opacity=function(t){return mt[t].sd<0?0:mt[t].sd>0?mt[t].a.opacity:"+=0"}),gt.length){at=r.utils.distribute(at);var i=d.slice(gt.length);ht.stagger=function(t,e){return at(~gt.indexOf(e)?d.indexOf(mt[t].swap.t):t,e,i)}}if(x.forEach((function(t){return n[t]&&ct.eventCallback(t,n[t],n[t+"Params"])})),D&&d.length)for(o in pt=B(ht,E),"scale"in D&&(D.scaleX=D.scaleY=D.scale,delete D.scale),D)(a=B(D[o],L))[o]=ht[o],!("duration"in a)&&"duration"in ht&&(a.duration=ht.duration),a.stagger=ht.stagger,wt.call(ct,d,a,0),delete pt[o];(d.length||dt.length||ft.length)&&($&&ct.add((function(){return V(e,$,ct._zTime<0?"remove":"add")}),0)&&!j&&V(e,$,"add"),d.length&&wt.call(ct,d,pt,0)),H(N,ft,ct),H(O,dt,ct);var g=s&&s.timeline;g&&(g.add(ct,0),s._final.push((function(){return X(mt,!P)}))),l=ct.duration(),ct.call((function(){var t=ct.time()>=l;t&&!g&&X(mt,!P),$&&V(e,$,t?"remove":"add")}))},z&&(Y=mt.filter((function(t){return!t.sd&&!t.a.isVisible&&t.b.isVisible})).map((function(t){return t.a.element}))),s?(Y&&(k=s._abs).push.apply(k,R(mt,Y)),s._run.push(y)):(Y&&K(R(mt,Y)),y());var xt=s?s.timeline:ct;return xt.revert=function(){return G(xt,1,1)},xt},$=function t(e){e.vars.onInterrupt&&e.vars.onInterrupt.apply(e,e.vars.onInterruptParams||[]),e.getChildren(!0,!1,!0).forEach(t)},G=function(t,e,n){if(t&&t.progress()<1&&(!t.paused()||n))return e&&($(t),e<2&&t.progress(1),t.kill()),!0},tt=function(t){for(var e,n=t.idLookup={},i=t.alt={},r=t.elementStates,s=r.length;s--;)n[(e=r[s]).id]?i[e.id]=e:n[e.id]=e},et=function(){function t(t,e,n){if(this.props=e&&e.props,this.simple=!(!e||!e.simple),n)this.targets=F(t),this.elementStates=t,tt(this);else{this.targets=i(t);var r=e&&(!1===e.kill||e.batch&&!e.kill);s&&!r&&s._kill.push(this),this.update(r||!!s)}}var e=t.prototype;return e.update=function(t){var e=this;return this.elementStates=this.targets.map((function(t){return new nt(t,e.props,e.simple)})),tt(this),this.interrupt(t),this.recordInlineStyles(),this},e.clear=function(){return this.targets.length=this.elementStates.length=0,tt(this),this},e.fit=function(t,e,n){for(var i,r,s=T(this.elementStates.slice(0),!1,!0),a=(t||this).idLookup,o=0;o<s.length;o++)i=s[o],n&&(i.matrix=(0,c.hK)(i.element,!1,!1,!0)),(r=a[i.id])&&W(i,r,e,!0,0,i),i.matrix=(0,c.hK)(i.element,!1,!1,!0);return this},e.getProperty=function(t,e){var n=this.getElementState(t)||v;return(e in n?n:n.props||v)[e]},e.add=function(t){for(var e,n,i,r=t.targets.length,s=this.idLookup,a=this.alt;r--;)(i=s[(n=t.elementStates[r]).id])&&(n.element===i.element||a[n.id]&&a[n.id].element===n.element)?(e=this.elementStates.indexOf(n.element===i.element?i:a[n.id]),this.targets.splice(e,1,t.targets[r]),this.elementStates.splice(e,1,n)):(this.targets.push(t.targets[r]),this.elementStates.push(n));return t.interrupted&&(this.interrupted=!0),t.simple||(this.simple=!1),tt(this),this},e.compare=function(t){var e,n,i,r,s,a,o,l,u=t.idLookup,h=this.idLookup,c=[],p=[],f=[],d=[],m=[],g=t.alt,v=this.alt,y=function(t,e,n){return(t.isVisible!==e.isVisible?t.isVisible?f:d:t.isVisible?p:c).push(n)&&m.push(n)},b=function(t,e,n){return m.indexOf(n)<0&&y(t,e,n)};for(i in u)s=g[i],a=v[i],r=(e=s?q(t,this,i):u[i]).element,n=h[i],a?(l=n.isVisible||!a.isVisible&&r===n.element?n:a,(o=!s||e.isVisible||s.isVisible||l.element!==s.element?e:s).isVisible&&l.isVisible&&o.element!==l.element?((o.isDifferent(l)?p:c).push(o.element,l.element),m.push(o.element,l.element)):y(o,l,o.element),s&&o.element===s.element&&(s=u[i]),b(o.element!==n.element&&s?s:o,n,n.element),b(s&&s.element===a.element?s:o,a,a.element),s&&b(s,a.element===s.element?a:n,s.element)):(n?n.isDifferent(e)?y(e,n,r):c.push(r):f.push(r),s&&b(s,n,s.element));for(i in h)u[i]||(d.push(h[i].element),v[i]&&d.push(v[i].element));return{changed:p,unchanged:c,enter:f,leave:d}},e.recordInlineStyles=function(){for(var t=b[this.props]||S,e=this.elementStates.length;e--;)A(this.elementStates[e],t)},e.interrupt=function(t){var e=this,n=[];this.targets.forEach((function(i){var r=i._flip,s=G(r,t?0:1);t&&s&&n.indexOf(r)<0&&r.add((function(){return e.updateVisibility()})),s&&n.push(r)})),!t&&n.length&&this.updateVisibility(),this.interrupted||(this.interrupted=!!n.length)},e.updateVisibility=function(){this.elementStates.forEach((function(t){var e=t.element.getBoundingClientRect();t.isVisible=!!(e.width||e.height||e.top||e.left),t.uncache=1}))},e.getElementState=function(t){return this.elementStates[this.targets.indexOf(C(t))]},e.makeAbsolute=function(){return T(this.elementStates.slice(0),!0,!0).map(Y)},t}(),nt=function(){function t(t,e,n){this.element=t,this.update(e,n)}var e=t.prototype;return e.isDifferent=function(t){var e=this.bounds,n=t.bounds;return e.top!==n.top||e.left!==n.left||e.width!==n.width||e.height!==n.height||!this.matrix.equals(t.matrix)||this.opacity!==t.opacity||this.props&&t.props&&JSON.stringify(this.props)!==JSON.stringify(t.props)},e.update=function(t,e){var n,i,s=this,a=s.element,o=r.getProperty(a),u=r.core.getCache(a),h=a.getBoundingClientRect(),f=a.getBBox&&"function"==typeof a.getBBox&&"svg"!==a.nodeName.toLowerCase()&&a.getBBox(),d=e?new c.cA(1,0,0,1,h.left+(0,c.Mt)(),h.top+(0,c.eK)()):(0,c.hK)(a,!1,!1,!0);u.uncache=1,s.getProp=o,s.element=a,s.id=((i=(n=a).getAttribute("data-flip-id"))||n.setAttribute("data-flip-id",i="auto-"+p++),i),s.matrix=d,s.cache=u,s.bounds=h,s.isVisible=!!(h.width||h.height||h.left||h.top),s.display=o("display"),s.position=o("position"),s.parent=a.parentNode,s.x=o("x"),s.y=o("y"),s.scaleX=u.scaleX,s.scaleY=u.scaleY,s.rotation=o("rotation"),s.skewX=o("skewX"),s.opacity=o("opacity"),s.width=f?f.width:l(o("width","px"),.04),s.height=f?f.height:l(o("height","px"),.04),t&&function(t,e){for(var n=r.getProperty(t.element,null,"native"),i=t.props={},s=e.length;s--;)i[e[s]]=(n(e[s])+"").trim();i.zIndex&&(i.zIndex=parseFloat(i.zIndex)||0)}(s,I[t]||M(t)),s.ctm=a.getCTM&&"svg"===a.nodeName.toLowerCase()&&(0,c.KQ)(a).inverse(),s.simple=e||1===k(d.a)&&!k(d.b)&&!k(d.c)&&1===k(d.d),s.uncache=0},t}(),it=function(){function t(t,e){this.vars=t,this.batch=e,this.states=[],this.timeline=e.timeline}var e=t.prototype;return e.getStateById=function(t){for(var e=this.states.length;e--;)if(this.states[e].idLookup[t])return this.states[e]},e.kill=function(){this.batch.remove(this)},t}(),rt=function(){function t(t){this.id=t,this.actions=[],this._kill=[],this._final=[],this._abs=[],this._run=[],this.data={},this.state=new et,this.timeline=r.timeline()}var e=t.prototype;return e.add=function(t){var e=this.actions.filter((function(e){return e.vars===t}));return e.length?e[0]:(e=new it("function"==typeof t?{animate:t}:t,this),this.actions.push(e),e)},e.remove=function(t){var e=this.actions.indexOf(t);return e>=0&&this.actions.splice(e,1),this},e.getState=function(t){var e=this,n=s,i=a;return s=this,this.state.clear(),this._kill.length=0,this.actions.forEach((function(n){n.vars.getState&&(n.states.length=0,a=n,n.state=n.vars.getState(n)),t&&n.states.forEach((function(t){return e.state.add(t)}))})),a=i,s=n,this.killConflicts(),this},e.animate=function(){var t,e,n=this,i=s,r=this.timeline,a=this.actions.length;for(s=this,r.clear(),this._abs.length=this._final.length=this._run.length=0,this.actions.forEach((function(t){t.vars.animate&&t.vars.animate(t);var e,n,i=t.vars.onEnter,r=t.vars.onLeave,s=t.targets;s&&s.length&&(i||r)&&(e=new et,t.states.forEach((function(t){return e.add(t)})),(n=e.compare(st.getState(s))).enter.length&&i&&i(n.enter),n.leave.length&&r&&r(n.leave))})),K(this._abs),this._run.forEach((function(t){return t()})),e=r.duration(),t=this._final.slice(0),r.add((function(){e<=r.time()&&(t.forEach((function(t){return t()})),f(n,"onComplete"))})),s=i;a--;)this.actions[a].vars.once&&this.actions[a].kill();return f(this,"onStart"),r.restart(),this},e.loadState=function(t){t||(t=function(){return 0});var e=[];return this.actions.forEach((function(n){if(n.vars.loadState){var i,r=function r(s){s&&(n.targets=s),~(i=e.indexOf(r))&&(e.splice(i,1),e.length||t())};e.push(r),n.vars.loadState(r)}})),e.length||t(),this},e.setState=function(){return this.actions.forEach((function(t){return t.targets=t.vars.setState&&t.vars.setState(t)})),this},e.killConflicts=function(t){return this.state.interrupt(t),this._kill.forEach((function(e){return e.interrupt(t)})),this},e.run=function(t,e){var n=this;return this!==s&&(t||this.getState(e),this.loadState((function(){n._killed||(n.setState(),n.animate())}))),this},e.clear=function(t){this.state.clear(),t||(this.actions.length=0)},e.getStateById=function(t){for(var e,n=this.actions.length;n--;)if(e=this.actions[n].getStateById(t))return e;return this.state.idLookup[t]&&this.state},e.kill=function(){this._killed=1,this.clear(),delete d[this.id]},t}(),st=function(){function t(){}return t.getState=function(e,n){var i=j(e,n);return a&&a.states.push(i),n&&n.batch&&t.batch(n.batch).state.add(i),i},t.from=function(t,e){return"clearProps"in(e=e||{})||(e.clearProps=!0),Z(t,j(e.targets||t.targets,{props:e.props||t.props,simple:e.simple,kill:!!e.kill}),e,-1)},t.to=function(t,e){return Z(t,j(e.targets||t.targets,{props:e.props||t.props,simple:e.simple,kill:!!e.kill}),e,1)},t.fromTo=function(t,e,n){return Z(t,e,n)},t.fit=function(t,e,n){var i=n?B(n,L):{},s=n||i,a=s.absolute,o=s.scale,l=s.getVars,u=s.props,h=s.runBackwards,c=s.onComplete,p=s.simple,f=n&&n.fitChild&&C(n.fitChild),d=z(e,u,p,t),m=z(t,0,p,d),g=u?b[u]:S,v=r.context();return u&&D(i,d.props),A(m,g),h&&("immediateRender"in i||(i.immediateRender=!0),i.onComplete=function(){N(m),c&&c.apply(this,arguments)}),a&&Y(m,d),i=W(m,d,o||f,!i.duration&&u,f,i.duration||l?i:0),"object"==typeof n&&"zIndex"in n&&(i.zIndex=n.zIndex),v&&!l&&v.add((function(){return function(){return N(m)}})),l?i:i.duration?r.to(m.element,i):null},t.makeAbsolute=function(t,e){return(t instanceof et?t:new et(t,e)).makeAbsolute()},t.batch=function(t){return t||(t="default"),d[t]||(d[t]=new rt(t))},t.killFlipsOf=function(t,e){(t instanceof et?t.targets:i(t)).forEach((function(t){return t&&G(t._flip,!1!==e?1:2)}))},t.isFlipping=function(e){var n=t.getByTarget(e);return!!n&&n.isActive()},t.getByTarget=function(t){return(C(t)||v)._flip},t.getElementState=function(t,e){return new nt(C(t),e)},t.convertCoordinates=function(t,e,n){var i=(0,c.hK)(e,!0,!0).multiply((0,c.hK)(t));return n?i.apply(n):i},t.register=function(t){if(o="undefined"!=typeof document&&document.body){r=t,(0,c.mk)(o),i=r.utils.toArray,u=r.core.getStyleSaver;var e=r.utils.snap(.1);l=function(t,n){return e(parseFloat(t)+n)}}},t}();st.version="3.13.0","undefined"!=typeof window&&window.gsap&&window.gsap.registerPlugin(st)},335:(t,e,n)=>{n.d(e,{KQ:()=>C,Mt:()=>b,cA:()=>E,eK:()=>y,hK:()=>L,mk:()=>d});var i,r,s,a,o,l,u,h,c,p="transform",f=p+"Origin",d=function(t){var e=t.ownerDocument||t;!(p in t.style)&&"msTransform"in t.style&&(f=(p="msTransform")+"Origin");for(;e.parentNode&&(e=e.parentNode););if(r=window,u=new E,e){i=e,s=e.documentElement,a=e.body,(h=i.createElementNS("http://www.w3.org/2000/svg","g")).style.transform="none";var n=e.createElement("div"),o=e.createElement("div"),l=e&&(e.body||e.firstElementChild);l&&l.appendChild&&(l.appendChild(n),n.appendChild(o),n.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),c=o.offsetParent!==n,l.removeChild(n))}return e},m=function(t){for(var e,n;t&&t!==a;)(n=t._gsap)&&n.uncache&&n.get(t,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e},g=[],v=[],y=function(){return r.pageYOffset||i.scrollTop||s.scrollTop||a.scrollTop||0},b=function(){return r.pageXOffset||i.scrollLeft||s.scrollLeft||a.scrollLeft||0},w=function(t){return t.ownerSVGElement||("svg"===(t.tagName+"").toLowerCase()?t:null)},x=function t(e){return"fixed"===r.getComputedStyle(e).position||((e=e.parentNode)&&1===e.nodeType?t(e):void 0)},S=function t(e,n){if(e.parentNode&&(i||d(e))){var r=w(e),s=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",a=r?n?"rect":"g":"div",u=2!==n?0:100,h=3===n?100:0,c="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",p=i.createElementNS?i.createElementNS(s.replace(/^https/,"http"),a):i.createElement(a);return n&&(r?(l||(l=t(e)),p.setAttribute("width",.01),p.setAttribute("height",.01),p.setAttribute("transform","translate("+u+","+h+")"),l.appendChild(p)):(o||((o=t(e)).style.cssText=c),p.style.cssText=c+"width:0.1px;height:0.1px;top:"+h+"px;left:"+u+"px",o.appendChild(p))),p}throw"Need document and parent."},C=function(t){var e,n=t.getCTM();return n||(e=t.style[p],t.style[p]="none",t.appendChild(h),n=h.getCTM(),t.removeChild(h),e?t.style[p]=e:t.style.removeProperty(p.replace(/([A-Z])/g,"-$1").toLowerCase())),n||u.clone()},k=function(t,e){var n,i,s,a,h,d,m=w(t),y=t===m,b=m?g:v,x=t.parentNode,k=x&&!m&&x.shadowRoot&&x.shadowRoot.appendChild?x.shadowRoot:x;if(t===r)return t;if(b.length||b.push(S(t,1),S(t,2),S(t,3)),n=m?l:o,m)y?(a=-(s=C(t)).e/s.a,h=-s.f/s.d,i=u):t.getBBox?(s=t.getBBox(),a=(i=(i=t.transform?t.transform.baseVal:{}).numberOfItems?i.numberOfItems>1?function(t){for(var e=new E,n=0;n<t.numberOfItems;n++)e.multiply(t.getItem(n).matrix);return e}(i):i.getItem(0).matrix:u).a*s.x+i.c*s.y,h=i.b*s.x+i.d*s.y):(i=new E,a=h=0),e&&"g"===t.tagName.toLowerCase()&&(a=h=0),(y?m:x).appendChild(n),n.setAttribute("transform","matrix("+i.a+","+i.b+","+i.c+","+i.d+","+(i.e+a)+","+(i.f+h)+")");else{if(a=h=0,c)for(i=t.offsetParent,s=t;s&&(s=s.parentNode)&&s!==i&&s.parentNode;)(r.getComputedStyle(s)[p]+"").length>4&&(a=s.offsetLeft,h=s.offsetTop,s=0);if("absolute"!==(d=r.getComputedStyle(t)).position&&"fixed"!==d.position)for(i=t.offsetParent;x&&x!==i;)a+=x.scrollLeft||0,h+=x.scrollTop||0,x=x.parentNode;(s=n.style).top=t.offsetTop-h+"px",s.left=t.offsetLeft-a+"px",s[p]=d[p],s[f]=d[f],s.position="fixed"===d.position?"fixed":"absolute",k.appendChild(n)}return n},V=function(t,e,n,i,r,s,a){return t.a=e,t.b=n,t.c=i,t.d=r,t.e=s,t.f=a,t},E=function(){function t(t,e,n,i,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),V(this,t,e,n,i,r,s)}var e=t.prototype;return e.inverse=function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,a=t*i-e*n||1e-10;return V(this,i/a,-e/a,-n/a,t/a,(n*s-i*r)/a,-(t*s-e*r)/a)},e.multiply=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=this.e,a=this.f,o=t.a,l=t.c,u=t.b,h=t.d,c=t.e,p=t.f;return V(this,o*e+u*i,o*n+u*r,l*e+h*i,l*n+h*r,s+c*e+p*i,a+c*n+p*r)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=this.e,a=this.f;return e===t.a&&n===t.b&&i===t.c&&r===t.d&&s===t.e&&a===t.f},e.apply=function(t,e){void 0===e&&(e={});var n=t.x,i=t.y,r=this.a,s=this.b,a=this.c,o=this.d,l=this.e,u=this.f;return e.x=n*r+i*a+l||0,e.y=n*s+i*o+u||0,e},t}();function L(t,e,n,r){if(!t||!t.parentNode||(i||d(t)).documentElement===t)return new E;var s=m(t),a=w(t)?g:v,o=k(t,n),l=a[0].getBoundingClientRect(),u=a[1].getBoundingClientRect(),h=a[2].getBoundingClientRect(),c=o.parentNode,p=!r&&x(t),f=new E((u.left-l.left)/100,(u.top-l.top)/100,(h.left-l.left)/100,(h.top-l.top)/100,l.left+(p?0:b()),l.top+(p?0:y()));if(c.removeChild(o),s)for(l=s.length;l--;)(u=s[l]).scaleX=u.scaleY=0,u.renderTransform(1,u);return e?f.inverse():f}}}]);