| @@ -1,2 +1,23 @@ | ||
| 1 | -/*! For license information please see cursor.js.LICENSE.txt */ | |
| 2 | -(()=>{"use strict";var t={5795:t=>{t.exports=window.ReactDOM},8744:(t,e,r)=>{var i=r(5795);e.H=i.createRoot,i.hydrateRoot}},e={};const r=window.React;var i=function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}(8744);const n=(t=document)=>{const[e,i]=(0,r.useState)({x:-400,y:-400,isTop:!1,isBottom:!1,isLeft:!1,isRight:!1});return(0,r.useEffect)((()=>{if(!t)return;const e=t=>{const e=document.body,{clientX:r,clientY:n,screenX:s,screenY:a}=t,{width:o,height:u}=e.getBoundingClientRect();i({x:r,y:n,screenX:s,screenY:a,isTop:n<u/2,isBottom:n>u/2,isLeft:r<o/2,isRight:r>o/2})};return t.addEventListener("click",e),()=>{t.removeEventListener("click",e)}}),[t]),e},s={digital:{glitchMode:"digital",intensity:"high",speed:"fast",blendMode:"multiply",size:20,primaryColor:"#ff4040",secondaryColor:"#40ff40",tertiaryColor:"#4040ff"},analog:{glitchMode:"analog",intensity:"medium",speed:"slow",blendMode:"normal",size:35,primaryColor:"#ffffff",secondaryColor:"#ff4444",tertiaryColor:"#4444ff"},cyberpunk:{glitchMode:"cyberpunk",intensity:"medium",speed:"medium",size:30,primaryColor:"#ff0080",secondaryColor:"#00ffff",tertiaryColor:"#ff0000"},matrix:{glitchMode:"matrix",intensity:"high",speed:"fast",size:25,primaryColor:"#00ff00",secondaryColor:"#40ff40",tertiaryColor:"#80ff80"}},a=t=>null!=t&&""!==t,o=({type:t,...e})=>{const{duration:i,size:n,background:s,secondaryBgColor:o,borderColor:u,secondaryBorderColor:l,tertiaryBorderColor:h,borderWidth:c}=e,f={rippleCircle:{...a(n)&&{"--b-blocks-effect-ripple-size":n+"px"},...a(s)&&{"--b-blocks-effect-ripple-background":s},...a(u)&&{"--b-blocks-effect-ripple-border-color":u},...a(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...a(i)&&{"--b-blocks-effect-ripple-duration":i+"s"}},rippleDouble:{fast:{...a(n)&&{"--b-blocks-effect-ripple-size":n+"px"},...a(s)&&{"--b-blocks-effect-ripple-background":s},...a(u)&&{"--b-blocks-effect-ripple-border-color":u},...a(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...a(i)&&{"--b-blocks-effect-ripple-duration":i+"s"}},slow:{...a(n)&&{"--b-blocks-effect-ripple-size":n+"px"},...a(o)&&{"--b-blocks-effect-ripple-background":o},...a(l)&&{"--b-blocks-effect-ripple-border-color":l},...a(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...a(i)&&{"--b-blocks-effect-ripple-slow-duration":(1.41*i).toFixed(2)+"s"}}},rippleWave:{wave1:{...a(n)&&{"--b-blocks-effect-ripple-wave-size":n+"px"},...a(i)&&{"--b-blocks-effect-ripple-duration":i+"s"},...a(u)&&{"--b-blocks-effect-ripple-border-color":u},...a(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"}},wave2:{...a(n)&&{"--b-blocks-effect-ripple-wave-size":n+"px"},...a(i)&&{"--b-blocks-effect-ripple-duration":i+"s"},...a(l)&&{"--b-blocks-effect-ripple-border-color":l},...a(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"}},wave3:{...a(n)&&{"--b-blocks-effect-ripple-wave-size":n+"px"},...a(i)&&{"--b-blocks-effect-ripple-duration":i+"s"},...a(h)&&{"--b-blocks-effect-ripple-border-color":h},...a(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"}}},ripplePulse:{...a(n)&&{"--b-blocks-effect-ripple-size":n+"px"},...a(s)&&{"--b-blocks-effect-ripple-background":s},...a(i)&&{"--b-blocks-effect-ripple-duration":i+"s"},...a(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...a(u)&&{"--b-blocks-effect-ripple-border-color":u}}};switch(t){case"rippleCircle":return(0,r.createElement)("div",{style:f.rippleCircle,className:"b-blocks-ripple-circle"});case"rippleDouble":return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{style:f.rippleDouble.fast,className:"b-blocks-ripple-circle b-blocks-ripple-fast"}),(0,r.createElement)("div",{style:f.rippleDouble.slow,className:"b-blocks-ripple-circle b-blocks-ripple-slow"}));case"rippleWave":return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{style:f.rippleWave.wave1,className:"b-blocks-ripple-wave b-blocks-wave-1"}),(0,r.createElement)("div",{style:f.rippleWave.wave2,className:"b-blocks-ripple-wave b-blocks-wave-2"}),(0,r.createElement)("div",{style:f.rippleWave.wave3,className:"b-blocks-ripple-wave b-blocks-wave-3"}));case"tsunami":return(0,r.createElement)(r.Fragment,null,[...Array(4)].map(((t,e)=>(0,r.createElement)("div",{key:e,className:"b-blocks-ripple",style:{animationDelay:.25*e+"s"}}))));case"ripplePulse":return(0,r.createElement)("div",{style:f.ripplePulse,className:"b-blocks-ripple-pulse"})}},u=({color:t="#f00",size:e=12,sparkRadius:i=15,sparkCount:s=8,duration:a=400,easing:o="ease-out",extraScale:u=1,domEl:l=document})=>{const h=(0,r.useRef)(null),c=(0,r.useRef)([]),f=(0,r.useRef)(null),d=n(l);(0,r.useEffect)((()=>{const t=h.current;if(!t)return;const e=()=>{t.width=window.innerWidth,t.height=window.innerHeight},r=()=>{e()};return window.addEventListener("resize",r),e(),()=>{window.removeEventListener("resize",r)}}),[]);const p=(0,r.useCallback)((t=>{switch(o){case"linear":return t;case"ease-in":return t*t;case"ease-in-out":return t<.5?2*t*t:(4-2*t)*t-1;default:return t*(2-t)}}),[o]);return(0,r.useEffect)((()=>{const r=h.current;if(!r)return;const n=r.getContext("2d");let s;const o=l=>{f.current||(f.current=l),n.clearRect(0,0,r.width,r.height),c.current=c.current.filter((r=>{const s=l-r.startTime;if(s>=a)return!1;const o=p(s/a),h=o*i*u,c=e*(1-o),f=r.x+h*Math.cos(r.angle),d=r.y+h*Math.sin(r.angle),m=r.x+(h+c)*Math.cos(r.angle),g=r.y+(h+c)*Math.sin(r.angle);return n.strokeStyle=t,n.lineWidth=2,n.beginPath(),n.moveTo(f,d),n.lineTo(m,g),n.stroke(),!0})),s=requestAnimationFrame(o)};return s=requestAnimationFrame(o),()=>{cancelAnimationFrame(s)}}),[t,e,i,s,a,p,u]),(0,r.useEffect)((()=>{if(!h.current||!d.x||!d.y)return;const t=performance.now(),e=Array.from({length:s},((e,r)=>({x:d.x,y:d.y,angle:2*Math.PI*r/s,startTime:t})));c.current.push(...e)}),[d,s]),(0,r.createElement)("canvas",{ref:h,style:{width:"100vw",height:"100vh",position:"fixed",top:0,left:0,pointerEvents:"none",zIndex:99999}})},l=({size:t=100,color:e="#ffb347",duration:i=1.5,delay:n=.05})=>{const s={...a(i)&&{"--b-blocks-explosion-transition-duration":i+"s"},...a(t)&&{"--b-blocks-explosion-size":t+"px"},...a(e)&&{"--b-blocks-explosion-color":e}};return(0,r.createElement)("div",{style:s,className:"spark-explosion-container"},[...Array(15)].map(((t,e)=>(0,r.createElement)("div",{key:e,className:"explosion-particle",style:{transform:`rotate(${24*e}deg)`,animationDelay:e*n+"s"}}))))},h=({duration:t=1.2,size:e=80,color:i="#74ebd5"})=>{const n={...a(t)&&{"--b-blocks-radial-transition-duration":t+"s"},...a(e)&&{"--b-blocks-radial-size":e+"px"},...a(i)&&{"--b-blocks-radial-color":i}};return(0,r.createElement)("div",{style:n,className:"spark-radial-container"},[...Array(12)].map(((t,e)=>(0,r.createElement)("div",{key:e,className:"radial-spark",style:{transform:`rotate(${30*e}deg)`}}))))},c=({duration:t=1,size:e=60,color:i="#ff9a8b"})=>{const n={...a(e)&&{"--b-blocks-starburst-size":e+"px"},...a(t)&&{"--b-blocks-starburst-transition-duration":t+"s"},...a(i)&&{"--b-blocks-starburst-color":i}};return(0,r.createElement)("div",{style:n,className:"spark-starburst-container"},[...Array(8)].map(((t,e)=>(0,r.createElement)("div",{key:e,className:"starburst-line",style:{transform:`rotate(${45*e}deg)`}}))))},f=({effect:t})=>{switch(t?.type){case"starburst":return(0,r.createElement)(c,{...t?.starburst});case"radial":return(0,r.createElement)(h,{...t?.radial});case"explosion":return(0,r.createElement)(l,{...t?.explosion})}},d=({duration:t,easing:e="ease-out",size:i=40,color:n="#ff6b6b"})=>{const s={...a(t)&&{"--b-blocks-simple-transition-duration":t+"ms"},...a(e)&&{"--b-blocks-simple-timing-function":e},...a(i)&&{"--b-blocks-simple-size":i+"px"},...a(n)&&{"--b-blocks-simple-color":n}};return(0,r.createElement)("div",{style:s,className:"spark-simple-container"},[...Array(6)].map(((t,e)=>(0,r.createElement)("div",{key:e,className:"spark-line",style:{transform:`rotate(${60*e}deg)`}}))))},p=({effect:t,domEl:e=document})=>{const i=(0,r.useRef)(null),s=n(e);return function(t,e,i="b-blocks-effect-wrapper"){(0,r.useEffect)((()=>{const e=t.current;e&&(e.classList.remove(i),e.offsetWidth,e.classList.add(i))}),[t.current,e])}(i,s,"b-blocks-effect-wrapper"),(0,r.createElement)(r.Fragment,null,"spark"!==t?.type&&(0,r.createElement)("div",{ref:i,style:{left:`${s.x}px`,top:`${s.y}px`,pointerEvents:"none"}},(()=>{switch(t?.type){case"rippleCircle":case"rippleDouble":case"rippleWave":case"ripplePulse":case"tsunami":return(0,r.createElement)(o,{type:t?.type,...t?.[t?.type],key:t?.type});case"sparkSimple":return(0,r.createElement)(d,{...t?.sparkSimple});case"starburst":case"radial":case"explosion":return(0,r.createElement)(f,{effect:t,key:t?.type});default:return null}})()),"spark"===t?.type&&(0,r.createElement)(u,{...t?.spark,domEl:e}))};function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var v,_,y,x,b,E,w,T,R,A,M,S,C,k,F,D,O,L={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},P={duration:.5,overwrite:!1,delay:0},z=1e8,B=1e-8,N=2*Math.PI,U=N/4,I=0,X=Math.sqrt,Y=Math.cos,V=Math.sin,G=function(t){return"string"==typeof t},q=function(t){return"function"==typeof t},W=function(t){return"number"==typeof t},$=function(t){return void 0===t},H=function(t){return"object"==typeof t},j=function(t){return!1!==t},Z=function(){return"undefined"!=typeof window},Q=function(t){return q(t)||G(t)},K="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},J=Array.isArray,tt=/(?:-?\.?\d|\.)+/gi,et=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,rt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,it=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,nt=/[+-]=-?[.\d]+/,st=/[^,'"\[\]\s]+/gi,at=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ot={},ut={},lt=function(t){return(ut=Nt(t,ot))&&Nr},ht=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},ct=function(t,e){return!e&&console.warn(t)},ft=function(t,e){return t&&(ot[t]=e)&&ut&&(ut[t]=e)||ot},dt=function(){return 0},pt={suppressEvents:!0,isStart:!0,kill:!1},mt={suppressEvents:!0,kill:!1},gt={suppressEvents:!0},vt={},_t=[],yt={},xt={},bt={},Et=30,wt=[],Tt="",Rt=function(t){var e,r,i=t[0];if(H(i)||q(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=wt.length;r--&&!wt[r].targetTest(i););e=wt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Ke(t[r],e)))||t.splice(r,1);return t},At=function(t){return t._gsap||Rt(me(t))[0]._gsap},Mt=function(t,e,r){return(r=t[e])&&q(r)?t[e]():$(r)&&t.getAttribute&&t.getAttribute(e)||r},St=function(t,e){return(t=t.split(",")).forEach(e)||t},Ct=function(t){return Math.round(1e5*t)/1e5||0},kt=function(t){return Math.round(1e7*t)/1e7||0},Ft=function(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i},Dt=function(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r},Ot=function(){var t,e,r=_t.length,i=_t.slice(0);for(yt={},_t.length=0,t=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)},Lt=function(t,e,r,i){_t.length&&!_&&Ot(),t.render(e,r,i||_&&e<0&&(t._initted||t._startAt)),_t.length&&!_&&Ot()},Pt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(st).length<2?e:G(t)?t.trim():t},zt=function(t){return t},Bt=function(t,e){for(var r in e)r in t||(t[r]=e[r]);return t},Nt=function(t,e){for(var r in e)t[r]=e[r];return t},Ut=function t(e,r){for(var i in r)"__proto__"!==i&&"constructor"!==i&&"prototype"!==i&&(e[i]=H(r[i])?t(e[i]||(e[i]={}),r[i]):r[i]);return e},It=function(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i},Xt=function(t){var e,r=t.parent||x,i=t.keyframes?(e=J(t.keyframes),function(t,r){for(var i in r)i in t||"duration"===i&&e||"ease"===i||(t[i]=r[i])}):Bt;if(j(t.inherit))for(;r;)i(t,r.vars.defaults),r=r.parent||r._dp;return t},Yt=function(t,e,r,i,n){void 0===r&&(r="_first"),void 0===i&&(i="_last");var s,a=t[i];if(n)for(s=e[n];a&&a[n]>s;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=a,e.parent=e._dp=t,e},Vt=function(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,s=e._next;n?n._next=s:t[r]===e&&(t[r]=s),s?s._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null},Gt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},qt=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},Wt=function(t,e,r,i){return t._startAt&&(_?t._startAt.revert(mt):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},$t=function t(e){return!e||e._ts&&t(e.parent)},Ht=function(t){return t._repeat?jt(t._tTime,t=t.duration()+t._rDelay)*t:0},jt=function(t,e){var r=Math.floor(t=kt(t/e));return t&&r===t?r-1:r},Zt=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Qt=function(t){return t._end=kt(t._start+(t._tDur/Math.abs(t._ts||t._rts||B)||0))},Kt=function(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=kt(r._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Qt(t),r._dirty||qt(r,t)),t},Jt=function(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Zt(t.rawTime(),e),(!e._dur||ce(0,e.totalDuration(),r)-e._tTime>B)&&e.render(r,!0)),qt(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-1e-8}},te=function(t,e,r,i){return e.parent&&Gt(e),e._start=kt((W(r)?r:r||t!==x?ue(t,r,e):t._time)+e._delay),e._end=kt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Yt(t,e,"_first","_last",t._sort?"_start":0),ne(e)||(t._recent=e),i||Jt(t,e),t._ts<0&&Kt(t,t._tTime),t},ee=function(t,e){return(ot.ScrollTrigger||ht("scrollTrigger",e))&&ot.ScrollTrigger.create(e,t)},re=function(t,e,r,i,n){return ar(t,e,n),t._initted?!r&&t._pt&&!_&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&R!==Ue.frame?(_t.push(t),t._lazy=[n,i],1):void 0:1},ie=function t(e){var r=e.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||t(r))},ne=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},se=function(t,e,r,i){var n=t._repeat,s=kt(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=s/t._dur),t._dur=s,t._tDur=n?n<0?1e10:kt(s*(n+1)+t._rDelay*n):s,a>0&&!i&&Kt(t,t._tTime=t._tDur*a),t.parent&&Qt(t),r||qt(t.parent,t),t},ae=function(t){return t instanceof tr?qt(t):se(t,t._dur)},oe={_start:0,endTime:dt,totalDuration:dt},ue=function t(e,r,i){var n,s,a,o=e.labels,u=e._recent||oe,l=e.duration()>=z?u.endTime(!1):e._dur;return G(r)&&(isNaN(r)||r in o)?(s=r.charAt(0),a="%"===r.substr(-1),n=r.indexOf("="),"<"===s||">"===s?(n>=0&&(r=r.replace(/=/,"")),("<"===s?u._start:u.endTime(u._repeat>=0))+(parseFloat(r.substr(1))||0)*(a?(n<0?u:i).totalDuration()/100:1)):n<0?(r in o||(o[r]=l),o[r]):(s=parseFloat(r.charAt(n-1)+r.substr(n+1)),a&&i&&(s=s/100*(J(i)?i[0]:i).totalDuration()),n>1?t(e,r.substr(0,n-1),i)+s:l+s)):null==r?l:+r},le=function(t,e,r){var i,n,s=W(e[1]),a=(s?2:1)+(t<2?0:1),o=e[a];if(s&&(o.duration=e[1]),o.parent=r,t){for(i=o,n=r;n&&!("immediateRender"in i);)i=n.vars.defaults||{},n=j(n.vars.inherit)&&n.parent;o.immediateRender=j(i.immediateRender),t<2?o.runBackwards=1:o.startAt=e[a-1]}return new cr(e[0],o,e[a+1])},he=function(t,e){return t||0===t?e(t):e},ce=function(t,e,r){return r<t?t:r>e?e:r},fe=function(t,e){return G(t)&&(e=at.exec(t))?e[1]:""},de=[].slice,pe=function(t,e){return t&&H(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&H(t[0]))&&!t.nodeType&&t!==b},me=function(t,e,r){return y&&!e&&y.selector?y.selector(t):!G(t)||r||!E&&Ie()?J(t)?function(t,e,r){return void 0===r&&(r=[]),t.forEach((function(t){var i;return G(t)&&!e||pe(t,1)?(i=r).push.apply(i,me(t)):r.push(t)}))||r}(t,r):pe(t)?de.call(t,0):t?[t]:[]:de.call((e||w).querySelectorAll(t),0)},ge=function(t){return t=me(t)[0]||ct("Invalid scope")||{},function(e){var r=t.current||t.nativeElement||t;return me(e,r.querySelectorAll?r:r===t?ct("Invalid scope")||w.createElement("div"):t)}},ve=function(t){return t.sort((function(){return.5-Math.random()}))},_e=function(t){if(q(t))return t;var e=H(t)?t:{each:t},r=$e(e.ease),i=e.from||0,n=parseFloat(e.base)||0,s={},a=i>0&&i<1,o=isNaN(i)||a,u=e.axis,l=i,h=i;return G(i)?l=h={center:.5,edges:.5,end:1}[i]||0:!a&&o&&(l=i[0],h=i[1]),function(t,a,c){var f,d,p,m,g,v,_,y,x,b=(c||e).length,E=s[b];if(!E){if(!(x="auto"===e.grid?0:(e.grid||[1,z])[1])){for(_=-z;_<(_=c[x++].getBoundingClientRect().left)&&x<b;);x<b&&x--}for(E=s[b]=[],f=o?Math.min(x,b)*l-.5:i%x,d=x===z?0:o?b*h/x-.5:i/x|0,_=0,y=z,v=0;v<b;v++)p=v%x-f,m=d-(v/x|0),E[v]=g=u?Math.abs("y"===u?m:p):X(p*p+m*m),g>_&&(_=g),g<y&&(y=g);"random"===i&&ve(E),E.max=_-y,E.min=y,E.v=b=(parseFloat(e.amount)||parseFloat(e.each)*(x>b?b-1:u?"y"===u?b/x:x:Math.max(x,b/x))||0)*("edges"===i?-1:1),E.b=b<0?n-b:n,E.u=fe(e.amount||e.each)||0,r=r&&b<0?qe(r):r}return b=(E[t]-E.min)/E.max||0,kt(E.b+(r?r(b):b)*E.v)+E.u}},ye=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var i=kt(Math.round(parseFloat(r)/t)*t*e);return(i-i%1)/e+(W(r)?0:fe(r))}},xe=function(t,e){var r,i,n=J(t);return!n&&H(t)&&(r=n=t.radius||z,t.values?(t=me(t.values),(i=!W(t[0]))&&(r*=r)):t=ye(t.increment)),he(e,n?q(t)?function(e){return i=t(e),Math.abs(i-e)<=r?i:e}:function(e){for(var n,s,a=parseFloat(i?e.x:e),o=parseFloat(i?e.y:0),u=z,l=0,h=t.length;h--;)(n=i?(n=t[h].x-a)*n+(s=t[h].y-o)*s:Math.abs(t[h]-a))<u&&(u=n,l=h);return l=!r||u<=r?t[l]:e,i||l===e||W(e)?l:l+fe(e)}:ye(t))},be=function(t,e,r,i){return he(J(t)?!e:!0===r?!!(r=0):!i,(function(){return J(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i}))},Ee=function(t,e,r){return he(r,(function(r){return t[~~e(r)]}))},we=function(t){for(var e,r,i,n,s=0,a="";~(e=t.indexOf("random(",s));)i=t.indexOf(")",e),n="["===t.charAt(e+7),r=t.substr(e+7,i-e-7).match(n?st:tt),a+=t.substr(s,e-s)+be(n?r:+r[0],n?0:+r[1],+r[2]||1e-5),s=i+1;return a+t.substr(s,t.length-s)},Te=function(t,e,r,i,n){var s=e-t,a=i-r;return he(n,(function(e){return r+((e-t)/s*a||0)}))},Re=function(t,e,r){var i,n,s,a=t.labels,o=z;for(i in a)(n=a[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(s=i,o=n);return s},Ae=function(t,e,r){var i,n,s,a=t.vars,o=a[e],u=y,l=t._ctx;if(o)return i=a[e+"Params"],n=a.callbackScope||t,r&&_t.length&&Ot(),l&&(y=l),s=i?o.apply(n,i):o.call(n),y=u,s},Me=function(t){return Gt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!_),t.progress()<1&&Ae(t,"onInterrupt"),t},Se=[],Ce=function(t){if(t)if(t=!t.name&&t.default||t,Z()||t.headless){var e=t.name,r=q(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:dt,render:xr,add:nr,kill:Er,modifier:br,rawVars:0},s={targetTest:0,get:0,getSetter:gr,aliases:{},register:0};if(Ie(),t!==i){if(xt[e])return;Bt(i,Bt(It(t,n),s)),Nt(i.prototype,Nt(n,It(t,s))),xt[i.prop=e]=i,t.targetTest&&(wt.push(i),vt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}ft(e,i),t.register&&t.register(Nr,i,Rr)}else Se.push(t)},ke=255,Fe={aqua:[0,ke,ke],lime:[0,ke,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ke],navy:[0,0,128],white:[ke,ke,ke],olive:[128,128,0],yellow:[ke,ke,0],orange:[ke,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ke,0,0],pink:[ke,192,203],cyan:[0,ke,ke],transparent:[ke,ke,ke,0]},De=function(t,e,r){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*ke+.5|0},Oe=function(t,e,r){var i,n,s,a,o,u,l,h,c,f,d=t?W(t)?[t>>16,t>>8&ke,t&ke]:0:Fe.black;if(!d){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Fe[t])d=Fe[t];else if("#"===t.charAt(0)){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),s=t.charAt(3),t="#"+i+i+n+n+s+s+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(d=parseInt(t.substr(1,6),16))>>16,d>>8&ke,d&ke,parseInt(t.substr(7),16)/255];d=[(t=parseInt(t.substr(1),16))>>16,t>>8&ke,t&ke]}else if("hsl"===t.substr(0,3))if(d=f=t.match(tt),e){if(~t.indexOf("="))return d=t.match(et),r&&d.length<4&&(d[3]=1),d}else a=+d[0]%360/360,o=+d[1]/100,i=2*(u=+d[2]/100)-(n=u<=.5?u*(o+1):u+o-u*o),d.length>3&&(d[3]*=1),d[0]=De(a+1/3,i,n),d[1]=De(a,i,n),d[2]=De(a-1/3,i,n);else d=t.match(tt)||Fe.transparent;d=d.map(Number)}return e&&!f&&(i=d[0]/ke,n=d[1]/ke,s=d[2]/ke,u=((l=Math.max(i,n,s))+(h=Math.min(i,n,s)))/2,l===h?a=o=0:(c=l-h,o=u>.5?c/(2-l-h):c/(l+h),a=l===i?(n-s)/c+(n<s?6:0):l===n?(s-i)/c+2:(i-n)/c+4,a*=60),d[0]=~~(a+.5),d[1]=~~(100*o+.5),d[2]=~~(100*u+.5)),r&&d.length<4&&(d[3]=1),d},Le=function(t){var e=[],r=[],i=-1;return t.split(ze).forEach((function(t){var n=t.match(rt)||[];e.push.apply(e,n),r.push(i+=n.length+1)})),e.c=r,e},Pe=function(t,e,r){var i,n,s,a,o="",u=(t+o).match(ze),l=e?"hsla(":"rgba(",h=0;if(!u)return t;if(u=u.map((function(t){return(t=Oe(t,e,1))&&l+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"})),r&&(s=Le(t),(i=r.c).join(o)!==s.c.join(o)))for(a=(n=t.replace(ze,"1").split(rt)).length-1;h<a;h++)o+=n[h]+(~i.indexOf(h)?u.shift()||l+"0,0,0,0)":(s.length?s:u.length?u:r).shift());if(!n)for(a=(n=t.split(ze)).length-1;h<a;h++)o+=n[h]+u[h];return o+n[a]},ze=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Fe)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Be=/hsl[a]?\(/,Ne=function(t){var e,r=t.join(" ");if(ze.lastIndex=0,ze.test(r))return e=Be.test(r),t[1]=Pe(t[1],e),t[0]=Pe(t[0],e,Le(t[1])),!0},Ue=function(){var t,e,r,i,n,s,a=Date.now,o=500,u=33,l=a(),h=l,c=1e3/240,f=c,d=[],p=function r(p){var m,g,v,_,y=a()-h,x=!0===p;if((y>o||y<0)&&(l+=y-u),((m=(v=(h+=y)-l)-f)>0||x)&&(_=++i.frame,n=v-1e3*i.time,i.time=v/=1e3,f+=m+(m>=c?4:c-m),g=1),x||(t=e(r)),g)for(s=0;s<d.length;s++)d[s](v,n,_,p)};return i={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(t){return n/(1e3/(t||60))},wake:function(){T&&(!E&&Z()&&(b=E=window,w=b.document||{},ot.gsap=Nr,(b.gsapVersions||(b.gsapVersions=[])).push(Nr.version),lt(ut||b.GreenSockGlobals||!b.gsap&&b||{}),Se.forEach(Ce)),r="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,t&&i.sleep(),e=r||function(t){return setTimeout(t,f-1e3*i.time+1|0)},M=1,p(2))},sleep:function(){(r?cancelAnimationFrame:clearTimeout)(t),M=0,e=dt},lagSmoothing:function(t,e){o=t||1/0,u=Math.min(e||33,o)},fps:function(t){c=1e3/(t||240),f=1e3*i.time+c},add:function(t,e,r){var n=e?function(e,r,s,a){t(e,r,s,a),i.remove(n)}:t;return i.remove(t),d[r?"unshift":"push"](n),Ie(),n},remove:function(t,e){~(e=d.indexOf(t))&&d.splice(e,1)&&s>=e&&s--},_listeners:d}}(),Ie=function(){return!M&&Ue.wake()},Xe={},Ye=/^[\d.\-M][\d.\-,\s]/,Ve=/["']/g,Ge=function(t){for(var e,r,i,n={},s=t.substr(1,t.length-3).split(":"),a=s[0],o=1,u=s.length;o<u;o++)r=s[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[a]=isNaN(i)?i.replace(Ve,"").trim():+i,a=r.substr(e+1).trim();return n},qe=function(t){return function(e){return 1-t(1-e)}},We=function t(e,r){for(var i,n=e._first;n;)n instanceof tr?t(n,r):!n.vars.yoyoEase||n._yoyo&&n._repeat||n._yoyo===r||(n.timeline?t(n.timeline,r):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=r)),n=n._next},$e=function(t,e){return t&&(q(t)?t:Xe[t]||function(t){var e,r,i,n,s=(t+"").split("("),a=Xe[s[0]];return a&&s.length>1&&a.config?a.config.apply(null,~t.indexOf("{")?[Ge(s[1])]:(e=t,r=e.indexOf("(")+1,i=e.indexOf(")"),n=e.indexOf("(",r),e.substring(r,~n&&n<i?e.indexOf(")",i+1):i)).split(",").map(Pt)):Xe._CE&&Ye.test(t)?Xe._CE("",t):a}(t))||e},He=function(t,e,r,i){void 0===r&&(r=function(t){return 1-e(1-t)}),void 0===i&&(i=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,s={easeIn:e,easeOut:r,easeInOut:i};return St(t,(function(t){for(var e in Xe[t]=ot[t]=s,Xe[n=t.toLowerCase()]=r,s)Xe[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Xe[t+"."+e]=s[e]})),s},je=function(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}},Ze=function t(e,r,i){var n=r>=1?r:1,s=(i||(e?.3:.45))/(r<1?r:1),a=s/N*(Math.asin(1/n)||0),o=function(t){return 1===t?1:n*Math.pow(2,-10*t)*V((t-a)*s)+1},u="out"===e?o:"in"===e?function(t){return 1-o(1-t)}:je(o);return s=N/s,u.config=function(r,i){return t(e,r,i)},u},Qe=function t(e,r){void 0===r&&(r=1.70158);var i=function(t){return t?--t*t*((r+1)*t+r)+1:0},n="out"===e?i:"in"===e?function(t){return 1-i(1-t)}:je(i);return n.config=function(r){return t(e,r)},n};St("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var r=e<5?e+1:e;He(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},(function(t){return 1-Math.pow(1-t,r)}),(function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2}))})),Xe.Linear.easeNone=Xe.none=Xe.Linear.easeIn,He("Elastic",Ze("in"),Ze("out"),Ze()),S=7.5625,F=2*(k=1/(C=2.75)),D=2.5*k,He("Bounce",(function(t){return 1-O(1-t)}),O=function(t){return t<k?S*t*t:t<F?S*Math.pow(t-1.5/C,2)+.75:t<D?S*(t-=2.25/C)*t+.9375:S*Math.pow(t-2.625/C,2)+.984375}),He("Expo",(function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)})),He("Circ",(function(t){return-(X(1-t*t)-1)})),He("Sine",(function(t){return 1===t?1:1-Y(t*U)})),He("Back",Qe("in"),Qe("out"),Qe()),Xe.SteppedEase=Xe.steps=ot.SteppedEase={config:function(t,e){void 0===t&&(t=1);var r=1/t,i=t+(e?0:1),n=e?1:0;return function(t){return((i*ce(0,.99999999,t)|0)+n)*r}}},P.ease=Xe["quad.out"],St("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return Tt+=t+","+t+"Params,"}));var Ke=function(t,e){this.id=I++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Mt,this.set=e?e.getSetter:gr},Je=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,se(this,+t.duration,1,1),this.data=t.data,y&&(this._ctx=y,y.data.push(this)),M||Ue.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,se(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(Ie(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Kt(this,t),!r._dp||r.parent||Jt(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&te(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===B||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),Lt(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Ht(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Ht(this),e):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?jt(this._tTime,r)+1:1},e.timeScale=function(t,e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Zt(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(ce(-Math.abs(this._delay),this._tDur,r),!1!==e),Qt(this),function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ie(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==B&&(this._tTime-=B)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&te(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(j(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Zt(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=gt);var e=_;return _=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),_=e,this},e.globalTime=function(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,ae(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,ae(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(ue(this,t),j(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,j(e)),this._dur||(this._zTime=-1e-8),this},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-B))},e.eventCallback=function(t,e,r){var i=this.vars;return arguments.length>1?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},e.then=function(t){var e=this;return new Promise((function(r){var i=q(t)?t:zt,n=function(){var t=e.then;e.then=null,q(i)&&(i=i(e))&&(i.then||i===e)&&(e.then=t),r(i),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?n():e._prom=n}))},e.kill=function(){Me(this)},t}();Bt(Je.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var tr=function(t){function e(e,r){var i;return void 0===e&&(e={}),(i=t.call(this,e)||this).labels={},i.smoothChildTiming=!!e.smoothChildTiming,i.autoRemoveChildren=!!e.autoRemoveChildren,i._sort=j(e.sortChildren),x&&te(e.parent||x,m(i),r),e.reversed&&i.reverse(),e.paused&&i.paused(!0),e.scrollTrigger&&ee(m(i),e.scrollTrigger),i}g(e,t);var r=e.prototype;return r.to=function(t,e,r){return le(0,arguments,this),this},r.from=function(t,e,r){return le(1,arguments,this),this},r.fromTo=function(t,e,r,i){return le(2,arguments,this),this},r.set=function(t,e,r){return e.duration=0,e.parent=this,Xt(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new cr(t,e,ue(this,r),1),this},r.call=function(t,e,r){return te(this,cr.delayedCall(0,t,e),r)},r.staggerTo=function(t,e,r,i,n,s,a){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=s,r.onCompleteParams=a,r.parent=this,new cr(t,r,ue(this,n)),this},r.staggerFrom=function(t,e,r,i,n,s,a){return r.runBackwards=1,Xt(r).immediateRender=j(r.immediateRender),this.staggerTo(t,e,r,i,n,s,a)},r.staggerFromTo=function(t,e,r,i,n,s,a,o){return i.startAt=r,Xt(i).immediateRender=j(i.immediateRender),this.staggerTo(t,e,i,n,s,a,o)},r.render=function(t,e,r){var i,n,s,a,o,u,l,h,c,f,d,p,m=this._time,g=this._dirty?this.totalDuration():this._tDur,v=this._dur,y=t<=0?0:kt(t),b=this._zTime<0!=t<0&&(this._initted||!v);if(this!==x&&y>g&&t>=0&&(y=g),y!==this._tTime||r||b){if(m!==this._time&&v&&(y+=this._time-m,t+=this._time-m),i=y,c=this._start,u=!(h=this._ts),b&&(v||(m=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(d=this._yoyo,o=v+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=kt(y%o),y===g?(a=this._repeat,i=v):((a=~~(f=kt(y/o)))&&a===f&&(i=v,a--),i>v&&(i=v)),f=jt(this._tTime,o),!m&&this._tTime&&f!==a&&this._tTime-f*o-this._dur<=0&&(f=a),d&&1&a&&(i=v-i,p=1),a!==f&&!this._lock){var E=d&&1&f,w=E===(d&&1&a);if(a<f&&(E=!E),m=E?0:y%v?v:y,this._lock=1,this.render(m||(p?0:kt(a*o)),e,!v)._lock=0,this._tTime=y,!e&&this.parent&&Ae(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1),m&&m!==this._time||u!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(v=this._dur,g=this._tDur,w&&(this._lock=2,m=E?v:-1e-4,this.render(m,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;We(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(l=function(t,e,r){var i;if(r>e)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,kt(m),kt(i)),l&&(y-=i-(i=l._start))),this._tTime=y,this._time=i,this._act=!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,m=0),!m&&i&&!e&&!a&&(Ae(this,"onStart"),this._tTime!==y))return this;if(i>=m&&t>=0)for(n=this._first;n;){if(s=n._next,(n._act||i>=n._start)&&n._ts&&l!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(n._ts>0?(i-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(i-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){l=0,s&&(y+=this._zTime=-1e-8);break}}n=s}else{n=this._last;for(var T=t<0?t:i;n;){if(s=n._prev,(n._act||T<=n._end)&&n._ts&&l!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(n._ts>0?(T-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(T-n._start)*n._ts,e,r||_&&(n._initted||n._startAt)),i!==this._time||!this._ts&&!u){l=0,s&&(y+=this._zTime=T?-1e-8:B);break}}n=s}}if(l&&!e&&(this.pause(),l.render(i>=m?0:-1e-8)._zTime=i>=m?1:-1,this._ts))return this._start=c,Qt(this),this.render(t,e,r);this._onUpdate&&!e&&Ae(this,"onUpdate",!0),(y===g&&this._tTime>=this.totalDuration()||!y&&m)&&(c!==this._start&&Math.abs(h)===Math.abs(this._ts)||this._lock||((t||!v)&&(y===g&&this._ts>0||!y&&this._ts<0)&&Gt(this,1),e||t<0&&!m||!y&&!m&&g||(Ae(this,y===g&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(y<g&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(t,e){var r=this;if(W(e)||(e=ue(this,e,t)),!(t instanceof Je)){if(J(t))return t.forEach((function(t){return r.add(t,e)})),this;if(G(t))return this.addLabel(t,e);if(!q(t))return this;t=cr.delayedCall(0,t)}return this!==t?te(this,t,e):this},r.getChildren=function(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-z);for(var n=[],s=this._first;s;)s._start>=i&&(s instanceof cr?e&&n.push(s):(r&&n.push(s),t&&n.push.apply(n,s.getChildren(!0,e,r)))),s=s._next;return n},r.getById=function(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},r.remove=function(t){return G(t)?this.removeLabel(t):q(t)?this.killTweensOf(t):(t.parent===this&&Vt(this,t),t===this._recent&&(this._recent=this._last),qt(this))},r.totalTime=function(e,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=kt(Ue.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,r),this._forcing=0,this):this._tTime},r.addLabel=function(t,e){return this.labels[t]=ue(this,e),this},r.removeLabel=function(t){return delete this.labels[t],this},r.addPause=function(t,e,r){var i=cr.delayedCall(0,e||dt,r);return i.data="isPause",this._hasPause=1,te(this,i,ue(this,t))},r.removePause=function(t){var e=this._first;for(t=ue(this,t);e;)e._start===t&&"isPause"===e.data&&Gt(e),e=e._next},r.killTweensOf=function(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)er!==i[n]&&i[n].kill(t,e);return this},r.getTweensOf=function(t,e){for(var r,i=[],n=me(t),s=this._first,a=W(e);s;)s instanceof cr?Dt(s._targets,n)&&(a?(!er||s._initted&&s._ts)&&s.globalTime(0)<=e&&s.globalTime(s.totalDuration())>e:!e||s.isActive())&&i.push(s):(r=s.getTweensOf(n,e)).length&&i.push.apply(i,r),s=s._next;return i},r.tweenTo=function(t,e){e=e||{};var r,i=this,n=ue(i,t),s=e,a=s.startAt,o=s.onStart,u=s.onStartParams,l=s.immediateRender,h=cr.to(i,Bt({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||B,onStart:function(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&se(h,t,0,1).render(h._time,!0,!0),r=1}o&&o.apply(h,u||[])}},e));return l?h.render(0):h},r.tweenFromTo=function(t,e,r){return this.tweenTo(e,Bt({startAt:{time:ue(this,t)}},r))},r.recent=function(){return this._recent},r.nextLabel=function(t){return void 0===t&&(t=this._time),Re(this,ue(this,t))},r.previousLabel=function(t){return void 0===t&&(t=this._time),Re(this,ue(this,t),1)},r.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+B)},r.shiftChildren=function(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,s=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in s)s[i]>=r&&(s[i]+=t);return qt(this)},r.invalidate=function(e){var r=this._first;for(this._lock=0;r;)r.invalidate(e),r=r._next;return t.prototype.invalidate.call(this,e)},r.clear=function(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),qt(this)},r.totalDuration=function(t){var e,r,i,n=0,s=this,a=s._last,o=z;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-t:t));if(s._dirty){for(i=s.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),(r=a._start)>o&&s._sort&&a._ts&&!s._lock?(s._lock=1,te(s,a,r-a._delay,1)._lock=0):o=r,r<0&&a._ts&&(n-=r,(!i&&!s._dp||i&&i.smoothChildTiming)&&(s._start+=r/s._ts,s._time-=r,s._tTime-=r),s.shiftChildren(-r,!1,-Infinity),o=0),a._end>n&&a._ts&&(n=a._end),a=e;se(s,s===x&&s._time>n?s._time:n,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(t){if(x._ts&&(Lt(x,Zt(t,x)),R=Ue.frame),Ue.frame>=Et){Et+=L.autoSleep||120;var e=x._first;if((!e||!e._ts)&&L.autoSleep&&Ue._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Ue.sleep()}}},e}(Je);Bt(tr.prototype,{_lock:0,_hasPause:0,_forcing:0});var er,rr,ir=function(t,e,r,i,n,s,a){var o,u,l,h,c,f,d,p,m=new Rr(this._pt,t,e,0,1,yr,null,n),g=0,v=0;for(m.b=r,m.e=i,r+="",(d=~(i+="").indexOf("random("))&&(i=we(i)),s&&(s(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(it)||[];o=it.exec(i);)h=o[0],c=i.substring(g,o.index),l?l=(l+1)%5:"rgba("===c.substr(-5)&&(l=1),h!==u[v++]&&(f=parseFloat(u[v-1])||0,m._pt={_next:m._pt,p:c||1===v?c:",",s:f,c:"="===h.charAt(1)?Ft(f,h)-f:parseFloat(h)-f,m:l&&l<4?Math.round:0},g=it.lastIndex);return m.c=g<i.length?i.substring(g,i.length):"",m.fp=a,(nt.test(i)||d)&&(m.e=0),this._pt=m,m},nr=function(t,e,r,i,n,s,a,o,u,l){q(i)&&(i=i(n||0,t,s));var h,c=t[e],f="get"!==r?r:q(c)?u?t[e.indexOf("set")||!q(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():c,d=q(c)?u?pr:dr:fr;if(G(i)&&(~i.indexOf("random(")&&(i=we(i)),"="===i.charAt(1)&&((h=Ft(f,i)+(fe(f)||0))||0===h)&&(i=h)),!l||f!==i||rr)return isNaN(f*i)||""===i?(!c&&!(e in t)&&ht(e,i),ir.call(this,t,e,f,i,d,o||L.stringFilter,u)):(h=new Rr(this._pt,t,e,+f||0,i-(f||0),"boolean"==typeof c?_r:vr,0,d),u&&(h.fp=u),a&&h.modifier(a,this,t),this._pt=h)},sr=function(t,e,r,i,n,s){var a,o,u,l;if(xt[t]&&!1!==(a=new xt[t]).init(n,a.rawVars?e[t]:function(t,e,r,i,n){if(q(t)&&(t=ur(t,n,e,r,i)),!H(t)||t.style&&t.nodeType||J(t)||K(t))return G(t)?ur(t,n,e,r,i):t;var s,a={};for(s in t)a[s]=ur(t[s],n,e,r,i);return a}(e[t],i,n,s,r),r,i,s)&&(r._pt=o=new Rr(r._pt,n,t,0,1,a.render,a,0,a.priority),r!==A))for(u=r._ptLookup[r._targets.indexOf(n)],l=a._props.length;l--;)u[a._props[l]]=o;return a},ar=function t(e,r,i){var n,s,a,o,u,l,h,c,f,d,p,m,g,y=e.vars,b=y.ease,E=y.startAt,w=y.immediateRender,T=y.lazy,R=y.onUpdate,A=y.runBackwards,M=y.yoyoEase,S=y.keyframes,C=y.autoRevert,k=e._dur,F=e._startAt,D=e._targets,O=e.parent,L=O&&"nested"===O.data?O.vars.targets:D,N="auto"===e._overwrite&&!v,U=e.timeline;if(U&&(!S||!b)&&(b="none"),e._ease=$e(b,P.ease),e._yEase=M?qe($e(!0===M?b:M,P.ease)):0,M&&e._yoyo&&!e._repeat&&(M=e._yEase,e._yEase=e._ease,e._ease=M),e._from=!U&&!!y.runBackwards,!U||S&&!y.stagger){if(m=(c=D[0]?At(D[0]).harness:0)&&y[c.prop],n=It(y,vt),F&&(F._zTime<0&&F.progress(1),r<0&&A&&w&&!C?F.render(-1,!0):F.revert(A&&k?mt:pt),F._lazy=0),E){if(Gt(e._startAt=cr.set(D,Bt({data:"isStart",overwrite:!1,parent:O,immediateRender:!0,lazy:!F&&j(T),startAt:null,delay:0,onUpdate:R&&function(){return Ae(e,"onUpdate")},stagger:0},E))),e._startAt._dp=0,e._startAt._sat=e,r<0&&(_||!w&&!C)&&e._startAt.revert(mt),w&&k&&r<=0&&i<=0)return void(r&&(e._zTime=r))}else if(A&&k&&!F)if(r&&(w=!1),a=Bt({overwrite:!1,data:"isFromStart",lazy:w&&!F&&j(T),immediateRender:w,stagger:0,parent:O},n),m&&(a[c.prop]=m),Gt(e._startAt=cr.set(D,a)),e._startAt._dp=0,e._startAt._sat=e,r<0&&(_?e._startAt.revert(mt):e._startAt.render(-1,!0)),e._zTime=r,w){if(!r)return}else t(e._startAt,B,B);for(e._pt=e._ptCache=0,T=k&&j(T)||T&&!k,s=0;s<D.length;s++){if(h=(u=D[s])._gsap||Rt(D)[s]._gsap,e._ptLookup[s]=d={},yt[h.id]&&_t.length&&Ot(),p=L===D?s:L.indexOf(u),c&&!1!==(f=new c).init(u,m||n,e,p,L)&&(e._pt=o=new Rr(e._pt,u,f.name,0,1,f.render,f,0,f.priority),f._props.forEach((function(t){d[t]=o})),f.priority&&(l=1)),!c||m)for(a in n)xt[a]&&(f=sr(a,n,e,p,u,L))?f.priority&&(l=1):d[a]=o=nr.call(e,u,a,"get",n[a],p,L,0,y.stringFilter);e._op&&e._op[s]&&e.kill(u,e._op[s]),N&&e._pt&&(er=e,x.killTweensOf(u,d,e.globalTime(r)),g=!e.parent,er=0),e._pt&&T&&(yt[h.id]=1)}l&&Tr(e),e._onInit&&e._onInit(e)}e._onUpdate=R,e._initted=(!e._op||e._pt)&&!g,S&&r<=0&&U.render(z,!0,!0)},or=function(t,e,r,i){var n,s,a=e.ease||i||"power1.inOut";if(J(e))s=r[t]||(r[t]=[]),e.forEach((function(t,r){return s.push({t:r/(e.length-1)*100,v:t,e:a})}));else for(n in e)s=r[n]||(r[n]=[]),"ease"===n||s.push({t:parseFloat(t),v:e[n],e:a})},ur=function(t,e,r,i,n){return q(t)?t.call(e,r,i,n):G(t)&&~t.indexOf("random(")?we(t):t},lr=Tt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",hr={};St(lr+",id,stagger,delay,duration,paused,scrollTrigger",(function(t){return hr[t]=1}));var cr=function(t){function e(e,r,i,n){var s;"number"==typeof r&&(i.duration=r,r=i,i=null);var a,o,u,l,h,c,f,d,p=(s=t.call(this,n?r:Xt(r))||this).vars,g=p.duration,_=p.delay,y=p.immediateRender,b=p.stagger,E=p.overwrite,w=p.keyframes,T=p.defaults,R=p.scrollTrigger,A=p.yoyoEase,M=r.parent||x,S=(J(e)||K(e)?W(e[0]):"length"in r)?[e]:me(e);if(s._targets=S.length?Rt(S):ct("GSAP target "+e+" not found. https://gsap.com",!L.nullTargetWarn)||[],s._ptLookup=[],s._overwrite=E,w||b||Q(g)||Q(_)){if(r=s.vars,(a=s.timeline=new tr({data:"nested",defaults:T||{},targets:M&&"nested"===M.data?M.vars.targets:S})).kill(),a.parent=a._dp=m(s),a._start=0,b||Q(g)||Q(_)){if(l=S.length,f=b&&_e(b),H(b))for(h in b)~lr.indexOf(h)&&(d||(d={}),d[h]=b[h]);for(o=0;o<l;o++)(u=It(r,hr)).stagger=0,A&&(u.yoyoEase=A),d&&Nt(u,d),c=S[o],u.duration=+ur(g,m(s),o,c,S),u.delay=(+ur(_,m(s),o,c,S)||0)-s._delay,!b&&1===l&&u.delay&&(s._delay=_=u.delay,s._start+=_,u.delay=0),a.to(c,u,f?f(o,c,S):0),a._ease=Xe.none;a.duration()?g=_=0:s.timeline=0}else if(w){Xt(Bt(a.vars.defaults,{ease:"none"})),a._ease=$e(w.ease||r.ease||"none");var C,k,F,D=0;if(J(w))w.forEach((function(t){return a.to(S,t,">")})),a.duration();else{for(h in u={},w)"ease"===h||"easeEach"===h||or(h,w[h],u,w.easeEach);for(h in u)for(C=u[h].sort((function(t,e){return t.t-e.t})),D=0,o=0;o<C.length;o++)(F={ease:(k=C[o]).e,duration:(k.t-(o?C[o-1].t:0))/100*g})[h]=k.v,a.to(S,F,D),D+=F.duration;a.duration()<g&&a.to({},{duration:g-a.duration()})}}g||s.duration(g=a.duration())}else s.timeline=0;return!0!==E||v||(er=m(s),x.killTweensOf(S),er=0),te(M,m(s),i),r.reversed&&s.reverse(),r.paused&&s.paused(!0),(y||!g&&!w&&s._start===kt(M._time)&&j(y)&&$t(m(s))&&"nested"!==M.data)&&(s._tTime=-1e-8,s.render(Math.max(0,-_)||0)),R&&ee(m(s),R),s}g(e,t);var r=e.prototype;return r.render=function(t,e,r){var i,n,s,a,o,u,l,h,c,f=this._time,d=this._tDur,p=this._dur,m=t<0,g=t>d-B&&!m?d:t<B?0:t;if(p){if(g!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==m||this._lazy){if(i=g,h=this.timeline,this._repeat){if(a=p+this._rDelay,this._repeat<-1&&m)return this.totalTime(100*a+t,e,r);if(i=kt(g%a),g===d?(s=this._repeat,i=p):(s=~~(o=kt(g/a)))&&s===o?(i=p,s--):i>p&&(i=p),(u=this._yoyo&&1&s)&&(c=this._yEase,i=p-i),o=jt(this._tTime,a),i===f&&!r&&this._initted&&s===o)return this._tTime=g,this;s!==o&&(h&&this._yEase&&We(h,u),this.vars.repeatRefresh&&!u&&!this._lock&&i!==a&&this._initted&&(this._lock=r=1,this.render(kt(a*s),!0).invalidate()._lock=0))}if(!this._initted){if(re(this,m?t:i,r,e,g))return this._tTime=0,this;if(!(f===this._time||r&&this.vars.repeatRefresh&&s!==o))return this;if(p!==this._dur)return this.render(t,e,r)}if(this._tTime=g,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=l=(c||this._ease)(i/p),this._from&&(this.ratio=l=1-l),i&&!f&&!e&&!s&&(Ae(this,"onStart"),this._tTime!==g))return this;for(n=this._pt;n;)n.r(l,n.d),n=n._next;h&&h.render(t<0?t:h._dur*h._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(m&&Wt(this,t,0,r),Ae(this,"onUpdate")),this._repeat&&s!==o&&this.vars.onRepeat&&!e&&this.parent&&Ae(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(m&&!this._onUpdate&&Wt(this,t,0,!0),(t||!p)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&Gt(this,1),e||m&&!f||!(g||f||u)||(Ae(this,g===d?"onComplete":"onReverseComplete",!0),this._prom&&!(g<d&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,r,i){var n,s,a,o=t.ratio,u=e<0||!e&&(!t._start&&ie(t)&&(t._initted||!ne(t))||(t._ts<0||t._dp._ts<0)&&!ne(t))?0:1,l=t._rDelay,h=0;if(l&&t._repeat&&(h=ce(0,t._tDur,e),s=jt(h,l),t._yoyo&&1&s&&(u=1-u),s!==jt(t._tTime,l)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||_||i||t._zTime===B||!e&&t._zTime){if(!t._initted&&re(t,e,i,r,h))return;for(a=t._zTime,t._zTime=e||(r?B:0),r||(r=e&&!a),t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=h,n=t._pt;n;)n.r(u,n.d),n=n._next;e<0&&Wt(t,e,0,!0),t._onUpdate&&!r&&Ae(t,"onUpdate"),h&&t._repeat&&!r&&t.parent&&Ae(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&Gt(t,1),r||_||(Ae(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},r.targets=function(){return this._targets},r.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},r.resetTo=function(t,e,r,i,n){M||Ue.wake(),this._ts||this.play();var s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||ar(this,s),function(t,e,r,i,n,s,a,o){var u,l,h,c,f=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!f)for(f=t._ptCache[e]=[],h=t._ptLookup,c=t._targets.length;c--;){if((u=h[c][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return rr=1,t.vars[e]="+=0",ar(t,a),rr=0,o?ct(e+" not eligible for reset"):1;f.push(u)}for(c=f.length;c--;)(u=(l=f[c])._pt||l).s=!i&&0!==i||n?u.s+(i||0)+s*u.c:i,u.c=r-u.s,l.e&&(l.e=Ct(r)+fe(l.e)),l.b&&(l.b=u.s+fe(l.b))}(this,t,e,r,i,this._ease(s/this._dur),s,n)?this.resetTo(t,e,r,i,1):(Kt(this,0),this.parent||Yt(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?Me(this):this.scrollTrigger&&this.scrollTrigger.kill(!!_),this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,er&&!0!==er.vars.overwrite)._first||Me(this),this.parent&&r!==this.timeline.totalDuration()&&se(this,this._dur*this.timeline._tDur/r,0,1),this}var i,n,s,a,o,u,l,h=this._targets,c=t?me(t):h,f=this._ptLookup,d=this._pt;if((!e||"all"===e)&&function(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(h,c))return"all"===e&&(this._pt=0),Me(this);for(i=this._op=this._op||[],"all"!==e&&(G(e)&&(o={},St(e,(function(t){return o[t]=1})),e=o),e=function(t,e){var r,i,n,s,a=t[0]?At(t[0]).harness:0,o=a&&a.aliases;if(!o)return e;for(i in r=Nt({},e),o)if(i in r)for(n=(s=o[i].split(",")).length;n--;)r[s[n]]=r[i];return r}(h,e)),l=h.length;l--;)if(~c.indexOf(h[l]))for(o in n=f[l],"all"===e?(i[l]=e,a=n,s={}):(s=i[l]=i[l]||{},a=e),a)(u=n&&n[o])&&("kill"in u.d&&!0!==u.d.kill(o)||Vt(this,u,"_pt"),delete n[o]),"all"!==s&&(s[o]=1);return this._initted&&!this._pt&&d&&Me(this),this},e.to=function(t,r){return new e(t,r,arguments[2])},e.from=function(t,e){return le(1,arguments)},e.delayedCall=function(t,r,i,n){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:r,onReverseComplete:r,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:n})},e.fromTo=function(t,e,r){return le(2,arguments)},e.set=function(t,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(t,r)},e.killTweensOf=function(t,e,r){return x.killTweensOf(t,e,r)},e}(Je);Bt(cr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),St("staggerTo,staggerFrom,staggerFromTo",(function(t){cr[t]=function(){var e=new tr,r=de.call(arguments,0);return r.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,r)}}));var fr=function(t,e,r){return t[e]=r},dr=function(t,e,r){return t[e](r)},pr=function(t,e,r,i){return t[e](i.fp,r)},mr=function(t,e,r){return t.setAttribute(e,r)},gr=function(t,e){return q(t[e])?dr:$(t[e])&&t.setAttribute?mr:fr},vr=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},_r=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},yr=function(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},xr=function(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},br=function(t,e,r,i){for(var n,s=this._pt;s;)n=s._next,s.p===i&&s.modifier(t,e,r),s=n},Er=function(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?Vt(this,i,"_pt"):i.dep||(e=1),i=r;return!e},wr=function(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)},Tr=function(t){for(var e,r,i,n,s=t._pt;s;){for(e=s._next,r=i;r&&r.pr>s.pr;)r=r._next;(s._prev=r?r._prev:n)?s._prev._next=s:i=s,(s._next=r)?r._prev=s:n=s,s=e}t._pt=i},Rr=function(){function t(t,e,r,i,n,s,a,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=s||vr,this.d=a||this,this.set=o||fr,this.pr=u||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,r){this.mSet=this.mSet||this.set,this.set=wr,this.m=t,this.mt=r,this.tween=e},t}();St(Tt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return vt[t]=1})),ot.TweenMax=ot.TweenLite=cr,ot.TimelineLite=ot.TimelineMax=tr,x=new tr({sortChildren:!1,defaults:P,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),L.stringFilter=Ne;var Ar=[],Mr={},Sr=[],Cr=0,kr=0,Fr=function(t){return(Mr[t]||Sr).map((function(t){return t()}))},Dr=function(){var t=Date.now(),e=[];t-Cr>2&&(Fr("matchMediaInit"),Ar.forEach((function(t){var r,i,n,s,a=t.queries,o=t.conditions;for(i in a)(r=b.matchMedia(a[i]).matches)&&(n=1),r!==o[i]&&(o[i]=r,s=1);s&&(t.revert(),n&&e.push(t))})),Fr("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t,(function(e){return t.add(null,e)}))})),Cr=t,Fr("matchMedia"))},Or=function(){function t(t,e){this.selector=e&&ge(e),this.data=[],this._r=[],this.isReverted=!1,this.id=kr++,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,r){q(t)&&(r=e,e=t,t=q);var i=this,n=function(){var t,n=y,s=i.selector;return n&&n!==i&&n.data.push(i),r&&(i.selector=ge(r)),y=i,t=e.apply(i,arguments),q(t)&&i._r.push(t),y=n,i.selector=s,i.isReverted=!1,t};return i.last=n,t===q?n(i,(function(t){return i.add(null,t)})):t?i[t]=n:n},e.ignore=function(t){var e=y;y=null,t(this),y=e},e.getTweens=function(){var e=[];return this.data.forEach((function(r){return r instanceof t?e.push.apply(e,r.getTweens()):r instanceof cr&&!(r.parent&&"nested"===r.parent.data)&&e.push(r)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var r=this;if(t?function(){for(var e,i=r.getTweens(),n=r.data.length;n--;)"isFlip"===(e=r.data[n]).data&&(e.revert(),e.getChildren(!0,!0,!1).forEach((function(t){return i.splice(i.indexOf(t),1)})));for(i.map((function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t}})).sort((function(t,e){return e.g-t.g||-1/0})).forEach((function(e){return e.t.revert(t)})),n=r.data.length;n--;)(e=r.data[n])instanceof tr?"nested"!==e.data&&(e.scrollTrigger&&e.scrollTrigger.revert(),e.kill()):!(e instanceof cr)&&e.revert&&e.revert(t);r._r.forEach((function(e){return e(t,r)})),r.isReverted=!0}():this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e)for(var i=Ar.length;i--;)Ar[i].id===this.id&&Ar.splice(i,1)},e.revert=function(t){this.kill(t||{})},t}(),Lr=function(){function t(t){this.contexts=[],this.scope=t,y&&y.data.push(this)}var e=t.prototype;return e.add=function(t,e,r){H(t)||(t={matches:t});var i,n,s,a=new Or(0,r||this.scope),o=a.conditions={};for(n in y&&!a.selector&&(a.selector=y.selector),this.contexts.push(a),e=a.add("onMatch",e),a.queries=t,t)"all"===n?s=1:(i=b.matchMedia(t[n]))&&(Ar.indexOf(a)<0&&Ar.push(a),(o[n]=i.matches)&&(s=1),i.addListener?i.addListener(Dr):i.addEventListener("change",Dr));return s&&e(a,(function(t){return a.add(null,t)})),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Pr={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach((function(t){return Ce(t)}))},timeline:function(t){return new tr(t)},getTweensOf:function(t,e){return x.getTweensOf(t,e)},getProperty:function(t,e,r,i){G(t)&&(t=me(t)[0]);var n=At(t||{}).get,s=r?zt:Pt;return"native"===r&&(r=""),t?e?s((xt[e]&&xt[e].get||n)(t,e,r,i)):function(e,r,i){return s((xt[e]&&xt[e].get||n)(t,e,r,i))}:t},quickSetter:function(t,e,r){if((t=me(t)).length>1){var i=t.map((function(t){return Nr.quickSetter(t,e,r)})),n=i.length;return function(t){for(var e=n;e--;)i[e](t)}}t=t[0]||{};var s=xt[e],a=At(t),o=a.harness&&(a.harness.aliases||{})[e]||e,u=s?function(e){var i=new s;A._pt=0,i.init(t,r?e+r:e,A,0,[t]),i.render(1,i),A._pt&&xr(1,A)}:a.set(t,o);return s?u:function(e){return u(t,o,r?e+r:e,a,1)}},quickTo:function(t,e,r){var i,n=Nr.to(t,Bt(((i={})[e]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),s=function(t,r,i){return n.resetTo(e,t,r,i)};return s.tween=n,s},isTweening:function(t){return x.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=$e(t.ease,P.ease)),Ut(P,t||{})},config:function(t){return Ut(L,t||{})},registerEffect:function(t){var e=t.name,r=t.effect,i=t.plugins,n=t.defaults,s=t.extendTimeline;(i||"").split(",").forEach((function(t){return t&&!xt[t]&&!ot[t]&&ct(e+" effect requires "+t+" plugin.")})),bt[e]=function(t,e,i){return r(me(t),Bt(e||{},n),i)},s&&(tr.prototype[e]=function(t,r,i){return this.add(bt[e](t,H(r)?r:(i=r)&&{},this),i)})},registerEase:function(t,e){Xe[t]=$e(e)},parseEase:function(t,e){return arguments.length?$e(t,e):Xe},getById:function(t){return x.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var r,i,n=new tr(t);for(n.smoothChildTiming=j(t.smoothChildTiming),x.remove(n),n._dp=0,n._time=n._tTime=x._time,r=x._first;r;)i=r._next,!e&&!r._dur&&r instanceof cr&&r.vars.onComplete===r._targets[0]||te(n,r,r._start-r._delay),r=i;return te(x,n,0),n},context:function(t,e){return t?new Or(t,e):y},matchMedia:function(t){return new Lr(t)},matchMediaRefresh:function(){return Ar.forEach((function(t){var e,r,i=t.conditions;for(r in i)i[r]&&(i[r]=!1,e=1);e&&t.revert()}))||Dr()},addEventListener:function(t,e){var r=Mr[t]||(Mr[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function(t,e){var r=Mr[t],i=r&&r.indexOf(e);i>=0&&r.splice(i,1)},utils:{wrap:function t(e,r,i){var n=r-e;return J(e)?Ee(e,t(0,e.length),r):he(i,(function(t){return(n+(t-e)%n)%n+e}))},wrapYoyo:function t(e,r,i){var n=r-e,s=2*n;return J(e)?Ee(e,t(0,e.length-1),r):he(i,(function(t){return e+((t=(s+(t-e)%s)%s||0)>n?s-t:t)}))},distribute:_e,random:be,snap:xe,normalize:function(t,e,r){return Te(t,e,0,1,r)},getUnit:fe,clamp:function(t,e,r){return he(r,(function(r){return ce(t,e,r)}))},splitColor:Oe,toArray:me,selector:ge,mapRange:Te,pipe:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(r){return t(parseFloat(r))+(e||fe(r))}},interpolate:function t(e,r,i,n){var s=isNaN(e+r)?0:function(t){return(1-t)*e+t*r};if(!s){var a,o,u,l,h,c=G(e),f={};if(!0===i&&(n=1)&&(i=null),c)e={p:e},r={p:r};else if(J(e)&&!J(r)){for(u=[],l=e.length,h=l-2,o=1;o<l;o++)u.push(t(e[o-1],e[o]));l--,s=function(t){t*=l;var e=Math.min(h,~~t);return u[e](t-e)},i=r}else n||(e=Nt(J(e)?[]:{},e));if(!u){for(a in r)nr.call(f,e,a,"get",r[a]);s=function(t){return xr(t,f)||(c?e.p:e)}}}return he(i,s)},shuffle:ve},install:lt,effects:bt,ticker:Ue,updateRoot:tr.updateRoot,plugins:xt,globalTimeline:x,core:{PropTween:Rr,globals:ft,Tween:cr,Timeline:tr,Animation:Je,getCache:At,_removeLinkedListItem:Vt,reverting:function(){return _},context:function(t){return t&&y&&(y.data.push(t),t._ctx=y),y},suppressOverwrites:function(t){return v=t}}};St("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return Pr[t]=cr[t]})),Ue.add(tr.updateRoot),A=Pr.to({},{duration:0});var zr=function(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r},Br=function(t,e){return{name:t,rawVars:1,init:function(t,r,i){i._onInit=function(t){var i,n;if(G(r)&&(i={},St(r,(function(t){return i[t]=1})),r=i),e){for(n in i={},r)i[n]=e(r[n]);r=i}!function(t,e){var r,i,n,s=t._targets;for(r in e)for(i=s.length;i--;)(n=t._ptLookup[i][r])&&(n=n.d)&&(n._pt&&(n=zr(n,r)),n&&n.modifier&&n.modifier(e[r],t,s[i],r))}(t,r)}}}},Nr=Pr.registerPlugin({name:"attr",init:function(t,e,r,i,n){var s,a,o;for(s in this.tween=r,e)o=t.getAttribute(s)||"",(a=this.add(t,"setAttribute",(o||0)+"",e[s],i,n,0,0,s)).op=s,a.b=o,this._props.push(s)},render:function(t,e){for(var r=e._pt;r;)_?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",init:function(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},Br("roundProps",ye),Br("modifiers"),Br("snap",xe))||Pr;cr.version=tr.version=Nr.version="3.12.7",T=1,Z()&&Ie(),Xe.Power0,Xe.Power1,Xe.Power2,Xe.Power3,Xe.Power4,Xe.Linear,Xe.Quad,Xe.Cubic,Xe.Quart,Xe.Quint,Xe.Strong,Xe.Elastic,Xe.Back,Xe.SteppedEase,Xe.Bounce,Xe.Sine,Xe.Expo,Xe.Circ;var Ur,Ir,Xr,Yr,Vr,Gr,qr,Wr,$r={},Hr=180/Math.PI,jr=Math.PI/180,Zr=Math.atan2,Qr=/([A-Z])/g,Kr=/(left|right|width|margin|padding|x)/i,Jr=/[\s,\(]\S/,ti={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},ei=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},ri=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},ii=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},ni=function(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)},si=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},ai=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},oi=function(t,e,r){return t.style[e]=r},ui=function(t,e,r){return t.style.setProperty(e,r)},li=function(t,e,r){return t._gsap[e]=r},hi=function(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r},ci=function(t,e,r,i,n){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(n,s)},fi=function(t,e,r,i,n){var s=t._gsap;s[e]=r,s.renderTransform(n,s)},di="transform",pi=di+"Origin",mi=function t(e,r){var i=this,n=this.target,s=n.style,a=n._gsap;if(e in $r&&s){if(this.tfm=this.tfm||{},"transform"===e)return ti.transform.split(",").forEach((function(e){return t.call(i,e,r)}));if(~(e=ti[e]||e).indexOf(",")?e.split(",").forEach((function(t){return i.tfm[t]=Oi(n,t)})):this.tfm[e]=a.x?a[e]:Oi(n,e),e===pi&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(di)>=0)return;a.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(pi,r,"")),e=di}(s||r)&&this.props.push(e,r,s[e])},gi=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},vi=function(){var t,e,r=this.props,i=this.target,n=i.style,s=i._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?i[r[t]](r[t+2]):i[r[t]]=r[t+2]:r[t+2]?n[r[t]]=r[t+2]:n.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(Qr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)s[e]=this.tfm[e];s.svg&&(s.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(t=qr())&&t.isStart||n[di]||(gi(n),s.zOrigin&&n[pi]&&(n[pi]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},_i=function(t,e){var r={target:t,props:[],revert:vi,save:mi};return t._gsap||Nr.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach((function(t){return r.save(t)})),r},yi=function(t,e){var r=Ir.createElementNS?Ir.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ir.createElement(t);return r&&r.style?r:Ir.createElement(t)},xi=function t(e,r,i){var n=getComputedStyle(e);return n[r]||n.getPropertyValue(r.replace(Qr,"-$1").toLowerCase())||n.getPropertyValue(r)||!i&&t(e,Ei(r)||r,1)||""},bi="O,Moz,ms,Ms,Webkit".split(","),Ei=function(t,e,r){var i=(e||Vr).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(bi[n]+t in i););return n<0?null:(3===n?"ms":n>=0?bi[n]:"")+t},wi=function(){"undefined"!=typeof window&&window.document&&(Ur=window,Ir=Ur.document,Xr=Ir.documentElement,Vr=yi("div")||{style:{}},yi("div"),di=Ei(di),pi=di+"Origin",Vr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Wr=!!Ei("perspective"),qr=Nr.core.reverting,Yr=1)},Ti=function(t){var e,r=t.ownerSVGElement,i=yi("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0);n.style.display="block",i.appendChild(n),Xr.appendChild(i);try{e=n.getBBox()}catch(t){}return i.removeChild(n),Xr.removeChild(i),e},Ri=function(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])},Ai=function(t){var e,r;try{e=t.getBBox()}catch(i){e=Ti(t),r=1}return e&&(e.width||e.height)||r||(e=Ti(t)),!e||e.width||e.x||e.y?e:{x:+Ri(t,["x","cx","x1"])||0,y:+Ri(t,["y","cy","y1"])||0,width:0,height:0}},Mi=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Ai(t))},Si=function(t,e){if(e){var r,i=t.style;e in $r&&e!==pi&&(e=di),i.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty("--"===r?e:e.replace(Qr,"-$1").toLowerCase())):i.removeAttribute(e)}},Ci=function(t,e,r,i,n,s){var a=new Rr(t._pt,e,r,0,1,s?ai:si);return t._pt=a,a.b=i,a.e=n,t._props.push(r),a},ki={deg:1,rad:1,turn:1},Fi={grid:1,flex:1},Di=function t(e,r,i,n){var s,a,o,u,l=parseFloat(i)||0,h=(i+"").trim().substr((l+"").length)||"px",c=Vr.style,f=Kr.test(r),d="svg"===e.tagName.toLowerCase(),p=(d?"client":"offset")+(f?"Width":"Height"),m=100,g="px"===n,v="%"===n;if(n===h||!l||ki[n]||ki[h])return l;if("px"!==h&&!g&&(l=t(e,r,i,"px")),u=e.getCTM&&Mi(e),(v||"%"===h)&&($r[r]||~r.indexOf("adius")))return s=u?e.getBBox()[f?"width":"height"]:e[p],Ct(v?l/s*m:l/100*s);if(c[f?"width":"height"]=m+(g?h:n),a="rem"!==n&&~r.indexOf("adius")||"em"===n&&e.appendChild&&!d?e:e.parentNode,u&&(a=(e.ownerSVGElement||{}).parentNode),a&&a!==Ir&&a.appendChild||(a=Ir.body),(o=a._gsap)&&v&&o.width&&f&&o.time===Ue.time&&!o.uncache)return Ct(l/o.width*m);if(!v||"height"!==r&&"width"!==r)(v||"%"===h)&&!Fi[xi(a,"display")]&&(c.position=xi(e,"position")),a===e&&(c.position="static"),a.appendChild(Vr),s=Vr[p],a.removeChild(Vr),c.position="absolute";else{var _=e.style[r];e.style[r]=m+n,s=e[p],_?e.style[r]=_:Si(e,r)}return f&&v&&((o=At(a)).time=Ue.time,o.width=a[p]),Ct(g?s*l/m:s&&l?m/s*l:0)},Oi=function(t,e,r,i){var n;return Yr||wi(),e in ti&&"transform"!==e&&~(e=ti[e]).indexOf(",")&&(e=e.split(",")[0]),$r[e]&&"transform"!==e?(n=Gi(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:qi(xi(t,pi))+" "+n.zOrigin+"px"):(!(n=t.style[e])||"auto"===n||i||~(n+"").indexOf("calc("))&&(n=Bi[e]&&Bi[e](t,e,r)||xi(t,e)||Mt(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?Di(t,e,n,r)+r:n},Li=function(t,e,r,i){if(!r||"none"===r){var n=Ei(e,t,1),s=n&&xi(t,n,1);s&&s!==r?(e=n,r=s):"borderColor"===e&&(r=xi(t,"borderTopColor"))}var a,o,u,l,h,c,f,d,p,m,g,v=new Rr(this._pt,t.style,e,0,1,yr),_=0,y=0;if(v.b=r,v.e=i,r+="","auto"==(i+="")&&(c=t.style[e],t.style[e]=i,i=xi(t,e)||i,c?t.style[e]=c:Si(t,e)),Ne(a=[r,i]),i=a[1],u=(r=a[0]).match(rt)||[],(i.match(rt)||[]).length){for(;o=rt.exec(i);)f=o[0],p=i.substring(_,o.index),h?h=(h+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(h=1),f!==(c=u[y++]||"")&&(l=parseFloat(c)||0,g=c.substr((l+"").length),"="===f.charAt(1)&&(f=Ft(l,f)+g),d=parseFloat(f),m=f.substr((d+"").length),_=rt.lastIndex-m.length,m||(m=m||L.units[e]||g,_===i.length&&(i+=m,v.e+=m)),g!==m&&(l=Di(t,e,c,m)||0),v._pt={_next:v._pt,p:p||1===y?p:",",s:l,c:d-l,m:h&&h<4||"zIndex"===e?Math.round:0});v.c=_<i.length?i.substring(_,i.length):""}else v.r="display"===e&&"none"===i?ai:si;return nt.test(i)&&(v.e=0),this._pt=v,v},Pi={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},zi=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,s=e.t,a=s.style,o=e.u,u=s._gsap;if("all"===o||!0===o)a.cssText="",i=1;else for(n=(o=o.split(",")).length;--n>-1;)r=o[n],$r[r]&&(i=1,r="transformOrigin"===r?pi:di),Si(s,r);i&&(Si(s,di),u&&(u.svg&&s.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",Gi(s,1),u.uncache=1,gi(a)))}},Bi={clearProps:function(t,e,r,i,n){if("isFromStart"!==n.data){var s=t._pt=new Rr(t._pt,e,r,0,0,zi);return s.u=i,s.pr=-10,s.tween=n,t._props.push(r),1}}},Ni=[1,0,0,1,0,0],Ui={},Ii=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Xi=function(t){var e=xi(t,di);return Ii(e)?Ni:e.substr(7).match(et).map(Ct)},Yi=function(t,e){var r,i,n,s,a=t._gsap||At(t),o=t.style,u=Xi(t);return a.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?Ni:u:(u!==Ni||t.offsetParent||t===Xr||a.svg||(n=o.display,o.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(s=1,i=t.nextElementSibling,Xr.appendChild(t)),u=Xi(t),n?o.display=n:Si(t,"display"),s&&(i?r.insertBefore(t,i):r?r.appendChild(t):Xr.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},Vi=function(t,e,r,i,n,s){var a,o,u,l=t._gsap,h=n||Yi(t,!0),c=l.xOrigin||0,f=l.yOrigin||0,d=l.xOffset||0,p=l.yOffset||0,m=h[0],g=h[1],v=h[2],_=h[3],y=h[4],x=h[5],b=e.split(" "),E=parseFloat(b[0])||0,w=parseFloat(b[1])||0;r?h!==Ni&&(o=m*_-g*v)&&(u=E*(-g/o)+w*(m/o)-(m*x-g*y)/o,E=E*(_/o)+w*(-v/o)+(v*x-_*y)/o,w=u):(E=(a=Ai(t)).x+(~b[0].indexOf("%")?E/100*a.width:E),w=a.y+(~(b[1]||b[0]).indexOf("%")?w/100*a.height:w)),i||!1!==i&&l.smooth?(y=E-c,x=w-f,l.xOffset=d+(y*m+x*v)-y,l.yOffset=p+(y*g+x*_)-x):l.xOffset=l.yOffset=0,l.xOrigin=E,l.yOrigin=w,l.smooth=!!i,l.origin=e,l.originIsAbsolute=!!r,t.style[pi]="0px 0px",s&&(Ci(s,l,"xOrigin",c,E),Ci(s,l,"yOrigin",f,w),Ci(s,l,"xOffset",d,l.xOffset),Ci(s,l,"yOffset",p,l.yOffset)),t.setAttribute("data-svg-origin",E+" "+w)},Gi=function(t,e){var r=t._gsap||new Ke(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,s,a,o,u,l,h,c,f,d,p,m,g,v,_,y,x,b,E,w,T,R,A,M,S,C,k,F,D,O,P,z=t.style,B=r.scaleX<0,N="px",U="deg",I=getComputedStyle(t),X=xi(t,pi)||"0";return i=n=s=u=l=h=c=f=d=0,a=o=1,r.svg=!(!t.getCTM||!Mi(t)),I.translate&&("none"===I.translate&&"none"===I.scale&&"none"===I.rotate||(z[di]=("none"!==I.translate?"translate3d("+(I.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==I.rotate?"rotate("+I.rotate+") ":"")+("none"!==I.scale?"scale("+I.scale.split(" ").join(",")+") ":"")+("none"!==I[di]?I[di]:"")),z.scale=z.rotate=z.translate="none"),g=Yi(t,r.svg),r.svg&&(r.uncache?(M=t.getBBox(),X=r.xOrigin-M.x+"px "+(r.yOrigin-M.y)+"px",A=""):A=!e&&t.getAttribute("data-svg-origin"),Vi(t,A||X,!!A||r.originIsAbsolute,!1!==r.smooth,g)),p=r.xOrigin||0,m=r.yOrigin||0,g!==Ni&&(x=g[0],b=g[1],E=g[2],w=g[3],i=T=g[4],n=R=g[5],6===g.length?(a=Math.sqrt(x*x+b*b),o=Math.sqrt(w*w+E*E),u=x||b?Zr(b,x)*Hr:0,(c=E||w?Zr(E,w)*Hr+u:0)&&(o*=Math.abs(Math.cos(c*jr))),r.svg&&(i-=p-(p*x+m*E),n-=m-(p*b+m*w))):(P=g[6],D=g[7],C=g[8],k=g[9],F=g[10],O=g[11],i=g[12],n=g[13],s=g[14],l=(v=Zr(P,F))*Hr,v&&(A=T*(_=Math.cos(-v))+C*(y=Math.sin(-v)),M=R*_+k*y,S=P*_+F*y,C=T*-y+C*_,k=R*-y+k*_,F=P*-y+F*_,O=D*-y+O*_,T=A,R=M,P=S),h=(v=Zr(-E,F))*Hr,v&&(_=Math.cos(-v),O=w*(y=Math.sin(-v))+O*_,x=A=x*_-C*y,b=M=b*_-k*y,E=S=E*_-F*y),u=(v=Zr(b,x))*Hr,v&&(A=x*(_=Math.cos(v))+b*(y=Math.sin(v)),M=T*_+R*y,b=b*_-x*y,R=R*_-T*y,x=A,T=M),l&&Math.abs(l)+Math.abs(u)>359.9&&(l=u=0,h=180-h),a=Ct(Math.sqrt(x*x+b*b+E*E)),o=Ct(Math.sqrt(R*R+P*P)),v=Zr(T,R),c=Math.abs(v)>2e-4?v*Hr:0,d=O?1/(O<0?-O:O):0),r.svg&&(A=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Ii(xi(t,di)),A&&t.setAttribute("transform",A))),Math.abs(c)>90&&Math.abs(c)<270&&(B?(a*=-1,c+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,c+=c<=0?180:-180)),e=e||r.uncache,r.x=i-((r.xPercent=i&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+N,r.y=n-((r.yPercent=n&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+N,r.z=s+N,r.scaleX=Ct(a),r.scaleY=Ct(o),r.rotation=Ct(u)+U,r.rotationX=Ct(l)+U,r.rotationY=Ct(h)+U,r.skewX=c+U,r.skewY=f+U,r.transformPerspective=d+N,(r.zOrigin=parseFloat(X.split(" ")[2])||!e&&r.zOrigin||0)&&(z[pi]=qi(X)),r.xOffset=r.yOffset=0,r.force3D=L.force3D,r.renderTransform=r.svg?Ki:Wr?Qi:$i,r.uncache=0,r},qi=function(t){return(t=t.split(" "))[0]+" "+t[1]},Wi=function(t,e,r){var i=fe(e);return Ct(parseFloat(e)+parseFloat(Di(t,"x",r+"px",i)))+i},$i=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Qi(t,e)},Hi="0deg",ji="0px",Zi=") ",Qi=function(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,s=r.x,a=r.y,o=r.z,u=r.rotation,l=r.rotationY,h=r.rotationX,c=r.skewX,f=r.skewY,d=r.scaleX,p=r.scaleY,m=r.transformPerspective,g=r.force3D,v=r.target,_=r.zOrigin,y="",x="auto"===g&&t&&1!==t||!0===g;if(_&&(h!==Hi||l!==Hi)){var b,E=parseFloat(l)*jr,w=Math.sin(E),T=Math.cos(E);E=parseFloat(h)*jr,b=Math.cos(E),s=Wi(v,s,w*b*-_),a=Wi(v,a,-Math.sin(E)*-_),o=Wi(v,o,T*b*-_+_)}m!==ji&&(y+="perspective("+m+Zi),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),(x||s!==ji||a!==ji||o!==ji)&&(y+=o!==ji||x?"translate3d("+s+", "+a+", "+o+") ":"translate("+s+", "+a+Zi),u!==Hi&&(y+="rotate("+u+Zi),l!==Hi&&(y+="rotateY("+l+Zi),h!==Hi&&(y+="rotateX("+h+Zi),c===Hi&&f===Hi||(y+="skew("+c+", "+f+Zi),1===d&&1===p||(y+="scale("+d+", "+p+Zi),v.style[di]=y||"translate(0, 0)"},Ki=function(t,e){var r,i,n,s,a,o=e||this,u=o.xPercent,l=o.yPercent,h=o.x,c=o.y,f=o.rotation,d=o.skewX,p=o.skewY,m=o.scaleX,g=o.scaleY,v=o.target,_=o.xOrigin,y=o.yOrigin,x=o.xOffset,b=o.yOffset,E=o.forceCSS,w=parseFloat(h),T=parseFloat(c);f=parseFloat(f),d=parseFloat(d),(p=parseFloat(p))&&(d+=p=parseFloat(p),f+=p),f||d?(f*=jr,d*=jr,r=Math.cos(f)*m,i=Math.sin(f)*m,n=Math.sin(f-d)*-g,s=Math.cos(f-d)*g,d&&(p*=jr,a=Math.tan(d-p),n*=a=Math.sqrt(1+a*a),s*=a,p&&(a=Math.tan(p),r*=a=Math.sqrt(1+a*a),i*=a)),r=Ct(r),i=Ct(i),n=Ct(n),s=Ct(s)):(r=m,s=g,i=n=0),(w&&!~(h+"").indexOf("px")||T&&!~(c+"").indexOf("px"))&&(w=Di(v,"x",h,"px"),T=Di(v,"y",c,"px")),(_||y||x||b)&&(w=Ct(w+_-(_*r+y*n)+x),T=Ct(T+y-(_*i+y*s)+b)),(u||l)&&(a=v.getBBox(),w=Ct(w+u/100*a.width),T=Ct(T+l/100*a.height)),a="matrix("+r+","+i+","+n+","+s+","+w+","+T+")",v.setAttribute("transform",a),E&&(v.style[di]=a)},Ji=function(t,e,r,i,n){var s,a,o=360,u=G(n),l=parseFloat(n)*(u&&~n.indexOf("rad")?Hr:1)-i,h=i+l+"deg";return u&&("short"===(s=n.split("_")[1])&&(l%=o)!=l%180&&(l+=l<0?o:-360),"cw"===s&&l<0?l=(l+36e9)%o-~~(l/o)*o:"ccw"===s&&l>0&&(l=(l-36e9)%o-~~(l/o)*o)),t._pt=a=new Rr(t._pt,e,r,i,l,ri),a.e=h,a.u="deg",t._props.push(r),a},tn=function(t,e){for(var r in e)t[r]=e[r];return t},en=function(t,e,r){var i,n,s,a,o,u,l,h=tn({},r._gsap),c=r.style;for(n in h.svg?(s=r.getAttribute("transform"),r.setAttribute("transform",""),c[di]=e,i=Gi(r,1),Si(r,di),r.setAttribute("transform",s)):(s=getComputedStyle(r)[di],c[di]=e,i=Gi(r,1),c[di]=s),$r)(s=h[n])!==(a=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=fe(s)!==(l=fe(a))?Di(r,n,s,l):parseFloat(s),u=parseFloat(a),t._pt=new Rr(t._pt,i,n,o,u-o,ei),t._pt.u=l||0,t._props.push(n));tn(i,h)};St("padding,margin,Width,Radius",(function(t,e){var r="Top",i="Right",n="Bottom",s="Left",a=(e<3?[r,i,n,s]:[r+s,r+i,n+i,n+s]).map((function(r){return e<2?t+r:"border"+r+t}));Bi[e>1?"border"+t:t]=function(t,e,r,i,n){var s,o;if(arguments.length<4)return s=a.map((function(e){return Oi(t,e,r)})),5===(o=s.join(" ")).split(s[0]).length?s[0]:o;s=(i+"").split(" "),o={},a.forEach((function(t,e){return o[t]=s[e]=s[e]||s[(e-1)/2|0]})),t.init(e,o,n)}}));var rn,nn,sn={name:"css",register:wi,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,r,i,n){var s,a,o,u,l,h,c,f,d,p,m,g,v,_,y,x,b,E,w,T,R=this._props,A=t.style,M=r.vars.startAt;for(c in Yr||wi(),this.styles=this.styles||_i(t),x=this.styles.props,this.tween=r,e)if("autoRound"!==c&&(a=e[c],!xt[c]||!sr(c,e,r,i,t,n)))if(l=typeof a,h=Bi[c],"function"===l&&(l=typeof(a=a.call(r,i,t,n))),"string"===l&&~a.indexOf("random(")&&(a=we(a)),h)h(this,t,c,a,r)&&(y=1);else if("--"===c.substr(0,2))s=(getComputedStyle(t).getPropertyValue(c)+"").trim(),a+="",ze.lastIndex=0,ze.test(s)||(f=fe(s),d=fe(a)),d?f!==d&&(s=Di(t,c,s,d)+d):f&&(a+=f),this.add(A,"setProperty",s,a,i,n,0,0,c),R.push(c),x.push(c,0,A[c]);else if("undefined"!==l){if(M&&c in M?(s="function"==typeof M[c]?M[c].call(r,i,t,n):M[c],G(s)&&~s.indexOf("random(")&&(s=we(s)),fe(s+"")||"auto"===s||(s+=L.units[c]||fe(Oi(t,c))||""),"="===(s+"").charAt(1)&&(s=Oi(t,c))):s=Oi(t,c),u=parseFloat(s),(p="string"===l&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),o=parseFloat(a),c in ti&&("autoAlpha"===c&&(1===u&&"hidden"===Oi(t,"visibility")&&o&&(u=0),x.push("visibility",0,A.visibility),Ci(this,A,"visibility",u?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==c&&"transform"!==c&&~(c=ti[c]).indexOf(",")&&(c=c.split(",")[0])),m=c in $r)if(this.styles.save(c),g||((v=t._gsap).renderTransform&&!e.parseTransform||Gi(t,e.parseTransform),_=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new Rr(this._pt,A,di,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===c)this._pt=new Rr(this._pt,v,"scaleY",v.scaleY,(p?Ft(v.scaleY,p+o):o)-v.scaleY||0,ei),this._pt.u=0,R.push("scaleY",c),c+="X";else{if("transformOrigin"===c){x.push(pi,0,A[pi]),E=void 0,w=void 0,T=void 0,w=(E=(b=a).split(" "))[0],T=E[1]||"50%","top"!==w&&"bottom"!==w&&"left"!==T&&"right"!==T||(b=w,w=T,T=b),E[0]=Pi[w]||w,E[1]=Pi[T]||T,a=E.join(" "),v.svg?Vi(t,a,0,_,0,this):((d=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&Ci(this,v,"zOrigin",v.zOrigin,d),Ci(this,A,c,qi(s),qi(a)));continue}if("svgOrigin"===c){Vi(t,a,1,_,0,this);continue}if(c in Ui){Ji(this,v,c,u,p?Ft(u,p+a):a);continue}if("smoothOrigin"===c){Ci(this,v,"smooth",v.smooth,a);continue}if("force3D"===c){v[c]=a;continue}if("transform"===c){en(this,a,t);continue}}else c in A||(c=Ei(c)||c);if(m||(o||0===o)&&(u||0===u)&&!Jr.test(a)&&c in A)o||(o=0),(f=(s+"").substr((u+"").length))!==(d=fe(a)||(c in L.units?L.units[c]:f))&&(u=Di(t,c,s,d)),this._pt=new Rr(this._pt,m?v:A,c,u,(p?Ft(u,p+o):o)-u,m||"px"!==d&&"zIndex"!==c||!1===e.autoRound?ei:ni),this._pt.u=d||0,f!==d&&"%"!==d&&(this._pt.b=s,this._pt.r=ii);else if(c in A)Li.call(this,t,c,s,p?p+a:a);else if(c in t)this.add(t,c,s||t[c],p?p+a:a,i,n);else if("parseTransform"!==c){ht(c,a);continue}m||(c in A?x.push(c,0,A[c]):"function"==typeof t[c]?x.push(c,2,t[c]()):x.push(c,1,s||t[c])),R.push(c)}y&&Tr(this)},render:function(t,e){if(e.tween._time||!qr())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:Oi,aliases:ti,getSetter:function(t,e,r){var i=ti[e];return i&&i.indexOf(",")<0&&(e=i),e in $r&&e!==pi&&(t._gsap.x||Oi(t,"x"))?r&&Gr===r?"scale"===e?hi:li:(Gr=r||{})&&("scale"===e?ci:fi):t.style&&!$(t.style[e])?oi:~e.indexOf("-")?ui:gr(t,e)},core:{_removeProperty:Si,_getMatrix:Yi}};Nr.utils.checkPrefix=Ei,Nr.core.getStyleSaver=_i,nn=St("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(rn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){$r[t]=1})),St(rn,(function(t){L.units[t]="deg",Ui[t]=1})),ti[nn[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+rn,St("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");ti[e[1]]=nn[e[0]]})),St("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){L.units[t]="px"})),Nr.registerPlugin(sn);var an=Nr.registerPlugin(sn)||Nr;function on({blobType:t="circle",fillColor:e="#00f0ff",blobSize:i=125,domEl:n=null,eventEl:s=window,rect:a={left:0,top:0},isDashboard:o=!1}){const u=[(0,r.useRef)(null),(0,r.useRef)(null),(0,r.useRef)(null)],l=(0,r.useRef)({x:0,y:0}),h=[(0,r.useRef)({x:0,y:0}),(0,r.useRef)({x:0,y:0}),(0,r.useRef)({x:0,y:0})],c=[Math.round(.4*i),i,Math.round(.6*i)],f=t=>{let e=t.clientX||t.touches&&t.touches[0].clientX,r=t.clientY||t.touches&&t.touches[0].clientY;a.left&&a.top&&(e-=a.left,r-=a.top),l.current={x:e,y:r}};return(0,r.useEffect)((()=>{if(s)return s.addEventListener("mousemove",f),s.addEventListener("touchmove",f),()=>{s.removeEventListener("mousemove",f),s.removeEventListener("touchmove",f)}}),[s,a]),(0,r.useEffect)((()=>{const t=()=>{an.to(h[0].current,{x:l.current.x,y:l.current.y,duration:.1,ease:"power1.out"});for(let t=1;t<3;t++)an.to(h[t].current,{x:h[t-1].current.x,y:h[t-1].current.y,duration:.5,ease:"power2.out"});u.forEach(((t,e)=>{t.current&&(t.current.style.transform=`translate3d(${h[e].current.x}px,${h[e].current.y}px,0) translate3d(-50%,-50%,0)`)})),requestAnimationFrame(t)},e=requestAnimationFrame(t);return()=>cancelAnimationFrame(e)}),[]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("svg",{style:{position:"absolute",width:0,height:0}},(0,r.createElement)("filter",{id:"bBlocks-cursor-blob"},(0,r.createElement)("feGaussianBlur",{in:"SourceGraphic",result:"blur",stdDeviation:"30"}),(0,r.createElement)("feColorMatrix",{in:"blur",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 35 -10"}))),(0,r.createElement)("div",{className:"bBlocks-blob-cursor-main",style:{position:o?"absolute":"fixed",left:0,top:0,width:a?.width?a.width:"100%",height:a?.height?a.height:"100%",pointerEvents:"none"},ref:n},[0,1,2].map((i=>(0,r.createElement)("div",{key:i,ref:u[i],style:{position:"absolute",willChange:"transform",borderRadius:"circle"===t?"50%":"0%",backgroundColor:e,opacity:.6,width:`${c[i]||60}px`,height:`${c[i]||60}px`}})))))}an.core.Tween;const un=(t=window)=>{const[e,i]=(0,r.useState)({}),[n,s]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(!t)return;const e=t=>{let e=t.clientX,r=t.clientY;i({x:e,y:r})},r=()=>s(!0),n=()=>s(!1);return t.addEventListener("mousemove",e),t.addEventListener("mousedown",r),t.addEventListener("mouseup",n),()=>{t.removeEventListener("mousemove",e),t.removeEventListener("mousedown",r),t.removeEventListener("mouseup",n)}}),[t,e]),{cursorPosition:e,isClicking:n,setIsClicking:s}},ln=({size:t=12,color:e="#3B82F6",duration:i=.1,domEl:n=null,eventEl:s=window})=>{const{cursorPosition:o,isClicking:u}=un(n),l=(0,r.useRef)(null);(0,r.useEffect)((()=>{l.current&&an.to(l.current,{x:o.x,y:o.y,duration:i,ease:"power3.out"})}),[o]),(0,r.useEffect)((()=>{l.current&&(u?an.to(l.current,{scale:.7,duration:.2,ease:"power2.out"}):an.to(l.current,{scale:1,duration:.2,ease:"elastic.out(1, 0.3)"}))}),[u]);const h={...a(t)&&{"--bBlocks-cursor-dot-cursor-size":t+"px"},...a(e)&&{"--bBlocks-cursor-dot-cursor-bg":e}};return(0,r.createElement)("div",{ref:l,className:"bBlocks-cursor-dotCursor",style:h})},hn="bBlocks-cursor",cn=({size:t=40,color:e="#EF4444",elasticity:i=.6,duration:n=.5,innerDuration:s=.1,borderWidth:a="2px",domEl:o=null,eventEl:u=window})=>{const{cursorPosition:l,isClicking:h}=un(o),c=(0,r.useRef)(null),f=(0,r.useRef)(null),d=(0,r.useRef)({x:0,y:0});return(0,r.useEffect)((()=>{if(!c.current||!f.current)return;an.to(c.current,{x:l.x,y:l.y,duration:s,ease:"power1.out"}),an.to(f.current,{x:l.x,y:l.y,duration:n,ease:`elastic.out(1, ${i})`});const e=l.x-d.current.x,r=l.y-d.current.y;Math.sqrt(e*e+r*r)>5?an.to(f.current,{width:1.5*t,height:.8*t,duration:.2}):an.to(f.current,{width:t,height:t,duration:.8,ease:"elastic.out(1, 0.3)"}),d.current={x:l.x,y:l.y}}),[l,t,i]),(0,r.useEffect)((()=>{c.current&&f.current&&(h?(an.to(c.current,{scale:.8,duration:.2}),an.to(f.current,{scale:1.2,duration:.3})):an.to([c.current,f.current],{scale:1,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[h]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{ref:c,className:`${hn}-elastic-cursor`,style:{width:.3*t,height:.3*t,backgroundColor:e}}),(0,r.createElement)("div",{ref:f,className:`${hn}-elastic-cursor-follower`,style:{width:t,height:t,border:`${a} solid ${e}`}}))},fn=({duration:t=.6,innerDuration:e=.1,size:i,followBg:n,followBorderColor:s,followBorderWidth:o,innerBg:u,innerBorderColor:l,innerBorderWidth:h,domEl:c=null})=>{const f=(0,r.useRef)(null),d=(0,r.useRef)(null),{cursorPosition:p}=un(c);(0,r.useEffect)((()=>{const r=f.current,i=d.current;an.to(r,{x:p.x,y:p.y,duration:t,ease:"power3"}),an.to(i,{x:p.x,y:p.y,duration:e,ease:"power3"})}),[p]);const m={...a(i)&&{"--bBlocks-follow-cursor-size":i},...a(n)&&{"--bBlocks-follow-cursor-bg":n},...a(s)&&{"--bBlocks-follow-cursor-border-color":s},...a(o)&&{"--bBlocks-follow-cursor-border-width":o}},g={...a(i)&&{"--bBlocks-follow-cursor-size":i},...a(u)&&{"--bBlocks-follow-inner-cursor-bg":u},...a(l)&&{"--bBlocks-follow-inner-cursor-border":l},...a(h)&&{"--bBlocks-follow-inner-cursor-border-width":h}};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{style:m,className:"bBlocks-follow-cursor",ref:f}),(0,r.createElement)("div",{style:g,className:"bBlocks-follow-inner-cursor",ref:d}))},dn=({size:t=20,primaryColor:e,secondaryColor:i,tertiaryColor:n,intensity:s="medium",speed:o="medium",tailLength:u=8,glitchMode:l="matrix",enabled:h=!0,blendMode:c="normal",showTrail:f=!0,clickEffect:d=!1,domEl:p=null,eventEl:m=window})=>{const g=(0,r.useRef)(null),{cursorPosition:v,isClicking:_}=un(p),[y,x]=(0,r.useState)([]);if((0,r.useEffect)((()=>{h&&f&&x((t=>[{x:v.x,y:v.y,opacity:1},...t.slice(0,u-1).map(((t,e)=>({...t,opacity:1-(e+1)/u})))]))}),[v,h,f,u]),!h)return null;const b={matrix:{primary:"#00ff00",secondary:"#40ff40",tertiary:"#80ff80"},digital:{primary:"#ff4040",secondary:"#40ff40",tertiary:"#4040ff"},cyberpunk:{primary:"#ff0080",secondary:"#00ffff",tertiary:"#ffff00"},analog:{primary:"#ffffff",secondary:"#ff4444",tertiary:"#4444ff"}},E={"--bBlocks-cursor-glitch-size":`${t}px`,"--bBlocks-cursor-glitch-primary-color":a(e)?e:b[l].primary,"--bBlocks-cursor-glitch-secondary-color":a(i)?i:b[l].secondary,"--bBlocks-cursor-glitch-tertiary-color":a(n)?n:b[l].tertiary,"--bBlocks-cursor-glitch-blend-mode":c,left:v.x,top:v.y,transform:"translate(-50%, -50%) "+(_&&d?"scale(1.5)":"scale(1)")},w=["glitch-cursor",`glitch-${l}`,`intensity-${s}`,`speed-${o}`,_&&d?"clicking":""].filter(Boolean).join(" ");return(0,r.createElement)(r.Fragment,null,f&&y.map(((i,n)=>(0,r.createElement)("div",{key:n,className:"glitch-cursor-trail",style:{"--bBlocks-cursor-glitch-size":t*(1-.1*n)+"px","--bBlocks-cursor-glitch-primary-color":e,"--bBlocks-cursor-glitch-trail-opacity":i.opacity,left:i.x,top:i.y,transform:"translate(-50%, -50%)",opacity:.6*i.opacity}}))),(0,r.createElement)("div",{ref:g,className:w,style:E},(0,r.createElement)("div",{className:"cursor-core"}),(0,r.createElement)("div",{className:"cursor-glitch-layer layer-1"}),(0,r.createElement)("div",{className:"cursor-glitch-layer layer-2"}),(0,r.createElement)("div",{className:"cursor-glitch-layer layer-3"}),(0,r.createElement)("div",{className:"b-blocks-cursor-ring"}),"matrix"===l&&(0,r.createElement)("div",{className:"matrix-particles"},Array.from({length:6}).map(((t,e)=>(0,r.createElement)("div",{key:e,className:"matrix-particle"}))))))},pn=({size:t=50,innerSize:e=10,color:i="#F97316",pulseSpeed:n=1.5,duration:s=.2,domEl:a=null,eventEl:o=window})=>{const{cursorPosition:u,isClicking:l}=un(a),h=(0,r.useRef)(null),c=(0,r.useRef)(null),f=(0,r.useRef)(null);return(0,r.useEffect)((()=>{h.current&&c.current&&an.to([h.current,c.current],{x:u.x,y:u.y,duration:s,ease:"power2.out"})}),[u]),(0,r.useEffect)((()=>{if(h.current)return f.current=an.timeline({repeat:-1,yoyo:!0}),f.current.to(h.current,{scale:1.2,opacity:.6,duration:n,ease:"sine.inOut"}).to(h.current,{scale:1,opacity:.2,duration:n,ease:"sine.inOut"}),()=>{f.current&&f.current.kill()}}),[n]),(0,r.useEffect)((()=>{c.current&&h.current&&f.current&&(l?(f.current.pause(),an.to(h.current,{scale:1.5,opacity:.8,duration:.3,ease:"power2.out"}),an.to(c.current,{scale:1.2,duration:.2,ease:"power2.out"})):(f.current.play(),an.to(h.current,{scale:1,opacity:.2,duration:.5,ease:"elastic.out(1, 0.3)"}),an.to(c.current,{scale:1,duration:.4,ease:"elastic.out(1, 0.3)"})))}),[l]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{ref:h,className:"b-blocks-cursor-glow-outer",style:{width:t,height:t,borderRadius:"50%",backgroundColor:i,opacity:.2}}),(0,r.createElement)("div",{ref:c,className:"b-blocks-cursor-glow-inner",style:{width:e,height:e,backgroundColor:i,boxShadow:`0 0 10px ${i}`}}))},mn=({size:t=50,colors:e=["#3B82F6","#10B981","#F59E0B"],rotationSpeed:i=60,duration:n=.2,domEl:s=null,eventEl:a=window})=>{const{cursorPosition:o,isClicking:u}=un(s),l=(0,r.useRef)(null),h=(0,r.useRef)(0),c=(0,r.useRef)(performance.now()),f=180*i,d=(0,r.useRef)(f);return(0,r.useEffect)((()=>{d.current=f}),[f]),(0,r.useEffect)((()=>{l.current&&an.to(l.current,{x:o.x,y:o.y,duration:n,ease:"power2.out"})}),[o,n]),(0,r.useEffect)((()=>{if(!l.current)return;const t=r=>{const i=(r-c.current)/1e3;c.current=r,h.current=(h.current+d.current*i)%360,l.current&&an.to(l.current,{background:`conic-gradient(from ${h.current}deg, ${e.join(", ")})`,duration:0}),requestAnimationFrame(t)},r=requestAnimationFrame(t);return()=>{cancelAnimationFrame(r)}}),[e]),(0,r.useEffect)((()=>{l.current&&(u?an.to(l.current,{scale:1.2,duration:.3,ease:"power2.out"}):an.to(l.current,{scale:1,duration:.5,ease:"elastic.out(1, 0.3)"}))}),[u]),(0,r.createElement)("div",{ref:l,className:"b-blocks-cursor-gradient",style:{width:t,height:t,background:`conic-gradient(from 0deg, ${e.join(", ")})`}})},gn=({url:t="",size:e=80,rounded:i="8px",domEl:n=null,eventEl:s=window})=>{const{cursorPosition:a,isClicking:o}=un(n),u=(0,r.useRef)(null);return(0,r.useEffect)((()=>{u.current&&an.to(u.current,{x:a.x,y:a.y,duration:.2,ease:"power2.out"})}),[a]),(0,r.useEffect)((()=>{u.current&&(o?an.to(u.current,{scale:1.2,rotation:5,duration:.3,ease:"power2.out"}):an.to(u.current,{scale:1,rotation:0,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[o]),(0,r.createElement)("div",{ref:u,className:"b-blocks-cursor-image",style:{width:e,height:e,backgroundImage:`url(${t})`,borderRadius:i}})},vn=({size:t=40,borderWidth:e=2,borderColor:i="#F59E0B",backgroundColor:n="#f59e0b1a",targetedEl:s='button, a, textarea, select, [role="button"], [type="submit"]',domEl:a=null,eventEl:o=window})=>{const{cursorPosition:u,isClicking:l}=un(a),h=(0,r.useRef)(null),[c,f]=(0,r.useState)(null);return(0,r.useEffect)((()=>{const t=t=>{const e=t.target.closest(s);f(e||null)};return a.addEventListener("mouseover",t),()=>{a.removeEventListener("mouseover",t)}}),[]),(0,r.useEffect)((()=>{if(h.current)if(c){const t=c.getBoundingClientRect(),e=t.left+t.width/2,r=t.top+t.height/2;an.to(h.current,{x:e,y:r,width:t.width+20,height:t.height+20,borderRadius:"8px",duration:.4,ease:"elastic.out(1, 0.6)"})}else an.to(h.current,{x:u.x,y:u.y,width:t,height:t,borderRadius:"50%",duration:.2,ease:"power2.out"})}),[u,c,t]),(0,r.useEffect)((()=>{h.current&&(l?an.to(h.current,{scale:.9,duration:.2,ease:"power2.out"}):an.to(h.current,{scale:1,duration:.3,ease:"elastic.out(1, 0.3)"}))}),[l]),(0,r.createElement)("div",{ref:h,className:"b-blocks-magnetic-cursor",style:{width:t,height:t,border:`${e}px solid ${i}`,backgroundColor:n}})},_n=({size:t=30,color:e="#08F7FE",shadowSize:i=20,duration:n=.2,domEl:s=null,eventEl:a=window})=>{const{cursorPosition:o,isClicking:u}=un(s),l=(0,r.useRef)(null),h=(0,r.useRef)(null);return(0,r.useEffect)((()=>{l.current&&h.current&&an.to([l.current,h.current],{x:o.x,y:o.y,duration:n,ease:"power2.out"})}),[o]),(0,r.useEffect)((()=>{l.current&&h.current&&(u?(an.to(l.current,{scale:.8,boxShadow:`0 0 ${1.5*i}px ${e}, 0 0 ${2*i}px ${e}`,duration:.2}),an.to(h.current,{scale:1.2,opacity:.8,duration:.2})):(an.to(l.current,{scale:1,boxShadow:`0 0 ${i}px ${e}, 0 0 ${1.5*i}px ${e}`,duration:.4,ease:"elastic.out(1, 0.3)"}),an.to(h.current,{scale:1,opacity:.4,duration:.4})))}),[u,e,i]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{ref:l,className:"b-blocks-neon-cursor",style:{width:t,height:t,backgroundColor:e,boxShadow:`0 0 ${i}px ${e}, 0 0 ${1.5*i}px ${e}`}}),(0,r.createElement)("div",{ref:h,className:"b-blocks-neon-glow",style:{width:3*t,height:3*t,backgroundColor:e,opacity:.4}}))},yn=({size:t=60,pixelSize:e=6,color:i="linear-gradient(135deg, #fecda5 0%, #fe2d2d 50%, #6b003e 100%)",duration:n=.15,domEl:s=null})=>{const{cursorPosition:a,isClicking:o}=un(s),u=(0,r.useRef)(null);(0,r.useEffect)((()=>{u.current&&an.to(u.current,{x:a.x,y:a.y,duration:n,ease:"power2.out"})}),[a]),(0,r.useEffect)((()=>{u.current&&(o?an.to(u.current,{scale:.8,duration:.2,ease:"power2.out"}):an.to(u.current,{scale:1,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[o]);const l=Math.ceil(t/e),h=[];for(let t=0;t<l;t++)for(let n=0;n<l;n++){const s=Math.sqrt(Math.pow(n-l/2,2)+Math.pow(t-l/2,2));s<=l/2&&h.push((0,r.createElement)("div",{key:`${n}-${t}`,style:{position:"absolute",left:n*e,top:t*e,width:e,height:e,background:i,opacity:o?1-s/(l/2)*.3:1}}))}return(0,r.createElement)("div",{ref:u,className:"b-blocks-cursor-pixelated",style:{width:t,height:t}},h)},xn=({size:t=40,borderWidth:e=2,borderColor:i="#10B981",duration:n=.2,domEl:s=null})=>{const{cursorPosition:a,isClicking:o}=un(s),u=(0,r.useRef)(null);return(0,r.useEffect)((()=>{u.current&&an.to(u.current,{x:a.x,y:a.y,duration:n,ease:"power2.out"})}),[a]),(0,r.useEffect)((()=>{u.current&&(o?an.to(u.current,{scale:.8,duration:.2,borderWidth:2*e,ease:"power2.out"}):an.to(u.current,{scale:1,borderWidth:e,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[o,e]),(0,r.createElement)("div",{ref:u,className:"b-blocks-cursor-ring",style:{width:t,height:t,border:`${e}px solid ${i}`}})},bn=({x:t,y:e,size:i,color:n,onComplete:s})=>{const a=(0,r.useRef)(null);return(0,r.useEffect)((()=>{a.current&&(an.set(a.current,{x:t,y:e,scale:0,opacity:1}),an.to(a.current,{scale:3,opacity:0,duration:1,ease:"power2.out",onComplete:s}))}),[t,e,s]),(0,r.createElement)("div",{ref:a,className:"b-blocks-cursor-ripple",style:{width:i,height:i,border:`2px solid ${n}`}})},En=({size:t=50,color:e="rgba(56, 189, 248, 0.6)",maxRipples:i=5,duration:n=.1})=>{const{cursorPosition:s,isClicking:a}=un(),o=(0,r.useRef)(null),[u,l]=(0,r.useState)([]),h=(0,r.useRef)(0),c=(0,r.useRef)(0);return(0,r.useEffect)((()=>{o.current&&an.to(o.current,{x:s.x,y:s.y,duration:n,ease:"power2.out"})}),[s]),(0,r.useEffect)((()=>{if(a){const t=Date.now();if(t-h.current>200){h.current=t;const e={id:c.current++,x:s.x,y:s.y};l((t=>{const r=[...t,e];return r.length>i?r.slice(r.length-i):r}))}}}),[a,s,i]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{ref:o,className:"b-blocks-cursor-ripple-wrapper",style:{width:t/3,height:t/3,backgroundColor:e.replace(/[^,]+(?=\))/,"1")}}),u.map((i=>(0,r.createElement)(bn,{key:i.id,x:i.x,y:i.y,size:t,color:e,onComplete:()=>{l((t=>t.filter((t=>t.id!==i.id))))}}))))},wn=({trailWidth:t=3,color:e="#111827",trailLength:i=50,domEl:n=null})=>{const{cursorPosition:s,isClicking:a}=un(n),o=(0,r.useRef)(null),u=(0,r.useRef)(null),l=(0,r.useRef)([]);(0,r.useEffect)((()=>{const t=u.current;if(!t)return;t.width=window.innerWidth,t.height=window.innerHeight;const e=()=>{t&&(t.width=window.innerWidth,t.height=window.innerHeight,h())};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,r.useEffect)((()=>{o.current&&(an.to(o.current,{x:s.x,y:s.y,duration:0,ease:"power2.out"}),l.current.push({x:s.x,y:s.y}),l.current.length>i&&l.current.shift(),h())}),[s,a,i]);const h=()=>{const r=u.current;if(!r)return;const i=r.getContext("2d");if(i&&(i.clearRect(0,0,r.width,r.height),!(l.current.length<2))){i.strokeStyle=e,i.lineWidth=t,i.lineCap="round",i.lineJoin="round",i.beginPath(),i.moveTo(l.current[0].x,l.current[0].y);for(let t=1;t<l.current.length;t++)if(t<l.current.length-1){const e=(l.current[t].x+l.current[t+1].x)/2,r=(l.current[t].y+l.current[t+1].y)/2;i.quadraticCurveTo(l.current[t].x,l.current[t].y,e,r)}else i.lineTo(l.current[t].x,l.current[t].y);i.stroke()}};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("canvas",{ref:u,className:"b-blocks-cursor-sketch"}),(0,r.createElement)("div",{ref:o,className:"b-blocks-cursor-sketch-dot",style:{width:3*t,height:3*t,borderRadius:"50%",backgroundColor:e,border:"none",transform:"translate(-50%, -50%)"}}))},Tn=({size:t=150,intensity:e=.7,color:i="#f00",duration:n=.2,domEl:s=null})=>{const{cursorPosition:a}=un(s),o=(0,r.useRef)(null);return(0,r.useEffect)((()=>{o.current&&an.to(o.current,{x:a.x,y:a.y,duration:n,ease:"power2.out"})}),[a]),(0,r.createElement)("div",{ref:o,className:"b-blocks-cursor-spotlight",style:{width:t,height:t,background:`radial-gradient(circle, ${i} 0%, rgba(255,255,255,0) 70%)`,opacity:e}})},Rn=({size:t=80,backgroundColor:e="#3b82f6",textColor:i="#FFFFFF",cursorText:n="Cursor Text",duration:s=.2,domEl:a=null})=>{const{cursorPosition:o,isClicking:u}=un(a),l=(0,r.useRef)(null);return(0,r.useEffect)((()=>{l.current&&an.to(l.current,{x:o.x,y:o.y,duration:s,ease:"power2.out"})}),[o]),(0,r.useEffect)((()=>{l.current&&(u?an.to(l.current,{scale:.9,duration:.2,ease:"power2.out"}):an.to(l.current,{scale:1,duration:.3,ease:"elastic.out(1, 0.3)"}))}),[u]),(0,r.createElement)("div",{ref:l,className:"b-blocks-cursor-text",style:{width:t+"px",height:t+"px",background:e,color:i,opacity:n?1:0}},n)},An=function({SIM_RESOLUTION:t=128,DYE_RESOLUTION:e=720,CAPTURE_RESOLUTION:i=512,DENSITY_DISSIPATION:n=3.5,VELOCITY_DISSIPATION:s=2,PRESSURE:a=.1,PRESSURE_ITERATIONS:o=20,CURL:u=3,SPLAT_RADIUS:l=.2,SPLAT_FORCE:h=6e3,SHADING:c=!0,COLOR_UPDATE_SPEED:f=10,BACK_COLOR:d={r:.5,g:0,b:0},TRANSPARENT:p=!0,domEl:m=window}){const g=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const r=g.current;if(!r)return;let v={SIM_RESOLUTION:t,DYE_RESOLUTION:e,CAPTURE_RESOLUTION:i,DENSITY_DISSIPATION:n,VELOCITY_DISSIPATION:s,PRESSURE:a,PRESSURE_ITERATIONS:o,CURL:u,SPLAT_RADIUS:l,SPLAT_FORCE:h,SHADING:c,COLOR_UPDATE_SPEED:f,PAUSED:!1,BACK_COLOR:d,TRANSPARENT:p},_=[new class{constructor(){this.id=-1,this.texcoordX=0,this.texcoordY=0,this.prevTexcoordX=0,this.prevTexcoordY=0,this.deltaX=0,this.deltaY=0,this.down=!1,this.moved=!1,this.color=[0,0,0]}}];const{gl:y,ext:x}=function(t){const e={alpha:!0,depth:!1,stencil:!1,antialias:!1,preserveDrawingBuffer:!1};let r=t.getContext("webgl2",e);const i=!!r;let n,s;i||(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)),i?(r.getExtension("EXT_color_buffer_float"),s=r.getExtension("OES_texture_float_linear")):(n=r.getExtension("OES_texture_half_float"),s=r.getExtension("OES_texture_half_float_linear")),r.clearColor(0,0,0,1);const a=i?r.HALF_FLOAT:n&&n.HALF_FLOAT_OES;let o,u,l;return i?(o=b(r,r.RGBA16F,r.RGBA,a),u=b(r,r.RG16F,r.RG,a),l=b(r,r.R16F,r.RED,a)):(o=b(r,r.RGBA,r.RGBA,a),u=b(r,r.RGBA,r.RGBA,a),l=b(r,r.RGBA,r.RGBA,a)),{gl:r,ext:{formatRGBA:o,formatRG:u,formatR:l,halfFloatTexType:a,supportLinearFiltering:s}}}(r);function b(t,e,r,i){if(!function(t,e,r,i){const n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,e,4,4,0,r,i,null);const s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);return t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE}(t,e,r,i))switch(e){case t.R16F:return b(t,t.RG16F,t.RG,i);case t.RG16F:return b(t,t.RGBA16F,t.RGBA,i);default:return null}return{internalFormat:e,format:r}}x.supportLinearFiltering||(v.DYE_RESOLUTION=256,v.SHADING=!1);class E{constructor(t,e){this.uniforms={},this.program=w(t,e),this.uniforms=T(this.program)}bind(){y.useProgram(this.program)}}function w(t,e){let r=y.createProgram();return y.attachShader(r,t),y.attachShader(r,e),y.linkProgram(r),y.getProgramParameter(r,y.LINK_STATUS)||console.trace(y.getProgramInfoLog(r)),r}function T(t){let e=[],r=y.getProgramParameter(t,y.ACTIVE_UNIFORMS);for(let i=0;i<r;i++){let r=y.getActiveUniform(t,i).name;e[r]=y.getUniformLocation(t,r)}return e}function R(t,e,r){e=function(t,e){if(!e)return t;let r="";return e.forEach((t=>{r+="#define "+t+"\n"})),r+t}(e,r);const i=y.createShader(t);return y.shaderSource(i,e),y.compileShader(i),y.getShaderParameter(i,y.COMPILE_STATUS)||console.trace(y.getShaderInfoLog(i)),i}const A=R(y.VERTEX_SHADER,"\n precision highp float;\n attribute vec2 aPosition;\n varying vec2 vUv;\n varying vec2 vL;\n varying vec2 vR;\n varying vec2 vT;\n varying vec2 vB;\n uniform vec2 texelSize;\n\n void main () {\n vUv = aPosition * 0.5 + 0.5;\n vL = vUv - vec2(texelSize.x, 0.0);\n vR = vUv + vec2(texelSize.x, 0.0);\n vT = vUv + vec2(0.0, texelSize.y);\n vB = vUv - vec2(0.0, texelSize.y);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n }\n "),M=R(y.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n uniform sampler2D uTexture;\n\n void main () {\n gl_FragColor = texture2D(uTexture, vUv);\n }\n "),S=R(y.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n uniform sampler2D uTexture;\n uniform float value;\n\n void main () {\n gl_FragColor = value * texture2D(uTexture, vUv);\n }\n "),C=R(y.FRAGMENT_SHADER,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n uniform sampler2D uTarget;\n uniform float aspectRatio;\n uniform vec3 color;\n uniform vec2 point;\n uniform float radius;\n\n void main () {\n vec2 p = vUv - point.xy;\n p.x *= aspectRatio;\n vec3 splat = exp(-dot(p, p) / radius) * color;\n vec3 base = texture2D(uTarget, vUv).xyz;\n gl_FragColor = vec4(base + splat, 1.0);\n }\n "),k=R(y.FRAGMENT_SHADER,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n uniform sampler2D uVelocity;\n uniform sampler2D uSource;\n uniform vec2 texelSize;\n uniform vec2 dyeTexelSize;\n uniform float dt;\n uniform float dissipation;\n\n vec4 bilerp (sampler2D sam, vec2 uv, vec2 tsize) {\n vec2 st = uv / tsize - 0.5;\n vec2 iuv = floor(st);\n vec2 fuv = fract(st);\n\n vec4 a = texture2D(sam, (iuv + vec2(0.5, 0.5)) * tsize);\n vec4 b = texture2D(sam, (iuv + vec2(1.5, 0.5)) * tsize);\n vec4 c = texture2D(sam, (iuv + vec2(0.5, 1.5)) * tsize);\n vec4 d = texture2D(sam, (iuv + vec2(1.5, 1.5)) * tsize);\n\n return mix(mix(a, b, fuv.x), mix(c, d, fuv.x), fuv.y);\n }\n\n void main () {\n #ifdef MANUAL_FILTERING\n vec2 coord = vUv - dt * bilerp(uVelocity, vUv, texelSize).xy * texelSize;\n vec4 result = bilerp(uSource, coord, dyeTexelSize);\n #else\n vec2 coord = vUv - dt * texture2D(uVelocity, vUv).xy * texelSize;\n vec4 result = texture2D(uSource, coord);\n #endif\n float decay = 1.0 + dissipation * dt;\n gl_FragColor = result / decay;\n }\n ",x.supportLinearFiltering?null:["MANUAL_FILTERING"]),F=R(y.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uVelocity;\n\n void main () {\n float L = texture2D(uVelocity, vL).x;\n float R = texture2D(uVelocity, vR).x;\n float T = texture2D(uVelocity, vT).y;\n float B = texture2D(uVelocity, vB).y;\n\n vec2 C = texture2D(uVelocity, vUv).xy;\n if (vL.x < 0.0) { L = -C.x; }\n if (vR.x > 1.0) { R = -C.x; }\n if (vT.y > 1.0) { T = -C.y; }\n if (vB.y < 0.0) { B = -C.y; }\n\n float div = 0.5 * (R - L + T - B);\n gl_FragColor = vec4(div, 0.0, 0.0, 1.0);\n }\n "),D=R(y.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uVelocity;\n\n void main () {\n float L = texture2D(uVelocity, vL).y;\n float R = texture2D(uVelocity, vR).y;\n float T = texture2D(uVelocity, vT).x;\n float B = texture2D(uVelocity, vB).x;\n float vorticity = R - L - T + B;\n gl_FragColor = vec4(0.5 * vorticity, 0.0, 0.0, 1.0);\n }\n "),O=R(y.FRAGMENT_SHADER,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n varying vec2 vL;\n varying vec2 vR;\n varying vec2 vT;\n varying vec2 vB;\n uniform sampler2D uVelocity;\n uniform sampler2D uCurl;\n uniform float curl;\n uniform float dt;\n\n void main () {\n float L = texture2D(uCurl, vL).x;\n float R = texture2D(uCurl, vR).x;\n float T = texture2D(uCurl, vT).x;\n float B = texture2D(uCurl, vB).x;\n float C = texture2D(uCurl, vUv).x;\n\n vec2 force = 0.5 * vec2(abs(T) - abs(B), abs(R) - abs(L));\n force /= length(force) + 0.0001;\n force *= curl * C;\n force.y *= -1.0;\n\n vec2 velocity = texture2D(uVelocity, vUv).xy;\n velocity += force * dt;\n velocity = min(max(velocity, -1000.0), 1000.0);\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n }\n "),L=R(y.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uPressure;\n uniform sampler2D uDivergence;\n\n void main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n float C = texture2D(uPressure, vUv).x;\n float divergence = texture2D(uDivergence, vUv).x;\n float pressure = (L + R + B + T - divergence) * 0.25;\n gl_FragColor = vec4(pressure, 0.0, 0.0, 1.0);\n }\n "),P=R(y.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uPressure;\n uniform sampler2D uVelocity;\n\n void main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n vec2 velocity = texture2D(uVelocity, vUv).xy;\n velocity.xy -= vec2(R - L, T - B);\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n }\n "),z=(y.bindBuffer(y.ARRAY_BUFFER,y.createBuffer()),y.bufferData(y.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),y.STATIC_DRAW),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,y.createBuffer()),y.bufferData(y.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),y.STATIC_DRAW),y.vertexAttribPointer(0,2,y.FLOAT,!1,0,0),y.enableVertexAttribArray(0),(t,e=!1)=>{null==t?(y.viewport(0,0,y.drawingBufferWidth,y.drawingBufferHeight),y.bindFramebuffer(y.FRAMEBUFFER,null)):(y.viewport(0,0,t.width,t.height),y.bindFramebuffer(y.FRAMEBUFFER,t.fbo)),e&&(y.clearColor(0,0,0,1),y.clear(y.COLOR_BUFFER_BIT)),y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)});let B,N,U,I,X;const Y=new E(A,M),V=new E(A,S),G=new E(A,C),q=new E(A,k),W=new E(A,F),$=new E(A,D),H=new E(A,O),j=new E(A,L),Z=new E(A,P),Q=new class{constructor(t,e){this.vertexShader=t,this.fragmentShaderSource=e,this.programs=[],this.activeProgram=null,this.uniforms=[]}setKeywords(t){let e=0;for(let r=0;r<t.length;r++)e+=ft(t[r]);let r=this.programs[e];if(null==r){let i=R(y.FRAGMENT_SHADER,this.fragmentShaderSource,t);r=w(this.vertexShader,i),this.programs[e]=r}r!==this.activeProgram&&(this.uniforms=T(r),this.activeProgram=r)}bind(){y.useProgram(this.activeProgram)}}(A,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n varying vec2 vL;\n varying vec2 vR;\n varying vec2 vT;\n varying vec2 vB;\n uniform sampler2D uTexture;\n uniform sampler2D uDithering;\n uniform vec2 ditherScale;\n uniform vec2 texelSize;\n\n vec3 linearToGamma (vec3 color) {\n color = max(color, vec3(0));\n return max(1.055 * pow(color, vec3(0.416666667)) - 0.055, vec3(0));\n }\n\n void main () {\n vec3 c = texture2D(uTexture, vUv).rgb;\n #ifdef SHADING\n vec3 lc = texture2D(uTexture, vL).rgb;\n vec3 rc = texture2D(uTexture, vR).rgb;\n vec3 tc = texture2D(uTexture, vT).rgb;\n vec3 bc = texture2D(uTexture, vB).rgb;\n\n float dx = length(rc) - length(lc);\n float dy = length(tc) - length(bc);\n\n vec3 n = normalize(vec3(dx, dy, length(texelSize)));\n vec3 l = vec3(0.0, 0.0, 1.0);\n\n float diffuse = clamp(dot(n, l) + 0.7, 0.7, 1.0);\n c *= diffuse;\n #endif\n\n float a = max(c.r, max(c.g, c.b));\n gl_FragColor = vec4(c, a);\n }\n ");function K(){let t=ht(v.SIM_RESOLUTION),e=ht(v.DYE_RESOLUTION);const r=x.halfFloatTexType,i=x.formatRGBA,n=x.formatRG,s=x.formatR,a=x.supportLinearFiltering?y.LINEAR:y.NEAREST;y.disable(y.BLEND),B=B?et(B,e.width,e.height,i.internalFormat,i.format,r,a):tt(e.width,e.height,i.internalFormat,i.format,r,a),N=N?et(N,t.width,t.height,n.internalFormat,n.format,r,a):tt(t.width,t.height,n.internalFormat,n.format,r,a),U=J(t.width,t.height,s.internalFormat,s.format,r,y.NEAREST),I=J(t.width,t.height,s.internalFormat,s.format,r,y.NEAREST),X=tt(t.width,t.height,s.internalFormat,s.format,r,y.NEAREST)}function J(t,e,r,i,n,s){y.activeTexture(y.TEXTURE0);let a=y.createTexture();y.bindTexture(y.TEXTURE_2D,a),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,s),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,s),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),y.texImage2D(y.TEXTURE_2D,0,r,t,e,0,i,n,null);let o=y.createFramebuffer();return y.bindFramebuffer(y.FRAMEBUFFER,o),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,a,0),y.viewport(0,0,t,e),y.clear(y.COLOR_BUFFER_BIT),{texture:a,fbo:o,width:t,height:e,texelSizeX:1/t,texelSizeY:1/e,attach:t=>(y.activeTexture(y.TEXTURE0+t),y.bindTexture(y.TEXTURE_2D,a),t)}}function tt(t,e,r,i,n,s){let a=J(t,e,r,i,n,s),o=J(t,e,r,i,n,s);return{width:t,height:e,texelSizeX:a.texelSizeX,texelSizeY:a.texelSizeY,get read(){return a},set read(t){a=t},get write(){return o},set write(t){o=t},swap(){let t=a;a=o,o=t}}}function et(t,e,r,i,n,s,a){return t.width===e&&t.height===r||(t.read=function(t,e,r,i,n,s,a){let o=J(e,r,i,n,s,a);return Y.bind(),y.uniform1i(Y.uniforms.uTexture,t.attach(0)),z(o),o}(t.read,e,r,i,n,s,a),t.write=J(e,r,i,n,s,a),t.width=e,t.height=r,t.texelSizeX=1/e,t.texelSizeY=1/r),t}!function(){let t=[];v.SHADING&&t.push("SHADING"),Q.setKeywords(t)}(),K();let rt=Date.now(),it=0;function nt(){const t=function(){let t=Date.now(),e=(t-rt)/1e3;return e=Math.min(e,.016666),rt=t,e}();(function(){let t=ct(r.clientWidth),e=ct(r.clientHeight);return(r.width!==t||r.height!==e)&&(r.width=t,r.height=e,!0)})()&&K(),function(t){it+=t*v.COLOR_UPDATE_SPEED,it>=1&&(it=(it-0)%1+0,_.forEach((t=>{t.color=lt()})))}(t),_.forEach((t=>{t.moved&&(t.moved=!1,function(t){let e=t.deltaX*v.SPLAT_FORCE,r=t.deltaY*v.SPLAT_FORCE;st(t.texcoordX,t.texcoordY,e,r,t.color)}(t))})),function(t){y.disable(y.BLEND),$.bind(),y.uniform2f($.uniforms.texelSize,N.texelSizeX,N.texelSizeY),y.uniform1i($.uniforms.uVelocity,N.read.attach(0)),z(I),H.bind(),y.uniform2f(H.uniforms.texelSize,N.texelSizeX,N.texelSizeY),y.uniform1i(H.uniforms.uVelocity,N.read.attach(0)),y.uniform1i(H.uniforms.uCurl,I.attach(1)),y.uniform1f(H.uniforms.curl,v.CURL),y.uniform1f(H.uniforms.dt,t),z(N.write),N.swap(),W.bind(),y.uniform2f(W.uniforms.texelSize,N.texelSizeX,N.texelSizeY),y.uniform1i(W.uniforms.uVelocity,N.read.attach(0)),z(U),V.bind(),y.uniform1i(V.uniforms.uTexture,X.read.attach(0)),y.uniform1f(V.uniforms.value,v.PRESSURE),z(X.write),X.swap(),j.bind(),y.uniform2f(j.uniforms.texelSize,N.texelSizeX,N.texelSizeY),y.uniform1i(j.uniforms.uDivergence,U.attach(0));for(let t=0;t<v.PRESSURE_ITERATIONS;t++)y.uniform1i(j.uniforms.uPressure,X.read.attach(1)),z(X.write),X.swap();Z.bind(),y.uniform2f(Z.uniforms.texelSize,N.texelSizeX,N.texelSizeY),y.uniform1i(Z.uniforms.uPressure,X.read.attach(0)),y.uniform1i(Z.uniforms.uVelocity,N.read.attach(1)),z(N.write),N.swap(),q.bind(),y.uniform2f(q.uniforms.texelSize,N.texelSizeX,N.texelSizeY),x.supportLinearFiltering||y.uniform2f(q.uniforms.dyeTexelSize,N.texelSizeX,N.texelSizeY);let e=N.read.attach(0);y.uniform1i(q.uniforms.uVelocity,e),y.uniform1i(q.uniforms.uSource,e),y.uniform1f(q.uniforms.dt,t),y.uniform1f(q.uniforms.dissipation,v.VELOCITY_DISSIPATION),z(N.write),N.swap(),x.supportLinearFiltering||y.uniform2f(q.uniforms.dyeTexelSize,B.texelSizeX,B.texelSizeY),y.uniform1i(q.uniforms.uVelocity,N.read.attach(0)),y.uniform1i(q.uniforms.uSource,B.read.attach(1)),y.uniform1f(q.uniforms.dissipation,v.DENSITY_DISSIPATION),z(B.write),B.swap()}(t),y.blendFunc(y.ONE,y.ONE_MINUS_SRC_ALPHA),y.enable(y.BLEND),function(t){let e=y.drawingBufferWidth,r=y.drawingBufferHeight;Q.bind(),v.SHADING&&y.uniform2f(Q.uniforms.texelSize,1/e,1/r),y.uniform1i(Q.uniforms.uTexture,B.read.attach(0)),z(t)}(null),requestAnimationFrame(nt)}function st(t,e,i,n,s){G.bind(),y.uniform1i(G.uniforms.uTarget,N.read.attach(0)),y.uniform1f(G.uniforms.aspectRatio,r.width/r.height),y.uniform2f(G.uniforms.point,t,e),y.uniform3f(G.uniforms.color,i,n,0),y.uniform1f(G.uniforms.radius,function(t){let e=r.width/r.height;return e>1&&(t*=e),t}(v.SPLAT_RADIUS/100)),z(N.write),N.swap(),y.uniform1i(G.uniforms.uTarget,B.read.attach(0)),y.uniform3f(G.uniforms.color,s.r,s.g,s.b),z(B.write),B.swap()}function at(t,e,i,n){t.id=e,t.down=!0,t.moved=!1,t.texcoordX=i/r.width,t.texcoordY=1-n/r.height,t.prevTexcoordX=t.texcoordX,t.prevTexcoordY=t.texcoordY,t.deltaX=0,t.deltaY=0,t.color=lt()}function ot(t,e,i,n){t.prevTexcoordX=t.texcoordX,t.prevTexcoordY=t.texcoordY,t.texcoordX=e/r.width,t.texcoordY=1-i/r.height,t.deltaX=function(t){let e=r.width/r.height;return e<1&&(t*=e),t}(t.texcoordX-t.prevTexcoordX),t.deltaY=function(t){let e=r.width/r.height;return e>1&&(t/=e),t}(t.texcoordY-t.prevTexcoordY),t.moved=Math.abs(t.deltaX)>0||Math.abs(t.deltaY)>0,t.color=n}function ut(t){t.down=!1}function lt(){let t=function(t){let e,r,i,n,s,a,o,u;switch(n=Math.floor(6*t),s=6*t-n,a=0,o=1*(1-1*s),u=1*(1-1*(1-s)),n%6){case 0:e=1,r=u,i=0;break;case 1:e=o,r=1,i=0;break;case 2:e=0,r=1,i=u;break;case 3:e=0,r=o,i=1;break;case 4:e=u,r=0,i=1;break;case 5:e=1,r=0,i=o}return{r:e,g:r,b:i}}(Math.random());return t.r*=.15,t.g*=.15,t.b*=.15,t}function ht(t){let e=y.drawingBufferWidth/y.drawingBufferHeight;e<1&&(e=1/e);const r=Math.round(t),i=Math.round(t*e);return y.drawingBufferWidth>y.drawingBufferHeight?{width:i,height:r}:{width:r,height:i}}function ct(t){const e=window.devicePixelRatio||1;return Math.floor(t*e)}function ft(t){if(0===t.length)return 0;let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return e}m.addEventListener("mousedown",(t=>{let e=_[0];at(e,-1,ct(t.clientX),ct(t.clientY)),function(t){const e=lt();e.r*=10,e.g*=10,e.b*=10;let r=10*(Math.random()-.5),i=30*(Math.random()-.5);st(t.texcoordX,t.texcoordY,r,i,e)}(e)})),document.body.addEventListener("mousemove",(function t(e){let r=_[0],i=ct(e.clientX),n=ct(e.clientY),s=lt();nt(),ot(r,i,n,s),document.body.removeEventListener("mousemove",t)})),m.addEventListener("mousemove",(t=>{let e=_[0];ot(e,ct(t.clientX),ct(t.clientY),e.color)})),document.body.addEventListener("touchstart",(function t(e){const r=e.targetTouches;let i=_[0];for(let t=0;t<r.length;t++){let e=ct(r[t].clientX),n=ct(r[t].clientY);nt(),at(i,r[t].identifier,e,n)}document.body.removeEventListener("touchstart",t)})),m.addEventListener("touchstart",(t=>{const e=t.targetTouches;let r=_[0];for(let t=0;t<e.length;t++){let i=ct(e[t].clientX),n=ct(e[t].clientY);at(r,e[t].identifier,i,n)}})),m.addEventListener("touchmove",(t=>{const e=t.targetTouches;let r=_[0];for(let t=0;t<e.length;t++)ot(r,ct(e[t].clientX),ct(e[t].clientY),r.color)}),!1),m.addEventListener("touchend",(t=>{const e=t.changedTouches;let r=_[0];for(let t=0;t<e.length;t++)ut(r)})),nt()}),[t,e,i,n,s,a,o,u,l,h,c,f,d,p]),(0,r.createElement)("div",{style:{position:"fixed",top:0,left:0,zIndex:50,pointerEvents:"none",width:"100%",height:"100%"}},(0,r.createElement)("canvas",{ref:g,id:"fluid",style:{width:"100vw",height:"100vh",display:"block"}}))},Mn=({shape:t={},domEl:e=null,eventEl:i=window,rect:n={},isDashboard:a=!1})=>{switch(t?.type){case"follow":return(0,r.createElement)(fn,{shape:t.type,...t?.follow,domEl:e});case"blob":return(0,r.createElement)(on,{...t.blob,domEl:e,eventEl:i,rect:n,isDashboard:a});case"dot":return(0,r.createElement)(ln,{...t.dot,domEl:e});case"elastic":return(0,r.createElement)(cn,{...t.elastic,domEl:e});case"digital":case"analog":case"cyberpunk":case"matrix":return(0,r.createElement)(dn,{...function(t,e){return{...s[t],...e?.[t]}}(t.type,t),key:t.type,domEl:e});case"glow":return(0,r.createElement)(pn,{...t?.glow,domEl:e});case"gradient":return(0,r.createElement)(mn,{...t?.gradient,domEl:e});case"image":return(0,r.createElement)(gn,{...t?.image,url:t?.image?.img?.url,domEl:e});case"magnetic":return(0,r.createElement)(vn,{...t?.magnetic,domEl:e});case"neon":return(0,r.createElement)(_n,{...t?.neon,domEl:e});case"pixelated":return(0,r.createElement)(yn,{...t?.pixelated,domEl:e});case"ring":return(0,r.createElement)(xn,{...t?.ring,domEl:e});case"ripple":return(0,r.createElement)(En,{domEl:e,eventEl:i});case"sketch":return(0,r.createElement)(wn,{...t?.sketch,domEl:e});case"spotlight":return(0,r.createElement)(Tn,{...t?.spotlight,domEl:e});case"splash":return(0,r.createElement)(An,{SPLAT_RADIUS:t?.splash?.size,key:t?.splash?.size,domEl:e});case"text":return(0,r.createElement)(Rn,{...t?.text,domEl:e});default:return null}};function Sn(t){let e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function Cn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function kn(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Fn(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Dn(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function On(t){let e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i}function Ln(t,e){let r=e[0],i=e[1],n=e[2],s=r*r+i*i+n*n;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function Pn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function zn(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[0],o=r[1],u=r[2];return t[0]=n*u-s*o,t[1]=s*a-i*u,t[2]=i*o-n*a,t}const Bn=function(){const t=[0,0,0],e=[0,0,0];return function(r,i){Cn(t,r),Cn(e,i),Ln(t,t),Ln(e,e);let n=Pn(t,e);return n>1?0:n<-1?Math.PI:Math.acos(n)}}();class Nn extends Array{constructor(t=0,e=t,r=t){return super(t,e,r),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,e=t,r=t){return t.length?this.copy(t):(function(t,e,r,i){t[0]=e,t[1]=r,t[2]=i}(this,t,e,r),this)}copy(t){return Cn(this,t),this}add(t,e){return e?kn(this,t,e):kn(this,this,t),this}sub(t,e){return e?Fn(this,t,e):Fn(this,this,t),this}multiply(t){var e,r,i;return t.length?(r=this,i=t,(e=this)[0]=r[0]*i[0],e[1]=r[1]*i[1],e[2]=r[2]*i[2]):Dn(this,this,t),this}divide(t){var e,r,i;return t.length?(r=this,i=t,(e=this)[0]=r[0]/i[0],e[1]=r[1]/i[1],e[2]=r[2]/i[2]):Dn(this,this,1/t),this}inverse(t=this){var e,r;return r=t,(e=this)[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],this}len(){return Sn(this)}distance(t){return t?function(t,e){let r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+i*i+n*n)}(this,t):Sn(this)}squaredLen(){return On(this)}squaredDistance(t){return t?function(t,e){let r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n}(this,t):On(this)}negate(t=this){var e,r;return r=t,(e=this)[0]=-r[0],e[1]=-r[1],e[2]=-r[2],this}cross(t,e){return e?zn(this,t,e):zn(this,this,t),this}scale(t){return Dn(this,this,t),this}normalize(){return Ln(this,this),this}dot(t){return Pn(this,t)}equals(t){return e=t,this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2];var e}applyMatrix3(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2];t[0]=i*r[0]+n*r[3]+s*r[6],t[1]=i*r[1]+n*r[4]+s*r[7],t[2]=i*r[2]+n*r[5]+s*r[8]}(this,this,t),this}applyMatrix4(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[3]*i+r[7]*n+r[11]*s+r[15];a=a||1,t[0]=(r[0]*i+r[4]*n+r[8]*s+r[12])/a,t[1]=(r[1]*i+r[5]*n+r[9]*s+r[13])/a,t[2]=(r[2]*i+r[6]*n+r[10]*s+r[14])/a}(this,this,t),this}scaleRotateMatrix4(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[3]*i+r[7]*n+r[11]*s+r[15];a=a||1,t[0]=(r[0]*i+r[4]*n+r[8]*s)/a,t[1]=(r[1]*i+r[5]*n+r[9]*s)/a,t[2]=(r[2]*i+r[6]*n+r[10]*s)/a}(this,this,t),this}applyQuaternion(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[0],o=r[1],u=r[2],l=o*s-u*n,h=u*i-a*s,c=a*n-o*i,f=o*c-u*h,d=u*l-a*c,p=a*h-o*l,m=2*r[3];l*=m,h*=m,c*=m,f*=2,d*=2,p*=2,t[0]=i+l+f,t[1]=n+h+d,t[2]=s+c+p}(this,this,t),this}angle(t){return Bn(this,t)}lerp(t,e){return function(t,e,r,i){let n=e[0],s=e[1],a=e[2];t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s),t[2]=a+i*(r[2]-a)}(this,this,t,e),this}smoothLerp(t,e,r){return function(t,e,r,i,n){const s=Math.exp(-i*n);let a=e[0],o=e[1],u=e[2];t[0]=r[0]+(a-r[0])*s,t[1]=r[1]+(o-r[1])*s,t[2]=r[2]+(u-r[2])*s}(this,this,t,e,r),this}clone(){return new Nn(this[0],this[1],this[2])}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}transformDirection(t){const e=this[0],r=this[1],i=this[2];return this[0]=t[0]*e+t[4]*r+t[8]*i,this[1]=t[1]*e+t[5]*r+t[9]*i,this[2]=t[2]*e+t[6]*r+t[10]*i,this.normalize()}}const Un=new Nn;let In=1;class Xn{constructor({canvas:t=document.createElement("canvas"),width:e=300,height:r=150,dpr:i=1,alpha:n=!1,depth:s=!0,stencil:a=!1,antialias:o=!1,premultipliedAlpha:u=!1,preserveDrawingBuffer:l=!1,powerPreference:h="default",autoClear:c=!0,webgl:f=2}={}){const d={alpha:n,depth:s,stencil:a,antialias:o,premultipliedAlpha:u,preserveDrawingBuffer:l,powerPreference:h};this.dpr=i,this.alpha=n,this.color=!0,this.depth=s,this.stencil=a,this.premultipliedAlpha=u,this.autoClear=c,this.id=In++,2===f&&(this.gl=t.getContext("webgl2",d)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",d)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(e,r),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,e){this.width=t,this.height=e,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=e*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:t+"px",height:e+"px"})}setViewport(t,e,r=0,i=0){this.state.viewport.width===t&&this.state.viewport.height===e||(this.state.viewport.width=t,this.state.viewport.height=e,this.state.viewport.x=r,this.state.viewport.y=i,this.gl.viewport(r,i,t,e))}setScissor(t,e,r=0,i=0){this.gl.scissor(r,i,t,e)}enable(t){!0!==this.state[t]&&(this.gl.enable(t),this.state[t]=!0)}disable(t){!1!==this.state[t]&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,e,r,i){this.state.blendFunc.src===t&&this.state.blendFunc.dst===e&&this.state.blendFunc.srcAlpha===r&&this.state.blendFunc.dstAlpha===i||(this.state.blendFunc.src=t,this.state.blendFunc.dst=e,this.state.blendFunc.srcAlpha=r,this.state.blendFunc.dstAlpha=i,void 0!==r?this.gl.blendFuncSeparate(t,e,r,i):this.gl.blendFunc(t,e))}setBlendEquation(t,e){t=t||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===e||(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=e,void 0!==e?this.gl.blendEquationSeparate(t,e):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}setStencilMask(t){this.state.stencilMask!==t&&(this.state.stencilMask=t,this.gl.stencilMask(t))}setStencilFunc(t,e,r){this.state.stencilFunc===t&&this.state.stencilRef===e&&this.state.stencilFuncMask===r||(this.state.stencilFunc=t||this.gl.ALWAYS,this.state.stencilRef=e||0,this.state.stencilFuncMask=r||0,this.gl.stencilFunc(t||this.gl.ALWAYS,e||0,r||0))}setStencilOp(t,e,r){this.state.stencilFail===t&&this.state.stencilDepthFail===e&&this.state.stencilDepthPass===r||(this.state.stencilFail=t,this.state.stencilDepthFail=e,this.state.stencilDepthPass=r,this.gl.stencilOp(t,e,r))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:e=null}={}){this.state.framebuffer!==e&&(this.state.framebuffer=e,this.gl.bindFramebuffer(t,e))}getExtension(t,e,r){return e&&this.gl[e]?this.gl[e].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),e?this.extensions[t]?this.extensions[t][r].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:t.zDepth!==e.zDepth?t.zDepth-e.zDepth:e.id-t.id}sortTransparent(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.zDepth!==e.zDepth?e.zDepth-t.zDepth:e.id-t.id}sortUI(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:e.id-t.id}getRenderList({scene:t,camera:e,frustumCull:r,sort:i}){let n=[];if(e&&r&&e.updateFrustum(),t.traverse((t=>{if(!t.visible)return!0;t.draw&&(r&&t.frustumCulled&&e&&!e.frustumIntersectsMesh(t)||n.push(t))})),i){const t=[],r=[],i=[];n.forEach((n=>{n.program.transparent?n.program.depthTest?r.push(n):i.push(n):t.push(n),n.zDepth=0,0===n.renderOrder&&n.program.depthTest&&e&&(n.worldMatrix.getTranslation(Un),Un.applyMatrix4(e.projectionViewMatrix),n.zDepth=Un.z)})),t.sort(this.sortOpaque),r.sort(this.sortTransparent),i.sort(this.sortUI),n=t.concat(r,i)}return n}render({scene:t,camera:e,target:r=null,update:i=!0,sort:n=!0,frustumCull:s=!0,clear:a}){null===r?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(r),this.setViewport(r.width,r.height)),(a||this.autoClear&&!1!==a)&&(!this.depth||r&&!r.depth||(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!r||r.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),i&&t.updateMatrixWorld(),e&&e.updateMatrixWorld(),this.getRenderList({scene:t,camera:e,frustumCull:s,sort:n}).forEach((t=>{t.draw({camera:e})}))}}function Yn(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=r[0],u=r[1],l=r[2],h=r[3];return t[0]=i*h+a*o+n*l-s*u,t[1]=n*h+a*u+s*o-i*l,t[2]=s*h+a*l+i*u-n*o,t[3]=a*h-i*o-n*u-s*l,t}class Vn extends Array{constructor(t=0,e=0,r=0,i=1){super(t,e,r,i),this.onChange=()=>{},this._target=this;const n=["0","1","2","3"];return new Proxy(this,{set(t,e){const r=Reflect.set(...arguments);return r&&n.includes(e)&&t.onChange(),r}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set w(t){this._target[3]=t,this.onChange()}identity(){var t;return(t=this._target)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.onChange(),this}set(t,e,r,i){return t.length?this.copy(t):(function(t,e,r,i,n){t[0]=e,t[1]=r,t[2]=i,t[3]=n}(this._target,t,e,r,i),this.onChange(),this)}rotateX(t){return function(t,e,r){r*=.5;let i=e[0],n=e[1],s=e[2],a=e[3],o=Math.sin(r),u=Math.cos(r);t[0]=i*u+a*o,t[1]=n*u+s*o,t[2]=s*u-n*o,t[3]=a*u-i*o}(this._target,this._target,t),this.onChange(),this}rotateY(t){return function(t,e,r){r*=.5;let i=e[0],n=e[1],s=e[2],a=e[3],o=Math.sin(r),u=Math.cos(r);t[0]=i*u-s*o,t[1]=n*u+a*o,t[2]=s*u+i*o,t[3]=a*u-n*o}(this._target,this._target,t),this.onChange(),this}rotateZ(t){return function(t,e,r){r*=.5;let i=e[0],n=e[1],s=e[2],a=e[3],o=Math.sin(r),u=Math.cos(r);t[0]=i*u+n*o,t[1]=n*u-i*o,t[2]=s*u+a*o,t[3]=a*u-s*o}(this._target,this._target,t),this.onChange(),this}inverse(t=this._target){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r*r+i*i+n*n+s*s,o=a?1/a:0;t[0]=-r*o,t[1]=-i*o,t[2]=-n*o,t[3]=s*o}(this._target,t),this.onChange(),this}conjugate(t=this._target){var e,r;return r=t,(e=this._target)[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],this.onChange(),this}copy(t){return e=this._target,r=t,e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],this.onChange(),this;var e,r}normalize(t=this._target){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r*r+i*i+n*n+s*s;a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=i*a,t[2]=n*a,t[3]=s*a}(this._target,t),this.onChange(),this}multiply(t,e){return e?Yn(this._target,t,e):Yn(this._target,this._target,t),this.onChange(),this}dot(t){return e=this._target,r=t,e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3];var e,r}fromMatrix3(t){return function(t,e){let r,i=e[0]+e[4]+e[8];if(i>0)r=Math.sqrt(i+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);let n=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*n+n]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*n+s]-e[3*s+n])*r,t[n]=(e[3*n+i]+e[3*i+n])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}}(this._target,t),this.onChange(),this}fromEuler(t,e){return function(t,e,r="YXZ"){let i=Math.sin(.5*e[0]),n=Math.cos(.5*e[0]),s=Math.sin(.5*e[1]),a=Math.cos(.5*e[1]),o=Math.sin(.5*e[2]),u=Math.cos(.5*e[2]);"XYZ"===r?(t[0]=i*a*u+n*s*o,t[1]=n*s*u-i*a*o,t[2]=n*a*o+i*s*u,t[3]=n*a*u-i*s*o):"YXZ"===r?(t[0]=i*a*u+n*s*o,t[1]=n*s*u-i*a*o,t[2]=n*a*o-i*s*u,t[3]=n*a*u+i*s*o):"ZXY"===r?(t[0]=i*a*u-n*s*o,t[1]=n*s*u+i*a*o,t[2]=n*a*o+i*s*u,t[3]=n*a*u-i*s*o):"ZYX"===r?(t[0]=i*a*u-n*s*o,t[1]=n*s*u+i*a*o,t[2]=n*a*o-i*s*u,t[3]=n*a*u+i*s*o):"YZX"===r?(t[0]=i*a*u+n*s*o,t[1]=n*s*u+i*a*o,t[2]=n*a*o-i*s*u,t[3]=n*a*u-i*s*o):"XZY"===r&&(t[0]=i*a*u-n*s*o,t[1]=n*s*u-i*a*o,t[2]=n*a*o+i*s*u,t[3]=n*a*u+i*s*o)}(this._target,t,t.order),e||this.onChange(),this}fromAxisAngle(t,e){return function(t,e,r){r*=.5;let i=Math.sin(r);t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r)}(this._target,t,e),this.onChange(),this}slerp(t,e){return function(t,e,r,i){let n,s,a,o,u,l=e[0],h=e[1],c=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];s=l*d+h*p+c*m+f*g,s<0&&(s=-s,d=-d,p=-p,m=-m,g=-g),1-s>1e-6?(n=Math.acos(s),a=Math.sin(n),o=Math.sin((1-i)*n)/a,u=Math.sin(i*n)/a):(o=1-i,u=i),t[0]=o*l+u*d,t[1]=o*h+u*p,t[2]=o*c+u*m,t[3]=o*f+u*g}(this._target,this._target,t,e),this.onChange(),this}fromArray(t,e=0){return this._target[0]=t[e],this._target[1]=t[e+1],this._target[2]=t[e+2],this._target[3]=t[e+3],this.onChange(),this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}}function Gn(t){let e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],a=t[5],o=t[6],u=t[7],l=t[8],h=t[9],c=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*a-r*s)*(c*g-f*m)-(e*o-i*s)*(h*g-f*p)+(e*u-n*s)*(h*m-c*p)+(r*o-i*a)*(l*g-f*d)-(r*u-n*a)*(l*m-c*d)+(i*u-n*o)*(l*p-h*d)}function qn(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],_=e[15],y=r[0],x=r[1],b=r[2],E=r[3];return t[0]=y*i+x*o+b*c+E*m,t[1]=y*n+x*u+b*f+E*g,t[2]=y*s+x*l+b*d+E*v,t[3]=y*a+x*h+b*p+E*_,y=r[4],x=r[5],b=r[6],E=r[7],t[4]=y*i+x*o+b*c+E*m,t[5]=y*n+x*u+b*f+E*g,t[6]=y*s+x*l+b*d+E*v,t[7]=y*a+x*h+b*p+E*_,y=r[8],x=r[9],b=r[10],E=r[11],t[8]=y*i+x*o+b*c+E*m,t[9]=y*n+x*u+b*f+E*g,t[10]=y*s+x*l+b*d+E*v,t[11]=y*a+x*h+b*p+E*_,y=r[12],x=r[13],b=r[14],E=r[15],t[12]=y*i+x*o+b*c+E*m,t[13]=y*n+x*u+b*f+E*g,t[14]=y*s+x*l+b*d+E*v,t[15]=y*a+x*h+b*p+E*_,t}function Wn(t,e){let r=e[0],i=e[1],n=e[2],s=e[4],a=e[5],o=e[6],u=e[8],l=e[9],h=e[10];return t[0]=Math.hypot(r,i,n),t[1]=Math.hypot(s,a,o),t[2]=Math.hypot(u,l,h),t}const $n=function(){const t=[1,1,1];return function(e,r){let i=t;Wn(i,r);let n=1/i[0],s=1/i[1],a=1/i[2],o=r[0]*n,u=r[1]*s,l=r[2]*a,h=r[4]*n,c=r[5]*s,f=r[6]*a,d=r[8]*n,p=r[9]*s,m=r[10]*a,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),e[3]=.25*v,e[0]=(f-p)/v,e[1]=(d-l)/v,e[2]=(u-h)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),e[3]=(f-p)/v,e[0]=.25*v,e[1]=(u+h)/v,e[2]=(d+l)/v):c>m?(v=2*Math.sqrt(1+c-o-m),e[3]=(d-l)/v,e[0]=(u+h)/v,e[1]=.25*v,e[2]=(f+p)/v):(v=2*Math.sqrt(1+m-o-c),e[3]=(u-h)/v,e[0]=(d+l)/v,e[1]=(f+p)/v,e[2]=.25*v),e}}();function Hn(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function jn(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}class Zn extends Array{constructor(t=1,e=0,r=0,i=0,n=0,s=1,a=0,o=0,u=0,l=0,h=1,c=0,f=0,d=0,p=0,m=1){return super(t,e,r,i,n,s,a,o,u,l,h,c,f,d,p,m),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,e,r,i,n,s,a,o,u,l,h,c,f,d,p,m){return t.length?this.copy(t):(function(t,e,r,i,n,s,a,o,u,l,h,c,f,d,p,m,g){t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=l,t[9]=h,t[10]=c,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g}(this,t,e,r,i,n,s,a,o,u,l,h,c,f,d,p,m),this)}translate(t,e=this){return function(t,e,r){let i,n,s,a,o,u,l,h,c,f,d,p,m=r[0],g=r[1],v=r[2];e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],f=e[9],d=e[10],p=e[11],t[0]=i,t[1]=n,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=l,t[7]=h,t[8]=c,t[9]=f,t[10]=d,t[11]=p,t[12]=i*m+o*g+c*v+e[12],t[13]=n*m+u*g+f*v+e[13],t[14]=s*m+l*g+d*v+e[14],t[15]=a*m+h*g+p*v+e[15])}(this,e,t),this}rotate(t,e,r=this){return function(t,e,r,i){let n,s,a,o,u,l,h,c,f,d,p,m,g,v,_,y,x,b,E,w,T,R,A,M,S=i[0],C=i[1],k=i[2],F=Math.hypot(S,C,k);Math.abs(F)<1e-6||(F=1/F,S*=F,C*=F,k*=F,n=Math.sin(r),s=Math.cos(r),a=1-s,o=e[0],u=e[1],l=e[2],h=e[3],c=e[4],f=e[5],d=e[6],p=e[7],m=e[8],g=e[9],v=e[10],_=e[11],y=S*S*a+s,x=C*S*a+k*n,b=k*S*a-C*n,E=S*C*a-k*n,w=C*C*a+s,T=k*C*a+S*n,R=S*k*a+C*n,A=C*k*a-S*n,M=k*k*a+s,t[0]=o*y+c*x+m*b,t[1]=u*y+f*x+g*b,t[2]=l*y+d*x+v*b,t[3]=h*y+p*x+_*b,t[4]=o*E+c*w+m*T,t[5]=u*E+f*w+g*T,t[6]=l*E+d*w+v*T,t[7]=h*E+p*w+_*T,t[8]=o*R+c*A+m*M,t[9]=u*R+f*A+g*M,t[10]=l*R+d*A+v*M,t[11]=h*R+p*A+_*M,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,r,t,e),this}scale(t,e=this){return function(t,e,r){let i=r[0],n=r[1],s=r[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(this,e,"number"==typeof t?[t,t,t]:t),this}add(t,e){return e?Hn(this,t,e):Hn(this,this,t),this}sub(t,e){return e?jn(this,t,e):jn(this,this,t),this}multiply(t,e){var r,i,n;return t.length?e?qn(this,t,e):qn(this,this,t):(i=this,n=t,(r=this)[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=i[3]*n,r[4]=i[4]*n,r[5]=i[5]*n,r[6]=i[6]*n,r[7]=i[7]*n,r[8]=i[8]*n,r[9]=i[9]*n,r[10]=i[10]*n,r[11]=i[11]*n,r[12]=i[12]*n,r[13]=i[13]*n,r[14]=i[14]*n,r[15]=i[15]*n),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}copy(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this}fromPerspective({fov:t,aspect:e,near:r,far:i}={}){return function(t,e,r,i,n){let s=1/Math.tan(e/2),a=1/(i-n);t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+i)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*i*a,t[15]=0}(this,t,e,r,i),this}fromOrthogonal({left:t,right:e,bottom:r,top:i,near:n,far:s}){return function(t,e,r,i,n,s,a){let o=1/(e-r),u=1/(i-n),l=1/(s-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*o,t[13]=(n+i)*u,t[14]=(a+s)*l,t[15]=1}(this,t,e,r,i,n,s),this}fromQuaternion(t){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r+r,o=i+i,u=n+n,l=r*a,h=i*a,c=i*o,f=n*a,d=n*o,p=n*u,m=s*a,g=s*o,v=s*u;t[0]=1-c-p,t[1]=h+v,t[2]=f-g,t[3]=0,t[4]=h-v,t[5]=1-l-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-l-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7],h=e[8],c=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],_=r*o-i*a,y=r*u-n*a,x=r*l-s*a,b=i*u-n*o,E=i*l-s*o,w=n*l-s*u,T=h*m-c*p,R=h*g-f*p,A=h*v-d*p,M=c*g-f*m,S=c*v-d*m,C=f*v-d*g,k=_*C-y*S+x*M+b*A-E*R+w*T;k&&(k=1/k,t[0]=(o*C-u*S+l*M)*k,t[1]=(n*S-i*C-s*M)*k,t[2]=(m*w-g*E+v*b)*k,t[3]=(f*E-c*w-d*b)*k,t[4]=(u*A-a*C-l*R)*k,t[5]=(r*C-n*A+s*R)*k,t[6]=(g*x-p*w-v*y)*k,t[7]=(h*w-f*x+d*y)*k,t[8]=(a*S-o*A+l*T)*k,t[9]=(i*A-r*S-s*T)*k,t[10]=(p*E-m*x+v*_)*k,t[11]=(c*x-h*E-d*_)*k,t[12]=(o*R-a*M-u*T)*k,t[13]=(r*M-i*R+n*T)*k,t[14]=(m*y-p*b-g*_)*k,t[15]=(h*b-c*y+f*_)*k)}(this,t),this}compose(t,e,r){return function(t,e,r,i){const n=t,s=e[0],a=e[1],o=e[2],u=e[3],l=s+s,h=a+a,c=o+o,f=s*l,d=s*h,p=s*c,m=a*h,g=a*c,v=o*c,_=u*l,y=u*h,x=u*c,b=i[0],E=i[1],w=i[2];n[0]=(1-(m+v))*b,n[1]=(d+x)*b,n[2]=(p-y)*b,n[3]=0,n[4]=(d-x)*E,n[5]=(1-(f+v))*E,n[6]=(g+_)*E,n[7]=0,n[8]=(p+y)*w,n[9]=(g-_)*w,n[10]=(1-(f+m))*w,n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1}(this,t,e,r),this}decompose(t,e,r){return function(t,e,r,i){let n=Sn([t[0],t[1],t[2]]);const s=Sn([t[4],t[5],t[6]]),a=Sn([t[8],t[9],t[10]]);Gn(t)<0&&(n=-n),r[0]=t[12],r[1]=t[13],r[2]=t[14];const o=t.slice(),u=1/n,l=1/s,h=1/a;o[0]*=u,o[1]*=u,o[2]*=u,o[4]*=l,o[5]*=l,o[6]*=l,o[8]*=h,o[9]*=h,o[10]*=h,$n(e,o),i[0]=n,i[1]=s,i[2]=a}(this,t,e,r),this}getRotation(t){return $n(t,this),this}getTranslation(t){var e,r;return r=this,(e=t)[0]=r[12],e[1]=r[13],e[2]=r[14],this}getScaling(t){return Wn(t,this),this}getMaxScaleOnAxis(){return function(t){let e=t[0],r=t[1],i=t[2],n=t[4],s=t[5],a=t[6],o=t[8],u=t[9],l=t[10];const h=e*e+r*r+i*i,c=n*n+s*s+a*a,f=o*o+u*u+l*l;return Math.sqrt(Math.max(h,c,f))}(this)}lookAt(t,e,r){return function(t,e,r,i){let n=e[0],s=e[1],a=e[2],o=i[0],u=i[1],l=i[2],h=n-r[0],c=s-r[1],f=a-r[2],d=h*h+c*c+f*f;0===d?f=1:(d=1/Math.sqrt(d),h*=d,c*=d,f*=d);let p=u*f-l*c,m=l*h-o*f,g=o*c-u*h;d=p*p+m*m+g*g,0===d&&(l?o+=1e-6:u?l+=1e-6:u+=1e-6,p=u*f-l*c,m=l*h-o*f,g=o*c-u*h,d=p*p+m*m+g*g),d=1/Math.sqrt(d),p*=d,m*=d,g*=d,t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=c*g-f*m,t[5]=f*p-h*g,t[6]=h*m-c*p,t[7]=0,t[8]=h,t[9]=c,t[10]=f,t[11]=0,t[12]=n,t[13]=s,t[14]=a,t[15]=1}(this,t,e,r),this}determinant(){return Gn(this)}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this[4]=t[e+4],this[5]=t[e+5],this[6]=t[e+6],this[7]=t[e+7],this[8]=t[e+8],this[9]=t[e+9],this[10]=t[e+10],this[11]=t[e+11],this[12]=t[e+12],this[13]=t[e+13],this[14]=t[e+14],this[15]=t[e+15],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t[e+4]=this[4],t[e+5]=this[5],t[e+6]=this[6],t[e+7]=this[7],t[e+8]=this[8],t[e+9]=this[9],t[e+10]=this[10],t[e+11]=this[11],t[e+12]=this[12],t[e+13]=this[13],t[e+14]=this[14],t[e+15]=this[15],t}}const Qn=new Zn;class Kn extends Array{constructor(t=0,e=t,r=t,i="YXZ"){super(t,e,r),this.order=i,this.onChange=()=>{},this._target=this;const n=["0","1","2"];return new Proxy(this,{set(t,e){const r=Reflect.set(...arguments);return r&&n.includes(e)&&t.onChange(),r}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set(t,e=t,r=t){return t.length?this.copy(t):(this._target[0]=t,this._target[1]=e,this._target[2]=r,this.onChange(),this)}copy(t){return this._target[0]=t[0],this._target[1]=t[1],this._target[2]=t[2],this.onChange(),this}reorder(t){return this._target.order=t,this.onChange(),this}fromRotationMatrix(t,e=this.order){return function(t,e,r="YXZ"){"XYZ"===r?(t[1]=Math.asin(Math.min(Math.max(e[8],-1),1)),Math.abs(e[8])<.99999?(t[0]=Math.atan2(-e[9],e[10]),t[2]=Math.atan2(-e[4],e[0])):(t[0]=Math.atan2(e[6],e[5]),t[2]=0)):"YXZ"===r?(t[0]=Math.asin(-Math.min(Math.max(e[9],-1),1)),Math.abs(e[9])<.99999?(t[1]=Math.atan2(e[8],e[10]),t[2]=Math.atan2(e[1],e[5])):(t[1]=Math.atan2(-e[2],e[0]),t[2]=0)):"ZXY"===r?(t[0]=Math.asin(Math.min(Math.max(e[6],-1),1)),Math.abs(e[6])<.99999?(t[1]=Math.atan2(-e[2],e[10]),t[2]=Math.atan2(-e[4],e[5])):(t[1]=0,t[2]=Math.atan2(e[1],e[0]))):"ZYX"===r?(t[1]=Math.asin(-Math.min(Math.max(e[2],-1),1)),Math.abs(e[2])<.99999?(t[0]=Math.atan2(e[6],e[10]),t[2]=Math.atan2(e[1],e[0])):(t[0]=0,t[2]=Math.atan2(-e[4],e[5]))):"YZX"===r?(t[2]=Math.asin(Math.min(Math.max(e[1],-1),1)),Math.abs(e[1])<.99999?(t[0]=Math.atan2(-e[9],e[5]),t[1]=Math.atan2(-e[2],e[0])):(t[0]=0,t[1]=Math.atan2(e[8],e[10]))):"XZY"===r&&(t[2]=Math.asin(-Math.min(Math.max(e[4],-1),1)),Math.abs(e[4])<.99999?(t[0]=Math.atan2(e[6],e[5]),t[1]=Math.atan2(e[8],e[0])):(t[0]=Math.atan2(-e[9],e[10]),t[1]=0))}(this._target,t,e),this.onChange(),this}fromQuaternion(t,e=this.order,r){return Qn.fromQuaternion(t),this._target.fromRotationMatrix(Qn,e),r||this.onChange(),this}fromArray(t,e=0){return this._target[0]=t[e],this._target[1]=t[e+1],this._target[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}}class Jn{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new Zn,this.worldMatrix=new Zn,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new Nn,this.quaternion=new Vn,this.scale=new Nn(1),this.rotation=new Kn,this.up=new Nn(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(t,e=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,e&&t&&t.addChild(this,!1)}addChild(t,e=!0){~this.children.indexOf(t)||this.children.push(t),e&&t.setParent(this,!1)}removeChild(t,e=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),e&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(null===this.parent?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let e=0,r=this.children.length;e<r;e++)this.children[e].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let e=0,r=this.children.length;e<r;e++)this.children[e].traverse(t)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,e=!1){e?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}const ts=new Nn;let es=1,rs=1,is=!1;class ns{constructor(t,e={}){t.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=t,this.attributes=e,this.id=es++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let t in e)this.addAttribute(t,e[t])}addAttribute(t,e){if(this.attributes[t]=e,e.id=rs++,e.size=e.size||1,e.type=e.type||(e.data.constructor===Float32Array?this.gl.FLOAT:e.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),e.target="index"===t?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,e.normalized=e.normalized||!1,e.stride=e.stride||0,e.offset=e.offset||0,e.count=e.count||(e.stride?e.data.byteLength/e.stride:e.data.length/e.size),e.divisor=e.instanced||0,e.needsUpdate=!1,e.usage=e.usage||this.gl.STATIC_DRAW,e.buffer||this.updateAttribute(e),e.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==e.count*e.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,e.count*e.divisor);this.instancedCount=e.count*e.divisor}else"index"===t?this.drawRange.count=e.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,e.count))}updateAttribute(t){const e=!t.buffer;e&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),e?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach(((t,{name:e,type:r})=>{if(!this.attributes[e])return void console.warn(`active attribute ${e} not being supplied`);const i=this.attributes[e];this.gl.bindBuffer(i.target,i.buffer),this.glState.boundBuffer=i.buffer;let n=1;35674===r&&(n=2),35675===r&&(n=3),35676===r&&(n=4);const s=i.size/n,a=1===n?0:n*n*4,o=1===n?0:4*n;for(let e=0;e<n;e++)this.gl.vertexAttribPointer(t+e,s,i.type,i.normalized,i.stride+a,i.offset+e*o),this.gl.enableVertexAttribArray(t+e),this.gl.renderer.vertexAttribDivisor(t+e,i.divisor)})),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:e=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach(((t,{name:e})=>{const r=this.attributes[e];r.needsUpdate&&this.updateAttribute(r)}));let r=2;this.attributes.index?.type===this.gl.UNSIGNED_INT&&(r=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*r,this.instancedCount):this.gl.renderer.drawArraysInstanced(e,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*r):this.gl.drawArrays(e,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;return t.data?t:is?void 0:(console.warn("No position buffer data found to compute bounds"),is=!0)}computeBoundingBox(t){t||(t=this.getPosition());const e=t.data,r=t.size;this.bounds||(this.bounds={min:new Nn,max:new Nn,center:new Nn,scale:new Nn,radius:1/0});const i=this.bounds.min,n=this.bounds.max,s=this.bounds.center,a=this.bounds.scale;i.set(1/0),n.set(-1/0);for(let t=0,s=e.length;t<s;t+=r){const r=e[t],s=e[t+1],a=e[t+2];i.x=Math.min(r,i.x),i.y=Math.min(s,i.y),i.z=Math.min(a,i.z),n.x=Math.max(r,n.x),n.y=Math.max(s,n.y),n.z=Math.max(a,n.z)}a.sub(n,i),s.add(i,n).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const e=t.data,r=t.size;this.bounds||this.computeBoundingBox(t);let i=0;for(let t=0,n=e.length;t<n;t+=r)ts.fromArray(e,t),i=Math.max(i,this.bounds.center.squaredDistance(ts));this.bounds.radius=Math.sqrt(i)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let ss=1;const as={};class os{constructor(t,{vertex:e,fragment:r,uniforms:i={},transparent:n=!1,cullFace:s=t.BACK,frontFace:a=t.CCW,depthTest:o=!0,depthWrite:u=!0,depthFunc:l=t.LEQUAL}={}){t.canvas||console.error("gl not passed as first argument to Program"),this.gl=t,this.uniforms=i,this.id=ss++,e||console.warn("vertex shader not supplied"),r||console.warn("fragment shader not supplied"),this.transparent=n,this.cullFace=s,this.frontFace=a,this.depthTest=o,this.depthWrite=u,this.depthFunc=l,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=t.createShader(t.VERTEX_SHADER),this.fragmentShader=t.createShader(t.FRAGMENT_SHADER),this.program=t.createProgram(),t.attachShader(this.program,this.vertexShader),t.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:e,fragment:r})}setShaders({vertex:t,fragment:e}){if(t&&(this.gl.shaderSource(this.vertexShader,t),this.gl.compileShader(this.vertexShader),""!==this.gl.getShaderInfoLog(this.vertexShader)&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}\nVertex Shader\n${ls(t)}`)),e&&(this.gl.shaderSource(this.fragmentShader,e),this.gl.compileShader(this.fragmentShader),""!==this.gl.getShaderInfoLog(this.fragmentShader)&&console.warn(`${this.gl.getShaderInfoLog(this.fragmentShader)}\nFragment Shader\n${ls(e)}`)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return console.warn(this.gl.getProgramInfoLog(this.program));this.uniformLocations=new Map;let r=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let t=0;t<r;t++){let e=this.gl.getActiveUniform(this.program,t);this.uniformLocations.set(e,this.gl.getUniformLocation(this.program,e.name));const r=e.name.match(/(\w+)/g);e.uniformName=r[0],e.nameComponents=r.slice(1)}this.attributeLocations=new Map;const i=[],n=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let t=0;t<n;t++){const e=this.gl.getActiveAttrib(this.program,t),r=this.gl.getAttribLocation(this.program,e.name);-1!==r&&(i[r]=e.name,this.attributeLocations.set(e,r))}this.attributeOrder=i.join("")}setBlendFunc(t,e,r,i){this.blendFunc.src=t,this.blendFunc.dst=e,this.blendFunc.srcAlpha=r,this.blendFunc.dstAlpha=i,t&&(this.transparent=!0)}setBlendEquation(t,e){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=e}setStencilFunc(t,e,r){this.stencilRef=e,this.stencilFunc.func=t,this.stencilFunc.ref=e,this.stencilFunc.mask=r}setStencilOp(t,e,r){this.stencilOp.stencilFail=t,this.stencilOp.depthFail=e,this.stencilOp.depthPass=r}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:t=!1}={}){let e=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach(((t,r)=>{let i=this.uniforms[r.uniformName];for(const t of r.nameComponents){if(!i)break;if(!(t in i)){if(Array.isArray(i.value))break;i=void 0;break}i=i[t]}if(!i)return cs(`Active uniform ${r.name} has not been supplied`);if(i&&void 0===i.value)return cs(`${r.name} uniform is missing a value parameter`);if(i.value.texture)return e+=1,i.value.update(e),us(this.gl,r.type,t,e);if(i.value.length&&i.value[0].texture){const n=[];return i.value.forEach((t=>{e+=1,t.update(e),n.push(e)})),us(this.gl,r.type,t,n)}us(this.gl,r.type,t,i.value)})),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function us(t,e,r,i){i=i.length?function(t){const e=t.length,r=t[0].length;if(void 0===r)return t;const i=e*r;let n=as[i];n||(as[i]=n=new Float32Array(i));for(let i=0;i<e;i++)n.set(t[i],i*r);return n}(i):i;const n=t.renderer.state.uniformLocations.get(r);if(i.length)if(void 0===n||n.length!==i.length)t.renderer.state.uniformLocations.set(r,i.slice(0));else{if(function(t,e){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r<i;r++)if(t[r]!==e[r])return!1;return!0}(n,i))return;n.set?n.set(i):function(t,e){for(let r=0,i=t.length;r<i;r++)t[r]=e[r]}(n,i),t.renderer.state.uniformLocations.set(r,n)}else{if(n===i)return;t.renderer.state.uniformLocations.set(r,i)}switch(e){case 5126:return i.length?t.uniform1fv(r,i):t.uniform1f(r,i);case 35664:return t.uniform2fv(r,i);case 35665:return t.uniform3fv(r,i);case 35666:return t.uniform4fv(r,i);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return i.length?t.uniform1iv(r,i):t.uniform1i(r,i);case 35671:case 35667:return t.uniform2iv(r,i);case 35672:case 35668:return t.uniform3iv(r,i);case 35673:case 35669:return t.uniform4iv(r,i);case 35674:return t.uniformMatrix2fv(r,!1,i);case 35675:return t.uniformMatrix3fv(r,!1,i);case 35676:return t.uniformMatrix4fv(r,!1,i)}}function ls(t){let e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}let hs=0;function cs(t){hs>100||(console.warn(t),hs++,hs>100&&console.warn("More than 100 program warnings - stopping logs."))}function fs(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],_=r[6],y=r[7],x=r[8];return t[0]=f*i+d*a+p*l,t[1]=f*n+d*o+p*h,t[2]=f*s+d*u+p*c,t[3]=m*i+g*a+v*l,t[4]=m*n+g*o+v*h,t[5]=m*s+g*u+v*c,t[6]=_*i+y*a+x*l,t[7]=_*n+y*o+x*h,t[8]=_*s+y*u+x*c,t}class ds extends Array{constructor(t=1,e=0,r=0,i=0,n=1,s=0,a=0,o=0,u=1){return super(t,e,r,i,n,s,a,o,u),this}set(t,e,r,i,n,s,a,o,u){return t.length?this.copy(t):(function(t,e,r,i,n,s,a,o,u,l){t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=l}(this,t,e,r,i,n,s,a,o,u),this)}translate(t,e=this){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],f=r[0],d=r[1];t[0]=i,t[1]=n,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=f*i+d*a+l,t[7]=f*n+d*o+h,t[8]=f*s+d*u+c}(this,e,t),this}rotate(t,e=this){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],f=Math.sin(r),d=Math.cos(r);t[0]=d*i+f*a,t[1]=d*n+f*o,t[2]=d*s+f*u,t[3]=d*a-f*i,t[4]=d*o-f*n,t[5]=d*u-f*s,t[6]=l,t[7]=h,t[8]=c}(this,e,t),this}scale(t,e=this){return function(t,e,r){let i=r[0],n=r[1];t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}(this,e,t),this}multiply(t,e){return e?fs(this,t,e):fs(this,this,t),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this}copy(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}fromMatrix4(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],this}fromQuaternion(t){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r+r,o=i+i,u=n+n,l=r*a,h=i*a,c=i*o,f=n*a,d=n*o,p=n*u,m=s*a,g=s*o,v=s*u;t[0]=1-c-p,t[3]=h-v,t[6]=f+g,t[1]=h+v,t[4]=1-l-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-l-c}(this,t),this}fromBasis(t,e,r){return this.set(t[0],t[1],t[2],e[0],e[1],e[2],r[0],r[1],r[2]),this}inverse(t=this){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7],h=e[8],c=h*a-o*l,f=-h*s+o*u,d=l*s-a*u,p=r*c+i*f+n*d;p&&(p=1/p,t[0]=c*p,t[1]=(-h*i+n*l)*p,t[2]=(o*i-n*a)*p,t[3]=f*p,t[4]=(h*r-n*u)*p,t[5]=(-o*r+n*s)*p,t[6]=d*p,t[7]=(-l*r+i*u)*p,t[8]=(a*r-i*s)*p)}(this,t),this}getNormalMatrix(t){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7],h=e[8],c=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],_=r*o-i*a,y=r*u-n*a,x=r*l-s*a,b=i*u-n*o,E=i*l-s*o,w=n*l-s*u,T=h*m-c*p,R=h*g-f*p,A=h*v-d*p,M=c*g-f*m,S=c*v-d*m,C=f*v-d*g,k=_*C-y*S+x*M+b*A-E*R+w*T;k&&(k=1/k,t[0]=(o*C-u*S+l*M)*k,t[1]=(u*A-a*C-l*R)*k,t[2]=(a*S-o*A+l*T)*k,t[3]=(n*S-i*C-s*M)*k,t[4]=(r*C-n*A+s*R)*k,t[5]=(i*A-r*S-s*T)*k,t[6]=(m*w-g*E+v*b)*k,t[7]=(g*x-p*w-v*y)*k,t[8]=(p*E-m*x+v*_)*k)}(this,t),this}}let ps=0;class ms extends Jn{constructor(t,{geometry:e,program:r,mode:i=t.TRIANGLES,frustumCulled:n=!0,renderOrder:s=0}={}){super(),t.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=t,this.id=ps++,this.geometry=e,this.program=r,this.mode=i,this.frustumCulled=n,this.renderOrder=s,this.modelViewMatrix=new Zn,this.normalMatrix=new ds,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t})));let e=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:e}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t})))}}function gs(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function vs(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function _s(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function ys(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)}function xs(t,e){return t[0]*e[1]-t[1]*e[0]}class bs extends Array{constructor(t=0,e=t){return super(t,e),this}get x(){return this[0]}get y(){return this[1]}set x(t){this[0]=t}set y(t){this[1]=t}set(t,e=t){return t.length?this.copy(t):(function(t,e,r){t[0]=e,t[1]=r}(this,t,e),this)}copy(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],this}add(t,e){return e?gs(this,t,e):gs(this,this,t),this}sub(t,e){return e?vs(this,t,e):vs(this,this,t),this}multiply(t){var e,r;return t.length?(r=t,(e=this)[0]=this[0]*r[0],e[1]=this[1]*r[1]):_s(this,this,t),this}divide(t){var e,r;return t.length?(r=t,(e=this)[0]=this[0]/r[0],e[1]=this[1]/r[1]):_s(this,this,1/t),this}inverse(t=this){var e,r;return r=t,(e=this)[0]=1/r[0],e[1]=1/r[1],this}len(){return ys(this)}distance(t){return t?(r=(e=t)[0]-this[0],i=e[1]-this[1],Math.sqrt(r*r+i*i)):ys(this);var e,r,i}squaredLen(){return this.squaredDistance()}squaredDistance(t){return t?(r=(e=t)[0]-this[0])*r+(i=e[1]-this[1])*i:function(t){var e=t[0],r=t[1];return e*e+r*r}(this);var e,r,i}negate(t=this){var e,r;return r=t,(e=this)[0]=-r[0],e[1]=-r[1],this}cross(t,e){return e?xs(t,e):xs(this,t)}scale(t){return _s(this,this,t),this}normalize(){var t,e,r,i;return(i=(e=(t=this)[0])*e+(r=t[1])*r)>0&&(i=1/Math.sqrt(i)),this[0]=t[0]*i,this[1]=t[1]*i,this}dot(t){return e=t,this[0]*e[0]+this[1]*e[1];var e}equals(t){return e=t,this[0]===e[0]&&this[1]===e[1];var e}applyMatrix3(t){var e,r,i;return e=t,r=this[0],i=this[1],this[0]=e[0]*r+e[3]*i+e[6],this[1]=e[1]*r+e[4]*i+e[7],this}applyMatrix4(t){return function(t,e,r){let i=e[0],n=e[1];t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13]}(this,this,t),this}lerp(t,e){return function(t,e,r,i){var n=e[0],s=e[1];t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s)}(this,this,t,e),this}smoothLerp(t,e,r){return function(t,e,r,i,n){const s=Math.exp(-i*n);let a=e[0],o=e[1];t[0]=r[0]+(a-r[0])*s,t[1]=r[1]+(o-r[1])*s}(this,this,t,e,r),this}clone(){return new bs(this[0],this[1])}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t}}const Es={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#00ff00",blue:"#0000ff",fuchsia:"#ff00ff",cyan:"#00ffff",yellow:"#ffff00",orange:"#ff8000"};function ws(t){4===t.length&&(t=t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e||console.warn(`Unable to convert hex string ${t} to rgb values`),[parseInt(e[1],16)/255,parseInt(e[2],16)/255,parseInt(e[3],16)/255]}function Ts(t){return void 0===t?[0,0,0]:3===arguments.length?arguments:isNaN(t)?"#"===t[0]?ws(t):Es[t.toLowerCase()]?ws(Es[t.toLowerCase()]):(console.warn("Color format not recognised"),[0,0,0]):(e=t,[((e=parseInt(e))>>16&255)/255,(e>>8&255)/255,(255&e)/255]);var e}class Rs extends Array{constructor(t){return Array.isArray(t)?super(...t):super(...Ts(...arguments))}get r(){return this[0]}get g(){return this[1]}get b(){return this[2]}set r(t){this[0]=t}set g(t){this[1]=t}set b(t){this[2]=t}set(t){return Array.isArray(t)?this.copy(t):this.copy(Ts(...arguments))}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this}}const As=new Nn;class Ms{constructor(t,{points:e,vertex:r=Ss,fragment:i=Cs,uniforms:n={},attributes:s={}}){this.gl=t,this.points=e,this.count=e.length,this.position=new Float32Array(3*this.count*2),this.prev=new Float32Array(3*this.count*2),this.next=new Float32Array(3*this.count*2);const a=new Float32Array(1*this.count*2),o=new Float32Array(2*this.count*2),u=new Uint16Array(3*(this.count-1)*2);for(let t=0;t<this.count;t++){a.set([-1,1],2*t);const e=t/(this.count-1);if(o.set([0,e,1,e],4*t),t===this.count-1)continue;const r=2*t;u.set([r+0,r+1,r+2],3*(r+0)),u.set([r+2,r+1,r+3],3*(r+1))}const l=this.geometry=new ns(t,Object.assign(s,{position:{size:3,data:this.position},prev:{size:3,data:this.prev},next:{size:3,data:this.next},side:{size:1,data:a},uv:{size:2,data:o},index:{size:1,data:u}}));this.updateGeometry(),n.uResolution||(this.resolution=n.uResolution={value:new bs}),n.uDPR||(this.dpr=n.uDPR={value:1}),n.uThickness||(this.thickness=n.uThickness={value:1}),n.uColor||(this.color=n.uColor={value:new Rs("#000")}),n.uMiter||(this.miter=n.uMiter={value:1}),this.resize();const h=this.program=new os(t,{vertex:r,fragment:i,uniforms:n});this.mesh=new ms(t,{geometry:l,program:h})}updateGeometry(){this.points.forEach(((t,e)=>{t.toArray(this.position,3*e*2),t.toArray(this.position,3*e*2+3),e?(t.toArray(this.next,3*(e-1)*2),t.toArray(this.next,3*(e-1)*2+3)):(As.copy(t).sub(this.points[e+1]).add(t),As.toArray(this.prev,3*e*2),As.toArray(this.prev,3*e*2+3)),e===this.points.length-1?(As.copy(t).sub(this.points[e-1]).add(t),As.toArray(this.next,3*e*2),As.toArray(this.next,3*e*2+3)):(t.toArray(this.prev,3*(e+1)*2),t.toArray(this.prev,3*(e+1)*2+3))})),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.prev.needsUpdate=!0,this.geometry.attributes.next.needsUpdate=!0}resize(){this.resolution&&this.resolution.value.set(this.gl.canvas.width,this.gl.canvas.height),this.dpr&&(this.dpr.value=this.gl.renderer.dpr)}}const Ss="\n precision highp float;\n\n attribute vec3 position;\n attribute vec3 next;\n attribute vec3 prev;\n attribute vec2 uv;\n attribute float side;\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n uniform vec2 uResolution;\n uniform float uDPR;\n uniform float uThickness;\n uniform float uMiter;\n\n varying vec2 vUv;\n\n vec4 getPosition() {\n mat4 mvp = projectionMatrix * modelViewMatrix;\n vec4 current = mvp * vec4(position, 1);\n vec4 nextPos = mvp * vec4(next, 1);\n vec4 prevPos = mvp * vec4(prev, 1);\n\n vec2 aspect = vec2(uResolution.x / uResolution.y, 1); \n vec2 currentScreen = current.xy / current.w * aspect;\n vec2 nextScreen = nextPos.xy / nextPos.w * aspect;\n vec2 prevScreen = prevPos.xy / prevPos.w * aspect;\n \n vec2 dir1 = normalize(currentScreen - prevScreen);\n vec2 dir2 = normalize(nextScreen - currentScreen);\n vec2 dir = normalize(dir1 + dir2);\n \n vec2 normal = vec2(-dir.y, dir.x);\n normal /= mix(1.0, max(0.3, dot(normal, vec2(-dir1.y, dir1.x))), uMiter);\n normal /= aspect;\n\n float pixelWidthRatio = 1.0 / (uResolution.y / uDPR);\n float pixelWidth = current.w * pixelWidthRatio;\n normal *= pixelWidth * uThickness;\n current.xy -= normal * side;\n \n return current;\n }\n\n void main() {\n vUv = uv;\n gl_Position = getPosition();\n }\n",Cs="\n precision highp float;\n\n uniform vec3 uColor;\n \n varying vec2 vUv;\n\n void main() {\n gl_FragColor.rgb = uColor;\n gl_FragColor.a = 1.0;\n }\n",ks=({colors:t=["#FC8EAC"],baseSpring:e=.03,baseFriction:i=.9,baseThickness:n=30,offsetFactor:s=.05,maxAge:a=500,pointCount:o=50,speedMultiplier:u=.6,enableFade:l=!1,enableShaderEffect:h=!1,effectAmplitude:c=2,backgroundColor:f=[0,0,0,0],domEl:d=document.body,eventEl:p=window,rect:m={width:window.innerWidth,height:window.innerHeight}})=>((0,r.useEffect)((()=>{const r=new Xn({dpr:window.devicePixelRatio||2,alpha:!0}),g=r.gl;Array.isArray(f)&&4===f.length?g.clearColor(f[0],f[1],f[2],f[3]):g.clearColor(0,0,0,0),g.canvas.style.position="absolute",g.canvas.style.top="0",g.canvas.style.left="0",g.canvas.style.width="100%",g.canvas.style.height="100%",g.canvas.style.pointerEvents="none",g.canvas.style.zIndex=9999,g.canvas.className="b-blocks-cursor-ribbon",d.contains(g.canvas)||d.appendChild(g.canvas);const v=new Jn,_=[];function y(){const t=window.devicePixelRatio||1;let e,i;e=m.width,i=m.height,g.canvas.width=e*t,g.canvas.height=i*t,r.setSize(e,i),_.forEach((t=>{t.polyline&&t.polyline.mesh&&t.polyline.mesh.program&&t.polyline.mesh.program.uniforms.uResolution&&(t.polyline.mesh.program.uniforms.uResolution.value=[e,i]),t.polyline.resize()}))}const x=new Nn;function b(t){let e,r;t.changedTouches&&t.changedTouches.length?(e=t.changedTouches[0].clientX,r=t.changedTouches[0].clientY):(e=t.clientX,r=t.clientY);let i,n,s=0,a=0;i=m.width,n=m.height,m.top&&(a=m.top,r-=a),m.left&&(s=m.left,e-=s),x.set(e/i*2-1,r/n*-2+1,0)}p.addEventListener("mousemove",b),p.addEventListener("touchstart",b),p.addEventListener("touchmove",b),window.addEventListener("resize",y);const E=(t.length-1)/2;let w,T;w=m.width,T=m.height,t.forEach(((t,r)=>{const a=e+.05*(Math.random()-.5),u=i+.05*(Math.random()-.5),f=n+3*(Math.random()-.5),d=new Nn((r-E)*s+.01*(Math.random()-.5),.1*(Math.random()-.5),0),p={spring:a,friction:u,mouseVelocity:new Nn,mouseOffset:d},m=o,y=[];for(let t=0;t<m;t++)y.push(new Nn);p.points=y,p.polyline=new Ms(g,{points:y,vertex:"\n precision highp float;\n attribute vec3 position;\n attribute vec3 next;\n attribute vec3 prev;\n attribute vec2 uv;\n attribute float side;\n uniform vec2 uResolution;\n uniform float uDPR;\n uniform float uThickness;\n uniform float uTime;\n uniform float uEnableShaderEffect;\n uniform float uEffectAmplitude;\n varying vec2 vUV;\n vec4 getPosition() {\n vec4 current = vec4(position, 1.0);\n vec2 aspect = vec2(uResolution.x / uResolution.y, 1.0);\n vec2 nextScreen = next.xy * aspect;\n vec2 prevScreen = prev.xy * aspect;\n vec2 tangent = normalize(nextScreen - prevScreen);\n vec2 normal = vec2(-tangent.y, tangent.x);\n normal /= aspect;\n normal *= mix(1.0, 0.1, pow(abs(uv.y - 0.5) * 2.0, 2.0));\n float dist = length(nextScreen - prevScreen);\n normal *= smoothstep(0.0, 0.02, dist);\n float pixelWidthRatio = 1.0 / (uResolution.y / uDPR);\n float pixelWidth = current.w * pixelWidthRatio;\n normal *= pixelWidth * uThickness;\n current.xy -= normal * side;\n if(uEnableShaderEffect > 0.5) {\n current.xy += normal * sin(uTime + current.x * 10.0) * uEffectAmplitude;\n }\n return current;\n }\n void main() {\n vUV = uv;\n gl_Position = getPosition();\n }\n ",fragment:"\n precision highp float;\n uniform vec3 uColor;\n uniform float uOpacity;\n uniform float uEnableFade;\n varying vec2 vUV;\n void main() {\n float fadeFactor = 1.0;\n if(uEnableFade > 0.5) {\n fadeFactor = 1.0 - smoothstep(0.0, 1.0, vUV.y);\n }\n gl_FragColor = vec4(uColor, uOpacity * fadeFactor);\n }\n ",uniforms:{uColor:{value:new Rs(t)},uThickness:{value:f},uOpacity:{value:1},uTime:{value:0},uEnableShaderEffect:{value:h?1:0},uEffectAmplitude:{value:c},uEnableFade:{value:l?1:0},uResolution:{value:[w,T]},uDPR:{value:window.devicePixelRatio||1}}}),p.polyline.mesh.setParent(v),_.push(p)})),y();const R=new Nn;let A,M=performance.now();return function t(){A=requestAnimationFrame(t);const e=performance.now(),i=e-M;M=e,_.forEach((t=>{R.copy(x).add(t.mouseOffset).sub(t.points[0]).multiply(t.spring),t.mouseVelocity.add(R).multiply(t.friction),t.points[0].add(t.mouseVelocity);for(let e=1;e<t.points.length;e++)if(isFinite(a)&&a>0){const r=a/(t.points.length-1),n=Math.min(1,i*u/r);t.points[e].lerp(t.points[e-1],n)}else t.points[e].lerp(t.points[e-1],.9);t.polyline.mesh.program.uniforms.uTime&&(t.polyline.mesh.program.uniforms.uTime.value=.001*e),t.polyline.updateGeometry()})),r.render({scene:v})}(),()=>{p.removeEventListener("mousemove",b),p.removeEventListener("touchstart",b),p.removeEventListener("touchmove",b),window.removeEventListener("resize",y),cancelAnimationFrame(A),g.canvas&&g.canvas.parentNode===d&&d.removeChild(g.canvas)}}),[t,e,i,n,s,a,o,u,l,h,c,f,d]),null),Fs=({cursorInfo:t})=>{const{data:e,isLoading:i}=((t,e={},i=!1)=>{const[n,s]=(0,r.useState)(!1),[a,o]=(0,r.useState)(!1),[u,l]=(0,r.useState)(null),[h,c]=(0,r.useState)(null);if(!wp.ajax)return void console.error("Please use wp-util as a dependency");const f=(r={})=>{s(!0),o(!1),l(null),wp.ajax.post(t,{...e,...r}).done((t=>{s(!1),c(t)})).fail((t=>{s(!1),o(!0),l(t)}))},d=async(t={})=>{f(t)};return(0,r.useEffect)((()=>{i||f(e)}),[]),{data:h,saveData:d,refetch:d,isLoading:n,isError:a,error:u}})("bBlocks_get_cursor_data_settings",{nonce:window.bBlocksCursorDataConfig?.nonce}),[n,s]=(0,r.useState)(null),o=((t=2e3)=>{const[e,i]=(0,r.useState)(!1),n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{document.hasFocus()&&i(!0);const e=()=>{clearTimeout(n.current),i(!0)},r=()=>{n.current=setTimeout((()=>i(!1)),t)};return document.body.addEventListener("mouseenter",e),document.body.addEventListener("mouseleave",r),()=>{document.body.removeEventListener("mouseenter",e),document.body.removeEventListener("mouseleave",r),clearTimeout(n.current)}}),[t]),e})(),[u,l]=(0,r.useState)(t);(0,r.useEffect)((()=>{document.addEventListener("bBlocksCursorCustomEventOnCursor",(function(t){l(t.detail.data)}))}),[]);const h=((t,e)=>{const[i,n]=(0,r.useState)(null);return(0,r.useEffect)((()=>{if(t||e){if(!t)return void n(e);if(!e)return void n(t);const r={...e,...t,shape:""!==t?.shape?.type&&t?.shape?t?.shape:e?.shape,effect:""!==t?.effect?.type&&t?.effect?t?.effect:e?.effect};n(r)}}),[t,e]),i})(u,n),{enableCursor:c=!0}=h||{};(0,r.useEffect)((()=>{!i&&e&&s(e)}),[e,i]);const f={...a(h?.shape?.customImg?.img)&&"predefined"==h?.source&&{cursor:`url(${h?.shape?.customImg?.img}), pointer`},..."shape"==h?.source&&{cursor:c?"auto":"none"},..."customUrl"==h?.source&&{cursor:`url(${h?.shape?.customImg?.url}), pointer`}};return(0,r.useEffect)((()=>{window.self===window.top&&f?.cursor&&(document.body.style.cursor=f.cursor)}),[h]),(0,r.createElement)(r.Fragment,null,"shape"==h?.source&&(0,r.createElement)(r.Fragment,null,"ribbon"===h?.shape?.type&&o&&(0,r.createElement)(ks,{...h?.shape?.ribbon,domEl:document.body,eventEl:document.body,rect:document.body.getBoundingClientRect(),key:h?.shape?.type}),h?.shape?.type&&"ribbon"!==h?.shape?.type&&o?(0,r.createElement)(Mn,{shape:h?.shape,domEl:window,eventEl:window,rect:{},key:h?.shape?.type}):null),h?.effect?.type&&(0,r.createElement)(p,{effect:h?.effect,key:h?.effect?.type}))};document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById("bBlocksCursorData");if(t){const e=JSON.parse(t.dataset.cursor);(0,i.H)(t).render((0,r.createElement)(Fs,{cursorInfo:e})),t.removeAttribute("data-cursor")}else if(window.self===window.top){const t=document.createElement("div");document.body.appendChild(t),(0,i.H)(t).render((0,r.createElement)(Fs,null))}}))})(); | |
| 1 | +(()=>{"use strict";const t=window.React,e=window.ReactDOM,r=(e=document)=>{const[r,i]=(0,t.useState)({x:-400,y:-400,isTop:!1,isBottom:!1,isLeft:!1,isRight:!1});return(0,t.useEffect)((()=>{if(!e)return;const t=t=>{const e=document.body,{clientX:r,clientY:n,screenX:s,screenY:a}=t,{width:o,height:u}=e.getBoundingClientRect();i({x:r,y:n,screenX:s,screenY:a,isTop:n<u/2,isBottom:n>u/2,isLeft:r<o/2,isRight:r>o/2})};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[e]),r},i={digital:{glitchMode:"digital",intensity:"high",speed:"fast",blendMode:"multiply",size:20,primaryColor:"#ff4040",secondaryColor:"#40ff40",tertiaryColor:"#4040ff"},analog:{glitchMode:"analog",intensity:"medium",speed:"slow",blendMode:"normal",size:35,primaryColor:"#ffffff",secondaryColor:"#ff4444",tertiaryColor:"#4444ff"},cyberpunk:{glitchMode:"cyberpunk",intensity:"medium",speed:"medium",size:30,primaryColor:"#ff0080",secondaryColor:"#00ffff",tertiaryColor:"#ff0000"},matrix:{glitchMode:"matrix",intensity:"high",speed:"fast",size:25,primaryColor:"#00ff00",secondaryColor:"#40ff40",tertiaryColor:"#80ff80"}},n=t=>null!=t&&""!==t,s=window.ReactJSXRuntime,a=({type:t,...e})=>{const{duration:r,size:i,background:a,secondaryBgColor:o,borderColor:u,secondaryBorderColor:l,tertiaryBorderColor:h,borderWidth:c}=e,d={rippleCircle:{...n(i)&&{"--b-blocks-effect-ripple-size":i+"px"},...n(a)&&{"--b-blocks-effect-ripple-background":a},...n(u)&&{"--b-blocks-effect-ripple-border-color":u},...n(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...n(r)&&{"--b-blocks-effect-ripple-duration":r+"s"}},rippleDouble:{fast:{...n(i)&&{"--b-blocks-effect-ripple-size":i+"px"},...n(a)&&{"--b-blocks-effect-ripple-background":a},...n(u)&&{"--b-blocks-effect-ripple-border-color":u},...n(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...n(r)&&{"--b-blocks-effect-ripple-duration":r+"s"}},slow:{...n(i)&&{"--b-blocks-effect-ripple-size":i+"px"},...n(o)&&{"--b-blocks-effect-ripple-background":o},...n(l)&&{"--b-blocks-effect-ripple-border-color":l},...n(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...n(r)&&{"--b-blocks-effect-ripple-slow-duration":(1.41*r).toFixed(2)+"s"}}},rippleWave:{wave1:{...n(i)&&{"--b-blocks-effect-ripple-wave-size":i+"px"},...n(r)&&{"--b-blocks-effect-ripple-duration":r+"s"},...n(u)&&{"--b-blocks-effect-ripple-border-color":u},...n(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"}},wave2:{...n(i)&&{"--b-blocks-effect-ripple-wave-size":i+"px"},...n(r)&&{"--b-blocks-effect-ripple-duration":r+"s"},...n(l)&&{"--b-blocks-effect-ripple-border-color":l},...n(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"}},wave3:{...n(i)&&{"--b-blocks-effect-ripple-wave-size":i+"px"},...n(r)&&{"--b-blocks-effect-ripple-duration":r+"s"},...n(h)&&{"--b-blocks-effect-ripple-border-color":h},...n(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"}}},ripplePulse:{...n(i)&&{"--b-blocks-effect-ripple-size":i+"px"},...n(a)&&{"--b-blocks-effect-ripple-background":a},...n(r)&&{"--b-blocks-effect-ripple-duration":r+"s"},...n(c)&&{"--b-blocks-effect-ripple-border-width":c+"px"},...n(u)&&{"--b-blocks-effect-ripple-border-color":u}}};switch(t){case"rippleCircle":return(0,s.jsx)("div",{style:d.rippleCircle,className:"b-blocks-ripple-circle"});case"rippleDouble":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:d.rippleDouble.fast,className:"b-blocks-ripple-circle b-blocks-ripple-fast"}),(0,s.jsx)("div",{style:d.rippleDouble.slow,className:"b-blocks-ripple-circle b-blocks-ripple-slow"})]});case"rippleWave":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:d.rippleWave.wave1,className:"b-blocks-ripple-wave b-blocks-wave-1"}),(0,s.jsx)("div",{style:d.rippleWave.wave2,className:"b-blocks-ripple-wave b-blocks-wave-2"}),(0,s.jsx)("div",{style:d.rippleWave.wave3,className:"b-blocks-ripple-wave b-blocks-wave-3"})]});case"tsunami":return(0,s.jsx)(s.Fragment,{children:[...Array(4)].map(((t,e)=>(0,s.jsx)("div",{className:"b-blocks-ripple",style:{animationDelay:.25*e+"s"}},e)))});case"ripplePulse":return(0,s.jsx)("div",{style:d.ripplePulse,className:"b-blocks-ripple-pulse"})}},o=({color:e="#f00",size:i=12,sparkRadius:n=15,sparkCount:a=8,duration:o=400,easing:u="ease-out",extraScale:l=1,domEl:h=document})=>{const c=(0,t.useRef)(null),d=(0,t.useRef)([]),f=(0,t.useRef)(null),p=r(h);(0,t.useEffect)((()=>{const t=c.current;if(!t)return;const e=()=>{t.width=window.innerWidth,t.height=window.innerHeight},r=()=>{e()};return window.addEventListener("resize",r),e(),()=>{window.removeEventListener("resize",r)}}),[]);const m=(0,t.useCallback)((t=>{switch(u){case"linear":return t;case"ease-in":return t*t;case"ease-in-out":return t<.5?2*t*t:(4-2*t)*t-1;default:return t*(2-t)}}),[u]);return(0,t.useEffect)((()=>{const t=c.current;if(!t)return;const r=t.getContext("2d");let s;const a=u=>{f.current||(f.current=u),r.clearRect(0,0,t.width,t.height),d.current=d.current.filter((t=>{const s=u-t.startTime;if(s>=o)return!1;const a=m(s/o),h=a*n*l,c=i*(1-a),d=t.x+h*Math.cos(t.angle),f=t.y+h*Math.sin(t.angle),p=t.x+(h+c)*Math.cos(t.angle),g=t.y+(h+c)*Math.sin(t.angle);return r.strokeStyle=e,r.lineWidth=2,r.beginPath(),r.moveTo(d,f),r.lineTo(p,g),r.stroke(),!0})),s=requestAnimationFrame(a)};return s=requestAnimationFrame(a),()=>{cancelAnimationFrame(s)}}),[e,i,n,a,o,m,l]),(0,t.useEffect)((()=>{if(!c.current||!p.x||!p.y)return;const t=performance.now(),e=Array.from({length:a},((e,r)=>({x:p.x,y:p.y,angle:2*Math.PI*r/a,startTime:t})));d.current.push(...e)}),[p,a]),(0,s.jsx)("canvas",{ref:c,style:{width:"100vw",height:"100vh",position:"fixed",top:0,left:0,pointerEvents:"none",zIndex:99999}})},u=({size:t=100,color:e="#ffb347",duration:r=1.5,delay:i=.05})=>{const a={...n(r)&&{"--b-blocks-explosion-transition-duration":r+"s"},...n(t)&&{"--b-blocks-explosion-size":t+"px"},...n(e)&&{"--b-blocks-explosion-color":e}};return(0,s.jsx)("div",{style:a,className:"spark-explosion-container",children:[...Array(15)].map(((t,e)=>(0,s.jsx)("div",{className:"explosion-particle",style:{transform:`rotate(${24*e}deg)`,animationDelay:e*i+"s"}},e)))})},l=({duration:t=1.2,size:e=80,color:r="#74ebd5"})=>{const i={...n(t)&&{"--b-blocks-radial-transition-duration":t+"s"},...n(e)&&{"--b-blocks-radial-size":e+"px"},...n(r)&&{"--b-blocks-radial-color":r}};return(0,s.jsx)("div",{style:i,className:"spark-radial-container",children:[...Array(12)].map(((t,e)=>(0,s.jsx)("div",{className:"radial-spark",style:{transform:`rotate(${30*e}deg)`}},e)))})},h=({duration:t=1,size:e=60,color:r="#ff9a8b"})=>{const i={...n(e)&&{"--b-blocks-starburst-size":e+"px"},...n(t)&&{"--b-blocks-starburst-transition-duration":t+"s"},...n(r)&&{"--b-blocks-starburst-color":r}};return(0,s.jsx)("div",{style:i,className:"spark-starburst-container",children:[...Array(8)].map(((t,e)=>(0,s.jsx)("div",{className:"starburst-line",style:{transform:`rotate(${45*e}deg)`}},e)))})},c=({effect:t})=>{switch(t?.type){case"starburst":return(0,s.jsx)(h,{...t?.starburst});case"radial":return(0,s.jsx)(l,{...t?.radial});case"explosion":return(0,s.jsx)(u,{...t?.explosion})}},d=({duration:t,easing:e="ease-out",size:r=40,color:i="#ff6b6b"})=>{const a={...n(t)&&{"--b-blocks-simple-transition-duration":t+"ms"},...n(e)&&{"--b-blocks-simple-timing-function":e},...n(r)&&{"--b-blocks-simple-size":r+"px"},...n(i)&&{"--b-blocks-simple-color":i}};return(0,s.jsx)("div",{style:a,className:"spark-simple-container",children:[...Array(6)].map(((t,e)=>(0,s.jsx)("div",{className:"spark-line",style:{transform:`rotate(${60*e}deg)`}},e)))})},f=({effect:e,domEl:i=document})=>{const n=(0,t.useRef)(null),u=r(i);return function(e,r,i="b-blocks-effect-wrapper"){(0,t.useEffect)((()=>{const t=e.current;t&&(t.classList.remove(i),t.offsetWidth,t.classList.add(i))}),[e.current,r])}(n,u,"b-blocks-effect-wrapper"),(0,s.jsxs)(s.Fragment,{children:["spark"!==e?.type&&(0,s.jsx)("div",{ref:n,style:{left:`${u.x}px`,top:`${u.y}px`,pointerEvents:"none"},children:(()=>{switch(e?.type){case"rippleCircle":case"rippleDouble": | |
| 2 | +case"rippleWave":case"ripplePulse":case"tsunami":return(0,t.createElement)(a,{type:e?.type,...e?.[e?.type],key:e?.type});case"sparkSimple":return(0,s.jsx)(d,{...e?.sparkSimple});case"starburst":case"radial":case"explosion":return(0,s.jsx)(c,{effect:e},e?.type);default:return null}})()}),"spark"===e?.type&&(0,s.jsx)(o,{...e?.spark,domEl:i})]})};function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var g,v,_,x,y,b,w,E,T,R,A,M,S,C,F,k,D,O={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},L={duration:.5,overwrite:!1,delay:0},P=1e8,z=1e-8,B=2*Math.PI,N=B/4,U=0,I=Math.sqrt,j=Math.cos,X=Math.sin,Y=function(t){return"string"==typeof t},V=function(t){return"function"==typeof t},G=function(t){return"number"==typeof t},q=function(t){return void 0===t},W=function(t){return"object"==typeof t},$=function(t){return!1!==t},H=function(){return"undefined"!=typeof window},Z=function(t){return V(t)||Y(t)},Q="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},K=Array.isArray,J=/(?:-?\.?\d|\.)+/gi,tt=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,et=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,rt=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,it=/[+-]=-?[.\d]+/,nt=/[^,'"\[\]\s]+/gi,st=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,at={},ot={},ut=function(t){return(ot=Bt(t,at))&&Br},lt=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},ht=function(t,e){return!e&&console.warn(t)},ct=function(t,e){return t&&(at[t]=e)&&ot&&(ot[t]=e)||at},dt=function(){return 0},ft={suppressEvents:!0,isStart:!0,kill:!1},pt={suppressEvents:!0,kill:!1},mt={suppressEvents:!0},gt={},vt=[],_t={},xt={},yt={},bt=30,wt=[],Et="",Tt=function(t){var e,r,i=t[0];if(W(i)||V(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=wt.length;r--&&!wt[r].targetTest(i););e=wt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Qe(t[r],e)))||t.splice(r,1);return t},Rt=function(t){return t._gsap||Tt(pe(t))[0]._gsap},At=function(t,e,r){return(r=t[e])&&V(r)?t[e]():q(r)&&t.getAttribute&&t.getAttribute(e)||r},Mt=function(t,e){return(t=t.split(",")).forEach(e)||t},St=function(t){return Math.round(1e5*t)/1e5||0},Ct=function(t){return Math.round(1e7*t)/1e7||0},Ft=function(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i},kt=function(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r},Dt=function(){var t,e,r=vt.length,i=vt.slice(0);for(_t={},vt.length=0,t=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)},Ot=function(t,e,r,i){vt.length&&!v&&Dt(),t.render(e,r,i||v&&e<0&&(t._initted||t._startAt)),vt.length&&!v&&Dt()},Lt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(nt).length<2?e:Y(t)?t.trim():t},Pt=function(t){return t},zt=function(t,e){for(var r in e)r in t||(t[r]=e[r]);return t},Bt=function(t,e){for(var r in e)t[r]=e[r];return t},Nt=function t(e,r){for(var i in r)"__proto__"!==i&&"constructor"!==i&&"prototype"!==i&&(e[i]=W(r[i])?t(e[i]||(e[i]={}),r[i]):r[i]);return e},Ut=function(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i},It=function(t){var e,r=t.parent||x,i=t.keyframes?(e=K(t.keyframes),function(t,r){for(var i in r)i in t||"duration"===i&&e||"ease"===i||(t[i]=r[i])}):zt;if($(t.inherit))for(;r;)i(t,r.vars.defaults),r=r.parent||r._dp;return t},jt=function(t,e,r,i,n){void 0===r&&(r="_first"),void 0===i&&(i="_last");var s,a=t[i];if(n)for(s=e[n];a&&a[n]>s;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=a,e.parent=e._dp=t,e},Xt=function(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,s=e._next;n?n._next=s:t[r]===e&&(t[r]=s),s?s._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null},Yt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Vt=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},Gt=function(t,e,r,i){return t._startAt&&(v?t._startAt.revert(pt):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},qt=function t(e){return!e||e._ts&&t(e.parent)},Wt=function(t){return t._repeat?$t(t._tTime,t=t.duration()+t._rDelay)*t:0},$t=function(t,e){var r=Math.floor(t=Ct(t/e));return t&&r===t?r-1:r},Ht=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Zt=function(t){return t._end=Ct(t._start+(t._tDur/Math.abs(t._ts||t._rts||z)||0))},Qt=function(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=Ct(r._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Zt(t),r._dirty||Vt(r,t)),t},Kt=function(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Ht(t.rawTime(),e),(!e._dur||he(0,e.totalDuration(),r)-e._tTime>z)&&e.render(r,!0)),Vt(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-1e-8}},Jt=function(t,e,r,i){return e.parent&&Yt(e),e._start=Ct((G(r)?r:r||t!==x?oe(t,r,e):t._time)+e._delay),e._end=Ct(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),jt(t,e,"_first","_last",t._sort?"_start":0),ie(e)||(t._recent=e),i||Kt(t,e),t._ts<0&&Qt(t,t._tTime),t},te=function(t,e){return(at.ScrollTrigger||lt("scrollTrigger",e))&&at.ScrollTrigger.create(e,t)},ee=function(t,e,r,i,n){return sr(t,e,n),t._initted?!r&&t._pt&&!v&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&T!==Ne.frame?(vt.push(t),t._lazy=[n,i],1):void 0:1},re=function t(e){var r=e.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||t(r))},ie=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},ne=function(t,e,r,i){var n=t._repeat,s=Ct(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=s/t._dur),t._dur=s,t._tDur=n?n<0?1e10:Ct(s*(n+1)+t._rDelay*n):s,a>0&&!i&&Qt(t,t._tTime=t._tDur*a),t.parent&&Zt(t),r||Vt(t.parent,t),t},se=function(t){return t instanceof Je?Vt(t):ne(t,t._dur)},ae={_start:0,endTime:dt,totalDuration:dt},oe=function t(e,r,i){var n,s,a,o=e.labels,u=e._recent||ae,l=e.duration()>=P?u.endTime(!1):e._dur;return Y(r)&&(isNaN(r)||r in o)?(s=r.charAt(0),a="%"===r.substr(-1),n=r.indexOf("="),"<"===s||">"===s?(n>=0&&(r=r.replace(/=/,"")),("<"===s?u._start:u.endTime(u._repeat>=0))+(parseFloat(r.substr(1))||0)*(a?(n<0?u:i).totalDuration()/100:1)):n<0?(r in o||(o[r]=l),o[r]):(s=parseFloat(r.charAt(n-1)+r.substr(n+1)),a&&i&&(s=s/100*(K(i)?i[0]:i).totalDuration()),n>1?t(e,r.substr(0,n-1),i)+s:l+s)):null==r?l:+r},ue=function(t,e,r){var i,n,s=G(e[1]),a=(s?2:1)+(t<2?0:1),o=e[a];if(s&&(o.duration=e[1]),o.parent=r,t){for(i=o,n=r;n&&!("immediateRender"in i);)i=n.vars.defaults||{},n=$(n.vars.inherit)&&n.parent;o.immediateRender=$(i.immediateRender),t<2?o.runBackwards=1:o.startAt=e[a-1]}return new hr(e[0],o,e[a+1])},le=function(t,e){return t||0===t?e(t):e},he=function(t,e,r){return r<t?t:r>e?e:r},ce=function(t,e){return Y(t)&&(e=st.exec(t))?e[1]:""},de=[].slice,fe=function(t,e){return t&&W(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&W(t[0]))&&!t.nodeType&&t!==y},pe=function(t,e,r){return _&&!e&&_.selector?_.selector(t):!Y(t)||r||!b&&Ue()?K(t)?function(t,e,r){return void 0===r&&(r=[]),t.forEach((function(t){var i;return Y(t)&&!e||fe(t,1)?(i=r).push.apply(i,pe(t)):r.push(t)}))||r}(t,r):fe(t)?de.call(t,0):t?[t]:[]:de.call((e||w).querySelectorAll(t),0)},me=function(t){return t=pe(t)[0]||ht("Invalid scope")||{},function(e){var r=t.current||t.nativeElement||t;return pe(e,r.querySelectorAll?r:r===t?ht("Invalid scope")||w.createElement("div"):t)}},ge=function(t){return t.sort((function(){return.5-Math.random()}))},ve=function(t){if(V(t))return t;var e=W(t)?t:{each:t},r=qe(e.ease),i=e.from||0,n=parseFloat(e.base)||0,s={},a=i>0&&i<1,o=isNaN(i)||a,u=e.axis,l=i,h=i;return Y(i)?l=h={center:.5,edges:.5,end:1}[i]||0:!a&&o&&(l=i[0],h=i[1]),function(t,a,c){ | |
| 3 | +var d,f,p,m,g,v,_,x,y,b=(c||e).length,w=s[b];if(!w){if(!(y="auto"===e.grid?0:(e.grid||[1,P])[1])){for(_=-P;_<(_=c[y++].getBoundingClientRect().left)&&y<b;);y<b&&y--}for(w=s[b]=[],d=o?Math.min(y,b)*l-.5:i%y,f=y===P?0:o?b*h/y-.5:i/y|0,_=0,x=P,v=0;v<b;v++)p=v%y-d,m=f-(v/y|0),w[v]=g=u?Math.abs("y"===u?m:p):I(p*p+m*m),g>_&&(_=g),g<x&&(x=g);"random"===i&&ge(w),w.max=_-x,w.min=x,w.v=b=(parseFloat(e.amount)||parseFloat(e.each)*(y>b?b-1:u?"y"===u?b/y:y:Math.max(y,b/y))||0)*("edges"===i?-1:1),w.b=b<0?n-b:n,w.u=ce(e.amount||e.each)||0,r=r&&b<0?Ve(r):r}return b=(w[t]-w.min)/w.max||0,Ct(w.b+(r?r(b):b)*w.v)+w.u}},_e=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var i=Ct(Math.round(parseFloat(r)/t)*t*e);return(i-i%1)/e+(G(r)?0:ce(r))}},xe=function(t,e){var r,i,n=K(t);return!n&&W(t)&&(r=n=t.radius||P,t.values?(t=pe(t.values),(i=!G(t[0]))&&(r*=r)):t=_e(t.increment)),le(e,n?V(t)?function(e){return i=t(e),Math.abs(i-e)<=r?i:e}:function(e){for(var n,s,a=parseFloat(i?e.x:e),o=parseFloat(i?e.y:0),u=P,l=0,h=t.length;h--;)(n=i?(n=t[h].x-a)*n+(s=t[h].y-o)*s:Math.abs(t[h]-a))<u&&(u=n,l=h);return l=!r||u<=r?t[l]:e,i||l===e||G(e)?l:l+ce(e)}:_e(t))},ye=function(t,e,r,i){return le(K(t)?!e:!0===r?!!(r=0):!i,(function(){return K(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i}))},be=function(t,e,r){return le(r,(function(r){return t[~~e(r)]}))},we=function(t){for(var e,r,i,n,s=0,a="";~(e=t.indexOf("random(",s));)i=t.indexOf(")",e),n="["===t.charAt(e+7),r=t.substr(e+7,i-e-7).match(n?nt:J),a+=t.substr(s,e-s)+ye(n?r:+r[0],n?0:+r[1],+r[2]||1e-5),s=i+1;return a+t.substr(s,t.length-s)},Ee=function(t,e,r,i,n){var s=e-t,a=i-r;return le(n,(function(e){return r+((e-t)/s*a||0)}))},Te=function(t,e,r){var i,n,s,a=t.labels,o=P;for(i in a)(n=a[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(s=i,o=n);return s},Re=function(t,e,r){var i,n,s,a=t.vars,o=a[e],u=_,l=t._ctx;if(o)return i=a[e+"Params"],n=a.callbackScope||t,r&&vt.length&&Dt(),l&&(_=l),s=i?o.apply(n,i):o.call(n),_=u,s},Ae=function(t){return Yt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!v),t.progress()<1&&Re(t,"onInterrupt"),t},Me=[],Se=function(t){if(t)if(t=!t.name&&t.default||t,H()||t.headless){var e=t.name,r=V(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:dt,render:xr,add:ir,kill:br,modifier:yr,rawVars:0},s={targetTest:0,get:0,getSetter:mr,aliases:{},register:0};if(Ue(),t!==i){if(xt[e])return;zt(i,zt(Ut(t,n),s)),Bt(i.prototype,Bt(n,Ut(t,s))),xt[i.prop=e]=i,t.targetTest&&(wt.push(i),gt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}ct(e,i),t.register&&t.register(Br,i,Tr)}else Me.push(t)},Ce=255,Fe={aqua:[0,Ce,Ce],lime:[0,Ce,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ce],navy:[0,0,128],white:[Ce,Ce,Ce],olive:[128,128,0],yellow:[Ce,Ce,0],orange:[Ce,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ce,0,0],pink:[Ce,192,203],cyan:[0,Ce,Ce],transparent:[Ce,Ce,Ce,0]},ke=function(t,e,r){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*Ce+.5|0},De=function(t,e,r){var i,n,s,a,o,u,l,h,c,d,f=t?G(t)?[t>>16,t>>8&Ce,t&Ce]:0:Fe.black;if(!f){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Fe[t])f=Fe[t];else if("#"===t.charAt(0)){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),s=t.charAt(3),t="#"+i+i+n+n+s+s+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(f=parseInt(t.substr(1,6),16))>>16,f>>8&Ce,f&Ce,parseInt(t.substr(7),16)/255];f=[(t=parseInt(t.substr(1),16))>>16,t>>8&Ce,t&Ce]}else if("hsl"===t.substr(0,3))if(f=d=t.match(J),e){if(~t.indexOf("="))return f=t.match(tt),r&&f.length<4&&(f[3]=1),f}else a=+f[0]%360/360,o=+f[1]/100,i=2*(u=+f[2]/100)-(n=u<=.5?u*(o+1):u+o-u*o),f.length>3&&(f[3]*=1),f[0]=ke(a+1/3,i,n),f[1]=ke(a,i,n),f[2]=ke(a-1/3,i,n);else f=t.match(J)||Fe.transparent;f=f.map(Number)}return e&&!d&&(i=f[0]/Ce,n=f[1]/Ce,s=f[2]/Ce,u=((l=Math.max(i,n,s))+(h=Math.min(i,n,s)))/2,l===h?a=o=0:(c=l-h,o=u>.5?c/(2-l-h):c/(l+h),a=l===i?(n-s)/c+(n<s?6:0):l===n?(s-i)/c+2:(i-n)/c+4,a*=60),f[0]=~~(a+.5),f[1]=~~(100*o+.5),f[2]=~~(100*u+.5)),r&&f.length<4&&(f[3]=1),f},Oe=function(t){var e=[],r=[],i=-1;return t.split(Pe).forEach((function(t){var n=t.match(et)||[];e.push.apply(e,n),r.push(i+=n.length+1)})),e.c=r,e},Le=function(t,e,r){var i,n,s,a,o="",u=(t+o).match(Pe),l=e?"hsla(":"rgba(",h=0;if(!u)return t;if(u=u.map((function(t){return(t=De(t,e,1))&&l+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"})),r&&(s=Oe(t),(i=r.c).join(o)!==s.c.join(o)))for(a=(n=t.replace(Pe,"1").split(et)).length-1;h<a;h++)o+=n[h]+(~i.indexOf(h)?u.shift()||l+"0,0,0,0)":(s.length?s:u.length?u:r).shift());if(!n)for(a=(n=t.split(Pe)).length-1;h<a;h++)o+=n[h]+u[h];return o+n[a]},Pe=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Fe)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),ze=/hsl[a]?\(/,Be=function(t){var e,r=t.join(" ");if(Pe.lastIndex=0,Pe.test(r))return e=ze.test(r),t[1]=Le(t[1],e),t[0]=Le(t[0],e,Oe(t[1])),!0},Ne=function(){var t,e,r,i,n,s,a=Date.now,o=500,u=33,l=a(),h=l,c=1e3/240,d=c,f=[],p=function r(p){var m,g,v,_,x=a()-h,y=!0===p;if((x>o||x<0)&&(l+=x-u),((m=(v=(h+=x)-l)-d)>0||y)&&(_=++i.frame,n=v-1e3*i.time,i.time=v/=1e3,d+=m+(m>=c?4:c-m),g=1),y||(t=e(r)),g)for(s=0;s<f.length;s++)f[s](v,n,_,p)};return i={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(t){return n/(1e3/(t||60))},wake:function(){E&&(!b&&H()&&(y=b=window,w=y.document||{},at.gsap=Br,(y.gsapVersions||(y.gsapVersions=[])).push(Br.version),ut(ot||y.GreenSockGlobals||!y.gsap&&y||{}),Me.forEach(Se)),r="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,t&&i.sleep(),e=r||function(t){return setTimeout(t,d-1e3*i.time+1|0)},A=1,p(2))},sleep:function(){(r?cancelAnimationFrame:clearTimeout)(t),A=0,e=dt},lagSmoothing:function(t,e){o=t||1/0,u=Math.min(e||33,o)},fps:function(t){c=1e3/(t||240),d=1e3*i.time+c},add:function(t,e,r){var n=e?function(e,r,s,a){t(e,r,s,a),i.remove(n)}:t;return i.remove(t),f[r?"unshift":"push"](n),Ue(),n},remove:function(t,e){~(e=f.indexOf(t))&&f.splice(e,1)&&s>=e&&s--},_listeners:f}}(),Ue=function(){return!A&&Ne.wake()},Ie={},je=/^[\d.\-M][\d.\-,\s]/,Xe=/["']/g,Ye=function(t){for(var e,r,i,n={},s=t.substr(1,t.length-3).split(":"),a=s[0],o=1,u=s.length;o<u;o++)r=s[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[a]=isNaN(i)?i.replace(Xe,"").trim():+i,a=r.substr(e+1).trim();return n},Ve=function(t){return function(e){return 1-t(1-e)}},Ge=function t(e,r){for(var i,n=e._first;n;)n instanceof Je?t(n,r):!n.vars.yoyoEase||n._yoyo&&n._repeat||n._yoyo===r||(n.timeline?t(n.timeline,r):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=r)),n=n._next},qe=function(t,e){return t&&(V(t)?t:Ie[t]||function(t){var e,r,i,n,s=(t+"").split("("),a=Ie[s[0]];return a&&s.length>1&&a.config?a.config.apply(null,~t.indexOf("{")?[Ye(s[1])]:(e=t,r=e.indexOf("(")+1,i=e.indexOf(")"),n=e.indexOf("(",r),e.substring(r,~n&&n<i?e.indexOf(")",i+1):i)).split(",").map(Lt)):Ie._CE&&je.test(t)?Ie._CE("",t):a}(t))||e},We=function(t,e,r,i){void 0===r&&(r=function(t){return 1-e(1-t)}),void 0===i&&(i=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,s={easeIn:e,easeOut:r,easeInOut:i};return Mt(t,(function(t){for(var e in Ie[t]=at[t]=s,Ie[n=t.toLowerCase()]=r,s)Ie[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Ie[t+"."+e]=s[e]})),s},$e=function(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}},He=function t(e,r,i){var n=r>=1?r:1,s=(i||(e?.3:.45))/(r<1?r:1),a=s/B*(Math.asin(1/n)||0),o=function(t){return 1===t?1:n*Math.pow(2,-10*t)*X((t-a)*s)+1},u="out"===e?o:"in"===e?function(t){return 1-o(1-t)}:$e(o);return s=B/s,u.config=function(r,i){return t(e,r,i)},u},Ze=function t(e,r){void 0===r&&(r=1.70158);var i=function(t){return t?--t*t*((r+1)*t+r)+1:0},n="out"===e?i:"in"===e?function(t){return 1-i(1-t)}:$e(i);return n.config=function(r){return t(e,r)},n} | |
| 4 | +;Mt("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var r=e<5?e+1:e;We(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},(function(t){return 1-Math.pow(1-t,r)}),(function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2}))})),Ie.Linear.easeNone=Ie.none=Ie.Linear.easeIn,We("Elastic",He("in"),He("out"),He()),M=7.5625,F=2*(C=1/(S=2.75)),k=2.5*C,We("Bounce",(function(t){return 1-D(1-t)}),D=function(t){return t<C?M*t*t:t<F?M*Math.pow(t-1.5/S,2)+.75:t<k?M*(t-=2.25/S)*t+.9375:M*Math.pow(t-2.625/S,2)+.984375}),We("Expo",(function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)})),We("Circ",(function(t){return-(I(1-t*t)-1)})),We("Sine",(function(t){return 1===t?1:1-j(t*N)})),We("Back",Ze("in"),Ze("out"),Ze()),Ie.SteppedEase=Ie.steps=at.SteppedEase={config:function(t,e){void 0===t&&(t=1);var r=1/t,i=t+(e?0:1),n=e?1:0;return function(t){return((i*he(0,.99999999,t)|0)+n)*r}}},L.ease=Ie["quad.out"],Mt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return Et+=t+","+t+"Params,"}));var Qe=function(t,e){this.id=U++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:At,this.set=e?e.getSetter:mr},Ke=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,ne(this,+t.duration,1,1),this.data=t.data,_&&(this._ctx=_,_.data.push(this)),A||Ne.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,ne(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(Ue(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Qt(this,t),!r._dp||r.parent||Kt(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&Jt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===z||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),Ot(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Wt(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Wt(this),e):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?$t(this._tTime,r)+1:1},e.timeScale=function(t,e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Ht(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(he(-Math.abs(this._delay),this._tDur,r),!1!==e),Zt(this),function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ue(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==z&&(this._tTime-=z)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Jt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+($(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ht(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=mt);var e=v;return v=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),v=e,this},e.globalTime=function(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,se(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,se(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(oe(this,t),$(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,$(e)),this._dur||(this._zTime=-1e-8),this},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-z))},e.eventCallback=function(t,e,r){var i=this.vars;return arguments.length>1?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},e.then=function(t){var e=this;return new Promise((function(r){var i=V(t)?t:Pt,n=function(){var t=e.then;e.then=null,V(i)&&(i=i(e))&&(i.then||i===e)&&(e.then=t),r(i),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?n():e._prom=n}))},e.kill=function(){Ae(this)},t}();zt(Ke.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Je=function(t){function e(e,r){var i;return void 0===e&&(e={}),(i=t.call(this,e)||this).labels={},i.smoothChildTiming=!!e.smoothChildTiming,i.autoRemoveChildren=!!e.autoRemoveChildren,i._sort=$(e.sortChildren),x&&Jt(e.parent||x,p(i),r),e.reversed&&i.reverse(),e.paused&&i.paused(!0),e.scrollTrigger&&te(p(i),e.scrollTrigger),i}m(e,t);var r=e.prototype;return r.to=function(t,e,r){return ue(0,arguments,this),this},r.from=function(t,e,r){return ue(1,arguments,this),this},r.fromTo=function(t,e,r,i){return ue(2,arguments,this),this},r.set=function(t,e,r){return e.duration=0,e.parent=this,It(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new hr(t,e,oe(this,r),1),this},r.call=function(t,e,r){return Jt(this,hr.delayedCall(0,t,e),r)},r.staggerTo=function(t,e,r,i,n,s,a){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=s,r.onCompleteParams=a,r.parent=this,new hr(t,r,oe(this,n)),this},r.staggerFrom=function(t,e,r,i,n,s,a){return r.runBackwards=1,It(r).immediateRender=$(r.immediateRender),this.staggerTo(t,e,r,i,n,s,a)},r.staggerFromTo=function(t,e,r,i,n,s,a,o){return i.startAt=r,It(i).immediateRender=$(i.immediateRender),this.staggerTo(t,e,i,n,s,a,o)},r.render=function(t,e,r){ | |
| 5 | +var i,n,s,a,o,u,l,h,c,d,f,p,m=this._time,g=this._dirty?this.totalDuration():this._tDur,_=this._dur,y=t<=0?0:Ct(t),b=this._zTime<0!=t<0&&(this._initted||!_);if(this!==x&&y>g&&t>=0&&(y=g),y!==this._tTime||r||b){if(m!==this._time&&_&&(y+=this._time-m,t+=this._time-m),i=y,c=this._start,u=!(h=this._ts),b&&(_||(m=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(f=this._yoyo,o=_+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=Ct(y%o),y===g?(a=this._repeat,i=_):((a=~~(d=Ct(y/o)))&&a===d&&(i=_,a--),i>_&&(i=_)),d=$t(this._tTime,o),!m&&this._tTime&&d!==a&&this._tTime-d*o-this._dur<=0&&(d=a),f&&1&a&&(i=_-i,p=1),a!==d&&!this._lock){var w=f&&1&d,E=w===(f&&1&a);if(a<d&&(w=!w),m=w?0:y%_?_:y,this._lock=1,this.render(m||(p?0:Ct(a*o)),e,!_)._lock=0,this._tTime=y,!e&&this.parent&&Re(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1),m&&m!==this._time||u!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(_=this._dur,g=this._tDur,E&&(this._lock=2,m=w?_:-1e-4,this.render(m,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Ge(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(l=function(t,e,r){var i;if(r>e)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,Ct(m),Ct(i)),l&&(y-=i-(i=l._start))),this._tTime=y,this._time=i,this._act=!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,m=0),!m&&i&&!e&&!a&&(Re(this,"onStart"),this._tTime!==y))return this;if(i>=m&&t>=0)for(n=this._first;n;){if(s=n._next,(n._act||i>=n._start)&&n._ts&&l!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(n._ts>0?(i-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(i-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){l=0,s&&(y+=this._zTime=-1e-8);break}}n=s}else{n=this._last;for(var T=t<0?t:i;n;){if(s=n._prev,(n._act||T<=n._end)&&n._ts&&l!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(n._ts>0?(T-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(T-n._start)*n._ts,e,r||v&&(n._initted||n._startAt)),i!==this._time||!this._ts&&!u){l=0,s&&(y+=this._zTime=T?-1e-8:z);break}}n=s}}if(l&&!e&&(this.pause(),l.render(i>=m?0:-1e-8)._zTime=i>=m?1:-1,this._ts))return this._start=c,Zt(this),this.render(t,e,r);this._onUpdate&&!e&&Re(this,"onUpdate",!0),(y===g&&this._tTime>=this.totalDuration()||!y&&m)&&(c!==this._start&&Math.abs(h)===Math.abs(this._ts)||this._lock||((t||!_)&&(y===g&&this._ts>0||!y&&this._ts<0)&&Yt(this,1),e||t<0&&!m||!y&&!m&&g||(Re(this,y===g&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(y<g&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(t,e){var r=this;if(G(e)||(e=oe(this,e,t)),!(t instanceof Ke)){if(K(t))return t.forEach((function(t){return r.add(t,e)})),this;if(Y(t))return this.addLabel(t,e);if(!V(t))return this;t=hr.delayedCall(0,t)}return this!==t?Jt(this,t,e):this},r.getChildren=function(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-P);for(var n=[],s=this._first;s;)s._start>=i&&(s instanceof hr?e&&n.push(s):(r&&n.push(s),t&&n.push.apply(n,s.getChildren(!0,e,r)))),s=s._next;return n},r.getById=function(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},r.remove=function(t){return Y(t)?this.removeLabel(t):V(t)?this.killTweensOf(t):(t.parent===this&&Xt(this,t),t===this._recent&&(this._recent=this._last),Vt(this))},r.totalTime=function(e,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ct(Ne.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,r),this._forcing=0,this):this._tTime},r.addLabel=function(t,e){return this.labels[t]=oe(this,e),this},r.removeLabel=function(t){return delete this.labels[t],this},r.addPause=function(t,e,r){var i=hr.delayedCall(0,e||dt,r);return i.data="isPause",this._hasPause=1,Jt(this,i,oe(this,t))},r.removePause=function(t){var e=this._first;for(t=oe(this,t);e;)e._start===t&&"isPause"===e.data&&Yt(e),e=e._next},r.killTweensOf=function(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)tr!==i[n]&&i[n].kill(t,e);return this},r.getTweensOf=function(t,e){for(var r,i=[],n=pe(t),s=this._first,a=G(e);s;)s instanceof hr?kt(s._targets,n)&&(a?(!tr||s._initted&&s._ts)&&s.globalTime(0)<=e&&s.globalTime(s.totalDuration())>e:!e||s.isActive())&&i.push(s):(r=s.getTweensOf(n,e)).length&&i.push.apply(i,r),s=s._next;return i},r.tweenTo=function(t,e){e=e||{};var r,i=this,n=oe(i,t),s=e,a=s.startAt,o=s.onStart,u=s.onStartParams,l=s.immediateRender,h=hr.to(i,zt({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||z,onStart:function(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&ne(h,t,0,1).render(h._time,!0,!0),r=1}o&&o.apply(h,u||[])}},e));return l?h.render(0):h},r.tweenFromTo=function(t,e,r){return this.tweenTo(e,zt({startAt:{time:oe(this,t)}},r))},r.recent=function(){return this._recent},r.nextLabel=function(t){return void 0===t&&(t=this._time),Te(this,oe(this,t))},r.previousLabel=function(t){return void 0===t&&(t=this._time),Te(this,oe(this,t),1)},r.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+z)},r.shiftChildren=function(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,s=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in s)s[i]>=r&&(s[i]+=t);return Vt(this)},r.invalidate=function(e){var r=this._first;for(this._lock=0;r;)r.invalidate(e),r=r._next;return t.prototype.invalidate.call(this,e)},r.clear=function(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Vt(this)},r.totalDuration=function(t){var e,r,i,n=0,s=this,a=s._last,o=P;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-t:t));if(s._dirty){for(i=s.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),(r=a._start)>o&&s._sort&&a._ts&&!s._lock?(s._lock=1,Jt(s,a,r-a._delay,1)._lock=0):o=r,r<0&&a._ts&&(n-=r,(!i&&!s._dp||i&&i.smoothChildTiming)&&(s._start+=r/s._ts,s._time-=r,s._tTime-=r),s.shiftChildren(-r,!1,-Infinity),o=0),a._end>n&&a._ts&&(n=a._end),a=e;ne(s,s===x&&s._time>n?s._time:n,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(t){if(x._ts&&(Ot(x,Ht(t,x)),T=Ne.frame),Ne.frame>=bt){bt+=O.autoSleep||120;var e=x._first;if((!e||!e._ts)&&O.autoSleep&&Ne._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Ne.sleep()}}},e}(Ke);zt(Je.prototype,{_lock:0,_hasPause:0,_forcing:0});var tr,er,rr=function(t,e,r,i,n,s,a){var o,u,l,h,c,d,f,p,m=new Tr(this._pt,t,e,0,1,_r,null,n),g=0,v=0;for(m.b=r,m.e=i,r+="",(f=~(i+="").indexOf("random("))&&(i=we(i)),s&&(s(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(rt)||[];o=rt.exec(i);)h=o[0],c=i.substring(g,o.index),l?l=(l+1)%5:"rgba("===c.substr(-5)&&(l=1),h!==u[v++]&&(d=parseFloat(u[v-1])||0,m._pt={_next:m._pt,p:c||1===v?c:",",s:d,c:"="===h.charAt(1)?Ft(d,h)-d:parseFloat(h)-d,m:l&&l<4?Math.round:0},g=rt.lastIndex);return m.c=g<i.length?i.substring(g,i.length):"",m.fp=a,(it.test(i)||f)&&(m.e=0),this._pt=m,m},ir=function(t,e,r,i,n,s,a,o,u,l){V(i)&&(i=i(n||0,t,s));var h,c=t[e],d="get"!==r?r:V(c)?u?t[e.indexOf("set")||!V(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():c,f=V(c)?u?fr:dr:cr;if(Y(i)&&(~i.indexOf("random(")&&(i=we(i)),"="===i.charAt(1)&&((h=Ft(d,i)+(ce(d)||0))||0===h)&&(i=h)),!l||d!==i||er)return isNaN(d*i)||""===i?(!c&&!(e in t)&<(e,i),rr.call(this,t,e,d,i,f,o||O.stringFilter,u)):(h=new Tr(this._pt,t,e,+d||0,i-(d||0),"boolean"==typeof c?vr:gr,0,f),u&&(h.fp=u),a&&h.modifier(a,this,t),this._pt=h)},nr=function(t,e,r,i,n,s){var a,o,u,l;if(xt[t]&&!1!==(a=new xt[t]).init(n,a.rawVars?e[t]:function(t,e,r,i,n){if(V(t)&&(t=or(t,n,e,r,i)), | |
| 6 | +!W(t)||t.style&&t.nodeType||K(t)||Q(t))return Y(t)?or(t,n,e,r,i):t;var s,a={};for(s in t)a[s]=or(t[s],n,e,r,i);return a}(e[t],i,n,s,r),r,i,s)&&(r._pt=o=new Tr(r._pt,n,t,0,1,a.render,a,0,a.priority),r!==R))for(u=r._ptLookup[r._targets.indexOf(n)],l=a._props.length;l--;)u[a._props[l]]=o;return a},sr=function t(e,r,i){var n,s,a,o,u,l,h,c,d,f,p,m,_,y=e.vars,b=y.ease,w=y.startAt,E=y.immediateRender,T=y.lazy,R=y.onUpdate,A=y.runBackwards,M=y.yoyoEase,S=y.keyframes,C=y.autoRevert,F=e._dur,k=e._startAt,D=e._targets,O=e.parent,B=O&&"nested"===O.data?O.vars.targets:D,N="auto"===e._overwrite&&!g,U=e.timeline;if(U&&(!S||!b)&&(b="none"),e._ease=qe(b,L.ease),e._yEase=M?Ve(qe(!0===M?b:M,L.ease)):0,M&&e._yoyo&&!e._repeat&&(M=e._yEase,e._yEase=e._ease,e._ease=M),e._from=!U&&!!y.runBackwards,!U||S&&!y.stagger){if(m=(c=D[0]?Rt(D[0]).harness:0)&&y[c.prop],n=Ut(y,gt),k&&(k._zTime<0&&k.progress(1),r<0&&A&&E&&!C?k.render(-1,!0):k.revert(A&&F?pt:ft),k._lazy=0),w){if(Yt(e._startAt=hr.set(D,zt({data:"isStart",overwrite:!1,parent:O,immediateRender:!0,lazy:!k&&$(T),startAt:null,delay:0,onUpdate:R&&function(){return Re(e,"onUpdate")},stagger:0},w))),e._startAt._dp=0,e._startAt._sat=e,r<0&&(v||!E&&!C)&&e._startAt.revert(pt),E&&F&&r<=0&&i<=0)return void(r&&(e._zTime=r))}else if(A&&F&&!k)if(r&&(E=!1),a=zt({overwrite:!1,data:"isFromStart",lazy:E&&!k&&$(T),immediateRender:E,stagger:0,parent:O},n),m&&(a[c.prop]=m),Yt(e._startAt=hr.set(D,a)),e._startAt._dp=0,e._startAt._sat=e,r<0&&(v?e._startAt.revert(pt):e._startAt.render(-1,!0)),e._zTime=r,E){if(!r)return}else t(e._startAt,z,z);for(e._pt=e._ptCache=0,T=F&&$(T)||T&&!F,s=0;s<D.length;s++){if(h=(u=D[s])._gsap||Tt(D)[s]._gsap,e._ptLookup[s]=f={},_t[h.id]&&vt.length&&Dt(),p=B===D?s:B.indexOf(u),c&&!1!==(d=new c).init(u,m||n,e,p,B)&&(e._pt=o=new Tr(e._pt,u,d.name,0,1,d.render,d,0,d.priority),d._props.forEach((function(t){f[t]=o})),d.priority&&(l=1)),!c||m)for(a in n)xt[a]&&(d=nr(a,n,e,p,u,B))?d.priority&&(l=1):f[a]=o=ir.call(e,u,a,"get",n[a],p,B,0,y.stringFilter);e._op&&e._op[s]&&e.kill(u,e._op[s]),N&&e._pt&&(tr=e,x.killTweensOf(u,f,e.globalTime(r)),_=!e.parent,tr=0),e._pt&&T&&(_t[h.id]=1)}l&&Er(e),e._onInit&&e._onInit(e)}e._onUpdate=R,e._initted=(!e._op||e._pt)&&!_,S&&r<=0&&U.render(P,!0,!0)},ar=function(t,e,r,i){var n,s,a=e.ease||i||"power1.inOut";if(K(e))s=r[t]||(r[t]=[]),e.forEach((function(t,r){return s.push({t:r/(e.length-1)*100,v:t,e:a})}));else for(n in e)s=r[n]||(r[n]=[]),"ease"===n||s.push({t:parseFloat(t),v:e[n],e:a})},or=function(t,e,r,i,n){return V(t)?t.call(e,r,i,n):Y(t)&&~t.indexOf("random(")?we(t):t},ur=Et+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",lr={};Mt(ur+",id,stagger,delay,duration,paused,scrollTrigger",(function(t){return lr[t]=1}));var hr=function(t){function e(e,r,i,n){var s;"number"==typeof r&&(i.duration=r,r=i,i=null);var a,o,u,l,h,c,d,f,m=(s=t.call(this,n?r:It(r))||this).vars,v=m.duration,_=m.delay,y=m.immediateRender,b=m.stagger,w=m.overwrite,E=m.keyframes,T=m.defaults,R=m.scrollTrigger,A=m.yoyoEase,M=r.parent||x,S=(K(e)||Q(e)?G(e[0]):"length"in r)?[e]:pe(e);if(s._targets=S.length?Tt(S):ht("GSAP target "+e+" not found. https://gsap.com",!O.nullTargetWarn)||[],s._ptLookup=[],s._overwrite=w,E||b||Z(v)||Z(_)){if(r=s.vars,(a=s.timeline=new Je({data:"nested",defaults:T||{},targets:M&&"nested"===M.data?M.vars.targets:S})).kill(),a.parent=a._dp=p(s),a._start=0,b||Z(v)||Z(_)){if(l=S.length,d=b&&ve(b),W(b))for(h in b)~ur.indexOf(h)&&(f||(f={}),f[h]=b[h]);for(o=0;o<l;o++)(u=Ut(r,lr)).stagger=0,A&&(u.yoyoEase=A),f&&Bt(u,f),c=S[o],u.duration=+or(v,p(s),o,c,S),u.delay=(+or(_,p(s),o,c,S)||0)-s._delay,!b&&1===l&&u.delay&&(s._delay=_=u.delay,s._start+=_,u.delay=0),a.to(c,u,d?d(o,c,S):0),a._ease=Ie.none;a.duration()?v=_=0:s.timeline=0}else if(E){It(zt(a.vars.defaults,{ease:"none"})),a._ease=qe(E.ease||r.ease||"none");var C,F,k,D=0;if(K(E))E.forEach((function(t){return a.to(S,t,">")})),a.duration();else{for(h in u={},E)"ease"===h||"easeEach"===h||ar(h,E[h],u,E.easeEach);for(h in u)for(C=u[h].sort((function(t,e){return t.t-e.t})),D=0,o=0;o<C.length;o++)(k={ease:(F=C[o]).e,duration:(F.t-(o?C[o-1].t:0))/100*v})[h]=F.v,a.to(S,k,D),D+=k.duration;a.duration()<v&&a.to({},{duration:v-a.duration()})}}v||s.duration(v=a.duration())}else s.timeline=0;return!0!==w||g||(tr=p(s),x.killTweensOf(S),tr=0),Jt(M,p(s),i),r.reversed&&s.reverse(),r.paused&&s.paused(!0),(y||!v&&!E&&s._start===Ct(M._time)&&$(y)&&qt(p(s))&&"nested"!==M.data)&&(s._tTime=-1e-8,s.render(Math.max(0,-_)||0)),R&&te(p(s),R),s}m(e,t);var r=e.prototype;return r.render=function(t,e,r){var i,n,s,a,o,u,l,h,c,d=this._time,f=this._tDur,p=this._dur,m=t<0,g=t>f-z&&!m?f:t<z?0:t;if(p){if(g!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==m||this._lazy){if(i=g,h=this.timeline,this._repeat){if(a=p+this._rDelay,this._repeat<-1&&m)return this.totalTime(100*a+t,e,r);if(i=Ct(g%a),g===f?(s=this._repeat,i=p):(s=~~(o=Ct(g/a)))&&s===o?(i=p,s--):i>p&&(i=p),(u=this._yoyo&&1&s)&&(c=this._yEase,i=p-i),o=$t(this._tTime,a),i===d&&!r&&this._initted&&s===o)return this._tTime=g,this;s!==o&&(h&&this._yEase&&Ge(h,u),this.vars.repeatRefresh&&!u&&!this._lock&&i!==a&&this._initted&&(this._lock=r=1,this.render(Ct(a*s),!0).invalidate()._lock=0))}if(!this._initted){if(ee(this,m?t:i,r,e,g))return this._tTime=0,this;if(!(d===this._time||r&&this.vars.repeatRefresh&&s!==o))return this;if(p!==this._dur)return this.render(t,e,r)}if(this._tTime=g,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=l=(c||this._ease)(i/p),this._from&&(this.ratio=l=1-l),i&&!d&&!e&&!s&&(Re(this,"onStart"),this._tTime!==g))return this;for(n=this._pt;n;)n.r(l,n.d),n=n._next;h&&h.render(t<0?t:h._dur*h._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(m&&Gt(this,t,0,r),Re(this,"onUpdate")),this._repeat&&s!==o&&this.vars.onRepeat&&!e&&this.parent&&Re(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(m&&!this._onUpdate&&Gt(this,t,0,!0),(t||!p)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&Yt(this,1),e||m&&!d||!(g||d||u)||(Re(this,g===f?"onComplete":"onReverseComplete",!0),this._prom&&!(g<f&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,r,i){var n,s,a,o=t.ratio,u=e<0||!e&&(!t._start&&re(t)&&(t._initted||!ie(t))||(t._ts<0||t._dp._ts<0)&&!ie(t))?0:1,l=t._rDelay,h=0;if(l&&t._repeat&&(h=he(0,t._tDur,e),s=$t(h,l),t._yoyo&&1&s&&(u=1-u),s!==$t(t._tTime,l)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||v||i||t._zTime===z||!e&&t._zTime){if(!t._initted&&ee(t,e,i,r,h))return;for(a=t._zTime,t._zTime=e||(r?z:0),r||(r=e&&!a),t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=h,n=t._pt;n;)n.r(u,n.d),n=n._next;e<0&&Gt(t,e,0,!0),t._onUpdate&&!r&&Re(t,"onUpdate"),h&&t._repeat&&!r&&t.parent&&Re(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&Yt(t,1),r||v||(Re(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},r.targets=function(){return this._targets},r.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},r.resetTo=function(t,e,r,i,n){A||Ne.wake(),this._ts||this.play();var s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||sr(this,s),function(t,e,r,i,n,s,a,o){var u,l,h,c,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],h=t._ptLookup,c=t._targets.length;c--;){if((u=h[c][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return er=1,t.vars[e]="+=0",sr(t,a),er=0,o?ht(e+" not eligible for reset"):1;d.push(u)}for(c=d.length;c--;)(u=(l=d[c])._pt||l).s=!i&&0!==i||n?u.s+(i||0)+s*u.c:i,u.c=r-u.s,l.e&&(l.e=St(r)+ce(l.e)),l.b&&(l.b=u.s+ce(l.b))}(this,t,e,r,i,this._ease(s/this._dur),s,n)?this.resetTo(t,e,r,i,1):(Qt(this,0),this.parent||jt(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(t,e){ | |
| 7 | +if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?Ae(this):this.scrollTrigger&&this.scrollTrigger.kill(!!v),this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,tr&&!0!==tr.vars.overwrite)._first||Ae(this),this.parent&&r!==this.timeline.totalDuration()&&ne(this,this._dur*this.timeline._tDur/r,0,1),this}var i,n,s,a,o,u,l,h=this._targets,c=t?pe(t):h,d=this._ptLookup,f=this._pt;if((!e||"all"===e)&&function(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(h,c))return"all"===e&&(this._pt=0),Ae(this);for(i=this._op=this._op||[],"all"!==e&&(Y(e)&&(o={},Mt(e,(function(t){return o[t]=1})),e=o),e=function(t,e){var r,i,n,s,a=t[0]?Rt(t[0]).harness:0,o=a&&a.aliases;if(!o)return e;for(i in r=Bt({},e),o)if(i in r)for(n=(s=o[i].split(",")).length;n--;)r[s[n]]=r[i];return r}(h,e)),l=h.length;l--;)if(~c.indexOf(h[l]))for(o in n=d[l],"all"===e?(i[l]=e,a=n,s={}):(s=i[l]=i[l]||{},a=e),a)(u=n&&n[o])&&("kill"in u.d&&!0!==u.d.kill(o)||Xt(this,u,"_pt"),delete n[o]),"all"!==s&&(s[o]=1);return this._initted&&!this._pt&&f&&Ae(this),this},e.to=function(t,r){return new e(t,r,arguments[2])},e.from=function(t,e){return ue(1,arguments)},e.delayedCall=function(t,r,i,n){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:r,onReverseComplete:r,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:n})},e.fromTo=function(t,e,r){return ue(2,arguments)},e.set=function(t,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(t,r)},e.killTweensOf=function(t,e,r){return x.killTweensOf(t,e,r)},e}(Ke);zt(hr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Mt("staggerTo,staggerFrom,staggerFromTo",(function(t){hr[t]=function(){var e=new Je,r=de.call(arguments,0);return r.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,r)}}));var cr=function(t,e,r){return t[e]=r},dr=function(t,e,r){return t[e](r)},fr=function(t,e,r,i){return t[e](i.fp,r)},pr=function(t,e,r){return t.setAttribute(e,r)},mr=function(t,e){return V(t[e])?dr:q(t[e])&&t.setAttribute?pr:cr},gr=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},vr=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},_r=function(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},xr=function(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},yr=function(t,e,r,i){for(var n,s=this._pt;s;)n=s._next,s.p===i&&s.modifier(t,e,r),s=n},br=function(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?Xt(this,i,"_pt"):i.dep||(e=1),i=r;return!e},wr=function(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)},Er=function(t){for(var e,r,i,n,s=t._pt;s;){for(e=s._next,r=i;r&&r.pr>s.pr;)r=r._next;(s._prev=r?r._prev:n)?s._prev._next=s:i=s,(s._next=r)?r._prev=s:n=s,s=e}t._pt=i},Tr=function(){function t(t,e,r,i,n,s,a,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=s||gr,this.d=a||this,this.set=o||cr,this.pr=u||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,r){this.mSet=this.mSet||this.set,this.set=wr,this.m=t,this.mt=r,this.tween=e},t}();Mt(Et+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return gt[t]=1})),at.TweenMax=at.TweenLite=hr,at.TimelineLite=at.TimelineMax=Je,x=new Je({sortChildren:!1,defaults:L,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),O.stringFilter=Be;var Rr=[],Ar={},Mr=[],Sr=0,Cr=0,Fr=function(t){return(Ar[t]||Mr).map((function(t){return t()}))},kr=function(){var t=Date.now(),e=[];t-Sr>2&&(Fr("matchMediaInit"),Rr.forEach((function(t){var r,i,n,s,a=t.queries,o=t.conditions;for(i in a)(r=y.matchMedia(a[i]).matches)&&(n=1),r!==o[i]&&(o[i]=r,s=1);s&&(t.revert(),n&&e.push(t))})),Fr("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t,(function(e){return t.add(null,e)}))})),Sr=t,Fr("matchMedia"))},Dr=function(){function t(t,e){this.selector=e&&me(e),this.data=[],this._r=[],this.isReverted=!1,this.id=Cr++,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,r){V(t)&&(r=e,e=t,t=V);var i=this,n=function(){var t,n=_,s=i.selector;return n&&n!==i&&n.data.push(i),r&&(i.selector=me(r)),_=i,t=e.apply(i,arguments),V(t)&&i._r.push(t),_=n,i.selector=s,i.isReverted=!1,t};return i.last=n,t===V?n(i,(function(t){return i.add(null,t)})):t?i[t]=n:n},e.ignore=function(t){var e=_;_=null,t(this),_=e},e.getTweens=function(){var e=[];return this.data.forEach((function(r){return r instanceof t?e.push.apply(e,r.getTweens()):r instanceof hr&&!(r.parent&&"nested"===r.parent.data)&&e.push(r)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var r=this;if(t?function(){for(var e,i=r.getTweens(),n=r.data.length;n--;)"isFlip"===(e=r.data[n]).data&&(e.revert(),e.getChildren(!0,!0,!1).forEach((function(t){return i.splice(i.indexOf(t),1)})));for(i.map((function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t}})).sort((function(t,e){return e.g-t.g||-1/0})).forEach((function(e){return e.t.revert(t)})),n=r.data.length;n--;)(e=r.data[n])instanceof Je?"nested"!==e.data&&(e.scrollTrigger&&e.scrollTrigger.revert(),e.kill()):!(e instanceof hr)&&e.revert&&e.revert(t);r._r.forEach((function(e){return e(t,r)})),r.isReverted=!0}():this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e)for(var i=Rr.length;i--;)Rr[i].id===this.id&&Rr.splice(i,1)},e.revert=function(t){this.kill(t||{})},t}(),Or=function(){function t(t){this.contexts=[],this.scope=t,_&&_.data.push(this)}var e=t.prototype;return e.add=function(t,e,r){W(t)||(t={matches:t});var i,n,s,a=new Dr(0,r||this.scope),o=a.conditions={};for(n in _&&!a.selector&&(a.selector=_.selector),this.contexts.push(a),e=a.add("onMatch",e),a.queries=t,t)"all"===n?s=1:(i=y.matchMedia(t[n]))&&(Rr.indexOf(a)<0&&Rr.push(a),(o[n]=i.matches)&&(s=1),i.addListener?i.addListener(kr):i.addEventListener("change",kr));return s&&e(a,(function(t){return a.add(null,t)})),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Lr={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach((function(t){return Se(t)}))},timeline:function(t){return new Je(t)},getTweensOf:function(t,e){return x.getTweensOf(t,e)},getProperty:function(t,e,r,i){Y(t)&&(t=pe(t)[0]);var n=Rt(t||{}).get,s=r?Pt:Lt;return"native"===r&&(r=""),t?e?s((xt[e]&&xt[e].get||n)(t,e,r,i)):function(e,r,i){return s((xt[e]&&xt[e].get||n)(t,e,r,i))}:t},quickSetter:function(t,e,r){if((t=pe(t)).length>1){var i=t.map((function(t){return Br.quickSetter(t,e,r)})),n=i.length;return function(t){for(var e=n;e--;)i[e](t)}}t=t[0]||{};var s=xt[e],a=Rt(t),o=a.harness&&(a.harness.aliases||{})[e]||e,u=s?function(e){var i=new s;R._pt=0,i.init(t,r?e+r:e,R,0,[t]),i.render(1,i),R._pt&&xr(1,R)}:a.set(t,o);return s?u:function(e){return u(t,o,r?e+r:e,a,1)}},quickTo:function(t,e,r){var i,n=Br.to(t,zt(((i={})[e]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),s=function(t,r,i){return n.resetTo(e,t,r,i)};return s.tween=n,s},isTweening:function(t){return x.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=qe(t.ease,L.ease)),Nt(L,t||{})},config:function(t){return Nt(O,t||{})},registerEffect:function(t){var e=t.name,r=t.effect,i=t.plugins,n=t.defaults,s=t.extendTimeline;(i||"").split(",").forEach((function(t){return t&&!xt[t]&&!at[t]&&ht(e+" effect requires "+t+" plugin.")})),yt[e]=function(t,e,i){return r(pe(t),zt(e||{},n),i)},s&&(Je.prototype[e]=function(t,r,i){return this.add(yt[e](t,W(r)?r:(i=r)&&{},this),i)})},registerEase:function(t,e){Ie[t]=qe(e)},parseEase:function(t,e){return arguments.length?qe(t,e):Ie},getById:function(t){return x.getById(t)},exportRoot:function(t,e){void 0===t&&(t={}) | |
| 8 | +;var r,i,n=new Je(t);for(n.smoothChildTiming=$(t.smoothChildTiming),x.remove(n),n._dp=0,n._time=n._tTime=x._time,r=x._first;r;)i=r._next,!e&&!r._dur&&r instanceof hr&&r.vars.onComplete===r._targets[0]||Jt(n,r,r._start-r._delay),r=i;return Jt(x,n,0),n},context:function(t,e){return t?new Dr(t,e):_},matchMedia:function(t){return new Or(t)},matchMediaRefresh:function(){return Rr.forEach((function(t){var e,r,i=t.conditions;for(r in i)i[r]&&(i[r]=!1,e=1);e&&t.revert()}))||kr()},addEventListener:function(t,e){var r=Ar[t]||(Ar[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function(t,e){var r=Ar[t],i=r&&r.indexOf(e);i>=0&&r.splice(i,1)},utils:{wrap:function t(e,r,i){var n=r-e;return K(e)?be(e,t(0,e.length),r):le(i,(function(t){return(n+(t-e)%n)%n+e}))},wrapYoyo:function t(e,r,i){var n=r-e,s=2*n;return K(e)?be(e,t(0,e.length-1),r):le(i,(function(t){return e+((t=(s+(t-e)%s)%s||0)>n?s-t:t)}))},distribute:ve,random:ye,snap:xe,normalize:function(t,e,r){return Ee(t,e,0,1,r)},getUnit:ce,clamp:function(t,e,r){return le(r,(function(r){return he(t,e,r)}))},splitColor:De,toArray:pe,selector:me,mapRange:Ee,pipe:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(r){return t(parseFloat(r))+(e||ce(r))}},interpolate:function t(e,r,i,n){var s=isNaN(e+r)?0:function(t){return(1-t)*e+t*r};if(!s){var a,o,u,l,h,c=Y(e),d={};if(!0===i&&(n=1)&&(i=null),c)e={p:e},r={p:r};else if(K(e)&&!K(r)){for(u=[],l=e.length,h=l-2,o=1;o<l;o++)u.push(t(e[o-1],e[o]));l--,s=function(t){t*=l;var e=Math.min(h,~~t);return u[e](t-e)},i=r}else n||(e=Bt(K(e)?[]:{},e));if(!u){for(a in r)ir.call(d,e,a,"get",r[a]);s=function(t){return xr(t,d)||(c?e.p:e)}}}return le(i,s)},shuffle:ge},install:ut,effects:yt,ticker:Ne,updateRoot:Je.updateRoot,plugins:xt,globalTimeline:x,core:{PropTween:Tr,globals:ct,Tween:hr,Timeline:Je,Animation:Ke,getCache:Rt,_removeLinkedListItem:Xt,reverting:function(){return v},context:function(t){return t&&_&&(_.data.push(t),t._ctx=_),_},suppressOverwrites:function(t){return g=t}}};Mt("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return Lr[t]=hr[t]})),Ne.add(Je.updateRoot),R=Lr.to({},{duration:0});var Pr=function(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r},zr=function(t,e){return{name:t,rawVars:1,init:function(t,r,i){i._onInit=function(t){var i,n;if(Y(r)&&(i={},Mt(r,(function(t){return i[t]=1})),r=i),e){for(n in i={},r)i[n]=e(r[n]);r=i}!function(t,e){var r,i,n,s=t._targets;for(r in e)for(i=s.length;i--;)(n=t._ptLookup[i][r])&&(n=n.d)&&(n._pt&&(n=Pr(n,r)),n&&n.modifier&&n.modifier(e[r],t,s[i],r))}(t,r)}}}},Br=Lr.registerPlugin({name:"attr",init:function(t,e,r,i,n){var s,a,o;for(s in this.tween=r,e)o=t.getAttribute(s)||"",(a=this.add(t,"setAttribute",(o||0)+"",e[s],i,n,0,0,s)).op=s,a.b=o,this._props.push(s)},render:function(t,e){for(var r=e._pt;r;)v?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",init:function(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},zr("roundProps",_e),zr("modifiers"),zr("snap",xe))||Lr;hr.version=Je.version=Br.version="3.12.7",E=1,H()&&Ue(),Ie.Power0,Ie.Power1,Ie.Power2,Ie.Power3,Ie.Power4,Ie.Linear,Ie.Quad,Ie.Cubic,Ie.Quart,Ie.Quint,Ie.Strong,Ie.Elastic,Ie.Back,Ie.SteppedEase,Ie.Bounce,Ie.Sine,Ie.Expo,Ie.Circ;var Nr,Ur,Ir,jr,Xr,Yr,Vr,Gr,qr={},Wr=180/Math.PI,$r=Math.PI/180,Hr=Math.atan2,Zr=/([A-Z])/g,Qr=/(left|right|width|margin|padding|x)/i,Kr=/[\s,\(]\S/,Jr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},ti=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},ei=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},ri=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},ii=function(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)},ni=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},si=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},ai=function(t,e,r){return t.style[e]=r},oi=function(t,e,r){return t.style.setProperty(e,r)},ui=function(t,e,r){return t._gsap[e]=r},li=function(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r},hi=function(t,e,r,i,n){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(n,s)},ci=function(t,e,r,i,n){var s=t._gsap;s[e]=r,s.renderTransform(n,s)},di="transform",fi=di+"Origin",pi=function t(e,r){var i=this,n=this.target,s=n.style,a=n._gsap;if(e in qr&&s){if(this.tfm=this.tfm||{},"transform"===e)return Jr.transform.split(",").forEach((function(e){return t.call(i,e,r)}));if(~(e=Jr[e]||e).indexOf(",")?e.split(",").forEach((function(t){return i.tfm[t]=Di(n,t)})):this.tfm[e]=a.x?a[e]:Di(n,e),e===fi&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(di)>=0)return;a.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(fi,r,"")),e=di}(s||r)&&this.props.push(e,r,s[e])},mi=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},gi=function(){var t,e,r=this.props,i=this.target,n=i.style,s=i._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?i[r[t]](r[t+2]):i[r[t]]=r[t+2]:r[t+2]?n[r[t]]=r[t+2]:n.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(Zr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)s[e]=this.tfm[e];s.svg&&(s.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(t=Vr())&&t.isStart||n[di]||(mi(n),s.zOrigin&&n[fi]&&(n[fi]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},vi=function(t,e){var r={target:t,props:[],revert:gi,save:pi};return t._gsap||Br.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach((function(t){return r.save(t)})),r},_i=function(t,e){var r=Ur.createElementNS?Ur.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ur.createElement(t);return r&&r.style?r:Ur.createElement(t)},xi=function t(e,r,i){var n=getComputedStyle(e);return n[r]||n.getPropertyValue(r.replace(Zr,"-$1").toLowerCase())||n.getPropertyValue(r)||!i&&t(e,bi(r)||r,1)||""},yi="O,Moz,ms,Ms,Webkit".split(","),bi=function(t,e,r){var i=(e||Xr).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(yi[n]+t in i););return n<0?null:(3===n?"ms":n>=0?yi[n]:"")+t},wi=function(){"undefined"!=typeof window&&window.document&&(Nr=window,Ur=Nr.document,Ir=Ur.documentElement,Xr=_i("div")||{style:{}},_i("div"),di=bi(di),fi=di+"Origin",Xr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Gr=!!bi("perspective"),Vr=Br.core.reverting,jr=1)},Ei=function(t){var e,r=t.ownerSVGElement,i=_i("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0);n.style.display="block",i.appendChild(n),Ir.appendChild(i);try{e=n.getBBox()}catch(t){}return i.removeChild(n),Ir.removeChild(i),e},Ti=function(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])},Ri=function(t){var e,r;try{e=t.getBBox()}catch(i){e=Ei(t),r=1}return e&&(e.width||e.height)||r||(e=Ei(t)),!e||e.width||e.x||e.y?e:{x:+Ti(t,["x","cx","x1"])||0,y:+Ti(t,["y","cy","y1"])||0,width:0,height:0}},Ai=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Ri(t))},Mi=function(t,e){if(e){var r,i=t.style;e in qr&&e!==fi&&(e=di),i.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty("--"===r?e:e.replace(Zr,"-$1").toLowerCase())):i.removeAttribute(e)}},Si=function(t,e,r,i,n,s){var a=new Tr(t._pt,e,r,0,1,s?si:ni);return t._pt=a,a.b=i,a.e=n,t._props.push(r),a},Ci={deg:1,rad:1,turn:1},Fi={grid:1,flex:1},ki=function t(e,r,i,n){var s,a,o,u,l=parseFloat(i)||0,h=(i+"").trim().substr((l+"").length)||"px",c=Xr.style,d=Qr.test(r),f="svg"===e.tagName.toLowerCase(),p=(f?"client":"offset")+(d?"Width":"Height"),m=100,g="px"===n,v="%"===n;if(n===h||!l||Ci[n]||Ci[h])return l;if("px"!==h&&!g&&(l=t(e,r,i,"px")),u=e.getCTM&&Ai(e),(v||"%"===h)&&(qr[r]||~r.indexOf("adius")))return s=u?e.getBBox()[d?"width":"height"]:e[p],St(v?l/s*m:l/100*s) | |
| 9 | +;if(c[d?"width":"height"]=m+(g?h:n),a="rem"!==n&&~r.indexOf("adius")||"em"===n&&e.appendChild&&!f?e:e.parentNode,u&&(a=(e.ownerSVGElement||{}).parentNode),a&&a!==Ur&&a.appendChild||(a=Ur.body),(o=a._gsap)&&v&&o.width&&d&&o.time===Ne.time&&!o.uncache)return St(l/o.width*m);if(!v||"height"!==r&&"width"!==r)(v||"%"===h)&&!Fi[xi(a,"display")]&&(c.position=xi(e,"position")),a===e&&(c.position="static"),a.appendChild(Xr),s=Xr[p],a.removeChild(Xr),c.position="absolute";else{var _=e.style[r];e.style[r]=m+n,s=e[p],_?e.style[r]=_:Mi(e,r)}return d&&v&&((o=Rt(a)).time=Ne.time,o.width=a[p]),St(g?s*l/m:s&&l?m/s*l:0)},Di=function(t,e,r,i){var n;return jr||wi(),e in Jr&&"transform"!==e&&~(e=Jr[e]).indexOf(",")&&(e=e.split(",")[0]),qr[e]&&"transform"!==e?(n=Yi(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Vi(xi(t,fi))+" "+n.zOrigin+"px"):(!(n=t.style[e])||"auto"===n||i||~(n+"").indexOf("calc("))&&(n=zi[e]&&zi[e](t,e,r)||xi(t,e)||At(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?ki(t,e,n,r)+r:n},Oi=function(t,e,r,i){if(!r||"none"===r){var n=bi(e,t,1),s=n&&xi(t,n,1);s&&s!==r?(e=n,r=s):"borderColor"===e&&(r=xi(t,"borderTopColor"))}var a,o,u,l,h,c,d,f,p,m,g,v=new Tr(this._pt,t.style,e,0,1,_r),_=0,x=0;if(v.b=r,v.e=i,r+="","auto"==(i+="")&&(c=t.style[e],t.style[e]=i,i=xi(t,e)||i,c?t.style[e]=c:Mi(t,e)),Be(a=[r,i]),i=a[1],u=(r=a[0]).match(et)||[],(i.match(et)||[]).length){for(;o=et.exec(i);)d=o[0],p=i.substring(_,o.index),h?h=(h+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(h=1),d!==(c=u[x++]||"")&&(l=parseFloat(c)||0,g=c.substr((l+"").length),"="===d.charAt(1)&&(d=Ft(l,d)+g),f=parseFloat(d),m=d.substr((f+"").length),_=et.lastIndex-m.length,m||(m=m||O.units[e]||g,_===i.length&&(i+=m,v.e+=m)),g!==m&&(l=ki(t,e,c,m)||0),v._pt={_next:v._pt,p:p||1===x?p:",",s:l,c:f-l,m:h&&h<4||"zIndex"===e?Math.round:0});v.c=_<i.length?i.substring(_,i.length):""}else v.r="display"===e&&"none"===i?si:ni;return it.test(i)&&(v.e=0),this._pt=v,v},Li={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Pi=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,s=e.t,a=s.style,o=e.u,u=s._gsap;if("all"===o||!0===o)a.cssText="",i=1;else for(n=(o=o.split(",")).length;--n>-1;)r=o[n],qr[r]&&(i=1,r="transformOrigin"===r?fi:di),Mi(s,r);i&&(Mi(s,di),u&&(u.svg&&s.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",Yi(s,1),u.uncache=1,mi(a)))}},zi={clearProps:function(t,e,r,i,n){if("isFromStart"!==n.data){var s=t._pt=new Tr(t._pt,e,r,0,0,Pi);return s.u=i,s.pr=-10,s.tween=n,t._props.push(r),1}}},Bi=[1,0,0,1,0,0],Ni={},Ui=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Ii=function(t){var e=xi(t,di);return Ui(e)?Bi:e.substr(7).match(tt).map(St)},ji=function(t,e){var r,i,n,s,a=t._gsap||Rt(t),o=t.style,u=Ii(t);return a.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?Bi:u:(u!==Bi||t.offsetParent||t===Ir||a.svg||(n=o.display,o.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(s=1,i=t.nextElementSibling,Ir.appendChild(t)),u=Ii(t),n?o.display=n:Mi(t,"display"),s&&(i?r.insertBefore(t,i):r?r.appendChild(t):Ir.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},Xi=function(t,e,r,i,n,s){var a,o,u,l=t._gsap,h=n||ji(t,!0),c=l.xOrigin||0,d=l.yOrigin||0,f=l.xOffset||0,p=l.yOffset||0,m=h[0],g=h[1],v=h[2],_=h[3],x=h[4],y=h[5],b=e.split(" "),w=parseFloat(b[0])||0,E=parseFloat(b[1])||0;r?h!==Bi&&(o=m*_-g*v)&&(u=w*(-g/o)+E*(m/o)-(m*y-g*x)/o,w=w*(_/o)+E*(-v/o)+(v*y-_*x)/o,E=u):(w=(a=Ri(t)).x+(~b[0].indexOf("%")?w/100*a.width:w),E=a.y+(~(b[1]||b[0]).indexOf("%")?E/100*a.height:E)),i||!1!==i&&l.smooth?(x=w-c,y=E-d,l.xOffset=f+(x*m+y*v)-x,l.yOffset=p+(x*g+y*_)-y):l.xOffset=l.yOffset=0,l.xOrigin=w,l.yOrigin=E,l.smooth=!!i,l.origin=e,l.originIsAbsolute=!!r,t.style[fi]="0px 0px",s&&(Si(s,l,"xOrigin",c,w),Si(s,l,"yOrigin",d,E),Si(s,l,"xOffset",f,l.xOffset),Si(s,l,"yOffset",p,l.yOffset)),t.setAttribute("data-svg-origin",w+" "+E)},Yi=function(t,e){var r=t._gsap||new Qe(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,s,a,o,u,l,h,c,d,f,p,m,g,v,_,x,y,b,w,E,T,R,A,M,S,C,F,k,D,L,P,z=t.style,B=r.scaleX<0,N="px",U="deg",I=getComputedStyle(t),j=xi(t,fi)||"0";return i=n=s=u=l=h=c=d=f=0,a=o=1,r.svg=!(!t.getCTM||!Ai(t)),I.translate&&("none"===I.translate&&"none"===I.scale&&"none"===I.rotate||(z[di]=("none"!==I.translate?"translate3d("+(I.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==I.rotate?"rotate("+I.rotate+") ":"")+("none"!==I.scale?"scale("+I.scale.split(" ").join(",")+") ":"")+("none"!==I[di]?I[di]:"")),z.scale=z.rotate=z.translate="none"),g=ji(t,r.svg),r.svg&&(r.uncache?(M=t.getBBox(),j=r.xOrigin-M.x+"px "+(r.yOrigin-M.y)+"px",A=""):A=!e&&t.getAttribute("data-svg-origin"),Xi(t,A||j,!!A||r.originIsAbsolute,!1!==r.smooth,g)),p=r.xOrigin||0,m=r.yOrigin||0,g!==Bi&&(y=g[0],b=g[1],w=g[2],E=g[3],i=T=g[4],n=R=g[5],6===g.length?(a=Math.sqrt(y*y+b*b),o=Math.sqrt(E*E+w*w),u=y||b?Hr(b,y)*Wr:0,(c=w||E?Hr(w,E)*Wr+u:0)&&(o*=Math.abs(Math.cos(c*$r))),r.svg&&(i-=p-(p*y+m*w),n-=m-(p*b+m*E))):(P=g[6],D=g[7],C=g[8],F=g[9],k=g[10],L=g[11],i=g[12],n=g[13],s=g[14],l=(v=Hr(P,k))*Wr,v&&(A=T*(_=Math.cos(-v))+C*(x=Math.sin(-v)),M=R*_+F*x,S=P*_+k*x,C=T*-x+C*_,F=R*-x+F*_,k=P*-x+k*_,L=D*-x+L*_,T=A,R=M,P=S),h=(v=Hr(-w,k))*Wr,v&&(_=Math.cos(-v),L=E*(x=Math.sin(-v))+L*_,y=A=y*_-C*x,b=M=b*_-F*x,w=S=w*_-k*x),u=(v=Hr(b,y))*Wr,v&&(A=y*(_=Math.cos(v))+b*(x=Math.sin(v)),M=T*_+R*x,b=b*_-y*x,R=R*_-T*x,y=A,T=M),l&&Math.abs(l)+Math.abs(u)>359.9&&(l=u=0,h=180-h),a=St(Math.sqrt(y*y+b*b+w*w)),o=St(Math.sqrt(R*R+P*P)),v=Hr(T,R),c=Math.abs(v)>2e-4?v*Wr:0,f=L?1/(L<0?-L:L):0),r.svg&&(A=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Ui(xi(t,di)),A&&t.setAttribute("transform",A))),Math.abs(c)>90&&Math.abs(c)<270&&(B?(a*=-1,c+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,c+=c<=0?180:-180)),e=e||r.uncache,r.x=i-((r.xPercent=i&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+N,r.y=n-((r.yPercent=n&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+N,r.z=s+N,r.scaleX=St(a),r.scaleY=St(o),r.rotation=St(u)+U,r.rotationX=St(l)+U,r.rotationY=St(h)+U,r.skewX=c+U,r.skewY=d+U,r.transformPerspective=f+N,(r.zOrigin=parseFloat(j.split(" ")[2])||!e&&r.zOrigin||0)&&(z[fi]=Vi(j)),r.xOffset=r.yOffset=0,r.force3D=O.force3D,r.renderTransform=r.svg?Qi:Gr?Zi:qi,r.uncache=0,r},Vi=function(t){return(t=t.split(" "))[0]+" "+t[1]},Gi=function(t,e,r){var i=ce(e);return St(parseFloat(e)+parseFloat(ki(t,"x",r+"px",i)))+i},qi=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Zi(t,e)},Wi="0deg",$i="0px",Hi=") ",Zi=function(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,s=r.x,a=r.y,o=r.z,u=r.rotation,l=r.rotationY,h=r.rotationX,c=r.skewX,d=r.skewY,f=r.scaleX,p=r.scaleY,m=r.transformPerspective,g=r.force3D,v=r.target,_=r.zOrigin,x="",y="auto"===g&&t&&1!==t||!0===g;if(_&&(h!==Wi||l!==Wi)){var b,w=parseFloat(l)*$r,E=Math.sin(w),T=Math.cos(w);w=parseFloat(h)*$r,b=Math.cos(w),s=Gi(v,s,E*b*-_),a=Gi(v,a,-Math.sin(w)*-_),o=Gi(v,o,T*b*-_+_)}m!==$i&&(x+="perspective("+m+Hi),(i||n)&&(x+="translate("+i+"%, "+n+"%) "),(y||s!==$i||a!==$i||o!==$i)&&(x+=o!==$i||y?"translate3d("+s+", "+a+", "+o+") ":"translate("+s+", "+a+Hi),u!==Wi&&(x+="rotate("+u+Hi),l!==Wi&&(x+="rotateY("+l+Hi),h!==Wi&&(x+="rotateX("+h+Hi),c===Wi&&d===Wi||(x+="skew("+c+", "+d+Hi),1===f&&1===p||(x+="scale("+f+", "+p+Hi),v.style[di]=x||"translate(0, 0)"},Qi=function(t,e){var r,i,n,s,a,o=e||this,u=o.xPercent,l=o.yPercent,h=o.x,c=o.y,d=o.rotation,f=o.skewX,p=o.skewY,m=o.scaleX,g=o.scaleY,v=o.target,_=o.xOrigin,x=o.yOrigin,y=o.xOffset,b=o.yOffset,w=o.forceCSS,E=parseFloat(h),T=parseFloat(c);d=parseFloat(d),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),d+=p),d||f?(d*=$r,f*=$r,r=Math.cos(d)*m,i=Math.sin(d)*m,n=Math.sin(d-f)*-g,s=Math.cos(d-f)*g,f&&(p*=$r,a=Math.tan(f-p),n*=a=Math.sqrt(1+a*a),s*=a, | |
| 10 | +p&&(a=Math.tan(p),r*=a=Math.sqrt(1+a*a),i*=a)),r=St(r),i=St(i),n=St(n),s=St(s)):(r=m,s=g,i=n=0),(E&&!~(h+"").indexOf("px")||T&&!~(c+"").indexOf("px"))&&(E=ki(v,"x",h,"px"),T=ki(v,"y",c,"px")),(_||x||y||b)&&(E=St(E+_-(_*r+x*n)+y),T=St(T+x-(_*i+x*s)+b)),(u||l)&&(a=v.getBBox(),E=St(E+u/100*a.width),T=St(T+l/100*a.height)),a="matrix("+r+","+i+","+n+","+s+","+E+","+T+")",v.setAttribute("transform",a),w&&(v.style[di]=a)},Ki=function(t,e,r,i,n){var s,a,o=360,u=Y(n),l=parseFloat(n)*(u&&~n.indexOf("rad")?Wr:1)-i,h=i+l+"deg";return u&&("short"===(s=n.split("_")[1])&&(l%=o)!=l%180&&(l+=l<0?o:-360),"cw"===s&&l<0?l=(l+36e9)%o-~~(l/o)*o:"ccw"===s&&l>0&&(l=(l-36e9)%o-~~(l/o)*o)),t._pt=a=new Tr(t._pt,e,r,i,l,ei),a.e=h,a.u="deg",t._props.push(r),a},Ji=function(t,e){for(var r in e)t[r]=e[r];return t},tn=function(t,e,r){var i,n,s,a,o,u,l,h=Ji({},r._gsap),c=r.style;for(n in h.svg?(s=r.getAttribute("transform"),r.setAttribute("transform",""),c[di]=e,i=Yi(r,1),Mi(r,di),r.setAttribute("transform",s)):(s=getComputedStyle(r)[di],c[di]=e,i=Yi(r,1),c[di]=s),qr)(s=h[n])!==(a=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=ce(s)!==(l=ce(a))?ki(r,n,s,l):parseFloat(s),u=parseFloat(a),t._pt=new Tr(t._pt,i,n,o,u-o,ti),t._pt.u=l||0,t._props.push(n));Ji(i,h)};Mt("padding,margin,Width,Radius",(function(t,e){var r="Top",i="Right",n="Bottom",s="Left",a=(e<3?[r,i,n,s]:[r+s,r+i,n+i,n+s]).map((function(r){return e<2?t+r:"border"+r+t}));zi[e>1?"border"+t:t]=function(t,e,r,i,n){var s,o;if(arguments.length<4)return s=a.map((function(e){return Di(t,e,r)})),5===(o=s.join(" ")).split(s[0]).length?s[0]:o;s=(i+"").split(" "),o={},a.forEach((function(t,e){return o[t]=s[e]=s[e]||s[(e-1)/2|0]})),t.init(e,o,n)}}));var en,rn,nn={name:"css",register:wi,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,r,i,n){var s,a,o,u,l,h,c,d,f,p,m,g,v,_,x,y,b,w,E,T,R=this._props,A=t.style,M=r.vars.startAt;for(c in jr||wi(),this.styles=this.styles||vi(t),y=this.styles.props,this.tween=r,e)if("autoRound"!==c&&(a=e[c],!xt[c]||!nr(c,e,r,i,t,n)))if(l=typeof a,h=zi[c],"function"===l&&(l=typeof(a=a.call(r,i,t,n))),"string"===l&&~a.indexOf("random(")&&(a=we(a)),h)h(this,t,c,a,r)&&(x=1);else if("--"===c.substr(0,2))s=(getComputedStyle(t).getPropertyValue(c)+"").trim(),a+="",Pe.lastIndex=0,Pe.test(s)||(d=ce(s),f=ce(a)),f?d!==f&&(s=ki(t,c,s,f)+f):d&&(a+=d),this.add(A,"setProperty",s,a,i,n,0,0,c),R.push(c),y.push(c,0,A[c]);else if("undefined"!==l){if(M&&c in M?(s="function"==typeof M[c]?M[c].call(r,i,t,n):M[c],Y(s)&&~s.indexOf("random(")&&(s=we(s)),ce(s+"")||"auto"===s||(s+=O.units[c]||ce(Di(t,c))||""),"="===(s+"").charAt(1)&&(s=Di(t,c))):s=Di(t,c),u=parseFloat(s),(p="string"===l&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),o=parseFloat(a),c in Jr&&("autoAlpha"===c&&(1===u&&"hidden"===Di(t,"visibility")&&o&&(u=0),y.push("visibility",0,A.visibility),Si(this,A,"visibility",u?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==c&&"transform"!==c&&~(c=Jr[c]).indexOf(",")&&(c=c.split(",")[0])),m=c in qr)if(this.styles.save(c),g||((v=t._gsap).renderTransform&&!e.parseTransform||Yi(t,e.parseTransform),_=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new Tr(this._pt,A,di,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===c)this._pt=new Tr(this._pt,v,"scaleY",v.scaleY,(p?Ft(v.scaleY,p+o):o)-v.scaleY||0,ti),this._pt.u=0,R.push("scaleY",c),c+="X";else{if("transformOrigin"===c){y.push(fi,0,A[fi]),w=void 0,E=void 0,T=void 0,E=(w=(b=a).split(" "))[0],T=w[1]||"50%","top"!==E&&"bottom"!==E&&"left"!==T&&"right"!==T||(b=E,E=T,T=b),w[0]=Li[E]||E,w[1]=Li[T]||T,a=w.join(" "),v.svg?Xi(t,a,0,_,0,this):((f=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&Si(this,v,"zOrigin",v.zOrigin,f),Si(this,A,c,Vi(s),Vi(a)));continue}if("svgOrigin"===c){Xi(t,a,1,_,0,this);continue}if(c in Ni){Ki(this,v,c,u,p?Ft(u,p+a):a);continue}if("smoothOrigin"===c){Si(this,v,"smooth",v.smooth,a);continue}if("force3D"===c){v[c]=a;continue}if("transform"===c){tn(this,a,t);continue}}else c in A||(c=bi(c)||c);if(m||(o||0===o)&&(u||0===u)&&!Kr.test(a)&&c in A)o||(o=0),(d=(s+"").substr((u+"").length))!==(f=ce(a)||(c in O.units?O.units[c]:d))&&(u=ki(t,c,s,f)),this._pt=new Tr(this._pt,m?v:A,c,u,(p?Ft(u,p+o):o)-u,m||"px"!==f&&"zIndex"!==c||!1===e.autoRound?ti:ii),this._pt.u=f||0,d!==f&&"%"!==f&&(this._pt.b=s,this._pt.r=ri);else if(c in A)Oi.call(this,t,c,s,p?p+a:a);else if(c in t)this.add(t,c,s||t[c],p?p+a:a,i,n);else if("parseTransform"!==c){lt(c,a);continue}m||(c in A?y.push(c,0,A[c]):"function"==typeof t[c]?y.push(c,2,t[c]()):y.push(c,1,s||t[c])),R.push(c)}x&&Er(this)},render:function(t,e){if(e.tween._time||!Vr())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:Di,aliases:Jr,getSetter:function(t,e,r){var i=Jr[e];return i&&i.indexOf(",")<0&&(e=i),e in qr&&e!==fi&&(t._gsap.x||Di(t,"x"))?r&&Yr===r?"scale"===e?li:ui:(Yr=r||{})&&("scale"===e?hi:ci):t.style&&!q(t.style[e])?ai:~e.indexOf("-")?oi:mr(t,e)},core:{_removeProperty:Mi,_getMatrix:ji}};Br.utils.checkPrefix=bi,Br.core.getStyleSaver=vi,rn=Mt("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(en="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){qr[t]=1})),Mt(en,(function(t){O.units[t]="deg",Ni[t]=1})),Jr[rn[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+en,Mt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");Jr[e[1]]=rn[e[0]]})),Mt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){O.units[t]="px"})),Br.registerPlugin(nn);var sn=Br.registerPlugin(nn)||Br;function an({blobType:e="circle",fillColor:r="#00f0ff",blobSize:i=125,domEl:n=null,eventEl:a=window,rect:o={left:0,top:0},isDashboard:u=!1}){const l=[(0,t.useRef)(null),(0,t.useRef)(null),(0,t.useRef)(null)],h=(0,t.useRef)({x:0,y:0}),c=[(0,t.useRef)({x:0,y:0}),(0,t.useRef)({x:0,y:0}),(0,t.useRef)({x:0,y:0})],d=[Math.round(.4*i),i,Math.round(.6*i)],f=t=>{let e=t.clientX||t.touches&&t.touches[0].clientX,r=t.clientY||t.touches&&t.touches[0].clientY;o.left&&o.top&&(e-=o.left,r-=o.top),h.current={x:e,y:r}};return(0,t.useEffect)((()=>{if(a)return a.addEventListener("mousemove",f),a.addEventListener("touchmove",f),()=>{a.removeEventListener("mousemove",f),a.removeEventListener("touchmove",f)}}),[a,o]),(0,t.useEffect)((()=>{const t=()=>{sn.to(c[0].current,{x:h.current.x,y:h.current.y,duration:.1,ease:"power1.out"});for(let t=1;t<3;t++)sn.to(c[t].current,{x:c[t-1].current.x,y:c[t-1].current.y,duration:.5,ease:"power2.out"});l.forEach(((t,e)=>{t.current&&(t.current.style.transform=`translate3d(${c[e].current.x}px,${c[e].current.y}px,0) translate3d(-50%,-50%,0)`)})),requestAnimationFrame(t)},e=requestAnimationFrame(t);return()=>cancelAnimationFrame(e)}),[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("svg",{style:{position:"absolute",width:0,height:0},children:(0,s.jsxs)("filter",{id:"bBlocks-cursor-blob",children:[(0,s.jsx)("feGaussianBlur",{in:"SourceGraphic",result:"blur",stdDeviation:"30"}),(0,s.jsx)("feColorMatrix",{in:"blur",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 35 -10"})]})}),(0,s.jsx)("div",{className:"bBlocks-blob-cursor-main",style:{position:u?"absolute":"fixed",left:0,top:0,width:o?.width?o.width:"100%",height:o?.height?o.height:"100%",pointerEvents:"none"},ref:n,children:[0,1,2].map((t=>(0,s.jsx)("div",{ref:l[t],style:{position:"absolute",willChange:"transform",borderRadius:"circle"===e?"50%":"0%",backgroundColor:r,opacity:.6,width:`${d[t]||60}px`,height:`${d[t]||60}px`}},t)))})]})}sn.core.Tween;const on=(e=window)=>{const[r,i]=(0,t.useState)({}),[n,s]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{if(!e)return;const t=t=>{let e=t.clientX,r=t.clientY;i({x:e,y:r})},r=()=>s(!0),n=()=>s(!1);return e.addEventListener("mousemove",t),e.addEventListener("mousedown",r),e.addEventListener("mouseup",n),()=>{e.removeEventListener("mousemove",t),e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",n)} | |
| 11 | +}),[e,r]),{cursorPosition:r,isClicking:n,setIsClicking:s}},un=({size:e=12,color:r="#3B82F6",duration:i=.1,domEl:a=null,eventEl:o=window})=>{const{cursorPosition:u,isClicking:l}=on(a),h=(0,t.useRef)(null);(0,t.useEffect)((()=>{h.current&&sn.to(h.current,{x:u.x,y:u.y,duration:i,ease:"power3.out"})}),[u]),(0,t.useEffect)((()=>{h.current&&(l?sn.to(h.current,{scale:.7,duration:.2,ease:"power2.out"}):sn.to(h.current,{scale:1,duration:.2,ease:"elastic.out(1, 0.3)"}))}),[l]);const c={...n(e)&&{"--bBlocks-cursor-dot-cursor-size":e+"px"},...n(r)&&{"--bBlocks-cursor-dot-cursor-bg":r}};return(0,s.jsx)("div",{ref:h,className:"bBlocks-cursor-dotCursor",style:c})},ln="bBlocks-cursor",hn=({size:e=40,color:r="#EF4444",elasticity:i=.6,duration:n=.5,innerDuration:a=.1,borderWidth:o="2px",domEl:u=null,eventEl:l=window})=>{const{cursorPosition:h,isClicking:c}=on(u),d=(0,t.useRef)(null),f=(0,t.useRef)(null),p=(0,t.useRef)({x:0,y:0});return(0,t.useEffect)((()=>{if(!d.current||!f.current)return;sn.to(d.current,{x:h.x,y:h.y,duration:a,ease:"power1.out"}),sn.to(f.current,{x:h.x,y:h.y,duration:n,ease:`elastic.out(1, ${i})`});const t=h.x-p.current.x,r=h.y-p.current.y;Math.sqrt(t*t+r*r)>5?sn.to(f.current,{width:1.5*e,height:.8*e,duration:.2}):sn.to(f.current,{width:e,height:e,duration:.8,ease:"elastic.out(1, 0.3)"}),p.current={x:h.x,y:h.y}}),[h,e,i]),(0,t.useEffect)((()=>{d.current&&f.current&&(c?(sn.to(d.current,{scale:.8,duration:.2}),sn.to(f.current,{scale:1.2,duration:.3})):sn.to([d.current,f.current],{scale:1,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[c]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:d,className:`${ln}-elastic-cursor`,style:{width:.3*e,height:.3*e,backgroundColor:r}}),(0,s.jsx)("div",{ref:f,className:`${ln}-elastic-cursor-follower`,style:{width:e,height:e,border:`${o} solid ${r}`}})]})},cn=({duration:e=.6,innerDuration:r=.1,size:i,followBg:a,followBorderColor:o,followBorderWidth:u,innerBg:l,innerBorderColor:h,innerBorderWidth:c,domEl:d=null})=>{const f=(0,t.useRef)(null),p=(0,t.useRef)(null),{cursorPosition:m}=on(d);(0,t.useEffect)((()=>{const t=f.current,i=p.current;sn.to(t,{x:m.x,y:m.y,duration:e,ease:"power3"}),sn.to(i,{x:m.x,y:m.y,duration:r,ease:"power3"})}),[m]);const g={...n(i)&&{"--bBlocks-follow-cursor-size":i},...n(a)&&{"--bBlocks-follow-cursor-bg":a},...n(o)&&{"--bBlocks-follow-cursor-border-color":o},...n(u)&&{"--bBlocks-follow-cursor-border-width":u}},v={...n(i)&&{"--bBlocks-follow-cursor-size":i},...n(l)&&{"--bBlocks-follow-inner-cursor-bg":l},...n(h)&&{"--bBlocks-follow-inner-cursor-border":h},...n(c)&&{"--bBlocks-follow-inner-cursor-border-width":c}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:g,className:"bBlocks-follow-cursor",ref:f}),(0,s.jsx)("div",{style:v,className:"bBlocks-follow-inner-cursor",ref:p})]})},dn=({size:e=20,primaryColor:r,secondaryColor:i,tertiaryColor:a,intensity:o="medium",speed:u="medium",tailLength:l=8,glitchMode:h="matrix",enabled:c=!0,blendMode:d="normal",showTrail:f=!0,clickEffect:p=!1,domEl:m=null,eventEl:g=window})=>{const v=(0,t.useRef)(null),{cursorPosition:_,isClicking:x}=on(m),[y,b]=(0,t.useState)([]);if((0,t.useEffect)((()=>{c&&f&&b((t=>[{x:_.x,y:_.y,opacity:1},...t.slice(0,l-1).map(((t,e)=>({...t,opacity:1-(e+1)/l})))]))}),[_,c,f,l]),!c)return null;const w={matrix:{primary:"#00ff00",secondary:"#40ff40",tertiary:"#80ff80"},digital:{primary:"#ff4040",secondary:"#40ff40",tertiary:"#4040ff"},cyberpunk:{primary:"#ff0080",secondary:"#00ffff",tertiary:"#ffff00"},analog:{primary:"#ffffff",secondary:"#ff4444",tertiary:"#4444ff"}},E={"--bBlocks-cursor-glitch-size":`${e}px`,"--bBlocks-cursor-glitch-primary-color":n(r)?r:w[h].primary,"--bBlocks-cursor-glitch-secondary-color":n(i)?i:w[h].secondary,"--bBlocks-cursor-glitch-tertiary-color":n(a)?a:w[h].tertiary,"--bBlocks-cursor-glitch-blend-mode":d,left:_.x,top:_.y,transform:"translate(-50%, -50%) "+(x&&p?"scale(1.5)":"scale(1)")},T=["glitch-cursor",`glitch-${h}`,`intensity-${o}`,`speed-${u}`,x&&p?"clicking":""].filter(Boolean).join(" ");return(0,s.jsxs)(s.Fragment,{children:[f&&y.map(((t,i)=>(0,s.jsx)("div",{className:"glitch-cursor-trail",style:{"--bBlocks-cursor-glitch-size":e*(1-.1*i)+"px","--bBlocks-cursor-glitch-primary-color":r,"--bBlocks-cursor-glitch-trail-opacity":t.opacity,left:t.x,top:t.y,transform:"translate(-50%, -50%)",opacity:.6*t.opacity}},i))),(0,s.jsxs)("div",{ref:v,className:T,style:E,children:[(0,s.jsx)("div",{className:"cursor-core"}),(0,s.jsx)("div",{className:"cursor-glitch-layer layer-1"}),(0,s.jsx)("div",{className:"cursor-glitch-layer layer-2"}),(0,s.jsx)("div",{className:"cursor-glitch-layer layer-3"}),(0,s.jsx)("div",{className:"b-blocks-cursor-ring"}),"matrix"===h&&(0,s.jsx)("div",{className:"matrix-particles",children:Array.from({length:6}).map(((t,e)=>(0,s.jsx)("div",{className:"matrix-particle"},e)))})]})]})},fn=({size:e=50,innerSize:r=10,color:i="#F97316",pulseSpeed:n=1.5,duration:a=.2,domEl:o=null,eventEl:u=window})=>{const{cursorPosition:l,isClicking:h}=on(o),c=(0,t.useRef)(null),d=(0,t.useRef)(null),f=(0,t.useRef)(null);return(0,t.useEffect)((()=>{c.current&&d.current&&sn.to([c.current,d.current],{x:l.x,y:l.y,duration:a,ease:"power2.out"})}),[l]),(0,t.useEffect)((()=>{if(c.current)return f.current=sn.timeline({repeat:-1,yoyo:!0}),f.current.to(c.current,{scale:1.2,opacity:.6,duration:n,ease:"sine.inOut"}).to(c.current,{scale:1,opacity:.2,duration:n,ease:"sine.inOut"}),()=>{f.current&&f.current.kill()}}),[n]),(0,t.useEffect)((()=>{d.current&&c.current&&f.current&&(h?(f.current.pause(),sn.to(c.current,{scale:1.5,opacity:.8,duration:.3,ease:"power2.out"}),sn.to(d.current,{scale:1.2,duration:.2,ease:"power2.out"})):(f.current.play(),sn.to(c.current,{scale:1,opacity:.2,duration:.5,ease:"elastic.out(1, 0.3)"}),sn.to(d.current,{scale:1,duration:.4,ease:"elastic.out(1, 0.3)"})))}),[h]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:c,className:"b-blocks-cursor-glow-outer",style:{width:e,height:e,borderRadius:"50%",backgroundColor:i,opacity:.2}}),(0,s.jsx)("div",{ref:d,className:"b-blocks-cursor-glow-inner",style:{width:r,height:r,backgroundColor:i,boxShadow:`0 0 10px ${i}`}})]})},pn=({size:e=50,colors:r=["#3B82F6","#10B981","#F59E0B"],rotationSpeed:i=60,duration:n=.2,domEl:a=null,eventEl:o=window})=>{const{cursorPosition:u,isClicking:l}=on(a),h=(0,t.useRef)(null),c=(0,t.useRef)(0),d=(0,t.useRef)(performance.now()),f=180*i,p=(0,t.useRef)(f);return(0,t.useEffect)((()=>{p.current=f}),[f]),(0,t.useEffect)((()=>{h.current&&sn.to(h.current,{x:u.x,y:u.y,duration:n,ease:"power2.out"})}),[u,n]),(0,t.useEffect)((()=>{if(!h.current)return;const t=e=>{const i=(e-d.current)/1e3;d.current=e,c.current=(c.current+p.current*i)%360,h.current&&sn.to(h.current,{background:`conic-gradient(from ${c.current}deg, ${r.join(", ")})`,duration:0}),requestAnimationFrame(t)},e=requestAnimationFrame(t);return()=>{cancelAnimationFrame(e)}}),[r]),(0,t.useEffect)((()=>{h.current&&(l?sn.to(h.current,{scale:1.2,duration:.3,ease:"power2.out"}):sn.to(h.current,{scale:1,duration:.5,ease:"elastic.out(1, 0.3)"}))}),[l]),(0,s.jsx)("div",{ref:h,className:"b-blocks-cursor-gradient",style:{width:e,height:e,background:`conic-gradient(from 0deg, ${r.join(", ")})`}})},mn=({url:e="",size:r=80,rounded:i="8px",domEl:n=null,eventEl:a=window})=>{const{cursorPosition:o,isClicking:u}=on(n),l=(0,t.useRef)(null);return(0,t.useEffect)((()=>{l.current&&sn.to(l.current,{x:o.x,y:o.y,duration:.2,ease:"power2.out"})}),[o]),(0,t.useEffect)((()=>{l.current&&(u?sn.to(l.current,{scale:1.2,rotation:5,duration:.3,ease:"power2.out"}):sn.to(l.current,{scale:1,rotation:0,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[u]),(0,s.jsx)("div",{ref:l,className:"b-blocks-cursor-image",style:{width:r,height:r,backgroundImage:`url(${e})`,borderRadius:i}})},gn=({size:e=40,borderWidth:r=2,borderColor:i="#F59E0B",backgroundColor:n="#f59e0b1a",targetedEl:a='button, a, textarea, select, [role="button"], [type="submit"]',domEl:o=null,eventEl:u=window})=>{ | |
| 12 | +const{cursorPosition:l,isClicking:h}=on(o),c=(0,t.useRef)(null),[d,f]=(0,t.useState)(null);return(0,t.useEffect)((()=>{const t=t=>{const e=t.target.closest(a);f(e||null)};return o.addEventListener("mouseover",t),()=>{o.removeEventListener("mouseover",t)}}),[]),(0,t.useEffect)((()=>{if(c.current)if(d){const t=d.getBoundingClientRect(),e=t.left+t.width/2,r=t.top+t.height/2;sn.to(c.current,{x:e,y:r,width:t.width+20,height:t.height+20,borderRadius:"8px",duration:.4,ease:"elastic.out(1, 0.6)"})}else sn.to(c.current,{x:l.x,y:l.y,width:e,height:e,borderRadius:"50%",duration:.2,ease:"power2.out"})}),[l,d,e]),(0,t.useEffect)((()=>{c.current&&(h?sn.to(c.current,{scale:.9,duration:.2,ease:"power2.out"}):sn.to(c.current,{scale:1,duration:.3,ease:"elastic.out(1, 0.3)"}))}),[h]),(0,s.jsx)("div",{ref:c,className:"b-blocks-magnetic-cursor",style:{width:e,height:e,border:`${r}px solid ${i}`,backgroundColor:n}})},vn=({size:e=30,color:r="#08F7FE",shadowSize:i=20,duration:n=.2,domEl:a=null,eventEl:o=window})=>{const{cursorPosition:u,isClicking:l}=on(a),h=(0,t.useRef)(null),c=(0,t.useRef)(null);return(0,t.useEffect)((()=>{h.current&&c.current&&sn.to([h.current,c.current],{x:u.x,y:u.y,duration:n,ease:"power2.out"})}),[u]),(0,t.useEffect)((()=>{h.current&&c.current&&(l?(sn.to(h.current,{scale:.8,boxShadow:`0 0 ${1.5*i}px ${r}, 0 0 ${2*i}px ${r}`,duration:.2}),sn.to(c.current,{scale:1.2,opacity:.8,duration:.2})):(sn.to(h.current,{scale:1,boxShadow:`0 0 ${i}px ${r}, 0 0 ${1.5*i}px ${r}`,duration:.4,ease:"elastic.out(1, 0.3)"}),sn.to(c.current,{scale:1,opacity:.4,duration:.4})))}),[l,r,i]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:h,className:"b-blocks-neon-cursor",style:{width:e,height:e,backgroundColor:r,boxShadow:`0 0 ${i}px ${r}, 0 0 ${1.5*i}px ${r}`}}),(0,s.jsx)("div",{ref:c,className:"b-blocks-neon-glow",style:{width:3*e,height:3*e,backgroundColor:r,opacity:.4}})]})},xn=({size:e=60,pixelSize:r=6,color:i="linear-gradient(135deg, #fecda5 0%, #fe2d2d 50%, #6b003e 100%)",duration:n=.15,domEl:a=null})=>{const{cursorPosition:o,isClicking:u}=on(a),l=(0,t.useRef)(null);(0,t.useEffect)((()=>{l.current&&sn.to(l.current,{x:o.x,y:o.y,duration:n,ease:"power2.out"})}),[o]),(0,t.useEffect)((()=>{l.current&&(u?sn.to(l.current,{scale:.8,duration:.2,ease:"power2.out"}):sn.to(l.current,{scale:1,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[u]);const h=Math.ceil(e/r),c=[];for(let t=0;t<h;t++)for(let e=0;e<h;e++){const n=Math.sqrt(Math.pow(e-h/2,2)+Math.pow(t-h/2,2));n<=h/2&&c.push((0,s.jsx)("div",{style:{position:"absolute",left:e*r,top:t*r,width:r,height:r,background:i,opacity:u?1-n/(h/2)*.3:1}},`${e}-${t}`))}return(0,s.jsx)("div",{ref:l,className:"b-blocks-cursor-pixelated",style:{width:e,height:e},children:c})},yn=({size:e=40,borderWidth:r=2,borderColor:i="#10B981",duration:n=.2,domEl:a=null})=>{const{cursorPosition:o,isClicking:u}=on(a),l=(0,t.useRef)(null);return(0,t.useEffect)((()=>{l.current&&sn.to(l.current,{x:o.x,y:o.y,duration:n,ease:"power2.out"})}),[o]),(0,t.useEffect)((()=>{l.current&&(u?sn.to(l.current,{scale:.8,duration:.2,borderWidth:2*r,ease:"power2.out"}):sn.to(l.current,{scale:1,borderWidth:r,duration:.4,ease:"elastic.out(1, 0.3)"}))}),[u,r]),(0,s.jsx)("div",{ref:l,className:"b-blocks-cursor-ring",style:{width:e,height:e,border:`${r}px solid ${i}`}})},bn=({x:e,y:r,size:i,color:n,onComplete:a})=>{const o=(0,t.useRef)(null);return(0,t.useEffect)((()=>{o.current&&(sn.set(o.current,{x:e,y:r,scale:0,opacity:1}),sn.to(o.current,{scale:3,opacity:0,duration:1,ease:"power2.out",onComplete:a}))}),[e,r,a]),(0,s.jsx)("div",{ref:o,className:"b-blocks-cursor-ripple",style:{width:i,height:i,border:`2px solid ${n}`}})},wn=({size:e=50,color:r="rgba(56, 189, 248, 0.6)",maxRipples:i=5,duration:n=.1})=>{const{cursorPosition:a,isClicking:o}=on(),u=(0,t.useRef)(null),[l,h]=(0,t.useState)([]),c=(0,t.useRef)(0),d=(0,t.useRef)(0);return(0,t.useEffect)((()=>{u.current&&sn.to(u.current,{x:a.x,y:a.y,duration:n,ease:"power2.out"})}),[a]),(0,t.useEffect)((()=>{if(o){const t=Date.now();if(t-c.current>200){c.current=t;const e={id:d.current++,x:a.x,y:a.y};h((t=>{const r=[...t,e];return r.length>i?r.slice(r.length-i):r}))}}}),[o,a,i]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:u,className:"b-blocks-cursor-ripple-wrapper",style:{width:e/3,height:e/3,backgroundColor:r.replace(/[^,]+(?=\))/,"1")}}),l.map((t=>(0,s.jsx)(bn,{x:t.x,y:t.y,size:e,color:r,onComplete:()=>{h((e=>e.filter((e=>e.id!==t.id))))}},t.id)))]})},En=({trailWidth:e=3,color:r="#111827",trailLength:i=50,domEl:n=null})=>{const{cursorPosition:a,isClicking:o}=on(n),u=(0,t.useRef)(null),l=(0,t.useRef)(null),h=(0,t.useRef)([]);(0,t.useEffect)((()=>{const t=l.current;if(!t)return;t.width=window.innerWidth,t.height=window.innerHeight;const e=()=>{t&&(t.width=window.innerWidth,t.height=window.innerHeight,c())};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,t.useEffect)((()=>{u.current&&(sn.to(u.current,{x:a.x,y:a.y,duration:0,ease:"power2.out"}),h.current.push({x:a.x,y:a.y}),h.current.length>i&&h.current.shift(),c())}),[a,o,i]);const c=()=>{const t=l.current;if(!t)return;const i=t.getContext("2d");if(i&&(i.clearRect(0,0,t.width,t.height),!(h.current.length<2))){i.strokeStyle=r,i.lineWidth=e,i.lineCap="round",i.lineJoin="round",i.beginPath(),i.moveTo(h.current[0].x,h.current[0].y);for(let t=1;t<h.current.length;t++)if(t<h.current.length-1){const e=(h.current[t].x+h.current[t+1].x)/2,r=(h.current[t].y+h.current[t+1].y)/2;i.quadraticCurveTo(h.current[t].x,h.current[t].y,e,r)}else i.lineTo(h.current[t].x,h.current[t].y);i.stroke()}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("canvas",{ref:l,className:"b-blocks-cursor-sketch"}),(0,s.jsx)("div",{ref:u,className:"b-blocks-cursor-sketch-dot",style:{width:3*e,height:3*e,borderRadius:"50%",backgroundColor:r,border:"none",transform:"translate(-50%, -50%)"}})]})},Tn=({size:e=150,intensity:r=.7,color:i="#f00",duration:n=.2,domEl:a=null})=>{const{cursorPosition:o}=on(a),u=(0,t.useRef)(null);return(0,t.useEffect)((()=>{u.current&&sn.to(u.current,{x:o.x,y:o.y,duration:n,ease:"power2.out"})}),[o]),(0,s.jsx)("div",{ref:u,className:"b-blocks-cursor-spotlight",style:{width:e,height:e,background:`radial-gradient(circle, ${i} 0%, rgba(255,255,255,0) 70%)`,opacity:r}})},Rn=({size:e=80,backgroundColor:r="#3b82f6",textColor:i="#FFFFFF",cursorText:n="Cursor Text",duration:a=.2,domEl:o=null})=>{const{cursorPosition:u,isClicking:l}=on(o),h=(0,t.useRef)(null);return(0,t.useEffect)((()=>{h.current&&sn.to(h.current,{x:u.x,y:u.y,duration:a,ease:"power2.out"})}),[u]),(0,t.useEffect)((()=>{h.current&&(l?sn.to(h.current,{scale:.9,duration:.2,ease:"power2.out"}):sn.to(h.current,{scale:1,duration:.3,ease:"elastic.out(1, 0.3)"}))}),[l]),(0,s.jsx)("div",{ref:h,className:"b-blocks-cursor-text",style:{width:e+"px",height:e+"px",background:r,color:i,opacity:n?1:0},children:n})},An=function({SIM_RESOLUTION:e=128,DYE_RESOLUTION:r=720,CAPTURE_RESOLUTION:i=512,DENSITY_DISSIPATION:n=3.5,VELOCITY_DISSIPATION:a=2,PRESSURE:o=.1,PRESSURE_ITERATIONS:u=20,CURL:l=3,SPLAT_RADIUS:h=.2,SPLAT_FORCE:c=6e3,SHADING:d=!0,COLOR_UPDATE_SPEED:f=10,BACK_COLOR:p={r:.5,g:0,b:0},TRANSPARENT:m=!0,domEl:g=window}){const v=(0,t.useRef)(null);return(0,t.useEffect)((()=>{const t=v.current;if(!t)return;let s={SIM_RESOLUTION:e,DYE_RESOLUTION:r,CAPTURE_RESOLUTION:i,DENSITY_DISSIPATION:n,VELOCITY_DISSIPATION:a,PRESSURE:o,PRESSURE_ITERATIONS:u,CURL:l,SPLAT_RADIUS:h,SPLAT_FORCE:c,SHADING:d,COLOR_UPDATE_SPEED:f,PAUSED:!1,BACK_COLOR:p,TRANSPARENT:m},_=[new class{constructor(){this.id=-1,this.texcoordX=0,this.texcoordY=0,this.prevTexcoordX=0,this.prevTexcoordY=0,this.deltaX=0,this.deltaY=0,this.down=!1,this.moved=!1,this.color=[0,0,0]}}];const{gl:x,ext:y}=function(t){const e={alpha:!0,depth:!1,stencil:!1,antialias:!1,preserveDrawingBuffer:!1};let r=t.getContext("webgl2",e);const i=!!r;let n,s;i||(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)),i?(r.getExtension("EXT_color_buffer_float"), | |
| 13 | +s=r.getExtension("OES_texture_float_linear")):(n=r.getExtension("OES_texture_half_float"),s=r.getExtension("OES_texture_half_float_linear")),r.clearColor(0,0,0,1);const a=i?r.HALF_FLOAT:n&&n.HALF_FLOAT_OES;let o,u,l;return i?(o=b(r,r.RGBA16F,r.RGBA,a),u=b(r,r.RG16F,r.RG,a),l=b(r,r.R16F,r.RED,a)):(o=b(r,r.RGBA,r.RGBA,a),u=b(r,r.RGBA,r.RGBA,a),l=b(r,r.RGBA,r.RGBA,a)),{gl:r,ext:{formatRGBA:o,formatRG:u,formatR:l,halfFloatTexType:a,supportLinearFiltering:s}}}(t);function b(t,e,r,i){if(!function(t,e,r,i){const n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,e,4,4,0,r,i,null);const s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);return t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE}(t,e,r,i))switch(e){case t.R16F:return b(t,t.RG16F,t.RG,i);case t.RG16F:return b(t,t.RGBA16F,t.RGBA,i);default:return null}return{internalFormat:e,format:r}}y.supportLinearFiltering||(s.DYE_RESOLUTION=256,s.SHADING=!1);class w{constructor(t,e){this.uniforms={},this.program=E(t,e),this.uniforms=T(this.program)}bind(){x.useProgram(this.program)}}function E(t,e){let r=x.createProgram();return x.attachShader(r,t),x.attachShader(r,e),x.linkProgram(r),x.getProgramParameter(r,x.LINK_STATUS)||console.trace(x.getProgramInfoLog(r)),r}function T(t){let e=[],r=x.getProgramParameter(t,x.ACTIVE_UNIFORMS);for(let i=0;i<r;i++){let r=x.getActiveUniform(t,i).name;e[r]=x.getUniformLocation(t,r)}return e}function R(t,e,r){e=function(t,e){if(!e)return t;let r="";return e.forEach((t=>{r+="#define "+t+"\n"})),r+t}(e,r);const i=x.createShader(t);return x.shaderSource(i,e),x.compileShader(i),x.getShaderParameter(i,x.COMPILE_STATUS)||console.trace(x.getShaderInfoLog(i)),i} | |
| 14 | +const A=R(x.VERTEX_SHADER,"\n precision highp float;\n attribute vec2 aPosition;\n varying vec2 vUv;\n varying vec2 vL;\n varying vec2 vR;\n varying vec2 vT;\n varying vec2 vB;\n uniform vec2 texelSize;\n\n void main () {\n vUv = aPosition * 0.5 + 0.5;\n vL = vUv - vec2(texelSize.x, 0.0);\n vR = vUv + vec2(texelSize.x, 0.0);\n vT = vUv + vec2(0.0, texelSize.y);\n vB = vUv - vec2(0.0, texelSize.y);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n }\n "),M=R(x.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n uniform sampler2D uTexture;\n\n void main () {\n gl_FragColor = texture2D(uTexture, vUv);\n }\n "),S=R(x.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n uniform sampler2D uTexture;\n uniform float value;\n\n void main () {\n gl_FragColor = value * texture2D(uTexture, vUv);\n }\n "),C=R(x.FRAGMENT_SHADER,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n uniform sampler2D uTarget;\n uniform float aspectRatio;\n uniform vec3 color;\n uniform vec2 point;\n uniform float radius;\n\n void main () {\n vec2 p = vUv - point.xy;\n p.x *= aspectRatio;\n vec3 splat = exp(-dot(p, p) / radius) * color;\n vec3 base = texture2D(uTarget, vUv).xyz;\n gl_FragColor = vec4(base + splat, 1.0);\n }\n "),F=R(x.FRAGMENT_SHADER,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n uniform sampler2D uVelocity;\n uniform sampler2D uSource;\n uniform vec2 texelSize;\n uniform vec2 dyeTexelSize;\n uniform float dt;\n uniform float dissipation;\n\n vec4 bilerp (sampler2D sam, vec2 uv, vec2 tsize) {\n vec2 st = uv / tsize - 0.5;\n vec2 iuv = floor(st);\n vec2 fuv = fract(st);\n\n vec4 a = texture2D(sam, (iuv + vec2(0.5, 0.5)) * tsize);\n vec4 b = texture2D(sam, (iuv + vec2(1.5, 0.5)) * tsize);\n vec4 c = texture2D(sam, (iuv + vec2(0.5, 1.5)) * tsize);\n vec4 d = texture2D(sam, (iuv + vec2(1.5, 1.5)) * tsize);\n\n return mix(mix(a, b, fuv.x), mix(c, d, fuv.x), fuv.y);\n }\n\n void main () {\n #ifdef MANUAL_FILTERING\n vec2 coord = vUv - dt * bilerp(uVelocity, vUv, texelSize).xy * texelSize;\n vec4 result = bilerp(uSource, coord, dyeTexelSize);\n #else\n vec2 coord = vUv - dt * texture2D(uVelocity, vUv).xy * texelSize;\n vec4 result = texture2D(uSource, coord);\n #endif\n float decay = 1.0 + dissipation * dt;\n gl_FragColor = result / decay;\n }\n ",y.supportLinearFiltering?null:["MANUAL_FILTERING"]),k=R(x.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uVelocity;\n\n void main () {\n float L = texture2D(uVelocity, vL).x;\n float R = texture2D(uVelocity, vR).x;\n float T = texture2D(uVelocity, vT).y;\n float B = texture2D(uVelocity, vB).y;\n\n vec2 C = texture2D(uVelocity, vUv).xy;\n if (vL.x < 0.0) { L = -C.x; }\n if (vR.x > 1.0) { R = -C.x; }\n if (vT.y > 1.0) { T = -C.y; }\n if (vB.y < 0.0) { B = -C.y; }\n\n float div = 0.5 * (R - L + T - B);\n gl_FragColor = vec4(div, 0.0, 0.0, 1.0);\n }\n "),D=R(x.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uVelocity;\n\n void main () {\n float L = texture2D(uVelocity, vL).y;\n float R = texture2D(uVelocity, vR).y;\n float T = texture2D(uVelocity, vT).x;\n float B = texture2D(uVelocity, vB).x;\n float vorticity = R - L - T + B;\n gl_FragColor = vec4(0.5 * vorticity, 0.0, 0.0, 1.0);\n }\n "),O=R(x.FRAGMENT_SHADER,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n varying vec2 vL;\n varying vec2 vR;\n varying vec2 vT;\n varying vec2 vB;\n uniform sampler2D uVelocity;\n uniform sampler2D uCurl;\n uniform float curl;\n uniform float dt;\n\n void main () {\n float L = texture2D(uCurl, vL).x;\n float R = texture2D(uCurl, vR).x;\n float T = texture2D(uCurl, vT).x;\n float B = texture2D(uCurl, vB).x;\n float C = texture2D(uCurl, vUv).x;\n\n vec2 force = 0.5 * vec2(abs(T) - abs(B), abs(R) - abs(L));\n force /= length(force) + 0.0001;\n force *= curl * C;\n force.y *= -1.0;\n\n vec2 velocity = texture2D(uVelocity, vUv).xy;\n velocity += force * dt;\n velocity = min(max(velocity, -1000.0), 1000.0);\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n }\n "),L=R(x.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uPressure;\n uniform sampler2D uDivergence;\n\n void main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n float C = texture2D(uPressure, vUv).x;\n float divergence = texture2D(uDivergence, vUv).x;\n float pressure = (L + R + B + T - divergence) * 0.25;\n gl_FragColor = vec4(pressure, 0.0, 0.0, 1.0);\n }\n "),P=R(x.FRAGMENT_SHADER,"\n precision mediump float;\n precision mediump sampler2D;\n varying highp vec2 vUv;\n varying highp vec2 vL;\n varying highp vec2 vR;\n varying highp vec2 vT;\n varying highp vec2 vB;\n uniform sampler2D uPressure;\n uniform sampler2D uVelocity;\n\n void main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n vec2 velocity = texture2D(uVelocity, vUv).xy;\n velocity.xy -= vec2(R - L, T - B);\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n }\n "),z=(x.bindBuffer(x.ARRAY_BUFFER,x.createBuffer()),x.bufferData(x.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),x.STATIC_DRAW),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,x.createBuffer()),x.bufferData(x.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),x.STATIC_DRAW),x.vertexAttribPointer(0,2,x.FLOAT,!1,0,0),x.enableVertexAttribArray(0),(t,e=!1)=>{null==t?(x.viewport(0,0,x.drawingBufferWidth,x.drawingBufferHeight),x.bindFramebuffer(x.FRAMEBUFFER,null)):(x.viewport(0,0,t.width,t.height),x.bindFramebuffer(x.FRAMEBUFFER,t.fbo)),e&&(x.clearColor(0,0,0,1),x.clear(x.COLOR_BUFFER_BIT)),x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)});let B,N,U,I,j | |
| 15 | +;const X=new w(A,M),Y=new w(A,S),V=new w(A,C),G=new w(A,F),q=new w(A,k),W=new w(A,D),$=new w(A,O),H=new w(A,L),Z=new w(A,P),Q=new class{constructor(t,e){this.vertexShader=t,this.fragmentShaderSource=e,this.programs=[],this.activeProgram=null,this.uniforms=[]}setKeywords(t){let e=0;for(let r=0;r<t.length;r++)e+=dt(t[r]);let r=this.programs[e];if(null==r){let i=R(x.FRAGMENT_SHADER,this.fragmentShaderSource,t);r=E(this.vertexShader,i),this.programs[e]=r}r!==this.activeProgram&&(this.uniforms=T(r),this.activeProgram=r)}bind(){x.useProgram(this.activeProgram)}}(A,"\n precision highp float;\n precision highp sampler2D;\n varying vec2 vUv;\n varying vec2 vL;\n varying vec2 vR;\n varying vec2 vT;\n varying vec2 vB;\n uniform sampler2D uTexture;\n uniform sampler2D uDithering;\n uniform vec2 ditherScale;\n uniform vec2 texelSize;\n\n vec3 linearToGamma (vec3 color) {\n color = max(color, vec3(0));\n return max(1.055 * pow(color, vec3(0.416666667)) - 0.055, vec3(0));\n }\n\n void main () {\n vec3 c = texture2D(uTexture, vUv).rgb;\n #ifdef SHADING\n vec3 lc = texture2D(uTexture, vL).rgb;\n vec3 rc = texture2D(uTexture, vR).rgb;\n vec3 tc = texture2D(uTexture, vT).rgb;\n vec3 bc = texture2D(uTexture, vB).rgb;\n\n float dx = length(rc) - length(lc);\n float dy = length(tc) - length(bc);\n\n vec3 n = normalize(vec3(dx, dy, length(texelSize)));\n vec3 l = vec3(0.0, 0.0, 1.0);\n\n float diffuse = clamp(dot(n, l) + 0.7, 0.7, 1.0);\n c *= diffuse;\n #endif\n\n float a = max(c.r, max(c.g, c.b));\n gl_FragColor = vec4(c, a);\n }\n ");function K(){let t=ht(s.SIM_RESOLUTION),e=ht(s.DYE_RESOLUTION);const r=y.halfFloatTexType,i=y.formatRGBA,n=y.formatRG,a=y.formatR,o=y.supportLinearFiltering?x.LINEAR:x.NEAREST;x.disable(x.BLEND),B=B?et(B,e.width,e.height,i.internalFormat,i.format,r,o):tt(e.width,e.height,i.internalFormat,i.format,r,o),N=N?et(N,t.width,t.height,n.internalFormat,n.format,r,o):tt(t.width,t.height,n.internalFormat,n.format,r,o),U=J(t.width,t.height,a.internalFormat,a.format,r,x.NEAREST),I=J(t.width,t.height,a.internalFormat,a.format,r,x.NEAREST),j=tt(t.width,t.height,a.internalFormat,a.format,r,x.NEAREST)}function J(t,e,r,i,n,s){x.activeTexture(x.TEXTURE0);let a=x.createTexture();x.bindTexture(x.TEXTURE_2D,a),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,s),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,s),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texImage2D(x.TEXTURE_2D,0,r,t,e,0,i,n,null);let o=x.createFramebuffer();return x.bindFramebuffer(x.FRAMEBUFFER,o),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,a,0),x.viewport(0,0,t,e),x.clear(x.COLOR_BUFFER_BIT),{texture:a,fbo:o,width:t,height:e,texelSizeX:1/t,texelSizeY:1/e,attach:t=>(x.activeTexture(x.TEXTURE0+t),x.bindTexture(x.TEXTURE_2D,a),t)}}function tt(t,e,r,i,n,s){let a=J(t,e,r,i,n,s),o=J(t,e,r,i,n,s);return{width:t,height:e,texelSizeX:a.texelSizeX,texelSizeY:a.texelSizeY,get read(){return a},set read(t){a=t},get write(){return o},set write(t){o=t},swap(){let t=a;a=o,o=t}}}function et(t,e,r,i,n,s,a){return t.width===e&&t.height===r||(t.read=function(t,e,r,i,n,s,a){let o=J(e,r,i,n,s,a);return X.bind(),x.uniform1i(X.uniforms.uTexture,t.attach(0)),z(o),o}(t.read,e,r,i,n,s,a),t.write=J(e,r,i,n,s,a),t.width=e,t.height=r,t.texelSizeX=1/e,t.texelSizeY=1/r),t}!function(){let t=[];s.SHADING&&t.push("SHADING"),Q.setKeywords(t)}(),K();let rt=Date.now(),it=0;function nt(){const e=function(){let t=Date.now(),e=(t-rt)/1e3;return e=Math.min(e,.016666),rt=t,e}();(function(){let e=ct(t.clientWidth),r=ct(t.clientHeight);return(t.width!==e||t.height!==r)&&(t.width=e,t.height=r,!0)})()&&K(),function(t){it+=t*s.COLOR_UPDATE_SPEED,it>=1&&(it=(it-0)%1+0,_.forEach((t=>{t.color=lt()})))}(e),_.forEach((t=>{t.moved&&(t.moved=!1,function(t){let e=t.deltaX*s.SPLAT_FORCE,r=t.deltaY*s.SPLAT_FORCE;st(t.texcoordX,t.texcoordY,e,r,t.color)}(t))})),function(t){x.disable(x.BLEND),W.bind(),x.uniform2f(W.uniforms.texelSize,N.texelSizeX,N.texelSizeY),x.uniform1i(W.uniforms.uVelocity,N.read.attach(0)),z(I),$.bind(),x.uniform2f($.uniforms.texelSize,N.texelSizeX,N.texelSizeY),x.uniform1i($.uniforms.uVelocity,N.read.attach(0)),x.uniform1i($.uniforms.uCurl,I.attach(1)),x.uniform1f($.uniforms.curl,s.CURL),x.uniform1f($.uniforms.dt,t),z(N.write),N.swap(),q.bind(),x.uniform2f(q.uniforms.texelSize,N.texelSizeX,N.texelSizeY),x.uniform1i(q.uniforms.uVelocity,N.read.attach(0)),z(U),Y.bind(),x.uniform1i(Y.uniforms.uTexture,j.read.attach(0)),x.uniform1f(Y.uniforms.value,s.PRESSURE),z(j.write),j.swap(),H.bind(),x.uniform2f(H.uniforms.texelSize,N.texelSizeX,N.texelSizeY),x.uniform1i(H.uniforms.uDivergence,U.attach(0));for(let t=0;t<s.PRESSURE_ITERATIONS;t++)x.uniform1i(H.uniforms.uPressure,j.read.attach(1)),z(j.write),j.swap();Z.bind(),x.uniform2f(Z.uniforms.texelSize,N.texelSizeX,N.texelSizeY),x.uniform1i(Z.uniforms.uPressure,j.read.attach(0)),x.uniform1i(Z.uniforms.uVelocity,N.read.attach(1)),z(N.write),N.swap(),G.bind(),x.uniform2f(G.uniforms.texelSize,N.texelSizeX,N.texelSizeY),y.supportLinearFiltering||x.uniform2f(G.uniforms.dyeTexelSize,N.texelSizeX,N.texelSizeY);let e=N.read.attach(0);x.uniform1i(G.uniforms.uVelocity,e),x.uniform1i(G.uniforms.uSource,e),x.uniform1f(G.uniforms.dt,t),x.uniform1f(G.uniforms.dissipation,s.VELOCITY_DISSIPATION),z(N.write),N.swap(),y.supportLinearFiltering||x.uniform2f(G.uniforms.dyeTexelSize,B.texelSizeX,B.texelSizeY),x.uniform1i(G.uniforms.uVelocity,N.read.attach(0)),x.uniform1i(G.uniforms.uSource,B.read.attach(1)),x.uniform1f(G.uniforms.dissipation,s.DENSITY_DISSIPATION),z(B.write),B.swap()}(e),x.blendFunc(x.ONE,x.ONE_MINUS_SRC_ALPHA),x.enable(x.BLEND),function(t){let e=x.drawingBufferWidth,r=x.drawingBufferHeight;Q.bind(),s.SHADING&&x.uniform2f(Q.uniforms.texelSize,1/e,1/r),x.uniform1i(Q.uniforms.uTexture,B.read.attach(0)),z(t)}(null),requestAnimationFrame(nt)}function st(e,r,i,n,a){V.bind(),x.uniform1i(V.uniforms.uTarget,N.read.attach(0)),x.uniform1f(V.uniforms.aspectRatio,t.width/t.height),x.uniform2f(V.uniforms.point,e,r),x.uniform3f(V.uniforms.color,i,n,0),x.uniform1f(V.uniforms.radius,function(e){let r=t.width/t.height;return r>1&&(e*=r),e}(s.SPLAT_RADIUS/100)),z(N.write),N.swap(),x.uniform1i(V.uniforms.uTarget,B.read.attach(0)),x.uniform3f(V.uniforms.color,a.r,a.g,a.b),z(B.write),B.swap()}function at(e,r,i,n){e.id=r,e.down=!0,e.moved=!1,e.texcoordX=i/t.width,e.texcoordY=1-n/t.height,e.prevTexcoordX=e.texcoordX,e.prevTexcoordY=e.texcoordY,e.deltaX=0,e.deltaY=0,e.color=lt()}function ot(e,r,i,n){e.prevTexcoordX=e.texcoordX,e.prevTexcoordY=e.texcoordY,e.texcoordX=r/t.width,e.texcoordY=1-i/t.height,e.deltaX=function(e){let r=t.width/t.height;return r<1&&(e*=r),e}(e.texcoordX-e.prevTexcoordX),e.deltaY=function(e){let r=t.width/t.height;return r>1&&(e/=r),e}(e.texcoordY-e.prevTexcoordY),e.moved=Math.abs(e.deltaX)>0||Math.abs(e.deltaY)>0,e.color=n}function ut(t){t.down=!1}function lt(){let t=function(t){let e,r,i,n,s,a,o,u;switch(n=Math.floor(6*t),s=6*t-n,a=0,o=1*(1-1*s),u=1*(1-1*(1-s)),n%6){case 0:e=1,r=u,i=0;break;case 1:e=o,r=1,i=0;break;case 2:e=0,r=1,i=u;break;case 3:e=0,r=o,i=1;break;case 4:e=u,r=0,i=1;break;case 5:e=1,r=0,i=o}return{r:e,g:r,b:i}}(Math.random());return t.r*=.15,t.g*=.15,t.b*=.15,t}function ht(t){let e=x.drawingBufferWidth/x.drawingBufferHeight;e<1&&(e=1/e);const r=Math.round(t),i=Math.round(t*e);return x.drawingBufferWidth>x.drawingBufferHeight?{width:i,height:r}:{width:r,height:i}}function ct(t){const e=window.devicePixelRatio||1;return Math.floor(t*e)}function dt(t){if(0===t.length)return 0;let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return e}g.addEventListener("mousedown",(t=>{let e=_[0] | |
| 16 | +;at(e,-1,ct(t.clientX),ct(t.clientY)),function(t){const e=lt();e.r*=10,e.g*=10,e.b*=10;let r=10*(Math.random()-.5),i=30*(Math.random()-.5);st(t.texcoordX,t.texcoordY,r,i,e)}(e)})),document.body.addEventListener("mousemove",(function t(e){let r=_[0],i=ct(e.clientX),n=ct(e.clientY),s=lt();nt(),ot(r,i,n,s),document.body.removeEventListener("mousemove",t)})),g.addEventListener("mousemove",(t=>{let e=_[0];ot(e,ct(t.clientX),ct(t.clientY),e.color)})),document.body.addEventListener("touchstart",(function t(e){const r=e.targetTouches;let i=_[0];for(let t=0;t<r.length;t++){let e=ct(r[t].clientX),n=ct(r[t].clientY);nt(),at(i,r[t].identifier,e,n)}document.body.removeEventListener("touchstart",t)})),g.addEventListener("touchstart",(t=>{const e=t.targetTouches;let r=_[0];for(let t=0;t<e.length;t++){let i=ct(e[t].clientX),n=ct(e[t].clientY);at(r,e[t].identifier,i,n)}})),g.addEventListener("touchmove",(t=>{const e=t.targetTouches;let r=_[0];for(let t=0;t<e.length;t++)ot(r,ct(e[t].clientX),ct(e[t].clientY),r.color)}),!1),g.addEventListener("touchend",(t=>{const e=t.changedTouches;let r=_[0];for(let t=0;t<e.length;t++)ut(r)})),nt()}),[e,r,i,n,a,o,u,l,h,c,d,f,p,m]),(0,s.jsx)("div",{style:{position:"fixed",top:0,left:0,zIndex:50,pointerEvents:"none",width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:v,id:"fluid",style:{width:"100vw",height:"100vh",display:"block"}})})},Mn=({shape:e={},domEl:r=null,eventEl:n=window,rect:a={},isDashboard:o=!1})=>{switch(e?.type){case"follow":return(0,s.jsx)(cn,{shape:e.type,...e?.follow,domEl:r});case"blob":return(0,s.jsx)(an,{...e.blob,domEl:r,eventEl:n,rect:a,isDashboard:o});case"dot":return(0,s.jsx)(un,{...e.dot,domEl:r});case"elastic":return(0,s.jsx)(hn,{...e.elastic,domEl:r});case"digital":case"analog":case"cyberpunk":case"matrix":return(0,t.createElement)(dn,{...function(t,e){return{...i[t],...e?.[t]}}(e.type,e),key:e.type,domEl:r});case"glow":return(0,s.jsx)(fn,{...e?.glow,domEl:r});case"gradient":return(0,s.jsx)(pn,{...e?.gradient,domEl:r});case"image":return(0,s.jsx)(mn,{...e?.image,url:e?.image?.img?.url,domEl:r});case"magnetic":return(0,s.jsx)(gn,{...e?.magnetic,domEl:r});case"neon":return(0,s.jsx)(vn,{...e?.neon,domEl:r});case"pixelated":return(0,s.jsx)(xn,{...e?.pixelated,domEl:r});case"ring":return(0,s.jsx)(yn,{...e?.ring,domEl:r});case"ripple":return(0,s.jsx)(wn,{domEl:r,eventEl:n});case"sketch":return(0,s.jsx)(En,{...e?.sketch,domEl:r});case"spotlight":return(0,s.jsx)(Tn,{...e?.spotlight,domEl:r});case"splash":return(0,s.jsx)(An,{SPLAT_RADIUS:e?.splash?.size,domEl:r},e?.splash?.size);case"text":return(0,s.jsx)(Rn,{...e?.text,domEl:r});default:return null}};function Sn(t){let e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function Cn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Fn(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function kn(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Dn(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function On(t){let e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i}function Ln(t,e){let r=e[0],i=e[1],n=e[2],s=r*r+i*i+n*n;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function Pn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function zn(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[0],o=r[1],u=r[2];return t[0]=n*u-s*o,t[1]=s*a-i*u,t[2]=i*o-n*a,t}const Bn=function(){const t=[0,0,0],e=[0,0,0];return function(r,i){Cn(t,r),Cn(e,i),Ln(t,t),Ln(e,e);let n=Pn(t,e);return n>1?0:n<-1?Math.PI:Math.acos(n)}}();class Nn extends Array{constructor(t=0,e=t,r=t){return super(t,e,r),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,e=t,r=t){return t.length?this.copy(t):(function(t,e,r,i){t[0]=e,t[1]=r,t[2]=i}(this,t,e,r),this)}copy(t){return Cn(this,t),this}add(t,e){return e?Fn(this,t,e):Fn(this,this,t),this}sub(t,e){return e?kn(this,t,e):kn(this,this,t),this}multiply(t){var e,r,i;return t.length?(r=this,i=t,(e=this)[0]=r[0]*i[0],e[1]=r[1]*i[1],e[2]=r[2]*i[2]):Dn(this,this,t),this}divide(t){var e,r,i;return t.length?(r=this,i=t,(e=this)[0]=r[0]/i[0],e[1]=r[1]/i[1],e[2]=r[2]/i[2]):Dn(this,this,1/t),this}inverse(t=this){var e,r;return r=t,(e=this)[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],this}len(){return Sn(this)}distance(t){return t?function(t,e){let r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+i*i+n*n)}(this,t):Sn(this)}squaredLen(){return On(this)}squaredDistance(t){return t?function(t,e){let r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n}(this,t):On(this)}negate(t=this){var e,r;return r=t,(e=this)[0]=-r[0],e[1]=-r[1],e[2]=-r[2],this}cross(t,e){return e?zn(this,t,e):zn(this,this,t),this}scale(t){return Dn(this,this,t),this}normalize(){return Ln(this,this),this}dot(t){return Pn(this,t)}equals(t){return e=t,this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2];var e}applyMatrix3(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2];t[0]=i*r[0]+n*r[3]+s*r[6],t[1]=i*r[1]+n*r[4]+s*r[7],t[2]=i*r[2]+n*r[5]+s*r[8]}(this,this,t),this}applyMatrix4(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[3]*i+r[7]*n+r[11]*s+r[15];a=a||1,t[0]=(r[0]*i+r[4]*n+r[8]*s+r[12])/a,t[1]=(r[1]*i+r[5]*n+r[9]*s+r[13])/a,t[2]=(r[2]*i+r[6]*n+r[10]*s+r[14])/a}(this,this,t),this}scaleRotateMatrix4(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[3]*i+r[7]*n+r[11]*s+r[15];a=a||1,t[0]=(r[0]*i+r[4]*n+r[8]*s)/a,t[1]=(r[1]*i+r[5]*n+r[9]*s)/a,t[2]=(r[2]*i+r[6]*n+r[10]*s)/a}(this,this,t),this}applyQuaternion(t){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=r[0],o=r[1],u=r[2],l=o*s-u*n,h=u*i-a*s,c=a*n-o*i,d=o*c-u*h,f=u*l-a*c,p=a*h-o*l,m=2*r[3];l*=m,h*=m,c*=m,d*=2,f*=2,p*=2,t[0]=i+l+d,t[1]=n+h+f,t[2]=s+c+p}(this,this,t),this}angle(t){return Bn(this,t)}lerp(t,e){return function(t,e,r,i){let n=e[0],s=e[1],a=e[2];t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s),t[2]=a+i*(r[2]-a)}(this,this,t,e),this}smoothLerp(t,e,r){return function(t,e,r,i,n){const s=Math.exp(-i*n);let a=e[0],o=e[1],u=e[2];t[0]=r[0]+(a-r[0])*s,t[1]=r[1]+(o-r[1])*s,t[2]=r[2]+(u-r[2])*s}(this,this,t,e,r),this}clone(){return new Nn(this[0],this[1],this[2])}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}transformDirection(t){const e=this[0],r=this[1],i=this[2];return this[0]=t[0]*e+t[4]*r+t[8]*i,this[1]=t[1]*e+t[5]*r+t[9]*i,this[2]=t[2]*e+t[6]*r+t[10]*i,this.normalize()}}const Un=new Nn;let In=1;class jn{constructor({canvas:t=document.createElement("canvas"),width:e=300,height:r=150,dpr:i=1,alpha:n=!1,depth:s=!0,stencil:a=!1,antialias:o=!1,premultipliedAlpha:u=!1,preserveDrawingBuffer:l=!1,powerPreference:h="default",autoClear:c=!0,webgl:d=2}={}){const f={alpha:n,depth:s,stencil:a,antialias:o,premultipliedAlpha:u,preserveDrawingBuffer:l,powerPreference:h};this.dpr=i,this.alpha=n,this.color=!0,this.depth=s,this.stencil=a,this.premultipliedAlpha=u,this.autoClear=c,this.id=In++,2===d&&(this.gl=t.getContext("webgl2",f)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",f)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(e,r),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"), | |
| 17 | +this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,e){this.width=t,this.height=e,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=e*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:t+"px",height:e+"px"})}setViewport(t,e,r=0,i=0){this.state.viewport.width===t&&this.state.viewport.height===e||(this.state.viewport.width=t,this.state.viewport.height=e,this.state.viewport.x=r,this.state.viewport.y=i,this.gl.viewport(r,i,t,e))}setScissor(t,e,r=0,i=0){this.gl.scissor(r,i,t,e)}enable(t){!0!==this.state[t]&&(this.gl.enable(t),this.state[t]=!0)}disable(t){!1!==this.state[t]&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,e,r,i){this.state.blendFunc.src===t&&this.state.blendFunc.dst===e&&this.state.blendFunc.srcAlpha===r&&this.state.blendFunc.dstAlpha===i||(this.state.blendFunc.src=t,this.state.blendFunc.dst=e,this.state.blendFunc.srcAlpha=r,this.state.blendFunc.dstAlpha=i,void 0!==r?this.gl.blendFuncSeparate(t,e,r,i):this.gl.blendFunc(t,e))}setBlendEquation(t,e){t=t||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===e||(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=e,void 0!==e?this.gl.blendEquationSeparate(t,e):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}setStencilMask(t){this.state.stencilMask!==t&&(this.state.stencilMask=t,this.gl.stencilMask(t))}setStencilFunc(t,e,r){this.state.stencilFunc===t&&this.state.stencilRef===e&&this.state.stencilFuncMask===r||(this.state.stencilFunc=t||this.gl.ALWAYS,this.state.stencilRef=e||0,this.state.stencilFuncMask=r||0,this.gl.stencilFunc(t||this.gl.ALWAYS,e||0,r||0))}setStencilOp(t,e,r){this.state.stencilFail===t&&this.state.stencilDepthFail===e&&this.state.stencilDepthPass===r||(this.state.stencilFail=t,this.state.stencilDepthFail=e,this.state.stencilDepthPass=r,this.gl.stencilOp(t,e,r))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:e=null}={}){this.state.framebuffer!==e&&(this.state.framebuffer=e,this.gl.bindFramebuffer(t,e))}getExtension(t,e,r){return e&&this.gl[e]?this.gl[e].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),e?this.extensions[t]?this.extensions[t][r].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:t.zDepth!==e.zDepth?t.zDepth-e.zDepth:e.id-t.id}sortTransparent(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.zDepth!==e.zDepth?e.zDepth-t.zDepth:e.id-t.id}sortUI(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:e.id-t.id}getRenderList({scene:t,camera:e,frustumCull:r,sort:i}){let n=[];if(e&&r&&e.updateFrustum(),t.traverse((t=>{if(!t.visible)return!0;t.draw&&(r&&t.frustumCulled&&e&&!e.frustumIntersectsMesh(t)||n.push(t))})),i){const t=[],r=[],i=[];n.forEach((n=>{n.program.transparent?n.program.depthTest?r.push(n):i.push(n):t.push(n),n.zDepth=0,0===n.renderOrder&&n.program.depthTest&&e&&(n.worldMatrix.getTranslation(Un),Un.applyMatrix4(e.projectionViewMatrix),n.zDepth=Un.z)})),t.sort(this.sortOpaque),r.sort(this.sortTransparent),i.sort(this.sortUI),n=t.concat(r,i)}return n}render({scene:t,camera:e,target:r=null,update:i=!0,sort:n=!0,frustumCull:s=!0,clear:a}){null===r?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(r),this.setViewport(r.width,r.height)),(a||this.autoClear&&!1!==a)&&(!this.depth||r&&!r.depth||(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!r||r.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),i&&t.updateMatrixWorld(),e&&e.updateMatrixWorld(),this.getRenderList({scene:t,camera:e,frustumCull:s,sort:n}).forEach((t=>{t.draw({camera:e})}))}}function Xn(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=r[0],u=r[1],l=r[2],h=r[3];return t[0]=i*h+a*o+n*l-s*u,t[1]=n*h+a*u+s*o-i*l,t[2]=s*h+a*l+i*u-n*o,t[3]=a*h-i*o-n*u-s*l,t}class Yn extends Array{constructor(t=0,e=0,r=0,i=1){super(t,e,r,i),this.onChange=()=>{},this._target=this;const n=["0","1","2","3"];return new Proxy(this,{set(t,e){const r=Reflect.set(...arguments);return r&&n.includes(e)&&t.onChange(),r}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set w(t){this._target[3]=t,this.onChange()}identity(){var t;return(t=this._target)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.onChange(),this}set(t,e,r,i){return t.length?this.copy(t):(function(t,e,r,i,n){t[0]=e,t[1]=r,t[2]=i,t[3]=n}(this._target,t,e,r,i),this.onChange(),this)}rotateX(t){return function(t,e,r){r*=.5;let i=e[0],n=e[1],s=e[2],a=e[3],o=Math.sin(r),u=Math.cos(r);t[0]=i*u+a*o,t[1]=n*u+s*o,t[2]=s*u-n*o,t[3]=a*u-i*o}(this._target,this._target,t),this.onChange(),this}rotateY(t){return function(t,e,r){r*=.5;let i=e[0],n=e[1],s=e[2],a=e[3],o=Math.sin(r),u=Math.cos(r);t[0]=i*u-s*o,t[1]=n*u+a*o,t[2]=s*u+i*o,t[3]=a*u-n*o}(this._target,this._target,t),this.onChange(),this}rotateZ(t){return function(t,e,r){r*=.5;let i=e[0],n=e[1],s=e[2],a=e[3],o=Math.sin(r),u=Math.cos(r);t[0]=i*u+n*o,t[1]=n*u-i*o,t[2]=s*u+a*o,t[3]=a*u-s*o}(this._target,this._target,t),this.onChange(),this}inverse(t=this._target){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r*r+i*i+n*n+s*s,o=a?1/a:0;t[0]=-r*o,t[1]=-i*o,t[2]=-n*o,t[3]=s*o}(this._target,t),this.onChange(),this}conjugate(t=this._target){var e,r;return r=t,(e=this._target)[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],this.onChange(),this}copy(t){return e=this._target,r=t,e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],this.onChange(),this;var e,r}normalize(t=this._target){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r*r+i*i+n*n+s*s | |
| 18 | +;a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=i*a,t[2]=n*a,t[3]=s*a}(this._target,t),this.onChange(),this}multiply(t,e){return e?Xn(this._target,t,e):Xn(this._target,this._target,t),this.onChange(),this}dot(t){return e=this._target,r=t,e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3];var e,r}fromMatrix3(t){return function(t,e){let r,i=e[0]+e[4]+e[8];if(i>0)r=Math.sqrt(i+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);let n=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*n+n]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*n+s]-e[3*s+n])*r,t[n]=(e[3*n+i]+e[3*i+n])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}}(this._target,t),this.onChange(),this}fromEuler(t,e){return function(t,e,r="YXZ"){let i=Math.sin(.5*e[0]),n=Math.cos(.5*e[0]),s=Math.sin(.5*e[1]),a=Math.cos(.5*e[1]),o=Math.sin(.5*e[2]),u=Math.cos(.5*e[2]);"XYZ"===r?(t[0]=i*a*u+n*s*o,t[1]=n*s*u-i*a*o,t[2]=n*a*o+i*s*u,t[3]=n*a*u-i*s*o):"YXZ"===r?(t[0]=i*a*u+n*s*o,t[1]=n*s*u-i*a*o,t[2]=n*a*o-i*s*u,t[3]=n*a*u+i*s*o):"ZXY"===r?(t[0]=i*a*u-n*s*o,t[1]=n*s*u+i*a*o,t[2]=n*a*o+i*s*u,t[3]=n*a*u-i*s*o):"ZYX"===r?(t[0]=i*a*u-n*s*o,t[1]=n*s*u+i*a*o,t[2]=n*a*o-i*s*u,t[3]=n*a*u+i*s*o):"YZX"===r?(t[0]=i*a*u+n*s*o,t[1]=n*s*u+i*a*o,t[2]=n*a*o-i*s*u,t[3]=n*a*u-i*s*o):"XZY"===r&&(t[0]=i*a*u-n*s*o,t[1]=n*s*u-i*a*o,t[2]=n*a*o+i*s*u,t[3]=n*a*u+i*s*o)}(this._target,t,t.order),e||this.onChange(),this}fromAxisAngle(t,e){return function(t,e,r){r*=.5;let i=Math.sin(r);t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r)}(this._target,t,e),this.onChange(),this}slerp(t,e){return function(t,e,r,i){let n,s,a,o,u,l=e[0],h=e[1],c=e[2],d=e[3],f=r[0],p=r[1],m=r[2],g=r[3];s=l*f+h*p+c*m+d*g,s<0&&(s=-s,f=-f,p=-p,m=-m,g=-g),1-s>1e-6?(n=Math.acos(s),a=Math.sin(n),o=Math.sin((1-i)*n)/a,u=Math.sin(i*n)/a):(o=1-i,u=i),t[0]=o*l+u*f,t[1]=o*h+u*p,t[2]=o*c+u*m,t[3]=o*d+u*g}(this._target,this._target,t,e),this.onChange(),this}fromArray(t,e=0){return this._target[0]=t[e],this._target[1]=t[e+1],this._target[2]=t[e+2],this._target[3]=t[e+3],this.onChange(),this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}}function Vn(t){let e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],a=t[5],o=t[6],u=t[7],l=t[8],h=t[9],c=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-r*s)*(c*g-d*m)-(e*o-i*s)*(h*g-d*p)+(e*u-n*s)*(h*m-c*p)+(r*o-i*a)*(l*g-d*f)-(r*u-n*a)*(l*m-c*f)+(i*u-n*o)*(l*p-h*f)}function Gn(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],v=e[14],_=e[15],x=r[0],y=r[1],b=r[2],w=r[3];return t[0]=x*i+y*o+b*c+w*m,t[1]=x*n+y*u+b*d+w*g,t[2]=x*s+y*l+b*f+w*v,t[3]=x*a+y*h+b*p+w*_,x=r[4],y=r[5],b=r[6],w=r[7],t[4]=x*i+y*o+b*c+w*m,t[5]=x*n+y*u+b*d+w*g,t[6]=x*s+y*l+b*f+w*v,t[7]=x*a+y*h+b*p+w*_,x=r[8],y=r[9],b=r[10],w=r[11],t[8]=x*i+y*o+b*c+w*m,t[9]=x*n+y*u+b*d+w*g,t[10]=x*s+y*l+b*f+w*v,t[11]=x*a+y*h+b*p+w*_,x=r[12],y=r[13],b=r[14],w=r[15],t[12]=x*i+y*o+b*c+w*m,t[13]=x*n+y*u+b*d+w*g,t[14]=x*s+y*l+b*f+w*v,t[15]=x*a+y*h+b*p+w*_,t}function qn(t,e){let r=e[0],i=e[1],n=e[2],s=e[4],a=e[5],o=e[6],u=e[8],l=e[9],h=e[10];return t[0]=Math.hypot(r,i,n),t[1]=Math.hypot(s,a,o),t[2]=Math.hypot(u,l,h),t}const Wn=function(){const t=[1,1,1];return function(e,r){let i=t;qn(i,r);let n=1/i[0],s=1/i[1],a=1/i[2],o=r[0]*n,u=r[1]*s,l=r[2]*a,h=r[4]*n,c=r[5]*s,d=r[6]*a,f=r[8]*n,p=r[9]*s,m=r[10]*a,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),e[3]=.25*v,e[0]=(d-p)/v,e[1]=(f-l)/v,e[2]=(u-h)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),e[3]=(d-p)/v,e[0]=.25*v,e[1]=(u+h)/v,e[2]=(f+l)/v):c>m?(v=2*Math.sqrt(1+c-o-m),e[3]=(f-l)/v,e[0]=(u+h)/v,e[1]=.25*v,e[2]=(d+p)/v):(v=2*Math.sqrt(1+m-o-c),e[3]=(u-h)/v,e[0]=(f+l)/v,e[1]=(d+p)/v,e[2]=.25*v),e}}();function $n(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Hn(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}class Zn extends Array{constructor(t=1,e=0,r=0,i=0,n=0,s=1,a=0,o=0,u=0,l=0,h=1,c=0,d=0,f=0,p=0,m=1){return super(t,e,r,i,n,s,a,o,u,l,h,c,d,f,p,m),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,e,r,i,n,s,a,o,u,l,h,c,d,f,p,m){return t.length?this.copy(t):(function(t,e,r,i,n,s,a,o,u,l,h,c,d,f,p,m,g){t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=l,t[9]=h,t[10]=c,t[11]=d,t[12]=f,t[13]=p,t[14]=m,t[15]=g}(this,t,e,r,i,n,s,a,o,u,l,h,c,d,f,p,m),this)}translate(t,e=this){return function(t,e,r){let i,n,s,a,o,u,l,h,c,d,f,p,m=r[0],g=r[1],v=r[2];e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=n,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=l,t[7]=h,t[8]=c,t[9]=d,t[10]=f,t[11]=p,t[12]=i*m+o*g+c*v+e[12],t[13]=n*m+u*g+d*v+e[13],t[14]=s*m+l*g+f*v+e[14],t[15]=a*m+h*g+p*v+e[15])}(this,e,t),this}rotate(t,e,r=this){return function(t,e,r,i){let n,s,a,o,u,l,h,c,d,f,p,m,g,v,_,x,y,b,w,E,T,R,A,M,S=i[0],C=i[1],F=i[2],k=Math.hypot(S,C,F);Math.abs(k)<1e-6||(k=1/k,S*=k,C*=k,F*=k,n=Math.sin(r),s=Math.cos(r),a=1-s,o=e[0],u=e[1],l=e[2],h=e[3],c=e[4],d=e[5],f=e[6],p=e[7],m=e[8],g=e[9],v=e[10],_=e[11],x=S*S*a+s,y=C*S*a+F*n,b=F*S*a-C*n,w=S*C*a-F*n,E=C*C*a+s,T=F*C*a+S*n,R=S*F*a+C*n,A=C*F*a-S*n,M=F*F*a+s,t[0]=o*x+c*y+m*b,t[1]=u*x+d*y+g*b,t[2]=l*x+f*y+v*b,t[3]=h*x+p*y+_*b,t[4]=o*w+c*E+m*T,t[5]=u*w+d*E+g*T,t[6]=l*w+f*E+v*T,t[7]=h*w+p*E+_*T,t[8]=o*R+c*A+m*M,t[9]=u*R+d*A+g*M,t[10]=l*R+f*A+v*M,t[11]=h*R+p*A+_*M,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,r,t,e),this}scale(t,e=this){return function(t,e,r){let i=r[0],n=r[1],s=r[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(this,e,"number"==typeof t?[t,t,t]:t),this}add(t,e){return e?$n(this,t,e):$n(this,this,t),this}sub(t,e){return e?Hn(this,t,e):Hn(this,this,t),this}multiply(t,e){var r,i,n;return t.length?e?Gn(this,t,e):Gn(this,this,t):(i=this,n=t,(r=this)[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=i[3]*n,r[4]=i[4]*n,r[5]=i[5]*n,r[6]=i[6]*n,r[7]=i[7]*n,r[8]=i[8]*n,r[9]=i[9]*n,r[10]=i[10]*n,r[11]=i[11]*n,r[12]=i[12]*n,r[13]=i[13]*n,r[14]=i[14]*n,r[15]=i[15]*n),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}copy(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this}fromPerspective({fov:t,aspect:e,near:r,far:i}={}){return function(t,e,r,i,n){let s=1/Math.tan(e/2),a=1/(i-n);t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+i)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*i*a,t[15]=0}(this,t,e,r,i),this}fromOrthogonal({left:t,right:e,bottom:r,top:i,near:n,far:s}){return function(t,e,r,i,n,s,a){let o=1/(e-r),u=1/(i-n),l=1/(s-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*o,t[13]=(n+i)*u,t[14]=(a+s)*l,t[15]=1}(this,t,e,r,i,n,s),this}fromQuaternion(t){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r+r,o=i+i,u=n+n,l=r*a,h=i*a,c=i*o,d=n*a,f=n*o,p=n*u,m=s*a,g=s*o,v=s*u;t[0]=1-c-p,t[1]=h+v,t[2]=d-g,t[3]=0,t[4]=h-v,t[5]=1-l-p,t[6]=f+m,t[7]=0,t[8]=d+g,t[9]=f-m,t[10]=1-l-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this}setPosition(t){ | |
| 19 | +return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7],h=e[8],c=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15],_=r*o-i*a,x=r*u-n*a,y=r*l-s*a,b=i*u-n*o,w=i*l-s*o,E=n*l-s*u,T=h*m-c*p,R=h*g-d*p,A=h*v-f*p,M=c*g-d*m,S=c*v-f*m,C=d*v-f*g,F=_*C-x*S+y*M+b*A-w*R+E*T;F&&(F=1/F,t[0]=(o*C-u*S+l*M)*F,t[1]=(n*S-i*C-s*M)*F,t[2]=(m*E-g*w+v*b)*F,t[3]=(d*w-c*E-f*b)*F,t[4]=(u*A-a*C-l*R)*F,t[5]=(r*C-n*A+s*R)*F,t[6]=(g*y-p*E-v*x)*F,t[7]=(h*E-d*y+f*x)*F,t[8]=(a*S-o*A+l*T)*F,t[9]=(i*A-r*S-s*T)*F,t[10]=(p*w-m*y+v*_)*F,t[11]=(c*y-h*w-f*_)*F,t[12]=(o*R-a*M-u*T)*F,t[13]=(r*M-i*R+n*T)*F,t[14]=(m*x-p*b-g*_)*F,t[15]=(h*b-c*x+d*_)*F)}(this,t),this}compose(t,e,r){return function(t,e,r,i){const n=t,s=e[0],a=e[1],o=e[2],u=e[3],l=s+s,h=a+a,c=o+o,d=s*l,f=s*h,p=s*c,m=a*h,g=a*c,v=o*c,_=u*l,x=u*h,y=u*c,b=i[0],w=i[1],E=i[2];n[0]=(1-(m+v))*b,n[1]=(f+y)*b,n[2]=(p-x)*b,n[3]=0,n[4]=(f-y)*w,n[5]=(1-(d+v))*w,n[6]=(g+_)*w,n[7]=0,n[8]=(p+x)*E,n[9]=(g-_)*E,n[10]=(1-(d+m))*E,n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1}(this,t,e,r),this}decompose(t,e,r){return function(t,e,r,i){let n=Sn([t[0],t[1],t[2]]);const s=Sn([t[4],t[5],t[6]]),a=Sn([t[8],t[9],t[10]]);Vn(t)<0&&(n=-n),r[0]=t[12],r[1]=t[13],r[2]=t[14];const o=t.slice(),u=1/n,l=1/s,h=1/a;o[0]*=u,o[1]*=u,o[2]*=u,o[4]*=l,o[5]*=l,o[6]*=l,o[8]*=h,o[9]*=h,o[10]*=h,Wn(e,o),i[0]=n,i[1]=s,i[2]=a}(this,t,e,r),this}getRotation(t){return Wn(t,this),this}getTranslation(t){var e,r;return r=this,(e=t)[0]=r[12],e[1]=r[13],e[2]=r[14],this}getScaling(t){return qn(t,this),this}getMaxScaleOnAxis(){return function(t){let e=t[0],r=t[1],i=t[2],n=t[4],s=t[5],a=t[6],o=t[8],u=t[9],l=t[10];const h=e*e+r*r+i*i,c=n*n+s*s+a*a,d=o*o+u*u+l*l;return Math.sqrt(Math.max(h,c,d))}(this)}lookAt(t,e,r){return function(t,e,r,i){let n=e[0],s=e[1],a=e[2],o=i[0],u=i[1],l=i[2],h=n-r[0],c=s-r[1],d=a-r[2],f=h*h+c*c+d*d;0===f?d=1:(f=1/Math.sqrt(f),h*=f,c*=f,d*=f);let p=u*d-l*c,m=l*h-o*d,g=o*c-u*h;f=p*p+m*m+g*g,0===f&&(l?o+=1e-6:u?l+=1e-6:u+=1e-6,p=u*d-l*c,m=l*h-o*d,g=o*c-u*h,f=p*p+m*m+g*g),f=1/Math.sqrt(f),p*=f,m*=f,g*=f,t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=c*g-d*m,t[5]=d*p-h*g,t[6]=h*m-c*p,t[7]=0,t[8]=h,t[9]=c,t[10]=d,t[11]=0,t[12]=n,t[13]=s,t[14]=a,t[15]=1}(this,t,e,r),this}determinant(){return Vn(this)}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this[4]=t[e+4],this[5]=t[e+5],this[6]=t[e+6],this[7]=t[e+7],this[8]=t[e+8],this[9]=t[e+9],this[10]=t[e+10],this[11]=t[e+11],this[12]=t[e+12],this[13]=t[e+13],this[14]=t[e+14],this[15]=t[e+15],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t[e+4]=this[4],t[e+5]=this[5],t[e+6]=this[6],t[e+7]=this[7],t[e+8]=this[8],t[e+9]=this[9],t[e+10]=this[10],t[e+11]=this[11],t[e+12]=this[12],t[e+13]=this[13],t[e+14]=this[14],t[e+15]=this[15],t}}const Qn=new Zn;class Kn extends Array{constructor(t=0,e=t,r=t,i="YXZ"){super(t,e,r),this.order=i,this.onChange=()=>{},this._target=this;const n=["0","1","2"];return new Proxy(this,{set(t,e){const r=Reflect.set(...arguments);return r&&n.includes(e)&&t.onChange(),r}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set(t,e=t,r=t){return t.length?this.copy(t):(this._target[0]=t,this._target[1]=e,this._target[2]=r,this.onChange(),this)}copy(t){return this._target[0]=t[0],this._target[1]=t[1],this._target[2]=t[2],this.onChange(),this}reorder(t){return this._target.order=t,this.onChange(),this}fromRotationMatrix(t,e=this.order){return function(t,e,r="YXZ"){"XYZ"===r?(t[1]=Math.asin(Math.min(Math.max(e[8],-1),1)),Math.abs(e[8])<.99999?(t[0]=Math.atan2(-e[9],e[10]),t[2]=Math.atan2(-e[4],e[0])):(t[0]=Math.atan2(e[6],e[5]),t[2]=0)):"YXZ"===r?(t[0]=Math.asin(-Math.min(Math.max(e[9],-1),1)),Math.abs(e[9])<.99999?(t[1]=Math.atan2(e[8],e[10]),t[2]=Math.atan2(e[1],e[5])):(t[1]=Math.atan2(-e[2],e[0]),t[2]=0)):"ZXY"===r?(t[0]=Math.asin(Math.min(Math.max(e[6],-1),1)),Math.abs(e[6])<.99999?(t[1]=Math.atan2(-e[2],e[10]),t[2]=Math.atan2(-e[4],e[5])):(t[1]=0,t[2]=Math.atan2(e[1],e[0]))):"ZYX"===r?(t[1]=Math.asin(-Math.min(Math.max(e[2],-1),1)),Math.abs(e[2])<.99999?(t[0]=Math.atan2(e[6],e[10]),t[2]=Math.atan2(e[1],e[0])):(t[0]=0,t[2]=Math.atan2(-e[4],e[5]))):"YZX"===r?(t[2]=Math.asin(Math.min(Math.max(e[1],-1),1)),Math.abs(e[1])<.99999?(t[0]=Math.atan2(-e[9],e[5]),t[1]=Math.atan2(-e[2],e[0])):(t[0]=0,t[1]=Math.atan2(e[8],e[10]))):"XZY"===r&&(t[2]=Math.asin(-Math.min(Math.max(e[4],-1),1)),Math.abs(e[4])<.99999?(t[0]=Math.atan2(e[6],e[5]),t[1]=Math.atan2(e[8],e[0])):(t[0]=Math.atan2(-e[9],e[10]),t[1]=0))}(this._target,t,e),this.onChange(),this}fromQuaternion(t,e=this.order,r){return Qn.fromQuaternion(t),this._target.fromRotationMatrix(Qn,e),r||this.onChange(),this}fromArray(t,e=0){return this._target[0]=t[e],this._target[1]=t[e+1],this._target[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}}class Jn{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new Zn,this.worldMatrix=new Zn,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new Nn,this.quaternion=new Yn,this.scale=new Nn(1),this.rotation=new Kn,this.up=new Nn(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(t,e=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,e&&t&&t.addChild(this,!1)}addChild(t,e=!0){~this.children.indexOf(t)||this.children.push(t),e&&t.setParent(this,!1)}removeChild(t,e=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),e&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(null===this.parent?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let e=0,r=this.children.length;e<r;e++)this.children[e].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let e=0,r=this.children.length;e<r;e++)this.children[e].traverse(t)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,e=!1){e?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}const ts=new Nn;let es=1,rs=1,is=!1;class ns{constructor(t,e={}){t.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=t,this.attributes=e,this.id=es++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let t in e)this.addAttribute(t,e[t])}addAttribute(t,e){if(this.attributes[t]=e,e.id=rs++,e.size=e.size||1,e.type=e.type||(e.data.constructor===Float32Array?this.gl.FLOAT:e.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),e.target="index"===t?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,e.normalized=e.normalized||!1,e.stride=e.stride||0,e.offset=e.offset||0,e.count=e.count||(e.stride?e.data.byteLength/e.stride:e.data.length/e.size),e.divisor=e.instanced||0,e.needsUpdate=!1,e.usage=e.usage||this.gl.STATIC_DRAW,e.buffer||this.updateAttribute(e),e.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==e.count*e.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,e.count*e.divisor);this.instancedCount=e.count*e.divisor | |
| 20 | +}else"index"===t?this.drawRange.count=e.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,e.count))}updateAttribute(t){const e=!t.buffer;e&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),e?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach(((t,{name:e,type:r})=>{if(!this.attributes[e])return void console.warn(`active attribute ${e} not being supplied`);const i=this.attributes[e];this.gl.bindBuffer(i.target,i.buffer),this.glState.boundBuffer=i.buffer;let n=1;35674===r&&(n=2),35675===r&&(n=3),35676===r&&(n=4);const s=i.size/n,a=1===n?0:n*n*4,o=1===n?0:4*n;for(let e=0;e<n;e++)this.gl.vertexAttribPointer(t+e,s,i.type,i.normalized,i.stride+a,i.offset+e*o),this.gl.enableVertexAttribArray(t+e),this.gl.renderer.vertexAttribDivisor(t+e,i.divisor)})),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:e=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach(((t,{name:e})=>{const r=this.attributes[e];r.needsUpdate&&this.updateAttribute(r)}));let r=2;this.attributes.index?.type===this.gl.UNSIGNED_INT&&(r=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*r,this.instancedCount):this.gl.renderer.drawArraysInstanced(e,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*r):this.gl.drawArrays(e,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;return t.data?t:is?void 0:(console.warn("No position buffer data found to compute bounds"),is=!0)}computeBoundingBox(t){t||(t=this.getPosition());const e=t.data,r=t.size;this.bounds||(this.bounds={min:new Nn,max:new Nn,center:new Nn,scale:new Nn,radius:1/0});const i=this.bounds.min,n=this.bounds.max,s=this.bounds.center,a=this.bounds.scale;i.set(1/0),n.set(-1/0);for(let t=0,s=e.length;t<s;t+=r){const r=e[t],s=e[t+1],a=e[t+2];i.x=Math.min(r,i.x),i.y=Math.min(s,i.y),i.z=Math.min(a,i.z),n.x=Math.max(r,n.x),n.y=Math.max(s,n.y),n.z=Math.max(a,n.z)}a.sub(n,i),s.add(i,n).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const e=t.data,r=t.size;this.bounds||this.computeBoundingBox(t);let i=0;for(let t=0,n=e.length;t<n;t+=r)ts.fromArray(e,t),i=Math.max(i,this.bounds.center.squaredDistance(ts));this.bounds.radius=Math.sqrt(i)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let ss=1;const as={};class os{constructor(t,{vertex:e,fragment:r,uniforms:i={},transparent:n=!1,cullFace:s=t.BACK,frontFace:a=t.CCW,depthTest:o=!0,depthWrite:u=!0,depthFunc:l=t.LEQUAL}={}){t.canvas||console.error("gl not passed as first argument to Program"),this.gl=t,this.uniforms=i,this.id=ss++,e||console.warn("vertex shader not supplied"),r||console.warn("fragment shader not supplied"),this.transparent=n,this.cullFace=s,this.frontFace=a,this.depthTest=o,this.depthWrite=u,this.depthFunc=l,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=t.createShader(t.VERTEX_SHADER),this.fragmentShader=t.createShader(t.FRAGMENT_SHADER),this.program=t.createProgram(),t.attachShader(this.program,this.vertexShader),t.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:e,fragment:r})}setShaders({vertex:t,fragment:e}){if(t&&(this.gl.shaderSource(this.vertexShader,t),this.gl.compileShader(this.vertexShader),""!==this.gl.getShaderInfoLog(this.vertexShader)&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}\nVertex Shader\n${ls(t)}`)),e&&(this.gl.shaderSource(this.fragmentShader,e),this.gl.compileShader(this.fragmentShader),""!==this.gl.getShaderInfoLog(this.fragmentShader)&&console.warn(`${this.gl.getShaderInfoLog(this.fragmentShader)}\nFragment Shader\n${ls(e)}`)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return console.warn(this.gl.getProgramInfoLog(this.program));this.uniformLocations=new Map;let r=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let t=0;t<r;t++){let e=this.gl.getActiveUniform(this.program,t);this.uniformLocations.set(e,this.gl.getUniformLocation(this.program,e.name));const r=e.name.match(/(\w+)/g);e.uniformName=r[0],e.nameComponents=r.slice(1)}this.attributeLocations=new Map;const i=[],n=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let t=0;t<n;t++){const e=this.gl.getActiveAttrib(this.program,t),r=this.gl.getAttribLocation(this.program,e.name);-1!==r&&(i[r]=e.name,this.attributeLocations.set(e,r))}this.attributeOrder=i.join("")}setBlendFunc(t,e,r,i){this.blendFunc.src=t,this.blendFunc.dst=e,this.blendFunc.srcAlpha=r,this.blendFunc.dstAlpha=i,t&&(this.transparent=!0)}setBlendEquation(t,e){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=e}setStencilFunc(t,e,r){this.stencilRef=e,this.stencilFunc.func=t,this.stencilFunc.ref=e,this.stencilFunc.mask=r}setStencilOp(t,e,r){this.stencilOp.stencilFail=t,this.stencilOp.depthFail=e,this.stencilOp.depthPass=r}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:t=!1}={}){let e=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach(((t,r)=>{let i=this.uniforms[r.uniformName];for(const t of r.nameComponents){if(!i)break;if(!(t in i)){if(Array.isArray(i.value))break;i=void 0;break}i=i[t]}if(!i)return cs(`Active uniform ${r.name} has not been supplied`);if(i&&void 0===i.value)return cs(`${r.name} uniform is missing a value parameter`);if(i.value.texture)return e+=1,i.value.update(e),us(this.gl,r.type,t,e);if(i.value.length&&i.value[0].texture){const n=[];return i.value.forEach((t=>{e+=1, | |
| 21 | +t.update(e),n.push(e)})),us(this.gl,r.type,t,n)}us(this.gl,r.type,t,i.value)})),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function us(t,e,r,i){i=i.length?function(t){const e=t.length,r=t[0].length;if(void 0===r)return t;const i=e*r;let n=as[i];n||(as[i]=n=new Float32Array(i));for(let i=0;i<e;i++)n.set(t[i],i*r);return n}(i):i;const n=t.renderer.state.uniformLocations.get(r);if(i.length)if(void 0===n||n.length!==i.length)t.renderer.state.uniformLocations.set(r,i.slice(0));else{if(function(t,e){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r<i;r++)if(t[r]!==e[r])return!1;return!0}(n,i))return;n.set?n.set(i):function(t,e){for(let r=0,i=t.length;r<i;r++)t[r]=e[r]}(n,i),t.renderer.state.uniformLocations.set(r,n)}else{if(n===i)return;t.renderer.state.uniformLocations.set(r,i)}switch(e){case 5126:return i.length?t.uniform1fv(r,i):t.uniform1f(r,i);case 35664:return t.uniform2fv(r,i);case 35665:return t.uniform3fv(r,i);case 35666:return t.uniform4fv(r,i);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return i.length?t.uniform1iv(r,i):t.uniform1i(r,i);case 35671:case 35667:return t.uniform2iv(r,i);case 35672:case 35668:return t.uniform3iv(r,i);case 35673:case 35669:return t.uniform4iv(r,i);case 35674:return t.uniformMatrix2fv(r,!1,i);case 35675:return t.uniformMatrix3fv(r,!1,i);case 35676:return t.uniformMatrix4fv(r,!1,i)}}function ls(t){let e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}let hs=0;function cs(t){hs>100||(console.warn(t),hs++,hs>100&&console.warn("More than 100 program warnings - stopping logs."))}function ds(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],d=r[0],f=r[1],p=r[2],m=r[3],g=r[4],v=r[5],_=r[6],x=r[7],y=r[8];return t[0]=d*i+f*a+p*l,t[1]=d*n+f*o+p*h,t[2]=d*s+f*u+p*c,t[3]=m*i+g*a+v*l,t[4]=m*n+g*o+v*h,t[5]=m*s+g*u+v*c,t[6]=_*i+x*a+y*l,t[7]=_*n+x*o+y*h,t[8]=_*s+x*u+y*c,t}class fs extends Array{constructor(t=1,e=0,r=0,i=0,n=1,s=0,a=0,o=0,u=1){return super(t,e,r,i,n,s,a,o,u),this}set(t,e,r,i,n,s,a,o,u){return t.length?this.copy(t):(function(t,e,r,i,n,s,a,o,u,l){t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=l}(this,t,e,r,i,n,s,a,o,u),this)}translate(t,e=this){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],d=r[0],f=r[1];t[0]=i,t[1]=n,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=d*i+f*a+l,t[7]=d*n+f*o+h,t[8]=d*s+f*u+c}(this,e,t),this}rotate(t,e=this){return function(t,e,r){let i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],u=e[5],l=e[6],h=e[7],c=e[8],d=Math.sin(r),f=Math.cos(r);t[0]=f*i+d*a,t[1]=f*n+d*o,t[2]=f*s+d*u,t[3]=f*a-d*i,t[4]=f*o-d*n,t[5]=f*u-d*s,t[6]=l,t[7]=h,t[8]=c}(this,e,t),this}scale(t,e=this){return function(t,e,r){let i=r[0],n=r[1];t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}(this,e,t),this}multiply(t,e){return e?ds(this,t,e):ds(this,this,t),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this}copy(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}fromMatrix4(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],this}fromQuaternion(t){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=r+r,o=i+i,u=n+n,l=r*a,h=i*a,c=i*o,d=n*a,f=n*o,p=n*u,m=s*a,g=s*o,v=s*u;t[0]=1-c-p,t[3]=h-v,t[6]=d+g,t[1]=h+v,t[4]=1-l-p,t[7]=f-m,t[2]=d-g,t[5]=f+m,t[8]=1-l-c}(this,t),this}fromBasis(t,e,r){return this.set(t[0],t[1],t[2],e[0],e[1],e[2],r[0],r[1],r[2]),this}inverse(t=this){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7],h=e[8],c=h*a-o*l,d=-h*s+o*u,f=l*s-a*u,p=r*c+i*d+n*f;p&&(p=1/p,t[0]=c*p,t[1]=(-h*i+n*l)*p,t[2]=(o*i-n*a)*p,t[3]=d*p,t[4]=(h*r-n*u)*p,t[5]=(-o*r+n*s)*p,t[6]=f*p,t[7]=(-l*r+i*u)*p,t[8]=(a*r-i*s)*p)}(this,t),this}getNormalMatrix(t){return function(t,e){let r=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7],h=e[8],c=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15],_=r*o-i*a,x=r*u-n*a,y=r*l-s*a,b=i*u-n*o,w=i*l-s*o,E=n*l-s*u,T=h*m-c*p,R=h*g-d*p,A=h*v-f*p,M=c*g-d*m,S=c*v-f*m,C=d*v-f*g,F=_*C-x*S+y*M+b*A-w*R+E*T;F&&(F=1/F,t[0]=(o*C-u*S+l*M)*F,t[1]=(u*A-a*C-l*R)*F,t[2]=(a*S-o*A+l*T)*F,t[3]=(n*S-i*C-s*M)*F,t[4]=(r*C-n*A+s*R)*F,t[5]=(i*A-r*S-s*T)*F,t[6]=(m*E-g*w+v*b)*F,t[7]=(g*y-p*E-v*x)*F,t[8]=(p*w-m*y+v*_)*F)}(this,t),this}}let ps=0;class ms extends Jn{constructor(t,{geometry:e,program:r,mode:i=t.TRIANGLES,frustumCulled:n=!0,renderOrder:s=0}={}){super(),t.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=t,this.id=ps++,this.geometry=e,this.program=r,this.mode=i,this.frustumCulled=n,this.renderOrder=s,this.modelViewMatrix=new Zn,this.normalMatrix=new fs,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t})));let e=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:e}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t})))}}function gs(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function vs(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function _s(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function xs(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)}function ys(t,e){return t[0]*e[1]-t[1]*e[0]}class bs extends Array{constructor(t=0,e=t){return super(t,e),this}get x(){return this[0]}get y(){return this[1]}set x(t){this[0]=t}set y(t){this[1]=t}set(t,e=t){return t.length?this.copy(t):(function(t,e,r){t[0]=e,t[1]=r}(this,t,e),this)}copy(t){var e,r;return r=t,(e=this)[0]=r[0],e[1]=r[1],this}add(t,e){return e?gs(this,t,e):gs(this,this,t),this}sub(t,e){return e?vs(this,t,e):vs(this,this,t),this}multiply(t){var e,r;return t.length?(r=t,(e=this)[0]=this[0]*r[0],e[1]=this[1]*r[1]):_s(this,this,t),this}divide(t){var e,r;return t.length?(r=t,(e=this)[0]=this[0]/r[0],e[1]=this[1]/r[1]):_s(this,this,1/t),this}inverse(t=this){var e,r;return r=t,(e=this)[0]=1/r[0],e[1]=1/r[1],this}len(){return xs(this)}distance(t){return t?(r=(e=t)[0]-this[0],i=e[1]-this[1],Math.sqrt(r*r+i*i)):xs(this);var e,r,i}squaredLen(){return this.squaredDistance()}squaredDistance(t){return t?(r=(e=t)[0]-this[0])*r+(i=e[1]-this[1])*i:function(t){var e=t[0],r=t[1];return e*e+r*r}(this);var e,r,i}negate(t=this){var e,r;return r=t,(e=this)[0]=-r[0],e[1]=-r[1],this}cross(t,e){return e?ys(t,e):ys(this,t)}scale(t){return _s(this,this,t),this}normalize(){var t,e,r,i;return(i=(e=(t=this)[0])*e+(r=t[1])*r)>0&&(i=1/Math.sqrt(i)),this[0]=t[0]*i,this[1]=t[1]*i,this}dot(t){return e=t,this[0]*e[0]+this[1]*e[1];var e}equals(t){return e=t,this[0]===e[0]&&this[1]===e[1];var e}applyMatrix3(t){var e,r,i;return e=t,r=this[0],i=this[1],this[0]=e[0]*r+e[3]*i+e[6],this[1]=e[1]*r+e[4]*i+e[7],this}applyMatrix4(t){return function(t,e,r){let i=e[0],n=e[1];t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13]}(this,this,t),this}lerp(t,e){return function(t,e,r,i){ | |
| 22 | +var n=e[0],s=e[1];t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s)}(this,this,t,e),this}smoothLerp(t,e,r){return function(t,e,r,i,n){const s=Math.exp(-i*n);let a=e[0],o=e[1];t[0]=r[0]+(a-r[0])*s,t[1]=r[1]+(o-r[1])*s}(this,this,t,e,r),this}clone(){return new bs(this[0],this[1])}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t}}const ws={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#00ff00",blue:"#0000ff",fuchsia:"#ff00ff",cyan:"#00ffff",yellow:"#ffff00",orange:"#ff8000"};function Es(t){4===t.length&&(t=t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e||console.warn(`Unable to convert hex string ${t} to rgb values`),[parseInt(e[1],16)/255,parseInt(e[2],16)/255,parseInt(e[3],16)/255]}function Ts(t){return void 0===t?[0,0,0]:3===arguments.length?arguments:isNaN(t)?"#"===t[0]?Es(t):ws[t.toLowerCase()]?Es(ws[t.toLowerCase()]):(console.warn("Color format not recognised"),[0,0,0]):(e=t,[((e=parseInt(e))>>16&255)/255,(e>>8&255)/255,(255&e)/255]);var e}class Rs extends Array{constructor(t){return Array.isArray(t)?super(...t):super(...Ts(...arguments))}get r(){return this[0]}get g(){return this[1]}get b(){return this[2]}set r(t){this[0]=t}set g(t){this[1]=t}set b(t){this[2]=t}set(t){return Array.isArray(t)?this.copy(t):this.copy(Ts(...arguments))}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this}}const As=new Nn;class Ms{constructor(t,{points:e,vertex:r=Ss,fragment:i=Cs,uniforms:n={},attributes:s={}}){this.gl=t,this.points=e,this.count=e.length,this.position=new Float32Array(3*this.count*2),this.prev=new Float32Array(3*this.count*2),this.next=new Float32Array(3*this.count*2);const a=new Float32Array(1*this.count*2),o=new Float32Array(2*this.count*2),u=new Uint16Array(3*(this.count-1)*2);for(let t=0;t<this.count;t++){a.set([-1,1],2*t);const e=t/(this.count-1);if(o.set([0,e,1,e],4*t),t===this.count-1)continue;const r=2*t;u.set([r+0,r+1,r+2],3*(r+0)),u.set([r+2,r+1,r+3],3*(r+1))}const l=this.geometry=new ns(t,Object.assign(s,{position:{size:3,data:this.position},prev:{size:3,data:this.prev},next:{size:3,data:this.next},side:{size:1,data:a},uv:{size:2,data:o},index:{size:1,data:u}}));this.updateGeometry(),n.uResolution||(this.resolution=n.uResolution={value:new bs}),n.uDPR||(this.dpr=n.uDPR={value:1}),n.uThickness||(this.thickness=n.uThickness={value:1}),n.uColor||(this.color=n.uColor={value:new Rs("#000")}),n.uMiter||(this.miter=n.uMiter={value:1}),this.resize();const h=this.program=new os(t,{vertex:r,fragment:i,uniforms:n});this.mesh=new ms(t,{geometry:l,program:h})}updateGeometry(){this.points.forEach(((t,e)=>{t.toArray(this.position,3*e*2),t.toArray(this.position,3*e*2+3),e?(t.toArray(this.next,3*(e-1)*2),t.toArray(this.next,3*(e-1)*2+3)):(As.copy(t).sub(this.points[e+1]).add(t),As.toArray(this.prev,3*e*2),As.toArray(this.prev,3*e*2+3)),e===this.points.length-1?(As.copy(t).sub(this.points[e-1]).add(t),As.toArray(this.next,3*e*2),As.toArray(this.next,3*e*2+3)):(t.toArray(this.prev,3*(e+1)*2),t.toArray(this.prev,3*(e+1)*2+3))})),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.prev.needsUpdate=!0,this.geometry.attributes.next.needsUpdate=!0}resize(){this.resolution&&this.resolution.value.set(this.gl.canvas.width,this.gl.canvas.height),this.dpr&&(this.dpr.value=this.gl.renderer.dpr)}}const Ss="\n precision highp float;\n\n attribute vec3 position;\n attribute vec3 next;\n attribute vec3 prev;\n attribute vec2 uv;\n attribute float side;\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n uniform vec2 uResolution;\n uniform float uDPR;\n uniform float uThickness;\n uniform float uMiter;\n\n varying vec2 vUv;\n\n vec4 getPosition() {\n mat4 mvp = projectionMatrix * modelViewMatrix;\n vec4 current = mvp * vec4(position, 1);\n vec4 nextPos = mvp * vec4(next, 1);\n vec4 prevPos = mvp * vec4(prev, 1);\n\n vec2 aspect = vec2(uResolution.x / uResolution.y, 1); \n vec2 currentScreen = current.xy / current.w * aspect;\n vec2 nextScreen = nextPos.xy / nextPos.w * aspect;\n vec2 prevScreen = prevPos.xy / prevPos.w * aspect;\n \n vec2 dir1 = normalize(currentScreen - prevScreen);\n vec2 dir2 = normalize(nextScreen - currentScreen);\n vec2 dir = normalize(dir1 + dir2);\n \n vec2 normal = vec2(-dir.y, dir.x);\n normal /= mix(1.0, max(0.3, dot(normal, vec2(-dir1.y, dir1.x))), uMiter);\n normal /= aspect;\n\n float pixelWidthRatio = 1.0 / (uResolution.y / uDPR);\n float pixelWidth = current.w * pixelWidthRatio;\n normal *= pixelWidth * uThickness;\n current.xy -= normal * side;\n \n return current;\n }\n\n void main() {\n vUv = uv;\n gl_Position = getPosition();\n }\n",Cs="\n precision highp float;\n\n uniform vec3 uColor;\n \n varying vec2 vUv;\n\n void main() {\n gl_FragColor.rgb = uColor;\n gl_FragColor.a = 1.0;\n }\n",Fs=({colors:e=["#FC8EAC"],baseSpring:r=.03,baseFriction:i=.9,baseThickness:n=30,offsetFactor:s=.05,maxAge:a=500,pointCount:o=50,speedMultiplier:u=.6,enableFade:l=!1,enableShaderEffect:h=!1,effectAmplitude:c=2,backgroundColor:d=[0,0,0,0],domEl:f=document.body,eventEl:p=window,rect:m={width:window.innerWidth,height:window.innerHeight}})=>((0,t.useEffect)((()=>{const t=new jn({dpr:window.devicePixelRatio||2,alpha:!0}),g=t.gl;Array.isArray(d)&&4===d.length?g.clearColor(d[0],d[1],d[2],d[3]):g.clearColor(0,0,0,0),g.canvas.style.position="absolute",g.canvas.style.top="0",g.canvas.style.left="0",g.canvas.style.width="100%",g.canvas.style.height="100%",g.canvas.style.pointerEvents="none",g.canvas.style.zIndex=9999,g.canvas.className="b-blocks-cursor-ribbon",f.contains(g.canvas)||f.appendChild(g.canvas);const v=new Jn,_=[];function x(){const e=window.devicePixelRatio||1;let r,i;r=m.width,i=m.height,g.canvas.width=r*e,g.canvas.height=i*e,t.setSize(r,i),_.forEach((t=>{t.polyline&&t.polyline.mesh&&t.polyline.mesh.program&&t.polyline.mesh.program.uniforms.uResolution&&(t.polyline.mesh.program.uniforms.uResolution.value=[r,i]),t.polyline.resize()}))}const y=new Nn;function b(t){let e,r;t.changedTouches&&t.changedTouches.length?(e=t.changedTouches[0].clientX,r=t.changedTouches[0].clientY):(e=t.clientX,r=t.clientY);let i,n,s=0,a=0;i=m.width,n=m.height,m.top&&(a=m.top,r-=a),m.left&&(s=m.left,e-=s),y.set(e/i*2-1,r/n*-2+1,0)}p.addEventListener("mousemove",b),p.addEventListener("touchstart",b),p.addEventListener("touchmove",b),window.addEventListener("resize",x);const w=(e.length-1)/2;let E,T;E=m.width,T=m.height,e.forEach(((t,e)=>{const a=r+.05*(Math.random()-.5),u=i+.05*(Math.random()-.5),d=n+3*(Math.random()-.5),f=new Nn((e-w)*s+.01*(Math.random()-.5),.1*(Math.random()-.5),0),p={spring:a,friction:u,mouseVelocity:new Nn,mouseOffset:f},m=o,x=[];for(let t=0;t<m;t++)x.push(new Nn);p.points=x,p.polyline=new Ms(g,{points:x, | |
| 23 | +vertex:"\n precision highp float;\n attribute vec3 position;\n attribute vec3 next;\n attribute vec3 prev;\n attribute vec2 uv;\n attribute float side;\n uniform vec2 uResolution;\n uniform float uDPR;\n uniform float uThickness;\n uniform float uTime;\n uniform float uEnableShaderEffect;\n uniform float uEffectAmplitude;\n varying vec2 vUV;\n vec4 getPosition() {\n vec4 current = vec4(position, 1.0);\n vec2 aspect = vec2(uResolution.x / uResolution.y, 1.0);\n vec2 nextScreen = next.xy * aspect;\n vec2 prevScreen = prev.xy * aspect;\n vec2 tangent = normalize(nextScreen - prevScreen);\n vec2 normal = vec2(-tangent.y, tangent.x);\n normal /= aspect;\n normal *= mix(1.0, 0.1, pow(abs(uv.y - 0.5) * 2.0, 2.0));\n float dist = length(nextScreen - prevScreen);\n normal *= smoothstep(0.0, 0.02, dist);\n float pixelWidthRatio = 1.0 / (uResolution.y / uDPR);\n float pixelWidth = current.w * pixelWidthRatio;\n normal *= pixelWidth * uThickness;\n current.xy -= normal * side;\n if(uEnableShaderEffect > 0.5) {\n current.xy += normal * sin(uTime + current.x * 10.0) * uEffectAmplitude;\n }\n return current;\n }\n void main() {\n vUV = uv;\n gl_Position = getPosition();\n }\n ",fragment:"\n precision highp float;\n uniform vec3 uColor;\n uniform float uOpacity;\n uniform float uEnableFade;\n varying vec2 vUV;\n void main() {\n float fadeFactor = 1.0;\n if(uEnableFade > 0.5) {\n fadeFactor = 1.0 - smoothstep(0.0, 1.0, vUV.y);\n }\n gl_FragColor = vec4(uColor, uOpacity * fadeFactor);\n }\n ",uniforms:{uColor:{value:new Rs(t)},uThickness:{value:d},uOpacity:{value:1},uTime:{value:0},uEnableShaderEffect:{value:h?1:0},uEffectAmplitude:{value:c},uEnableFade:{value:l?1:0},uResolution:{value:[E,T]},uDPR:{value:window.devicePixelRatio||1}}}),p.polyline.mesh.setParent(v),_.push(p)})),x();const R=new Nn;let A,M=performance.now();return function e(){A=requestAnimationFrame(e);const r=performance.now(),i=r-M;M=r,_.forEach((t=>{R.copy(y).add(t.mouseOffset).sub(t.points[0]).multiply(t.spring),t.mouseVelocity.add(R).multiply(t.friction),t.points[0].add(t.mouseVelocity);for(let e=1;e<t.points.length;e++)if(isFinite(a)&&a>0){const r=a/(t.points.length-1),n=Math.min(1,i*u/r);t.points[e].lerp(t.points[e-1],n)}else t.points[e].lerp(t.points[e-1],.9);t.polyline.mesh.program.uniforms.uTime&&(t.polyline.mesh.program.uniforms.uTime.value=.001*r),t.polyline.updateGeometry()})),t.render({scene:v})}(),()=>{p.removeEventListener("mousemove",b),p.removeEventListener("touchstart",b),p.removeEventListener("touchmove",b),window.removeEventListener("resize",x),cancelAnimationFrame(A),g.canvas&&g.canvas.parentNode===f&&f.removeChild(g.canvas)}}),[e,r,i,n,s,a,o,u,l,h,c,d,f]),null),ks=({cursorInfo:e})=>{const{data:r,isLoading:i}=((e,r={},i=!1)=>{const[n,s]=(0,t.useState)(!1),[a,o]=(0,t.useState)(!1),[u,l]=(0,t.useState)(null),[h,c]=(0,t.useState)(null);if(!wp.ajax)return void console.error("Please use wp-util as a dependency");const d=(t={})=>{s(!0),o(!1),l(null),wp.ajax.post(e,{...r,...t}).done((t=>{s(!1),c(t)})).fail((t=>{s(!1),o(!0),l(t)}))},f=async(t={})=>{d(t)};return(0,t.useEffect)((()=>{i||d(r)}),[]),{data:h,saveData:f,refetch:f,isLoading:n,isError:a,error:u}})("bBlocks_get_cursor_data_settings",{nonce:window.bBlocksCursorDataConfig?.nonce}),[a,o]=(0,t.useState)(null),u=((e=2e3)=>{const[r,i]=(0,t.useState)(!1),n=(0,t.useRef)(null);return(0,t.useEffect)((()=>{document.hasFocus()&&i(!0);const t=()=>{clearTimeout(n.current),i(!0)},r=()=>{n.current=setTimeout((()=>i(!1)),e)};return document.body.addEventListener("mouseenter",t),document.body.addEventListener("mouseleave",r),()=>{document.body.removeEventListener("mouseenter",t),document.body.removeEventListener("mouseleave",r),clearTimeout(n.current)}}),[e]),r})(),[l,h]=(0,t.useState)(e);(0,t.useEffect)((()=>{document.addEventListener("bBlocksCursorCustomEventOnCursor",(function(t){h(t.detail.data)}))}),[]);const c=((e,r)=>{const[i,n]=(0,t.useState)(null);return(0,t.useEffect)((()=>{if(e||r){if(!e)return void n(r);if(!r)return void n(e);const t={...r,...e,shape:""!==e?.shape?.type&&e?.shape?e?.shape:r?.shape,effect:""!==e?.effect?.type&&e?.effect?e?.effect:r?.effect};n(t)}}),[e,r]),i})(l,a),{enableCursor:d=!0}=c||{};(0,t.useEffect)((()=>{!i&&r&&o(r)}),[r,i]);const p={...n(c?.shape?.customImg?.img)&&"predefined"==c?.source&&{cursor:`url(${c?.shape?.customImg?.img}), pointer`},..."shape"==c?.source&&{cursor:d?"auto":"none"},..."customUrl"==c?.source&&{cursor:`url(${c?.shape?.customImg?.url}), pointer`}};return(0,t.useEffect)((()=>{window.self===window.top&&p?.cursor&&(document.body.style.cursor=p.cursor)}),[c]),(0,s.jsxs)(s.Fragment,{children:["shape"==c?.source&&(0,s.jsxs)(s.Fragment,{children:["ribbon"===c?.shape?.type&&u&&(0,t.createElement)(Fs,{...c?.shape?.ribbon,domEl:document.body,eventEl:document.body,rect:document.body.getBoundingClientRect(),key:c?.shape?.type}),c?.shape?.type&&"ribbon"!==c?.shape?.type&&u?(0,s.jsx)(Mn,{shape:c?.shape,domEl:window,eventEl:window,rect:{}},c?.shape?.type):null]}),c?.effect?.type&&(0,s.jsx)(f,{effect:c?.effect},c?.effect?.type)]})};document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById("bBlocksCursorData");if(t){const r=JSON.parse(t.dataset.cursor);(0,e.createRoot)(t).render((0,s.jsx)(ks,{cursorInfo:r})),t.removeAttribute("data-cursor")}else if(window.self===window.top){const t=document.createElement("div");document.body.appendChild(t),(0,e.createRoot)(t).render((0,s.jsx)(ks,{}))}}))})(); | |